diff --git a/base/.classpath b/base/.classpath index 50ce172089..e49c515468 100644 --- a/base/.classpath +++ b/base/.classpath @@ -28,11 +28,6 @@ - - - - - diff --git a/base/META-INF/MANIFEST.MF b/base/META-INF/MANIFEST.MF index 53b20775e5..857c0bdaed 100644 --- a/base/META-INF/MANIFEST.MF +++ b/base/META-INF/MANIFEST.MF @@ -62,5 +62,5 @@ Export-Package: org.adempiere.apps.graph, org.compiere.util, org.compiere.wf Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0", - org.adempiere.tools;bundle-version="0.0.0", - org.adempiere.jboss;bundle-version="0.0.0" + org.adempiere.tools;bundle-version="0.0.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/client/META-INF/MANIFEST.MF b/client/META-INF/MANIFEST.MF index 1fc7adb0e2..d14875718d 100644 --- a/client/META-INF/MANIFEST.MF +++ b/client/META-INF/MANIFEST.MF @@ -193,6 +193,5 @@ Export-Package: com.keypoint, org.jfree.util Require-Bundle: org.adempiere.base;bundle-version="0.0.0", org.eclipse.core.runtime;bundle-version="3.5.0", - org.adempiere.tools;bundle-version="0.0.0", - org.adempiere.jbossfacet;bundle-version="0.0.0" + org.adempiere.tools;bundle-version="0.0.0" Bundle-Activator: org.adempiere.client.Activator diff --git a/doc/.classpath b/doc/.classpath index 026ff551f4..be201bada6 100644 --- a/doc/.classpath +++ b/doc/.classpath @@ -7,7 +7,6 @@ - diff --git a/equinox-target/launchconfig/adempiere_equinox_swing.launch b/equinox-target/launchconfig/adempiere_equinox_swing.launch index 5461616d1e..8209eadc3f 100644 --- a/equinox-target/launchconfig/adempiere_equinox_swing.launch +++ b/equinox-target/launchconfig/adempiere_equinox_swing.launch @@ -21,5 +21,5 @@ - + diff --git a/equinox-target/launchconfig/adempiere_equinox_zk.launch b/equinox-target/launchconfig/adempiere_equinox_zk.launch index 114ca6aff1..9b7ea92765 100644 --- a/equinox-target/launchconfig/adempiere_equinox_zk.launch +++ b/equinox-target/launchconfig/adempiere_equinox_zk.launch @@ -21,5 +21,5 @@ - + diff --git a/glassfishfacet/.classpath b/glassfishfacet/.classpath deleted file mode 100644 index 672c93644e..0000000000 --- a/glassfishfacet/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/glassfishfacet/.project b/glassfishfacet/.project deleted file mode 100644 index 7c53bf5c56..0000000000 --- a/glassfishfacet/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - glassfishfacet - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/glassfishfacet/config/domain.xml b/glassfishfacet/config/domain.xml deleted file mode 100644 index 9df158ce96..0000000000 --- a/glassfishfacet/config/domain.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - ... - -DADEMPIERE_HOME=YourAdempiereHome - diff --git a/glassfishfacet/config/login.conf b/glassfishfacet/config/login.conf deleted file mode 100644 index 2f3f18a7bd..0000000000 --- a/glassfishfacet/config/login.conf +++ /dev/null @@ -1,3 +0,0 @@ -adempiere { - org.adempiere.as.glassfish.AdempiereLoginModule required; -}; diff --git a/glassfishfacet/config/readme.txt b/glassfishfacet/config/readme.txt deleted file mode 100644 index cfa87cb2c2..0000000000 --- a/glassfishfacet/config/readme.txt +++ /dev/null @@ -1,7 +0,0 @@ -* merge contents from domain.xml and login.conf to the respective file of your glassfish instance. - e.g: c:\glassfish\domains\domain1\config\domain.xml, c:\glassfish\domains\domain1\config\login.conf -* copy Adempiere.jar and AdempiereSLib.jar to installRoot/lib folder - e.g: c:\glassfish\lib -* copy adempiere.ear to the domains/autodeploy folder - e.g: c:\glassfish\domains\domain1\autodeploy - diff --git a/glassfishfacet/config/sun-application.xml b/glassfishfacet/config/sun-application.xml deleted file mode 100644 index 8708d5d88a..0000000000 --- a/glassfishfacet/config/sun-application.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - adempiereUsers - adempiereUsers - - adempiere - \ No newline at end of file diff --git a/glassfishfacet/src/org/adempiere/as/glassfish/AdempiereLoginModule.java b/glassfishfacet/src/org/adempiere/as/glassfish/AdempiereLoginModule.java deleted file mode 100644 index ce20c8efee..0000000000 --- a/glassfishfacet/src/org/adempiere/as/glassfish/AdempiereLoginModule.java +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2007 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * - * Copyright (C) 2007 Low Heng Sin hengsin@avantz.com - * _____________________________________________ - *****************************************************************************/ -package org.adempiere.as.glassfish; - -import javax.security.auth.login.LoginException; - -import com.sun.appserv.security.AppservPasswordLoginModule; - -/** - * JAAS login module for adempiere - * @author Low Heng Sin - */ -public class AdempiereLoginModule extends AppservPasswordLoginModule { - @Override - protected void authenticateUser() throws LoginException { - // Get the current realm and check whether it is instance of your realm - if (!(_currentRealm instanceof AdempiereRealm)) { - throw new LoginException("Realm must be of type AdempiereRealm. CurrentRealm=" + _currentRealm.getClass()); - } - - AdempiereRealm realm = (AdempiereRealm) _currentRealm; - - String[] groups = realm.authenticate(_username, _password); - - commitUserAuthentication(groups); - } -} diff --git a/glassfishfacet/src/org/adempiere/as/glassfish/AdempiereRealm.java b/glassfishfacet/src/org/adempiere/as/glassfish/AdempiereRealm.java deleted file mode 100644 index ef2f7dafb1..0000000000 --- a/glassfishfacet/src/org/adempiere/as/glassfish/AdempiereRealm.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.adempiere.as.glassfish; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Login; - -import com.sun.appserv.security.AppservRealm; -import com.sun.enterprise.security.auth.realm.BadRealmException; -import com.sun.enterprise.security.auth.realm.IASRealm; -import com.sun.enterprise.security.auth.realm.InvalidOperationException; -import com.sun.enterprise.security.auth.realm.NoSuchRealmException; -import com.sun.enterprise.security.auth.realm.NoSuchUserException; - -public class AdempiereRealm extends AppservRealm { - - private Map> groupCache = new HashMap>(); - - @Override - protected void init(Properties props) throws BadRealmException, - NoSuchRealmException { - String jaasCtx = props.getProperty(IASRealm.JAAS_CONTEXT_PARAM); - this.setProperty(IASRealm.JAAS_CONTEXT_PARAM, jaasCtx); - if (jaasCtx == null) { - throw new BadRealmException(IASRealm.JAAS_CONTEXT_PARAM - + " is null."); - } - } - - @Override - public String getAuthType() { - return "adempiere"; - } - - @Override - public Enumeration getGroupNames(String username) - throws InvalidOperationException, NoSuchUserException { - if (groupCache.containsKey(username)) - return Collections.enumeration(groupCache.get(username)); - else - return null; - } - - public String[] authenticate(String username, String password) { - KeyNamePair[] roles = null; - // do authentication - if (username != null && password != null) { - // perform db authentication - Login login = new Login(Env.getCtx()); - roles = login.getRoles(username, password); - } else { - // no username or password - roles = null; - } - - String[] groups = new String[0]; - List grpList = new ArrayList(); - if (roles != null && roles.length > 0) { - grpList.add("adempiereUsers"); - for (KeyNamePair knp : roles) { - grpList.add(knp.getName()); - } - groupCache.remove(username); - groupCache.put(username, grpList); - groups = grpList.toArray(groups); - } - return groups; - } -} diff --git a/glassfishfacet/src/org/adempiere/as/glassfish/GlassFish.java b/glassfishfacet/src/org/adempiere/as/glassfish/GlassFish.java deleted file mode 100644 index f91e723270..0000000000 --- a/glassfishfacet/src/org/adempiere/as/glassfish/GlassFish.java +++ /dev/null @@ -1,95 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2008 Low Heng Sin * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.as.glassfish; - -import java.net.URL; -import java.util.Hashtable; - -import javax.naming.Context; - -import org.adempiere.as.IApplicationServer; - -import com.sun.appserv.security.ProgrammaticLogin; - -/** - * - * @author Low Heng Sin - * - */ -public class GlassFish implements IApplicationServer { - - private static final String LOGIN_CONFIG = "java.security.auth.login.config"; - - //ensure client library is installed - static { - try { - Class.forName("com.sun.enterprise.naming.SerialInitContextFactory"); - } catch (ClassNotFoundException e) { - throw new IllegalStateException(e); - } - } - - /** - * @see IApplicationServer#getInitialContextEnvironment(String, int, String, String) - */ - public Hashtable getInitialContextEnvironment( - String AppsHost, int AppsPort, String principal, String credential) { - if (principal != null && credential != null) - { - String property = System.getProperty(LOGIN_CONFIG); - if (property == null || property.trim().length() == 0) - { - try - { - URL configUrl = GlassFish.class.getResource("login.conf"); - if (configUrl == null) - configUrl = GlassFish.class.getClassLoader().getResource("/org/adempiere/as/glassfish/login.conf"); - System.setProperty(LOGIN_CONFIG, configUrl.toString()); - } - catch (Exception e) - { - throw new RuntimeException("Failed to load login.conf"); - } - ProgrammaticLogin login = new ProgrammaticLogin(); - try { - login.login(principal, credential); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - else - { - ProgrammaticLogin login = new ProgrammaticLogin(); - try { - login.login(principal, credential, "adempiere", true); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } - - Hashtable env = new Hashtable(); - env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory"); - env.put(Context.URL_PKG_PREFIXES, "com.sun.enterprise.naming"); - env.put(Context.STATE_FACTORIES, "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl"); - - env.put("org.omg.CORBA.ORBInitialHost", AppsHost); - env.put("org.omg.CORBA.ORBInitialPort", Integer.toString(AppsPort)); - return env; - } - - public int getDefaultNamingServicePort() { - return 3700; - } - -} diff --git a/glassfishfacet/src/org/adempiere/as/glassfish/login.conf b/glassfishfacet/src/org/adempiere/as/glassfish/login.conf deleted file mode 100644 index 9e3e54eeec..0000000000 --- a/glassfishfacet/src/org/adempiere/as/glassfish/login.conf +++ /dev/null @@ -1,10 +0,0 @@ -/* Copyright 2004 Sun Microsystems, Inc. All rights reserved. */ -/* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ - -default { - com.sun.enterprise.security.auth.login.ClientPasswordLoginModule required debug=false; -}; - -adempiere { - com.sun.enterprise.security.auth.login.ClientPasswordLoginModule required debug=false; -}; \ No newline at end of file diff --git a/install/.classpath b/install/.classpath index 701ac0fbe1..949d240292 100644 --- a/install/.classpath +++ b/install/.classpath @@ -5,7 +5,6 @@ - diff --git a/jboss/.classpath b/jboss/.classpath deleted file mode 100644 index c0559fe568..0000000000 --- a/jboss/.classpath +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/jboss/.project b/jboss/.project deleted file mode 100644 index ac83f0cff5..0000000000 --- a/jboss/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - jboss - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/jboss/JBossORG-EULA.txt b/jboss/JBossORG-EULA.txt deleted file mode 100644 index 2dee291b7d..0000000000 --- a/jboss/JBossORG-EULA.txt +++ /dev/null @@ -1,104 +0,0 @@ -LICENSE AGREEMENT -JBOSS(r) - -This License Agreement governs the use of the Software Packages and any updates to the Software -Packages, regardless of the delivery mechanism. Each Software Package is a collective work -under U.S. Copyright Law. Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to -the user ("Client") a license to the applicable collective work(s) pursuant to the -GNU Lesser General Public License v. 2.1 except for the following Software Packages: -(a) JBoss Portal Forums and JBoss Transactions JTS, each of which is licensed pursuant to the -GNU General Public License v.2; - -(b) JBoss Rules, which is licensed pursuant to the Apache License v.2.0; - -(c) an optional download for JBoss Cache for the Berkeley DB for Java database, which is licensed under the -(open source) Sleepycat License (if Client does not wish to use the open source version of this database, -it may purchase a license from Sleepycat Software); - -and (d) the BPEL extension for JBoss jBPM, which is licensed under the Common Public License v.1, -and, pursuant to the OASIS BPEL4WS standard, requires parties wishing to redistribute to enter various -royalty-free patent licenses. - -Each of the foregoing licenses is available at http://www.opensource.org/licenses/index.php. - -1. The Software. "Software Packages" refer to the various software modules that are created and made available -for distribution by the JBoss.org open source community at http://www.jboss.org. Each of the Software Packages -may be comprised of hundreds of software components. The end user license agreement for each component is located in -the component's source code. With the exception of certain image files identified in Section 2 below, -the license terms for the components permit Client to copy, modify, and redistribute the component, -in both source code and binary code forms. This agreement does not limit Client's rights under, -or grant Client rights that supersede, the license terms of any particular component. - -2. Intellectual Property Rights. The Software Packages are owned by Red Hat and others and are protected under copyright -and other laws. Title to the Software Packages and any component, or to any copy, modification, or merged portion shall -remain with the aforementioned, subject to the applicable license. The "JBoss" trademark, "Red Hat" trademark, the -individual Software Package trademarks, and the "Shadowman" logo are registered trademarks of Red Hat and its affiliates -in the U.S. and other countries. This agreement permits Client to distribute unmodified copies of the Software Packages -using the Red Hat trademarks that Red Hat has inserted in the Software Packages on the condition that Client follows Red Hat's -trademark guidelines for those trademarks located at http://www.redhat.com/about/corporate/trademark/. Client must abide by -these trademark guidelines when distributing the Software Packages, regardless of whether the Software Packages have been modified. -If Client modifies the Software Packages, then Client must replace all Red Hat trademarks and logos identified at -http://www.jboss.com/company/logos unless a separate agreement with Red Hat is executed or other permission granted. -Merely deleting the files containing the Red Hat trademarks may corrupt the Software Packages. - -3. Limited Warranty. Except as specifically stated in this Paragraph 3 or a license for a particular -component, to the maximum extent permitted under applicable law, the Software Packages and the -components are provided and licensed "as is" without warranty of any kind, expressed or implied, -including the implied warranties of merchantability, non-infringement or fitness for a particular purpose. -Red Hat warrants that the media on which Software Packages may be furnished will be free from defects in -materials and manufacture under normal use for a period of 30 days from the date of delivery to Client. -Red Hat does not warrant that the functions contained in the Software Packages will meet Client's requirements -or that the operation of the Software Packages will be entirely error free or appear precisely as described -in the accompanying documentation. This warranty extends only to the party that purchases the Services -pertaining to the Software Packages from Red Hat or a Red Hat authorized distributor. - -4. Limitation of Remedies and Liability. To the maximum extent permitted by applicable law, the remedies -described below are accepted by Client as its only remedies. Red Hat's entire liability, and Client's -exclusive remedies, shall be: If the Software media is defective, Client may return it within 30 days of -delivery along with a copy of Client's payment receipt and Red Hat, at its option, will replace it or -refund the money paid by Client for the Software. To the maximum extent permitted by applicable law, -Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental or consequential -damages, including lost profits or lost savings arising out of the use or inability to use the Software, -even if Red Hat or such dealer has been advised of the possibility of such damages. In no event shall -Red Hat's liability under this agreement exceed the amount that Client paid to Red Hat under this -Agreement during the twelve months preceding the action. - -5. Export Control. As required by U.S. law, Client represents and warrants that it: -(a) understands that the Software Packages are subject to export controls under the -U.S. Commerce Department's Export Administration Regulations ("EAR"); - -(b) is not located in a prohibited destination country under the EAR or U.S. sanctions regulations -(currently Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria); - -(c) will not export, re-export, or transfer the Software Packages to any prohibited destination, entity, -or individual without the necessary export license(s) or authorizations(s) from the U.S. Government; - -(d) will not use or transfer the Software Packages for use in any sensitive nuclear, chemical or -biological weapons, or missile technology end-uses unless authorized by the U.S. Government by -regulation or specific license; - -(e) understands and agrees that if it is in the United States and exports or transfers the Software -Packages to eligible end users, it will, as required by EAR Section 740.17(e), submit semi-annual -reports to the Commerce Department's Bureau of Industry & Security (BIS), which include the name and -address (including country) of each transferee; - -and (f) understands that countries other than the United States may restrict the import, use, or -export of encryption products and that it shall be solely responsible for compliance with any such -import, use, or export restrictions. - -6. Third Party Programs. Red Hat may distribute third party software programs with the Software Packages -that are not part of the Software Packages and which Client must install separately. These third party -programs are subject to their own license terms. The license terms either accompany the programs or -can be viewed at http://www.redhat.com/licenses/. If Client does not agree to abide by the applicable -license terms for such programs, then Client may not install them. If Client wishes to install the programs -on more than one system or transfer the programs to another party, then Client must contact the licensor -of the programs. - -7. General. If any provision of this agreement is held to be unenforceable, that shall not affect the -enforceability of the remaining provisions. This License Agreement shall be governed by the laws of the -State of North Carolina and of the United States, without regard to any conflict of laws provisions, -except that the United Nations Convention on the International Sale of Goods shall not apply. - -Copyright 2006-2007 Red Hat, Inc. All rights reserved. -"JBoss" and the JBoss logo are registered trademarks of Red Hat, Inc. -All other trademarks are the property of their respective owners. diff --git a/jboss/META-INF/MANIFEST.MF b/jboss/META-INF/MANIFEST.MF deleted file mode 100644 index 7af0dba21b..0000000000 --- a/jboss/META-INF/MANIFEST.MF +++ /dev/null @@ -1,114 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: jboss -Bundle-SymbolicName: org.adempiere.jboss -Bundle-Version: 0.0.0.1 -Bundle-ClassPath: client/jboss-client.jar, - client/jboss-common-client.jar, - client/jboss-j2ee.jar, - client/jbosssx-client.jar, - client/jboss-transaction-client.jar, - client/jnp-client.jar, - client/jmx-invoker-adaptor-client.jar, - client/jbossall-client.jar -Export-Package: EDU.oswego.cs.dl.util.concurrent, - EDU.oswego.cs.dl.util.concurrent.misc, - javax.ejb, - javax.ejb.spi, - javax.enterprise.deploy.model, - javax.enterprise.deploy.model.exceptions, - javax.enterprise.deploy.shared, - javax.enterprise.deploy.shared.factories, - javax.enterprise.deploy.spi, - javax.enterprise.deploy.spi.exceptions, - javax.enterprise.deploy.spi.factories, - javax.enterprise.deploy.spi.status, - javax.jms, - javax.management, - javax.management.loading, - javax.management.modelmbean, - javax.management.monitor, - javax.management.openmbean, - javax.management.relation, - javax.management.timer, - javax.resource, - javax.resource.cci, - javax.resource.spi, - javax.resource.spi.endpoint, - javax.resource.spi.security, - javax.resource.spi.work, - javax.security.jacc, - javax.sql, - javax.transaction, - javax.transaction.xa, - javax.xml.registry, - javax.xml.registry.infomodel, - org.apache.xerces.impl.xs, - org.jboss.corba, - org.jboss.crypto, - org.jboss.crypto.digest, - org.jboss.ejb, - org.jboss.ejb.plugins.cmp.jdbc, - org.jboss.ejb.plugins.keygenerator, - org.jboss.invocation, - org.jboss.invocation.http.interfaces, - org.jboss.invocation.jrmp.interfaces, - org.jboss.invocation.jrmp.server, - org.jboss.invocation.pooled.interfaces, - org.jboss.invocation.unified.interfaces, - org.jboss.invocation.unified.marshall, - org.jboss.jmx.adaptor.rmi, - org.jboss.jmx.connector.invoker.client, - org.jboss.logging, - org.jboss.logging.appender, - org.jboss.logging.filter, - org.jboss.logging.layout, - org.jboss.logging.util, - org.jboss.monitor.client, - org.jboss.naming, - org.jboss.naming.client.java, - org.jboss.naming.interceptors, - org.jboss.net.protocol, - org.jboss.net.protocol.file, - org.jboss.net.protocol.http, - org.jboss.net.protocol.njar, - org.jboss.net.protocol.resource, - org.jboss.net.sockets, - org.jboss.net.ssl, - org.jboss.proxy, - org.jboss.proxy.compiler, - org.jboss.proxy.ejb, - org.jboss.proxy.ejb.handle, - org.jboss.security, - org.jboss.security.auth.callback, - org.jboss.security.auth.login, - org.jboss.security.jndi, - org.jboss.security.plugins, - org.jboss.security.ssl, - org.jboss.tm, - org.jboss.tm.integrity, - org.jboss.tm.usertx.client, - org.jboss.tm.usertx.interfaces, - org.jboss.tm.usertx.server, - org.jboss.util, - org.jboss.util.coerce, - org.jboss.util.collection, - org.jboss.util.deadlock, - org.jboss.util.file, - org.jboss.util.id, - org.jboss.util.loading, - org.jboss.util.naming, - org.jboss.util.platform, - org.jboss.util.property, - org.jboss.util.property.jmx, - org.jboss.util.propertyeditor, - org.jboss.util.state, - org.jboss.util.state.xml, - org.jboss.util.stream, - org.jboss.util.threadpool, - org.jboss.util.timeout, - org.jboss.util.xml, - org.jnp.interfaces, - org.jnp.interfaces.java, - org.jnp.interfaces.jnp, - org.jnp.server diff --git a/jboss/bin/classpath.sh b/jboss/bin/classpath.sh deleted file mode 100644 index b79057cba4..0000000000 --- a/jboss/bin/classpath.sh +++ /dev/null @@ -1,193 +0,0 @@ -#!/bin/sh -### ====================================================================== ### -## ## -## A tool to determine JBoss classpaths. ## -## ## -### ====================================================================== ### - -### $Id: classpath.sh 7809 2002-05-22 02:39:56Z user57 $ ### - -DIRNAME=`dirname $0` -PROGNAME=`basename $0` -CAT="cat" - -# -# Helper to complain. -# -warn() { - echo "${PROGNAME}: $*" -} - -# -# Helper to puke. -# -die() { - warn $* - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false; -darwin=false; -case "`uname`" in - CYGWIN*) - cygwin=true - ;; - - Darwin*) - darwin=true - ;; -esac - -# -# Print the command line help message. -# -printHelpMessage() { - $CAT < - -options: - -h, --help Print this help message. - -- Stop processing options. - -r, --relative Use relative paths. - -classpath: - -c, --client Client classpath (client/*). - -s, --server Server classpath (lib/*). - -b, --both Both the client and server classpaths. -EOF -} - -RELATIVE=false - -# -# Process command line options. -# -processCommandLine() { - while [ "x$1" != "x" ]; do - case "$1" in - --help|-h) - printHelpMessage - exit 1 - ;; - - --relative|-r) - RELATIVE=true - ;; - - --) - shift - if [ "x$argv" = "x" ]; then - argv="$1" - else - argv="$argv $1" - fi - break - ;; - - *) - if [ "x$argv" = "x" ]; then - argv="$1" - else - argv="$argv $1" - fi - ;; - esac - shift - done -} - -if [ -n "$CLASSPATH" ] ; then - LOCALCLASSPATH=$CLASSPATH -fi - -# -# Print the class path for the given type. -# -printClassPath() { - -# -# jason: should be fixed to only include proper classpath bits -# - - case "$1" in - -c|--client) - DIRLIBS="`ls $JBOSS_HOME/client/*`:$JBOSS_HOME/client" - ;; - - -s|--server) - DIRLIBS=`ls $JBOSS_HOME/lib/*` - ;; - - -b|--both) - DIRLIBS="`ls $JBOSS_HOME/client/*`:$JBOSS_HOME/client" - DIRLIBS="${DIRLIBS}:`ls $JBOSS_HOME/lib/*`" - ;; - - *) - printHelpMessage - exit 0 - ;; - esac - - for i in ${DIRLIBS}; do - if [ "$i" != "${DIRLIBS}" ] ; then - if [ -z "$LOCALCLASSPATH" ] ; then - LOCALCLASSPATH=$i - else - LOCALCLASSPATH="$i":$LOCALCLASSPATH - fi - fi - done - - # For Cygwin, switch paths to Windows format before running java - if $cygwin; then - LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` - fi - - echo $LOCALCLASSPATH -} - -# -# Main entry-point. -# -main() { - argv="" - - # process the command line - processCommandLine "$@" - - # For Cygwin, ensure paths are in UNIX format before anything is touched - if $cygwin ; then - [ -n "$JBOSS_HOME" ] && - JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$JAVAC_JAR" ] && - JAVAC_JAR=`cygpath --unix "$JAVAC_JAR"` - fi - - # Setup JBOSS_HOME - if [ "x$JBOSS_HOME" = "x" ]; then - if $RELATIVE ; then - JBOSS_HOME="$DIRNAME/.." - else - # get the full path (without any relative bits) - JBOSS_HOME=`cd $DIRNAME/..; pwd` - fi - fi - - if [ "x$argv" = "x" ]; then - printHelpMessage - exit 0 - fi - - printClassPath $argv -} - -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -# -# Boot-strap -# -main "$@" diff --git a/jboss/bin/jboss_init_hpux.sh b/jboss/bin/jboss_init_hpux.sh deleted file mode 100644 index d53eda6578..0000000000 --- a/jboss/bin/jboss_init_hpux.sh +++ /dev/null @@ -1,257 +0,0 @@ -#!/bin/sh -# -# $Id: jboss_init_hpux.sh 57105 2006-09-23 14:09:27Z dimitris@jboss.org $ -# -# JBoss Control Script for HP-UX -# -# description: JBoss Applicaton Server / EJB Container -# -# Run this script as the root user. This script will start -# as many instances of JBoss as there are array entries in a -# startup configuration file under /etc/rc.config.d/ as -# defined below. If no configuration file exists, the script -# will still attempt to start at least one server using default -# values. -# -# Installation Instructions: -# 1. Copy /bin/jboss_init_hpux.sh to/sbin/init.d/jboss -# 2. Create softlinks to the file from the various startup and shutdown -# directories: -# ln -s /sbin/init.d/jboss /sbin/rc2.d/K001jboss -# ln -s /sbin/init.d/jboss /sbin/rc3.d/S999jboss -# 3. Create /etc/rc.config.d/jboss with the variables defined below. For -# example if you have two servers at /opt/jboss1 and /opt/jboss2 that run -# as users jboss1 and jboss2 using the default instances, then you would -# create the following configuration entries: -############# -# JBOSS_HOME[0]=/opt/jboss1 -# JBOSS_USER[0]=jboss1 -# SERVER_NAME[0]=default -# JBOSS_START[0]=1 -## default console logging (you can also just omit the next line) -# JBOSS_CONSOLE[0]="" -############# -# JBOSS_HOME[1]=/opt/jboss2 -# JBOSS_USER[1]=jboss2 -# SERVER_NAME[1]=default -# JBOSS_START[1]=1 -## No Console logging -# JBOSS_CONSOLE[1]=/dev/null -# - -################################################################## -# -# This script will start as many instances of JBoss as there are -# consecutive array entries for the variables defined below. -# -# There may be a unique jboss server instance for each $JBOSS_HOME[i] -# and $SERVER_NAME[i] combination. -# -# The following variables should be defined in /etc/rc.config.d/jboss. -# If they are not, the variables are defaulted below: -# -# JBOSS_HOME[i] - root directory for jboss installation, like -# /opt/jboss-. -# The default for the 1st instance is /opt/jboss: JBOSS_HOME[0]=/opt/jboss. -# No default for any other instance. -# -# SERVER_NAME[i] - server instance name. Normally "all", "default", or -# "minimal". Maps to server instance at $JBOSS_HOME/server/$SERVER_NAME -# The default value is "default". -# -# JBOSS_START[i] - set to "0" to force JBOSS to not start when this script -# is run. Usefull when this script is run automatically at system -# startup time. Default is "1" to startup. -# -# JBOSS_USER[i] - it is username by which the jboss application server -# is started. The default user is jboss. -# -# JBOSS_CONSOLE[i] - file where jboss console logging will be written -# Use "/dev/null" if console logging is not desired. -# default is /var/opt/jboss/jboss__.log -# -# JAVA_HOME should also be defined in the target users environment, such -# as is the case when it is exported from ~/.profile. -# -# NOTE: The notation for array subscript [0] is optional. You can refer to -# JBOSS_HOME[0] as JBOSS_HOME. -# -# read config variables from files in /etc/rc.config.d -# by convention the config values should be in a file /etc/rc.config.d, -# such as /etc/rc.config.d/jboss. If these variables are not defined -# in a configuration file in rc.config.d, we will attempt to deal with it by -# setting defaults in the program - -if [ -f /etc/rc.config ] -then - . /etc/rc.config -else - print "ERROR: /etc/rc.config default file MISSING" 1>&2 -fi -umask 022 - -# -# Make sure variables are defined at least for the first instance of the -# array. Note that $SERVER_NAME is the same as ${SERVER_NAME[0]} - -JBOSS_HOME=${JBOSS_HOME:-"/opt/jboss"} - -PATH=/sbin:/usr/sbin:/usr/bin:$PATH -export PATH - -#Usage: isJBossRunning -# sets non zero return code if Jboss is not running -# sets global isJBossRunningPid with 1st process id if it is running -isJBossRunning() -{ - typeset JBossHome=$2 JBossUserId=$1 instance=$3 junk - ((isJBossRunningPid=0)) - # pipeline reads 1st jboss pid if it is running for user, jboss home, and instance - ps -xu $JBossUserId | - grep "$JBossHome.*org.jboss.Main.*\-c[ \t]*$instance" | grep -v "grep" | - read isJBossRunningPid junk -} - -#USAGE: isUserOK -# prints any problems on standard error and returns with a non-zero status -# returns a 0 status if all is OK -isUserOK() -{ - # check if the user exists - id ${JBOSS_USER[i]} >/dev/null 2>&1 - if (($?!=0)); then - echo "ERROR: The user ${JBOSS_USER[i]} does not exist." 1>&2 - return 1 - fi - - # check if the user has write permission on the jboss instance directory - su ${JBOSS_USER[i]} -c "test -w ${JBOSS_HOME[i]}/server/${SERVER_NAME[i]}" >/dev/null 2>&1 - if (($?!=0)); then - echo "ERROR: The user ${JBOSS_USER[i]} does not have write access to ${JBOSS_HOME[i]}/server/${SERVER_NAME[i]}" 1>&2 - return 2 - fi - - # user must have JAVA_HOME defined - su - ${JBOSS_USER[i]} -c 'whence java || [[ -d $JAVA_HOME ]]' >/dev/null 2>&1 - if (($?!=0)); then - echo "ERROR: The user \"${JBOSS_USER[i]}\" does not have \$JAVA_HOME defined; either define \$JAVA_HOME for this user or ensure that a path to \"java\" exists." 1>&2 - return 3 - fi - - # user looks good so far - return 0 -} - -# Usage: startJBoss -startJBoss() -{ - typeset -i i=$1 - - (( ${JBOSS_START[i]} != 1 )) && return 0 - - # make sure the console log exists with appropriate permissions for JBOSS_USER[i] - if [[ ! -d ${JBOSS_CONSOLE[i]%/*} ]]; then - mkdir -p ${JBOSS_CONSOLE[i]%/*} - chmod 0755 ${JBOSS_CONSOLE[i]%/*} - chown ${JBOSS_USER[i]} ${JBOSS_CONSOLE[i]%/*} - fi - - # do some basic error checking - if [[ ! -d ${JBOSS_HOME[i]} ]]; then - echo "ERROR: JBOSS_HOME[$i] is not a valid directory : ${JBOSS_HOME[i]}" 1>&2 - return 1 - fi - - isUserOK || return 2 - - isJBossRunning ${JBOSS_USER[i]} ${JBOSS_HOME[i]} ${SERVER_NAME[i]} - if (( $? == 0 )); then - echo "JBoss AS is already running for user ${JBOSS_USER[i]} at ${JBOSS_HOME[i]} with instance ${SERVER_NAME[i]}" 1>&2 - return 3 - fi - - # keep last version of the console log around - [[ -f ${JBOSS_CONSOLE[i]} ]] && mv ${JBOSS_CONSOLE[i]} ${JBOSS_CONSOLE[i]}.old - - # JBoss is not running, start it up - CMD_START="${JBOSS_HOME[i]}/bin/run.sh -c ${SERVER_NAME[i]}" - nohup su - ${JBOSS_USER[i]} -c "sh $CMD_START" >${JBOSS_CONSOLE[i]} 2>&1 & - echo "Starting JBoss AS for user ${JBOSS_USER[i]} at ${JBOSS_HOME[i]} with instance ${SERVER_NAME[i]}." - - # wait a few seconds then check if it started ok - #isJBossRunning ${JBOSS_USER[i]} ${JBOSS_HOME[i]} ${SERVER_NAME[i]} || sleep 2 || - #isJBossRunning ${JBOSS_USER[i]} ${JBOSS_HOME[i]} ${SERVER_NAME[i]} || sleep 3 || - #echo "... server not started yet. Check the log files for errors" -} - -# Usage: stopJBoss -stopJBoss() -{ - typeset -i i=$1 - - # return silently if JBoss AS is not running - isJBossRunning ${JBOSS_USER[i]} ${JBOSS_HOME[i]} ${SERVER_NAME[i]} || return 0 - - # JBoss is running and $isJBossRunningPid is set to the process id - # SIGTERM does a gracefull shutdown like ^C - echo "Stopping JBoss AS PID $isJBossRunningPid for user ${JBOSS_USER[i]} at ${JBOSS_HOME[i]} with instance ${SERVER_NAME[i]}" - kill -s SIGTERM $isJBossRunningPid - - # wait for up to 30 seconds for the process to terminate gracefully - isJBossRunning ${JBOSS_USER[i]} ${JBOSS_HOME[i]} ${SERVER_NAME[i]} && printf "please wait " && sleep 5 && - isJBossRunning ${JBOSS_USER[i]} ${JBOSS_HOME[i]} ${SERVER_NAME[i]} && printf "." && sleep 10 && - isJBossRunning ${JBOSS_USER[i]} ${JBOSS_HOME[i]} ${SERVER_NAME[i]} && printf "." && sleep 15 && - isJBossRunning ${JBOSS_USER[i]} ${JBOSS_HOME[i]} ${SERVER_NAME[i]} && - echo "NOT Terminated! Wait a moment then check to see if the process has shut down gracefully, or terminate it now with\n \"kill -s SIGKILL $isJBossRunningPid\"" >&2 -} - -# Usage: doAll -doAll() -{ - typeset cmd=$1 - typeset -i rc=0 - shift - - # loop thru the configuration file for servers to start or stop as identified by JBOSS_HOME[i] and the - # other parameters - - ((i=0)) - while [[ ${JBOSS_HOME[i]} != "" ]] - do - - # set defaults for any missing values - SERVER_NAME[$i]=${SERVER_NAME[i]:-"default"} - JBOSS_USER[$i]=${JBOSS_USER[i]:-"jboss"} - JBOSS_CONSOLE[$i]=${JBOSS_CONSOLE[i]:-/var/opt/jboss/${JBOSS_USER[i]}/jboss_${SERVER_NAME[i]}.log} - JBOSS_START[$i]=${JBOSS_START[i]:-1} - - $cmd $i $* - (($? != 0)) && rc=$? - ((i=i+1)) - done - return $rc -} - -case "$1" in - start_msg) - echo "Starting JBoss" - ;; - start) - doAll startJBoss - ;; - stop_msg) - echo "Stopping JBoss" - ;; - stop) - doAll stopJBoss - ;; - restart) - $0 stop - $0 start - ;; - *) - echo "usage: $0 (start|stop|restart|help)" 1>&2 - exit 1 -esac - -exit $? diff --git a/jboss/bin/jboss_init_redhat.sh b/jboss/bin/jboss_init_redhat.sh deleted file mode 100644 index bec0302275..0000000000 --- a/jboss/bin/jboss_init_redhat.sh +++ /dev/null @@ -1,147 +0,0 @@ -#!/bin/sh -# -# $Id: jboss_init_redhat.sh 71252 2008-03-25 17:52:00Z dbhole $ -# -# JBoss Control Script -# -# To use this script run it as root - it will switch to the specified user -# -# Here is a little (and extremely primitive) startup/shutdown script -# for RedHat systems. It assumes that JBoss lives in /usr/local/jboss, -# it's run by user 'jboss' and JDK binaries are in /usr/local/jdk/bin. -# All this can be changed in the script itself. -# -# Either modify this script for your requirements or just ensure that -# the following variables are set correctly before calling the script. - -#define where jboss is - this is the directory containing directories log, bin, conf etc -JBOSS_HOME=${JBOSS_HOME:-"/usr/local/jboss"} - -#define the user under which jboss will run, or use 'RUNASIS' to run as the current user -JBOSS_USER=${JBOSS_USER:-"jboss"} - -#make sure java is in your path -JAVAPTH=${JAVAPTH:-"/usr/local/jdk/bin"} - -#configuration to use, usually one of 'minimal', 'default', 'all' -JBOSS_CONF=${JBOSS_CONF:-"default"} - -#if JBOSS_HOST specified, use -b to bind jboss services to that address -JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"} - -#define the script to use to start jboss -JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF $JBOSS_BIND_ADDR"} - -if [ "$JBOSS_USER" = "RUNASIS" ]; then - SUBIT="" -else - SUBIT="su - $JBOSS_USER -c " -fi - -if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then - # ensure the file exists - touch $JBOSS_CONSOLE - if [ ! -z "$SUBIT" ]; then - chown $JBOSS_USER $JBOSS_CONSOLE - fi -fi - -if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then - echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE" - echo "WARNING: ignoring it and using /dev/null" - JBOSS_CONSOLE="/dev/null" -fi - -#define what will be done with the console log -JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"} - -JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH" - -if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then - export PATH=$PATH:$JAVAPTH -fi - -if [ ! -d "$JBOSS_HOME" ]; then - echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME - exit 1 -fi - -echo JBOSS_CMD_START = $JBOSS_CMD_START - -function procrunning() { - procid=0 - JBOSSSCRIPT=$(echo $JBOSSSH | awk '{print $1}' | sed 's/\//\\\//g') - for procid in `/sbin/pidof -x "$JBOSSSCRIPT"`; do - ps -fp $procid | grep "${JBOSSSH% *}" > /dev/null && pid=$procid - done -} - - -stop() { - pid=0 - procrunning - if [ $pid = '0' ]; then - echo -n -e "\nNo JBossas is currently running\n" - exit 1 - fi - - RETVAL=1 - - # If process is still running - - # First, try to kill it nicely - for id in `ps --ppid $pid | awk '{print $1}' | grep -v "^PID$"`; do - if [ -z "$SUBIT" ]; then - kill -15 $id - else - $SUBIT "kill -15 $id" - fi - done - - sleep=0 - while [ $sleep -lt 120 -a $RETVAL -eq 1 ]; do - echo -n -e "\nwaiting for processes to stop"; - sleep 10 - sleep=`expr $sleep + 10` - pid=0 - procrunning - if [ $pid == '0' ]; then - RETVAL=0 - fi - done - - # Still not dead... kill it - - count=0 - pid=0 - procrunning - - if [ $RETVAL != 0 ] ; then - echo -e "\nTimeout: Shutdown command was sent, but process is still running with PID $pid" - exit 1 - fi - - echo - exit 0 -} - -case "$1" in -start) - cd $JBOSS_HOME/bin - if [ -z "$SUBIT" ]; then - eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 & - else - $SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &" - fi - ;; -stop) - stop - ;; -restart) - $0 stop - $0 start - ;; -*) - echo "usage: $0 (start|stop|restart|help)" -esac - diff --git a/jboss/bin/jboss_init_suse.sh b/jboss/bin/jboss_init_suse.sh deleted file mode 100644 index 99ef483f9c..0000000000 --- a/jboss/bin/jboss_init_suse.sh +++ /dev/null @@ -1,183 +0,0 @@ -#!/bin/sh -# -# JBoss Control Script -# -# To use this script -# run it as root - it will switch to the specified user -# It loses all console output - use the log. -# -# Here is a little (and extremely primitive) -# startup/shutdown script for SuSE systems. It assumes -# that JBoss lives in /usr/local/jboss, it's run by user -# 'jboss' and JDK binaries are in /usr/local/jdk/bin. All -# this can be changed in the script itself. -# -# Either amend this script for your requirements -# or just ensure that the following variables are set correctly -# before calling the script. -# -### BEGIN INIT INFO -# Provides: jboss -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Description: Start the JBoss application server. -### END INIT INFO - -#define where jboss is - this is the directory containing directories log, bin, conf etc -JBOSS_HOME=${JBOSS_HOME:-"/opt/jboss"} - -#make java is on your path -JAVAPTH=${JAVAPTH:-"/usr/java/j2sdk1.4.1/bin"} - -#define the script to use to start jboss -JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c default"} - -# Shell functions sourced from /etc/rc.status: -# rc_check check and set local and overall rc status -# rc_status check and set local and overall rc status -# rc_status -v ditto but be verbose in local rc status -# rc_status -v -r ditto and clear the local rc status -# rc_failed set local and overall rc status to failed -# rc_reset clear local rc status (overall remains) -# rc_exit exit appropriate to overall rc status -. /etc/rc.status - -# First reset status of this service -rc_reset - -# Return values acc. to LSB for all commands but status: -# 0 - success -# 1 - misc error -# 2 - invalid or excess args -# 3 - unimplemented feature (e.g. reload) -# 4 - insufficient privilege -# 5 - program not installed -# 6 - program not configured -# -# Note that starting an already running service, stopping -# or restarting a not-running service as well as the restart -# with force-reload (in case signalling is not supported) are -# considered a success. - -if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then - # ensure the file exists - touch $JBOSS_CONSOLE -fi - -if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then - echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE" - echo "WARNING: ignoring it and using /dev/null" - JBOSS_CONSOLE="/dev/null" -fi - -#define what will be done with the console log -JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/opt/jboss/log/jboss.log"} - -#define the user under which jboss will run, or use RUNASIS to run as the current user -JBOSSUS=${JBOSSUS:-"jboss"} - -CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH" - -if [ "$JBOSSUS" = "RUNASIS" ]; then - SUBIT="" -else - SUBIT="su - $JBOSSUS -c " -fi - -if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then - export PATH=$PATH:$JAVAPTH -fi - -if [ ! -d "$JBOSS_HOME" ]; then - echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME - exit 1 -fi - -function procrunning() { - procid=0 - JBOSSSCRIPT=$(echo $JBOSSSH | awk '{print $1}' | sed 's/\//\\\//g') - for procid in `/sbin/pidof -x "$JBOSSSCRIPT"`; do - ps -fp $procid | grep "${JBOSSSH% *}" > /dev/null && pid=$procid - done -} - - -stop() { - pid=0 - procrunning - if [ $pid = '0' ]; then - echo -n -e "\nNo JBossas is currently running\n" - exit 1 - fi - - RETVAL=1 - - # If process is still running - - # First, try to kill it nicely - for id in `ps --ppid $pid | awk '{print $1}' | grep -v "^PID$"`; do - if [ -z "$SUBIT" ]; then - kill -15 $id - else - $SUBIT "kill -15 $id" - fi - done - - sleep=0 - while [ $sleep -lt 120 -a $RETVAL -eq 1 ]; do - echo -n -e "\nwaiting for processes to stop"; - sleep 10 - sleep=`expr $sleep + 10` - pid=0 - procrunning - if [ $pid == '0' ]; then - RETVAL=0 - fi - done - - # Still not dead... kill it - - count=0 - pid=0 - procrunning - - if [ $RETVAL != 0 ] ; then - echo -e "\nTimeout: Shutdown command was sent, but process is still running with PID $pid" - exit 1 - fi - - echo - exit 0 -} - - -case "$1" in -start) - echo -n "Starting JBoss application server: " - cd $JBOSS_HOME/bin - if [ -z "$SUBIT" ]; then - eval $CMD_START >${JBOSS_CONSOLE} 2>&1 & - else - $SUBIT "$CMD_START >${JBOSS_CONSOLE} 2>&1 &" - fi - - # Remember status and be verbose - rc_status -v - ;; -stop) - echo -n "Shutting down JBoss application server: " - stop - - # Remember status and be verbose - rc_status -v - ;; -restart) - $0 stop - $0 start - - # Remember status and be quiet - rc_status - ;; -*) - echo "usage: $0 (start|stop|restart|help)" -esac diff --git a/jboss/bin/probe.bat b/jboss/bin/probe.bat deleted file mode 100644 index 40a29e8725..0000000000 --- a/jboss/bin/probe.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo off -rem ------------------------------------------------------------------------- -rem JGroups Cluster Discovery Script for Win32 -rem ------------------------------------------------------------------------- - -REM Discovers all UDP-based members running on a certain mcast address (use -help for help) -REM Probe [-help] [-addr ] [-port ] [-ttl ] [-timeout ] - -set CLASSPATH=..\lib\commons-logging.jar;..\server\all\lib\jgroups.jar - -set CP=%CLASSPATH% - -java -cp %CP% org.jgroups.tests.Probe %* diff --git a/jboss/bin/probe.sh b/jboss/bin/probe.sh deleted file mode 100644 index 3198e44442..0000000000 --- a/jboss/bin/probe.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -### ====================================================================== ### -## ## -## JGroups Cluster Discovery Script ## -## ## -### ====================================================================== ### - -# Discovers all UDP-based members running on a certain mcast address (use -help for help) -# Probe [-help] [-addr ] [-port ] [-ttl ] [-timeout ] - -CLASSPATH=.:../lib/commons-logging.jar:../server/all/lib/jgroups.jar:$CLASSPATH - -# OS specific support (must be 'true' or 'false'). -cygwin=false; -case "`uname`" in - CYGWIN*) - cygwin=true - ;; -esac - -if [ $cygwin = "true" ]; then - CP=`cygpath -wp $CLASSPATH` -else - CP=$CLASSPATH -fi - -java -cp $CP org.jgroups.tests.Probe $* diff --git a/jboss/bin/run.bat b/jboss/bin/run.bat deleted file mode 100644 index ed593d2a1e..0000000000 --- a/jboss/bin/run.bat +++ /dev/null @@ -1,110 +0,0 @@ -@echo off -rem ------------------------------------------------------------------------- -rem JBoss Bootstrap Script for Win32 -rem ------------------------------------------------------------------------- - -rem $Id: run.bat 73584 2008-05-22 12:09:26Z dimitris@jboss.org $ - -@if not "%ECHO%" == "" echo %ECHO% -@if "%OS%" == "Windows_NT" setlocal - -set DIRNAME=.\ -if "%OS%" == "Windows_NT" set DIRNAME=%~dp0% -set PROGNAME=run.bat -if "%OS%" == "Windows_NT" set PROGNAME=%~nx0% - -pushd %DIRNAME%.. -set JBOSS_HOME=%CD% -popd - -REM Add bin/native to the PATH if present -if exist "%JBOSS_HOME%\bin\native" set PATH=%JBOSS_HOME%\bin\native;%PATH% -if exist "%JBOSS_HOME%\bin\native" set JAVA_OPTS=%JAVA_OPTS% -Djava.library.path="%PATH%" - -rem Find run.jar, or we can't continue - -set RUNJAR=%JBOSS_HOME%\bin\run.jar -if exist "%RUNJAR%" goto FOUND_RUN_JAR -echo Could not locate %RUNJAR%. Please check that you are in the -echo bin directory when running this script. -goto END - -:FOUND_RUN_JAR - -if not "%JAVA_HOME%" == "" goto ADD_TOOLS - -set JAVA=java - -echo JAVA_HOME is not set. Unexpected results may occur. -echo Set JAVA_HOME to the directory of your local JDK to avoid this message. -goto SKIP_TOOLS - -:ADD_TOOLS - -set JAVA=%JAVA_HOME%\bin\java - -rem A full JDK with toos.jar is not required anymore since jboss web packages -rem the eclipse jdt compiler and javassist has its own internal compiler. -if not exist "%JAVA_HOME%\lib\tools.jar" goto SKIP_TOOLS - -rem If exists, point to the JDK javac compiler in case the user wants to -rem later override the eclipse jdt compiler for compiling JSP pages. -set JAVAC_JAR=%JAVA_HOME%\lib\tools.jar - -:SKIP_TOOLS - -rem If JBOSS_CLASSPATH or JAVAC_JAR is empty, don't include it, as this will -rem result in including the local directory in the classpath, which makes -rem error tracking harder. -if not "%JAVAC_JAR%" == "" set RUNJAR=%JAVAC_JAR%;%RUNJAR% -if "%JBOSS_CLASSPATH%" == "" set RUN_CLASSPATH=%RUNJAR% -if "%RUN_CLASSPATH%" == "" set RUN_CLASSPATH=%JBOSS_CLASSPATH%;%RUNJAR% - -set JBOSS_CLASSPATH=%RUN_CLASSPATH% - -rem Setup JBoss specific properties -set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME% - -rem Add -server to the JVM options, if supported -"%JAVA%" -server -version 2>&1 | findstr /I hotspot > nul -if not errorlevel == 1 (set JAVA_OPTS=%JAVA_OPTS% -server) - -rem JVM memory allocation pool parameters. Modify as appropriate. -set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m -XX:MaxPermSize=128m - -rem With Sun JVMs reduce the RMI GCs to once per hour -set JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 - -rem JPDA options. Uncomment and modify as appropriate to enable remote debugging. -rem set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS% - -rem Setup the java endorsed dirs -set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed - -echo =============================================================================== -echo. -echo JBoss Bootstrap Environment -echo. -echo JBOSS_HOME: %JBOSS_HOME% -echo. -echo JAVA: %JAVA% -echo. -echo JAVA_OPTS: %JAVA_OPTS% -echo. -echo CLASSPATH: %JBOSS_CLASSPATH% -echo. -echo =============================================================================== -echo. - -:RESTART -"%JAVA%" %JAVA_OPTS% ^ - -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" ^ - -classpath "%JBOSS_CLASSPATH%" ^ - org.jboss.Main %* - -if ERRORLEVEL 10 goto RESTART - -:END -if "%NOPAUSE%" == "" pause - -:END_NO_PAUSE diff --git a/jboss/bin/run.conf b/jboss/bin/run.conf deleted file mode 100644 index f9106e7c22..0000000000 --- a/jboss/bin/run.conf +++ /dev/null @@ -1,50 +0,0 @@ -## -*- shell-script -*- ###################################################### -## ## -## JBoss Bootstrap Script Configuration ## -## ## -############################################################################## - -### $Id: run.conf 62747 2007-05-02 17:43:36Z dimitris@jboss.org $ - -# -# This file is optional; it may be removed if not needed. -# - -# -# Specify the maximum file descriptor limit, use "max" or "maximum" to use -# the default, as queried by the system. -# -# Defaults to "maximum" -# -#MAX_FD="maximum" - -# -# Specify the profiler configuration file to load. -# -# Default is to not load profiler configuration file. -# -#PROFILER="" - -# -# Specify the location of the Java home directory. If set then $JAVA will -# be defined to $JAVA_HOME/bin/java, else $JAVA will be "java". -# -#JAVA_HOME="/opt/java/jdk" - -# -# Specify the exact Java VM executable to use. -# -#JAVA="" - -# -# Specify options to pass to the Java VM. -# -if [ "x$JAVA_OPTS" = "x" ]; then - JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=128m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" -fi - -# Sample JPDA settings for remote socket debuging -#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n" - -# Sample JPDA settings for shared memory debugging -#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss" diff --git a/jboss/bin/run.sh b/jboss/bin/run.sh deleted file mode 100644 index ac4aed35b9..0000000000 --- a/jboss/bin/run.sh +++ /dev/null @@ -1,256 +0,0 @@ -#!/bin/sh -### ====================================================================== ### -## ## -## JBoss Bootstrap Script ## -## ## -### ====================================================================== ### - -### $Id: run.sh 75849 2008-07-15 18:43:17Z dimitris@jboss.org $ ### - -DIRNAME=`dirname $0` -PROGNAME=`basename $0` -GREP="grep" - -# Use the maximum available, or set MAX_FD != -1 to use that -MAX_FD="maximum" - -# -# Helper to complain. -# -warn() { - echo "${PROGNAME}: $*" -} - -# -# Helper to puke. -# -die() { - warn $* - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false; -darwin=false; -linux=false; -case "`uname`" in - CYGWIN*) - cygwin=true - ;; - - Darwin*) - darwin=true - ;; - - Linux) - linux=true - ;; -esac - -# Read an optional running configuration file -if [ "x$RUN_CONF" = "x" ]; then - RUN_CONF="$DIRNAME/run.conf" -fi -if [ -r "$RUN_CONF" ]; then - . "$RUN_CONF" -fi - -# Force IPv4 on Linux systems since IPv6 doesn't work correctly with jdk5 and lower -if [ "$linux" = "true" ]; then - JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true" -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$JBOSS_HOME" ] && - JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$JAVAC_JAR" ] && - JAVAC_JAR=`cygpath --unix "$JAVAC_JAR"` -fi - -# Setup JBOSS_HOME -if [ "x$JBOSS_HOME" = "x" ]; then - # get the full path (without any relative bits) - JBOSS_HOME=`cd $DIRNAME/..; pwd` -fi -export JBOSS_HOME - -# Increase the maximum file descriptors if we can -if [ "$cygwin" = "false" ]; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ]; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then - # use the system max - MAX_FD="$MAX_FD_LIMIT" - fi - - ulimit -n $MAX_FD - if [ $? -ne 0 ]; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# Setup the JVM -if [ "x$JAVA" = "x" ]; then - if [ "x$JAVA_HOME" != "x" ]; then - JAVA="$JAVA_HOME/bin/java" - else - JAVA="java" - fi -fi - -# Setup the classpath -runjar="$JBOSS_HOME/bin/run.jar" -if [ ! -f "$runjar" ]; then - die "Missing required file: $runjar" -fi -JBOSS_BOOT_CLASSPATH="$runjar" - -# Tomcat uses the JDT Compiler -# Only include tools.jar if someone wants to use the JDK instead. -# compatible distribution which JAVA_HOME points to -if [ "x$JAVAC_JAR" = "x" ]; then - JAVAC_JAR_FILE="$JAVA_HOME/lib/tools.jar" -else - JAVAC_JAR_FILE="$JAVAC_JAR" -fi -if [ ! -f "$JAVAC_JAR_FILE" ]; then - # MacOSX does not have a seperate tools.jar - if [ "$darwin" != "true" -a "x$JAVAC_JAR" != "x" ]; then - warn "Missing file: JAVAC_JAR=$JAVAC_JAR" - warn "Unexpected results may occur." - fi - JAVAC_JAR_FILE= -fi - -if [ "x$JBOSS_CLASSPATH" = "x" ]; then - JBOSS_CLASSPATH="$JBOSS_BOOT_CLASSPATH" -else - JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH" -fi -if [ "x$JAVAC_JAR_FILE" != "x" ]; then - JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JAVAC_JAR_FILE" -fi - -# If -server not set in JAVA_OPTS, set it, if supported -SERVER_SET=`echo $JAVA_OPTS | $GREP "\-server"` -if [ "x$SERVER_SET" = "x" ]; then - - # Check for SUN(tm) JVM w/ HotSpot support - if [ "x$HAS_HOTSPOT" = "x" ]; then - HAS_HOTSPOT=`"$JAVA" -version 2>&1 | $GREP -i HotSpot` - fi - - # Enable -server if we have Hotspot, unless we can't - if [ "x$HAS_HOTSPOT" != "x" ]; then - # MacOS does not support -server flag - if [ "$darwin" != "true" ]; then - JAVA_OPTS="-server $JAVA_OPTS" - fi - fi -fi - -# Setup JBosst Native library path -JBOSS_NATIVE_DIR="$JBOSS_HOME/bin/native" -if [ -d "$JBOSS_NATIVE_DIR" ]; then - if $cygwin ; then - export PATH="$JBOSS_NATIVE_DIR:$PATH" - JBOSS_NATIVE_DIR=`cygpath --dos "$JBOSS_NATIVE_DIR"` - fi - if [ "x$LD_LIBRARY_PATH" = "x" ]; then - LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR" - else - LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR:$LD_LIBRARY_PATH" - fi - export LD_LIBRARY_PATH - if [ "x$JAVA_OPTS" = "x" ]; then - JAVA_OPTS="-Djava.library.path=$JBOSS_NATIVE_DIR" - else - JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$JBOSS_NATIVE_DIR" - fi -fi - -# Setup JBoss specific properties -JAVA_OPTS="-Dprogram.name=$PROGNAME $JAVA_OPTS" - -# Setup the java endorsed dirs -JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"` - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - JBOSS_CLASSPATH=`cygpath --path --windows "$JBOSS_CLASSPATH"` - JBOSS_ENDORSED_DIRS=`cygpath --path --windows "$JBOSS_ENDORSED_DIRS"` -fi - -# Display our environment -echo "=========================================================================" -echo "" -echo " JBoss Bootstrap Environment" -echo "" -echo " JBOSS_HOME: $JBOSS_HOME" -echo "" -echo " JAVA: $JAVA" -echo "" -echo " JAVA_OPTS: $JAVA_OPTS" -echo "" -echo " CLASSPATH: $JBOSS_CLASSPATH" -echo "" -echo "=========================================================================" -echo "" - -while true; do - if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "x" ]; then - # Execute the JVM in the foreground - "$JAVA" $JAVA_OPTS \ - -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \ - -classpath "$JBOSS_CLASSPATH" \ - org.jboss.Main "$@" - JBOSS_STATUS=$? - else - # Execute the JVM in the background - "$JAVA" $JAVA_OPTS \ - -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \ - -classpath "$JBOSS_CLASSPATH" \ - org.jboss.Main "$@" & - JBOSS_PID=$! - # Trap common signals and relay them to the jboss process - trap "kill -HUP $JBOSS_PID" HUP - trap "kill -TERM $JBOSS_PID" INT - trap "kill -QUIT $JBOSS_PID" QUIT - trap "kill -PIPE $JBOSS_PID" PIPE - trap "kill -TERM $JBOSS_PID" TERM - # Wait until the background process exits - WAIT_STATUS=128 - while [ "$WAIT_STATUS" -ge 128 ]; do - wait $JBOSS_PID 2>/dev/null - WAIT_STATUS=$? - if [ "${WAIT_STATUS}" -gt 128 ]; then - SIGNAL=`expr ${WAIT_STATUS} - 128` - SIGNAL_NAME=`kill -l ${SIGNAL}` - echo "*** JBossAS process (${JBOSS_PID}) received ${SIGNAL_NAME} signal ***" >&2 - fi - done - if [ "${WAIT_STATUS}" -lt 127 ]; then - JBOSS_STATUS=$WAIT_STATUS - else - JBOSS_STATUS=0 - fi - fi - # If restart doesn't work, check you are running JBossAS 4.0.4+ - # http://jira.jboss.com/jira/browse/JBAS-2483 - # or the following if you're running Red Hat 7.0 - # http://developer.java.sun.com/developer/bugParade/bugs/4465334.html - if [ "$JBOSS_STATUS" -eq 10 ]; then - echo "Restarting JBoss..." - else - exit $JBOSS_STATUS - fi -done - diff --git a/jboss/bin/shutdown.bat b/jboss/bin/shutdown.bat deleted file mode 100644 index f2245d4253..0000000000 --- a/jboss/bin/shutdown.bat +++ /dev/null @@ -1,56 +0,0 @@ -@echo off -rem ------------------------------------------------------------------------- -rem JBoss JVM Launcher -rem ------------------------------------------------------------------------- - -rem $Id: shutdown.bat 72204 2008-04-15 09:34:39Z dimitris@jboss.org $ - -if not "%ECHO%" == "" echo %ECHO% -if "%OS%" == "Windows_NT" setlocal - -set MAIN_JAR_NAME=shutdown.jar -set MAIN_CLASS=org.jboss.Shutdown - -set DIRNAME=.\ -if "%OS%" == "Windows_NT" set DIRNAME=%~dp0% -set PROGNAME=run.bat -if "%OS%" == "Windows_NT" set PROGNAME=%~nx0% - -rem Find MAIN_JAR, or we can't continue - -set MAIN_JAR=%DIRNAME%\%MAIN_JAR_NAME% -if exist "%MAIN_JAR%" goto FOUND_MAIN_JAR -echo Could not locate %MAIN_JAR%. Please check that you are in the -echo bin directory when running this script. -goto END - -:FOUND_MAIN_JAR - -if not "%JAVA_HOME%" == "" goto HAVE_JAVA_HOME - -set JAVA=java - -echo JAVA_HOME is not set. Unexpected results may occur. -echo Set JAVA_HOME to the directory of your local JDK to avoid this message. -goto SKIP_SET_JAVA_HOME - -:HAVE_JAVA_HOME - -set JAVA=%JAVA_HOME%\bin\java - -:SKIP_SET_JAVA_HOME - -set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%MAIN_JAR%;%DIRNAME%/../client/jbossall-client.jar - -rem Setup JBoss sepecific properties -set JAVA_OPTS=%JAVA_OPTS% -Djboss.boot.loader.name=%PROGNAME% - -rem JPDA options. Uncomment and modify as appropriate to enable remote debugging. -rem set JAVA_OPTS=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS% - -"%JAVA%" %JAVA_OPTS% -classpath "%JBOSS_CLASSPATH%" %MAIN_CLASS% %* - -:END -if "%NOPAUSE%" == "" pause - -:END_NO_PAUSE diff --git a/jboss/bin/shutdown.sh b/jboss/bin/shutdown.sh deleted file mode 100644 index b9fe93d368..0000000000 --- a/jboss/bin/shutdown.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -### ====================================================================== ### -## ## -## JBoss Shutdown Script ## -## ## -### ====================================================================== ### - -### $Id: shutdown.sh 62718 2007-05-02 09:06:09Z dimitris@jboss.org $ ### - -DIRNAME=`dirname $0` -PROGNAME=`basename $0` -GREP="grep" - -# -# Helper to complain. -# -die() { - echo "${PROGNAME}: $*" - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false; -case "`uname`" in - CYGWIN*) - cygwin=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$JBOSS_HOME" ] && - JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Setup JBOSS_HOME -if [ "x$JBOSS_HOME" = "x" ]; then - JBOSS_HOME=`cd $DIRNAME/..; pwd` -fi -export JBOSS_HOME - -# Setup the JVM -if [ "x$JAVA" = "x" ]; then - if [ "x$JAVA_HOME" != "x" ]; then - JAVA="$JAVA_HOME/bin/java" - else - JAVA="java" - fi -fi - -# Setup the classpath -JBOSS_BOOT_CLASSPATH="$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jbossall-client.jar" - -if [ "x$JBOSS_CLASSPATH" = "x" ]; then - JBOSS_CLASSPATH="$JBOSS_BOOT_CLASSPATH" -else - JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"` - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - JBOSS_CLASSPATH=`cygpath --path --windows "$JBOSS_CLASSPATH"` -fi - -# Execute the JVM -exec "$JAVA" \ - $JAVA_OPTS \ - -classpath $JBOSS_CLASSPATH \ - org.jboss.Shutdown "$@" diff --git a/jboss/bin/twiddle.bat b/jboss/bin/twiddle.bat deleted file mode 100644 index 96171b4879..0000000000 --- a/jboss/bin/twiddle.bat +++ /dev/null @@ -1,61 +0,0 @@ -@echo off -rem ------------------------------------------------------------------------- -rem JBoss JVM Launcher -rem ------------------------------------------------------------------------- - -rem $Id: twiddle.bat 72204 2008-04-15 09:34:39Z dimitris@jboss.org $ - -if not "%ECHO%" == "" echo %ECHO% -if "%OS%" == "Windows_NT" setlocal - -set MAIN_JAR_NAME=twiddle.jar -set MAIN_CLASS=org.jboss.console.twiddle.Twiddle - -set DIRNAME=.\ -if "%OS%" == "Windows_NT" set DIRNAME=%~dp0% -set PROGNAME=run.bat -if "%OS%" == "Windows_NT" set PROGNAME=%~nx0% - -rem Find MAIN_JAR, or we can't continue - -set MAIN_JAR=%DIRNAME%\%MAIN_JAR_NAME% -if exist "%MAIN_JAR%" goto FOUND_MAIN_JAR -echo Could not locate %MAIN_JAR%. Please check that you are in the -echo bin directory when running this script. -goto END - -:FOUND_MAIN_JAR - -if not "%JAVA_HOME%" == "" goto HAVE_JAVA_HOME - -set JAVA=java - -echo JAVA_HOME is not set. Unexpected results may occur. -echo Set JAVA_HOME to the directory of your local JDK to avoid this message. -goto SKIP_SET_JAVA_HOME - -:HAVE_JAVA_HOME - -set JAVA=%JAVA_HOME%\bin\java - -:SKIP_SET_JAVA_HOME - -rem only include jbossall-client.jar in classpath, if -rem JBOSS_CLASSPATH was not yet set -if not "%JBOSS_CLASSPATH%" == "" GOTO HAVE_JB_CP -set JBOSS_CLASSPATH=%DIRNAME%\..\client\jbossall-client.jar -set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%DIRNAME%\..\client\getopt.jar -set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%DIRNAME%\..\client\log4j.jar -set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%DIRNAME%\..\lib\jboss-jmx.jar -:HAVE_JB_CP - -set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%MAIN_JAR% - -rem Setup JBoss sepecific properties -set JBOSS_HOME=%DIRNAME%\.. -set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed -set JAVA_OPTS=%JAVA_OPTS% -Djboss.boot.loader.name=%PROGNAME% - -"%JAVA%" %JAVA_OPTS% "-Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS%" -classpath "%JBOSS_CLASSPATH%" %MAIN_CLASS% %* - -:END diff --git a/jboss/bin/twiddle.sh b/jboss/bin/twiddle.sh deleted file mode 100644 index ded300eebb..0000000000 --- a/jboss/bin/twiddle.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh -### ====================================================================== ### -## ## -## JBoss Shutdown Script ## -## ## -### ====================================================================== ### - -### $Id: twiddle.sh 57032 2006-09-20 22:03:16Z dimitris@jboss.org $ ### - -DIRNAME=`dirname $0` -PROGNAME=`basename $0` -GREP="grep" - -# -# Helper to complain. -# -die() { - echo "${PROGNAME}: $*" - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false; -case "`uname`" in - CYGWIN*) - cygwin=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$JBOSS_HOME" ] && - JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Setup JBOSS_HOME -if [ "x$JBOSS_HOME" = "x" ]; then - JBOSS_HOME=`cd $DIRNAME/..; pwd` -fi -export JBOSS_HOME - -# Setup the JVM -if [ "x$JAVA_HOME" != "x" ]; then - JAVA=$JAVA_HOME/bin/java -else - JAVA="java" -fi - -# Setup the classpath -JBOSS_BOOT_CLASSPATH="$JBOSS_HOME/bin/twiddle.jar" - -if [ "x$JBOSS_CLASSPATH" = "x" ]; then - JBOSS_CLASSPATH="$JBOSS_BOOT_CLASSPATH" - JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_HOME/client/jbossall-client.jar" - JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_HOME/client/getopt.jar" - JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_HOME/client/log4j.jar" - JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_HOME/lib/jboss-jmx.jar" -else - JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH" -fi - -# Setup the java endorsed dirs -JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"` - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - JBOSS_CLASSPATH=`cygpath --path --windows "$JBOSS_CLASSPATH"` - JBOSS_ENDORSED_DIRS=`cygpath --path --windows "$JBOSS_ENDORSED_DIRS"` -fi - -# Execute the JVM -exec "$JAVA" \ - $JAVA_OPTS \ - -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \ - -Dprogram.name="$PROGNAME" \ - -classpath $JBOSS_CLASSPATH \ - org.jboss.console.twiddle.Twiddle "$@" diff --git a/jboss/bin/wsconsume.bat b/jboss/bin/wsconsume.bat deleted file mode 100644 index 804460d91a..0000000000 --- a/jboss/bin/wsconsume.bat +++ /dev/null @@ -1,70 +0,0 @@ -@echo off - -rem $Id: wsconsume.bat 2885 2008-03-22 23:05:16Z richard.opalka@jboss.com $ - -@if not "%ECHO%" == "" echo %ECHO% -@if "%OS%" == "Windows_NT" setlocal - -set DIRNAME=.\ -if "%OS%" == "Windows_NT" set DIRNAME=%~dp0% -set PROGNAME=run.bat -if "%OS%" == "Windows_NT" set PROGNAME=%~nx0% - -rem Read all command line arguments - -REM -REM The %ARGS% env variable commented out in favor of using %* to include -REM all args in java command line. See bug #840239. [jpl] -REM -REM set ARGS= -REM :loop -REM if [%1] == [] goto endloop -REM set ARGS=%ARGS% %1 -REM shift -REM goto loop -REM :endloop - -set JAVA=%JAVA_HOME%\bin\java -set JBOSS_HOME=%DIRNAME%\.. -rem Setup the java endorsed dirs -set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed - -rem shared libs -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JAVA_HOME%/lib/tools.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/activation.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/getopt.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/wstx.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/log4j.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/mail.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-spi.jar - -rem shared jaxws libs -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-tools.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-rt.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/stax-api.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-api.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-impl.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-xjc.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/streambuffer.jar -set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/stax-ex.jar - -rem stack specific dependencies -if exist %JBOSS_HOME%/client/jbossws-client.jar goto else - rem JBossWS-Metro stack libraries - echo JBossWS-Metro stack deployed - set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-metro-client.jar - goto endif -:else - rem JBossWS-Native stack libraries - echo JBossWS-Native stack deployed - set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/javassist.jar - set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-xml-binding.jar - set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-client.jar - set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxws.jar - set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxrpc.jar - set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-saaj.jar -:endif - -rem Execute the JVM -"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSCONSUME_CLASSPATH%" org.jboss.wsf.spi.tools.cmd.WSConsume %* diff --git a/jboss/bin/wsconsume.sh b/jboss/bin/wsconsume.sh deleted file mode 100644 index 92d4d52bc3..0000000000 --- a/jboss/bin/wsconsume.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/sh - -# -# Invoke wsconsume with dynamic classpath -# depending on the deployed stack and the location -# -# @author Heiko.Braun@jboss.com -# @version $Id: wsconsume.sh 2885 2008-03-22 23:05:16Z richard.opalka@jboss.com $ -# - -DIRNAME=`dirname $0` -PROGNAME=`basename $0` - -# OS specific support (must be 'true' or 'false'). -cygwin=false; -case "`uname`" in - CYGWIN*) - cygwin=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$JBOSS_HOME" ] && - JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Setup JBOSS_HOME -if [ "x$JBOSS_HOME" = "x" ]; then - # get the full path (without any relative bits) - JBOSS_HOME=`cd $DIRNAME/..; pwd` -fi -export JBOSS_HOME - -# Setup the JVM -if [ "x$JAVA" = "x" ]; then - if [ "x$JAVA_HOME" != "x" ]; then - JAVA="$JAVA_HOME/bin/java" - else - JAVA="java" - fi -fi - -#JPDA options. Uncomment and modify as appropriate to enable remote debugging . -#JAVA_OPTS="-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y $JAVA_OPTS" - -# Setup JBoss sepecific properties -JAVA_OPTS="$JAVA_OPTS" - -# Setup the java endorsed dirs -JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed" - -### -# Setup the LIBDIR -# This script maybe used form within the jbossws distribution -# or installed under JBOSS_HOME/bin -### - -PARENT=`cd $DIRNAME/..; pwd` -if [ -d $PARENT/client ]; then - LIBDIR=$JBOSS_HOME/client -else - LIBDIR=$PARENT/lib -fi - -# is it a JBossWS-native or SunRI installation? -if [ -f $LIBDIR/jbossws-client.jar ]; then - JBOSSWS_NATIVE="true" -fi - -### -# Setup the wsprovide classpath -# The classpath is dynamically build depending on the stack that -# is deployed. See $JBOSSWS_NATIVE above. -### - -# shared libs -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JAVA_HOME/lib/tools.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/activation.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/getopt.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/wstx.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jbossall-client.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/log4j.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/mail.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jbossws-spi.jar" - -# shared jaxws libs -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jaxws-tools.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jaxws-rt.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/stax-api.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jaxb-api.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jaxb-impl.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jaxb-xjc.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/streambuffer.jar" -WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/stax-ex.jar" - -### -# Stack specific dependencies -### - -if [ "x$JBOSSWS_NATIVE" = "x" ]; then - # JBossWS-Metro stack libraries - echo "JBossWS-Metro stack deployed" - WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jbossws-metro-client.jar" -else - # JBossWS-Native stack libraries - echo "JBossWS-Native stack deployed" - WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/javassist.jar" - WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jboss-xml-binding.jar" - WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jbossws-client.jar" - WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jboss-jaxws.jar" - WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jboss-jaxrpc.jar" - WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jboss-saaj.jar" -fi - -### -# Execute the JVM -### - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"` - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - WSCONSUME_CLASSPATH=`cygpath --path --windows "$WSCONSUME_CLASSPATH"` - JBOSS_ENDORSED_DIRS=`cygpath --path --windows "$JBOSS_ENDORSED_DIRS"` -fi - -"$JAVA" $JAVA_OPTS \ - -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \ - -Dlog4j.configuration=wstools-log4j.xml \ - -classpath "$WSCONSUME_CLASSPATH" \ - org.jboss.wsf.spi.tools.cmd.WSConsume "$@" diff --git a/jboss/bin/wsprovide.bat b/jboss/bin/wsprovide.bat deleted file mode 100644 index ed2538898f..0000000000 --- a/jboss/bin/wsprovide.bat +++ /dev/null @@ -1,75 +0,0 @@ -@echo off - -rem $Id: wsprovide.bat 2885 2008-03-22 23:05:16Z richard.opalka@jboss.com $ - -@if not "%ECHO%" == "" echo %ECHO% -@if "%OS%" == "Windows_NT" setlocal - -set DIRNAME=.\ -if "%OS%" == "Windows_NT" set DIRNAME=%~dp0% -set PROGNAME=run.bat -if "%OS%" == "Windows_NT" set PROGNAME=%~nx0% - -rem Read all command line arguments - -REM -REM The %ARGS% env variable commented out in favor of using %* to include -REM all args in java command line. See bug #840239. [jpl] -REM -REM set ARGS= -REM :loop -REM if [%1] == [] goto endloop -REM set ARGS=%ARGS% %1 -REM shift -REM goto loop -REM :endloop - -set JAVA=%JAVA_HOME%\bin\java -set JBOSS_HOME=%DIRNAME%\.. -rem Setup the java endorsed dirs -set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed - -rem shared libs -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JAVA_HOME%/lib/tools.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jbossws-spi.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/activation.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/getopt.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/log4j.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/mail.jar - -rem shared jaxws libs -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jaxb-api.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jaxb-impl.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jaxb-xjc.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jaxws-tools.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jaxws-rt.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/streambuffer.jar -set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/stax-ex.jar - -rem stack specific dependencies -if exist %JBOSS_HOME%/client/jbossws-client.jar goto else - rem JBossWS-Metro stack libraries - echo JBossWS-Metro stack deployed - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jbossws-metro-client.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jaxws-api.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jsr181-api.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/saaj-api.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/saaj-impl.jar - goto endif -:else - rem JBossWS-Native stack libraries - echo JBossWS-Native stack deployed - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jboss-xml-binding.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/javassist.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jbossws-client.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxws.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxrpc.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jboss-saaj.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/policy.jar - set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/wsdl4j.jar -:endif - -rem Execute the JVM -"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSPROVIDE_CLASSPATH%" org.jboss.wsf.spi.tools.cmd.WSProvide %* diff --git a/jboss/bin/wsprovide.sh b/jboss/bin/wsprovide.sh deleted file mode 100644 index 14b1c362c1..0000000000 --- a/jboss/bin/wsprovide.sh +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/sh - -# -# Invoke wsprovide with dynamic classpath -# depending on the deployed stack and the location -# -# @author Heiko.Braun@jboss.com -# @version $Id: wsprovide.sh 2885 2008-03-22 23:05:16Z richard.opalka@jboss.com $ -# - -DIRNAME=`dirname $0` -PROGNAME=`basename $0` - -# OS specific support (must be 'true' or 'false'). -cygwin=false; -case "`uname`" in - CYGWIN*) - cygwin=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$JBOSS_HOME" ] && - JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Setup JBOSS_HOME -if [ "x$JBOSS_HOME" = "x" ]; then - # get the full path (without any relative bits) - JBOSS_HOME=`cd $DIRNAME/..; pwd` -fi -export JBOSS_HOME - -# Setup the JVM -if [ "x$JAVA" = "x" ]; then - if [ "x$JAVA_HOME" != "x" ]; then - JAVA="$JAVA_HOME/bin/java" - else - JAVA="java" - fi -fi - -#JPDA options. Uncomment and modify as appropriate to enable remote debugging . -#JAVA_OPTS="-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y $JAVA_OPTS" - -# Setup JBoss sepecific properties -JAVA_OPTS="$JAVA_OPTS" - -# Setup the java endorsed dirs -JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed" - -### -# Setup the LIBDIR -# This script maybe used form within the jbossws distribution -# or installed under JBOSS_HOME/bin -### - -PARENT=`cd $DIRNAME/..; pwd` -if [ -d $PARENT/client ]; then - LIBDIR=$JBOSS_HOME/client -else - LIBDIR=$PARENT/lib -fi - -# is it a JBossWS-native or SunRI installation? -if [ -f $LIBDIR/jbossws-client.jar ]; then - JBOSSWS_NATIVE="true" -fi - -### -# Setup the wsprovide classpath -# The classpath is dynamically build depending on the stack that -# is deployed. See $JBOSSWS_NATIVE above. -### - -# shared libs -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JAVA_HOME/lib/tools.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jbossws-spi.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/activation.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/getopt.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jbossall-client.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/log4j.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/mail.jar" - -# shared jaxws libs -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jaxb-api.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jaxb-impl.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jaxb-xjc.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jaxws-tools.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jaxws-rt.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/streambuffer.jar" -WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/stax-ex.jar" - -### -# stack specific dependencies -### - -if [ "x$JBOSSWS_NATIVE" = "x" ]; then - # JBossWS-Metro stack libraries - echo "JBossWS-Metro stack deployed" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jbossws-metro-client.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jaxws-api.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jsr181-api.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/saaj-api.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/saaj-impl.jar" -else - # JBossWS-Native stack libraries - echo "JBossWS-Native stack deployed" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jboss-xml-binding.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/javassist.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jbossall-client.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jbossws-client.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jboss-jaxws.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jboss-jaxrpc.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jboss-saaj.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/policy.jar" - WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/wsdl4j.jar" -fi - -### -# Execute the JVM -### - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"` - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - WSPROVIDE_CLASSPATH=`cygpath --path --windows "$WSPROVIDE_CLASSPATH"` - JBOSS_ENDORSED_DIRS=`cygpath --path --windows "$JBOSS_ENDORSED_DIRS"` -fi - -"$JAVA" $JAVA_OPTS \ - -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \ - -Dlog4j.configuration=wstools-log4j.xml \ - -classpath "$WSPROVIDE_CLASSPATH" \ - org.jboss.wsf.spi.tools.cmd.WSProvide "$@" diff --git a/jboss/bin/wsrunclient.bat b/jboss/bin/wsrunclient.bat deleted file mode 100644 index b11604cfe2..0000000000 --- a/jboss/bin/wsrunclient.bat +++ /dev/null @@ -1,58 +0,0 @@ -@echo off - -rem $Id: wsrunclient.bat 3813 2008-03-31 12:03:40Z richard.opalka@jboss.com $ - -@if not "%ECHO%" == "" echo %ECHO% -@if "%OS%" == "Windows_NT" setlocal - -set DIRNAME=.\ -if "%OS%" == "Windows_NT" set DIRNAME=%~dp0% -set PROGNAME=run.bat -if "%OS%" == "Windows_NT" set PROGNAME=%~nx0% - - -if not [%1] == [] goto start - echo %PROGNAME% is a command line tool that invokes a JBossWS JAX-WS Web Service client. - echo It builds the correct classpath and endorsed libs for you. Feel free to use - echo the code for this script to make your own shell scripts. It is open source - echo after all. - echo. - echo usage: %PROGNAME% [-classpath ^] ^ [arguments...] - goto EOF -:start -set ARGS= -:loop -if [%1] == [] goto endloop - if not %1 == -classpath goto argset - set WSRUNCLIENT_CLASSPATH=%2 - shift - shift - goto loop - :argset - set ARGS=%ARGS% %1 - shift - goto loop -:endloop - -set JAVA=%JAVA_HOME%\bin\java -set JBOSS_HOME=%DIRNAME%\.. -rem Setup the java endorsed dirs - -rem Setup the java endorsed dirs -set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed - -rem Setup the client classpath -set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/log4j.jar -set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/jbossws-client.jar -set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/xmlsec.jar - -rem JBossAS-5.0 subset of jbossall-client.jar -set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/jboss-logging-spi.jar -set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/jboss-common-core.jar - -rem JBossAS-4.2 subset of jbossall-client.jar -set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/jboss-common-client.jar - -rem Execute the JVM -"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSRUNCLIENT_CLASSPATH%" %ARGS% -:EOF diff --git a/jboss/bin/wsrunclient.sh b/jboss/bin/wsrunclient.sh deleted file mode 100644 index 4126ea615b..0000000000 --- a/jboss/bin/wsrunclient.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh - -# $Id: wsrunclient.sh 3813 2008-03-31 12:03:40Z richard.opalka@jboss.com $ -DIRNAME=`dirname $0` -PROGNAME=`basename $0` - -if [ $# -eq 0 ]; then - echo "$PROGNAME is a command line tool that invokes a JBossWS JAX-WS Web Service client." - echo "It builds the correct classpath and endorsed libs for you. Feel free to use" - echo "the code for this script to make your own shell scripts. It is open source" - echo "after all." - echo - echo "usage: $PROGNAME [-classpath ] [arguments...]" - exit 1; -fi - -# OS specific support (must be 'true' or 'false'). -cygwin=false; -case "`uname`" in - CYGWIN*) - cygwin=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$JBOSS_HOME" ] && - JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -while [ $# -ge 1 ]; do - case $1 in - "-classpath") WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$2"; shift;; - *) args=$args" $1";; - esac - shift -done - -# Setup JBOSS_HOME -if [ "x$JBOSS_HOME" = "x" ]; then - # get the full path (without any relative bits) - JBOSS_HOME=`cd $DIRNAME/..; pwd` -fi -export JBOSS_HOME - -# Setup the JVM -if [ "x$JAVA" = "x" ]; then - if [ "x$JAVA_HOME" != "x" ]; then - JAVA="$JAVA_HOME/bin/java" - else - JAVA="java" - fi -fi - -#JPDA options. Uncomment and modify as appropriate to enable remote debugging . -#JAVA_OPTS="-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n $JAVA_OPTS" - -# Setup JBoss sepecific properties -JAVA_OPTS="$JAVA_OPTS" - -# Setup the java endorsed dirs -JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed" - -# Setup the client classpath -WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/log4j.jar" -WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/jbossws-client.jar" -WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/xmlsec.jar" - -# JBossAS-5.0 subset of jbossall-client.jar -WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/jboss-logging-spi.jar" -WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/jboss-common-core.jar" - -# JBossAS-4.2 subset of jbossall-client.jar -WSRUNCLIENT_CLASSPATH="$WSRUNCLIENT_CLASSPATH:$JBOSS_HOME/client/jboss-common-client.jar" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"` - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - WSRUNCLIENT_CLASSPATH=`cygpath --path --windows "$WSRUNCLIENT_CLASSPATH"` - JBOSS_ENDORSED_DIRS=`cygpath --path --windows "$JBOSS_ENDORSED_DIRS"` -fi - -# Execute the JVM -"$JAVA" $JAVA_OPTS \ - -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \ - -Dlog4j.configuration=wstools-log4j.xml \ - -classpath "$WSRUNCLIENT_CLASSPATH" \ - $args diff --git a/jboss/bin/wstools.bat b/jboss/bin/wstools.bat deleted file mode 100644 index 741c03b15a..0000000000 --- a/jboss/bin/wstools.bat +++ /dev/null @@ -1,69 +0,0 @@ -@echo off - -rem $Id: wstools.bat 3813 2008-03-31 12:03:40Z richard.opalka@jboss.com $ - -@if not "%ECHO%" == "" echo %ECHO% -@if "%OS%" == "Windows_NT" setlocal - -set DIRNAME=.\ -if "%OS%" == "Windows_NT" set DIRNAME=%~dp0% -set PROGNAME=run.bat -if "%OS%" == "Windows_NT" set PROGNAME=%~nx0% - -rem Read all command line arguments - -REM -REM The %ARGS% env variable commented out in favor of using %* to include -REM all args in java command line. See bug #840239. [jpl] -REM -REM set ARGS= -REM :loop -REM if [%1] == [] goto endloop -REM set ARGS=%ARGS% %1 -REM shift -REM goto loop -REM :endloop - -set JAVA=%JAVA_HOME%\bin\java -set JBOSS_HOME=%DIRNAME%\.. -rem Setup the java endorsed dirs -set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed - -rem Setup the wstools classpath -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JAVA_HOME%/lib/tools.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/activation.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/getopt.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/wstx.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/wsdl4j.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/log4j.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/mail.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/concurrent.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/jbossws-spi.jar - -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/javassist.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/jboss-xml-binding.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/jbossws-client.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxws.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxrpc.jar -set WSTOOLS_CLASSPATH=%WSTOOLS_CLASSPATH%;%JBOSS_HOME%/client/jboss-saaj.jar - -rem Display our environment -echo =========================================================================" -echo . -echo WSTools Environment -echo . -echo JBOSS_HOME: %JBOSS_HOME% -echo . -echo JAVA: %JAVA% -echo . -echo JAVA_OPTS: %JAVA_OPTS% -echo . -rem echo CLASSPATH: %WSTOOLS_CLASSPATH% -rem echo . -echo =========================================================================" -echo . - -rem Execute the JVM -"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSTOOLS_CLASSPATH%" org.jboss.ws.tools.WSTools %* - diff --git a/jboss/bin/wstools.sh b/jboss/bin/wstools.sh deleted file mode 100644 index f4d847bcbf..0000000000 --- a/jboss/bin/wstools.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/sh - -# $Id: wstools.sh 3813 2008-03-31 12:03:40Z richard.opalka@jboss.com $ - -DIRNAME=`dirname $0` -PROGNAME=`basename $0` - -# OS specific support (must be 'true' or 'false'). -cygwin=false; -case "`uname`" in - CYGWIN*) - cygwin=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$JBOSS_HOME" ] && - JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Setup JBOSS_HOME -if [ "x$JBOSS_HOME" = "x" ]; then - # get the full path (without any relative bits) - JBOSS_HOME=`cd $DIRNAME/..; pwd` -fi -export JBOSS_HOME - -# Setup the JVM -if [ "x$JAVA" = "x" ]; then - if [ "x$JAVA_HOME" != "x" ]; then - JAVA="$JAVA_HOME/bin/java" - else - JAVA="java" - fi -fi - -#JPDA options. Uncomment and modify as appropriate to enable remote debugging . -#JAVA_OPTS="-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n $JAVA_OPTS" - -# Setup JBoss sepecific properties -JAVA_OPTS="$JAVA_OPTS" - -# Setup the java endorsed dirs -JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed" - -# Setup the wstools classpath -# shared libs -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JAVA_HOME/lib/tools.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/activation.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/getopt.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/wstx.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/wsdl4j.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/jbossall-client.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/log4j.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/mail.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/concurrent.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/jbossws-spi.jar" - -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/javassist.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/jboss-xml-binding.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/jbossws-client.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/jboss-jaxws.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/jboss-jaxrpc.jar" -WSTOOLS_CLASSPATH="$WSTOOLS_CLASSPATH:$JBOSS_HOME/client/jboss-saaj.jar" - - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"` - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - WSTOOLS_CLASSPATH=`cygpath --path --windows "$WSTOOLS_CLASSPATH"` - JBOSS_ENDORSED_DIRS=`cygpath --path --windows "$JBOSS_ENDORSED_DIRS"` -fi - -# Display our environment -echo "=========================================================================" -echo "" -echo " WSTools Environment" -echo "" -echo " JBOSS_HOME: $JBOSS_HOME" -echo "" -echo " JAVA: $JAVA" -echo "" -echo " JAVA_OPTS: $JAVA_OPTS" -echo "" -#echo " CLASSPATH: $WSTOOLS_CLASSPATH" -#echo "" -echo "=========================================================================" -echo "" - -# Execute the JVM -"$JAVA" $JAVA_OPTS \ - -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \ - -Dlog4j.configuration=wstools-log4j.xml \ - -classpath "$WSTOOLS_CLASSPATH" \ - org.jboss.ws.tools.WSTools "$@" diff --git a/jboss/build.properties b/jboss/build.properties deleted file mode 100644 index 94b04f62d7..0000000000 --- a/jboss/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -bin.includes = META-INF/,\ - client/jboss-client.jar,\ - client/jboss-common-client.jar,\ - client/jboss-j2ee.jar,\ - client/jbosssx-client.jar,\ - client/jboss-transaction-client.jar,\ - client/jnp-client.jar,\ - client/jmx-invoker-adaptor-client.jar,\ - client/jbossall-client.jar diff --git a/jboss/build.xml b/jboss/build.xml deleted file mode 100644 index 9def206026..0000000000 --- a/jboss/build.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/jboss/client/auth.conf b/jboss/client/auth.conf deleted file mode 100644 index 94361d2192..0000000000 --- a/jboss/client/auth.conf +++ /dev/null @@ -1,25 +0,0 @@ -srp-client { - // Example client auth.conf for using the SRPLoginModule - org.jboss.security.srp.jaas.SRPLoginModule required - password-stacking="useFirstPass" - principalClassName="org.jboss.security.SimplePrincipal" - srpServerJndiName="SRPServerInterface" - debug=true - ; - - // jBoss LoginModule - org.jboss.security.ClientLoginModule required - password-stacking="useFirstPass" - ; - - // Put your login modules that need jBoss here -}; - -other { - // jBoss LoginModule - org.jboss.security.ClientLoginModule required - ; - - // Put your login modules that need jBoss here -}; - diff --git a/jboss/copyright.txt b/jboss/copyright.txt deleted file mode 100644 index 4e7172662d..0000000000 --- a/jboss/copyright.txt +++ /dev/null @@ -1,159 +0,0 @@ -The JBoss(R)* app server is Copyright 2000-2007, Red Hat Middleware LLC -and individual contributors, and is licensed under the GNU LGPL. - -A summary of the individual contributors is given below. -Any omission should be sent to scott.stark@jboss.org. - -CVS Login(s) Name -------------------------------------------------------------------------------- -adrian,ejort Adrian Brock -aloubyansky,loubyansky Alex Loubyansky -asaldhana,osdchicago Anil Saldhana -csuconic,clebert Clebert Suconic -dimitris,andd Dimitris Andreadis -kkhan,kabkhan Kabir Khan -ovidiu,ovidiuf Ovidiu Feodorov -starksm,stark Scott M Stark -tdiesler Thomas Diesler -timfox Tim Fox -bstansberry Brian Stansberry -jgreene,nihility Jason Greene -rloehr Ruel Loehr -reverbel Francisco Reverbel -alesj Ales Justin -bdecoste Bill DeCoste -bill,patriot1burke Bill Burke -telrod Tom Elrod -schrouf Ulf Schroeter -rrajasekaran Rajesh Rajasekaran -genman Elias Ross -clin Chi Lin -ssilvert Stan Silvert -peterj Peter Johnson -rcampbell,recampbell Ryan Cambell -acoliver,acoliver2 Andy Oliver -walkerrl49 Bob Walker -bwang,bwang00 Ben Wang -pilhuhn Heiko W. Rupp -jerrygauth Jerry Gauthier -ltexier Luc Texier -jchang Jack Chang -nrichards,orb Norman Richards -remm Remy Maucherat -nrocher,noelrocher Noel Rocher -ccrouch Charles Crouch -sacha,slaboure Sacha Labourey -bela,belaan Bela Ban -jmoran Jim Moran -gavin,oneovthafew Gavin King -msurtani Manik Surtani -sebersole,steveebersole Steve Ebersole -smarlow Scott Marlow -hbarlas Haroon Barlas -rawb Robert Stryker -flaviarnn Flavia Rainone -cazzius Claudio Vesco -russo,royrusso Roy Russo -theute Thomas Heute -mnf999,fleury Marc Fleury -aveitas Algirdas Veitas -deb Deborah Hooker -karan_malhi Karan Singh -pharaohh Les A. Hazlewood -ricardoarguello Ricardo Arguello -rauschuber Chris Rauschuber -jhaynie Jeff Haynie -vietj,cooperfbi Julien Viet -richarzk Klaus Richarz -chussenet Claude Hussenet -aclute Andrew Clute -juntao Juntao Yuan -kevconner Kevin Conner -mlavergn Marc Lavergne -triathlon98 Joachim Van der Auwera -ivelin Ivelin Atanasoff Ivanov -kimptoc,kimptonc Chris Kimpton -marshall_law,mculpepper Marshall Culpepper -tpeuss Thomas Peuss -essington Jason Essington -posselt Dietmar Posselt -juhalindfors,juha Juha Lindfors -lqd Christian Riege -scoy Stephen Coy -cgjung Christoph Georg Jung -rnjn5 Neil Dattani -luke_t,negaton Luke Taylor -sreich Stefan Reich -thomasra Thomas Roka-Aardal -mikefinn Mike Finn -d_jencks David Jencks -jules_gosnell Jules Gosnell -dsundstrom Dain Sundstrom -gregwilkins Greg Wilkins -janb Jan Bartel -eli201 Eli Tilevich -harald_gliebe Harald Gliebe -mnewcomb Michael Newcomb -andygodwin Andy Godwin -chirino,hiram Hiram Chirino -user57 Jason Dillon -nphelps Nathan W. Phelps -sasp Spyridon Samothrakis -igorfie Igor Fedorenko -jboynes Jeremy Boynes -kbirch Kevin Birch -yanikc Yanik Crepeau -alindsey Aaron Lindsey -mclaugs Scott McLaughlin -austinchau Austin Chau -binaryfeed Jeffrey Wescott -pra Peter Antman -jcooley James Cooley -gropi Tobias Frech -mattmunz Matthew Munz -stormy_sky,schaefera Andreas Schaefer -peter_f Peter Fagerlunds -sparre,osh Ole Husgaard -bartmann Michael Bartmann -lsanders Larry Sanderson -thesitesman Seth Sites -azakkerman Anatoly Akkerman -sgturner Greg Turner -fbrier Frederick N. Brier -biorn_steedom,simone Simone Bordet -yarrumretep Peter M. Murray -peterbraswell Peter Braswell -jwalters Jay Walters -danch Dan Christopherson -fhanik Filip Hanik -squirest Trevor Squires -olegnitz,oleg Oleg Nitz -neales Neale Swinnerton -mikesr Mike Swainston-Rainford -dbudworth David Budworth -weave Brian Weaver -vharcq Vincent Harcq -dmaplesden David Maplesden -boissier Guillaume Boissiere -plevart Peter Levart -thedug Doug Ferguson -lepe,lennart Lennart Petersson -charles_chan Charles Chan -pkendall Paul Kendall -vlada Vladimir Blagojevic -rickardoberg,oberg Rickard Öberg -jayeshpk Jayesh Parayali -deerwood Georg Rehfeld -tobyallsopp,allsopp Toby Allsopp -kvvinaymenon KV Vinay Menon -docodan Daniel OConnor -stacycurl Stacy Curl -phox Fulco Muriglio -dmcnair Dewayne McNair -vladimir Vladimir Ivanovic -joel Joel Phillips -Luc Boudreau(JIRA) Luc Boudreau - -------------------------------------------------------------------------------- -* JBoss is a registered trademark of Red Hat Middleware LLC. - diff --git a/jboss/jar-versions.xml b/jboss/jar-versions.xml deleted file mode 100644 index 4aa2a275b8..0000000000 --- a/jboss/jar-versions.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jboss/lgpl.html b/jboss/lgpl.html deleted file mode 100644 index 0e0676cb37..0000000000 --- a/jboss/lgpl.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - Appendix A. GNU Lesser General Public License

GNU Lesser General Public License

This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.

-

Free Software Foundation, Inc.
-   51 Franklin Street, Fifth Floor,
-   Boston,
-   MA
-   02110-1301
-   USA
-

-

Everyone is permitted to copy and distribute verbatim - copies of this license document, but changing it is not - allowed.

Version 2.1, February 1999

-

Preamble

The licenses for most software are designed to take away your - freedom to share and change it. By contrast, the GNU General Public - Licenses are intended to guarantee your freedom to share and change - free software--to make sure the software is free for all its users.

This license, the Lesser General Public License, applies to some - specially designated software packages--typically libraries--of the - Free Software Foundation and other authors who decide to use it. You - can use it too, but we suggest you first think carefully about whether - this license or the ordinary General Public License is the better - strategy to use in any particular case, based on the explanations below.

When we speak of free software, we are referring to freedom of use, - not price. Our General Public Licenses are designed to make sure that - you have the freedom to distribute copies of free software (and charge - for this service if you wish); that you receive source code or can get - it if you want it; that you can change the software and use pieces of - it in new free programs; and that you are informed that you can do - these things.

To protect your rights, we need to make restrictions that forbid - distributors to deny you these rights or to ask you to surrender these - rights. These restrictions translate to certain responsibilities for - you if you distribute copies of the library or if you modify it.

For example, if you distribute copies of the library, whether gratis - or for a fee, you must give the recipients all the rights that we gave - you. You must make sure that they, too, receive or can get the source - code. If you link other code with the library, you must provide - complete object files to the recipients, so that they can relink them - with the library after making changes to the library and recompiling - it. And you must show them these terms so they know their rights.

We protect your rights with a two-step method: -

  1. we copyright the library, and

  2. we offer you this license, which gives you legal - permission to copy, distribute and/or modify the library.

-

To protect each distributor, we want to make it very clear that - there is no warranty for the free library. Also, if the library is - modified by someone else and passed on, the recipients should know - that what they have is not the original version, so that the original - author's reputation will not be affected by problems that might be - introduced by others.

Finally, software patents pose a constant threat to the existence of - any free program. We wish to make sure that a company cannot - effectively restrict the users of a free program by obtaining a - restrictive license from a patent holder. Therefore, we insist that - any patent license obtained for a version of the library must be - consistent with the full freedom of use specified in this license.

Most GNU software, including some libraries, is covered by the - ordinary GNU General Public License. This license, the GNU Lesser - General Public License, applies to certain designated libraries, and - is quite different from the ordinary General Public License. We use - this license for certain libraries in order to permit linking those - libraries into non-free programs.

When a program is linked with a library, whether statically or using - a shared library, the combination of the two is legally speaking a - combined work, a derivative of the original library. The ordinary - General Public License therefore permits such linking only if the - entire combination fits its criteria of freedom. The Lesser General - Public License permits more lax criteria for linking other code with - the library.

We call this license the Lesser General Public License because it - does Less to protect the user's freedom than the ordinary General - Public License. It also provides other free software developers Less - of an advantage over competing non-free programs. These disadvantages - are the reason we use the ordinary General Public License for many - libraries. However, the Lesser license provides advantages in certain - special circumstances.

For example, on rare occasions, there may be a special need to - encourage the widest possible use of a certain library, so that it becomes - a de-facto standard. To achieve this, non-free programs must be - allowed to use the library. A more frequent case is that a free - library does the same job as widely used non-free libraries. In this - case, there is little to gain by limiting the free library to free - software only, so we use the Lesser General Public License.

In other cases, permission to use a particular library in non-free - programs enables a greater number of people to use a large body of - free software. For example, permission to use the GNU C Library in - non-free programs enables many more people to use the whole GNU - operating system, as well as its variant, the GNU/Linux operating - system.

Although the Lesser General Public License is Less protective of the - users' freedom, it does ensure that the user of a program that is - linked with the Library has the freedom and the wherewithal to run - that program using a modified version of the Library.

The precise terms and conditions for copying, distribution and - modification follow. Pay close attention to the difference between a - “work based on the library” and a “work that uses the library”. The - former contains code derived from the library, whereas the latter must - be combined with the library in order to run.

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

Section 0

This License Agreement applies to any software library or other - program which contains a notice placed by the copyright holder or - other authorized party saying it may be distributed under the terms of - this Lesser General Public License (also called “this License”). - Each licensee is addressed as “you”.

A “library” means a collection of software functions and/or data - prepared so as to be conveniently linked with application programs - (which use some of those functions and data) to form executables.

The “Library”, below, refers to any such software library or work - which has been distributed under these terms. A “work based on the - Library” means either the Library or any derivative work under - copyright law: that is to say, a work containing the Library or a - portion of it, either verbatim or with modifications and/or translated - straightforwardly into another language. (Hereinafter, translation is - included without limitation in the term “modification”.)

Source code” for a work means the preferred form of the work for - making modifications to it. For a library, complete source code means - all the source code for all modules it contains, plus any associated - interface definition files, plus the scripts used to control compilation - and installation of the library.

Activities other than copying, distribution and modification are not - covered by this License; they are outside its scope. The act of - running a program using the Library is not restricted, and output from - such a program is covered only if its contents constitute a work based - on the Library (independent of the use of the Library in a tool for - writing it). Whether that is true depends on what the Library does - and what the program that uses the Library does.

Section 1

You may copy and distribute verbatim copies of the Library's - complete source code as you receive it, in any medium, provided that - you conspicuously and appropriately publish on each copy an - appropriate copyright notice and disclaimer of warranty; keep intact - all the notices that refer to this License and to the absence of any - warranty; and distribute a copy of this License along with the - Library.

You may charge a fee for the physical act of transferring a copy, - and you may at your option offer warranty protection in exchange for a - fee.

Section 2

You may modify your copy or copies of the Library or any portion - of it, thus forming a work based on the Library, and copy and - distribute such modifications or work under the terms of Section 1 - above, provided that you also meet all of these conditions: -

  1. The modified work must itself be a software library.

  2. You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change.

  3. You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License.

  4. If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful.

    (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.)

-

These requirements apply to the modified work as a whole. If - identifiable sections of that work are not derived from the Library, - and can be reasonably considered independent and separate works in - themselves, then this License, and its terms, do not apply to those - sections when you distribute them as separate works. But when you - distribute the same sections as part of a whole which is a work based - on the Library, the distribution of the whole must be on the terms of - this License, whose permissions for other licensees extend to the - entire whole, and thus to each and every part regardless of who wrote - it.

Thus, it is not the intent of this section to claim rights or contest - your rights to work written entirely by you; rather, the intent is to - exercise the right to control the distribution of derivative or - collective works based on the Library.

In addition, mere aggregation of another work not based on the Library - with the Library (or with a work based on the Library) on a volume of - a storage or distribution medium does not bring the other work under - the scope of this License.

Section 3

You may opt to apply the terms of the ordinary GNU General Public - License instead of this License to a given copy of the Library. To do - this, you must alter all the notices that refer to this License, so - that they refer to the ordinary GNU General Public License, version 2, - instead of to this License. (If a newer version than version 2 of the - ordinary GNU General Public License has appeared, then you can specify - that version instead if you wish.) Do not make any other change in - these notices.

Once this change is made in a given copy, it is irreversible for - that copy, so the ordinary GNU General Public License applies to all - subsequent copies and derivative works made from that copy.

This option is useful when you wish to copy part of the code of - the Library into a program that is not a library.

Section 4

You may copy and distribute the Library (or a portion or - derivative of it, under Section 2) in object code or executable form - under the terms of Sections 1 and 2 above provided that you accompany - it with the complete corresponding machine-readable source code, which - must be distributed under the terms of Sections 1 and 2 above on a - medium customarily used for software interchange.

If distribution of object code is made by offering access to copy - from a designated place, then offering equivalent access to copy the - source code from the same place satisfies the requirement to - distribute the source code, even though third parties are not - compelled to copy the source along with the object code.

Section 5

A program that contains no derivative of any portion of the - Library, but is designed to work with the Library by being compiled or - linked with it, is called a “work that uses the Library”. Such a - work, in isolation, is not a derivative work of the Library, and - therefore falls outside the scope of this License.

However, linking a “work that uses the Library” with the Library - creates an executable that is a derivative of the Library (because it - contains portions of the Library), rather than a “work that uses the - library”. The executable is therefore covered by this License. - Section 6 states terms for distribution of such executables.

When a “work that uses the Library” uses material from a header file - that is part of the Library, the object code for the work may be a - derivative work of the Library even though the source code is not. - Whether this is true is especially significant if the work can be - linked without the Library, or if the work is itself a library. The - threshold for this to be true is not precisely defined by law.

If such an object file uses only numerical parameters, data - structure layouts and accessors, and small macros and small inline - functions (ten lines or less in length), then the use of the object - file is unrestricted, regardless of whether it is legally a derivative - work. (Executables containing this object code plus portions of the - Library will still fall under Section 6.)

Otherwise, if the work is a derivative of the Library, you may - distribute the object code for the work under the terms of Section 6. - Any executables containing that work also fall under Section 6, - whether or not they are linked directly with the Library itself.

Section 6

As an exception to the Sections above, you may also combine or - link a “work that uses the Library” with the Library to produce a - work containing portions of the Library, and distribute that work - under terms of your choice, provided that the terms permit - modification of the work for the customer's own use and reverse - engineering for debugging such modifications.

You must give prominent notice with each copy of the work that the - Library is used in it and that the Library and its use are covered by - this License. You must supply a copy of this License. If the work - during execution displays copyright notices, you must include the - copyright notice for the Library among them, as well as a reference - directing the user to the copy of this License. Also, you must do one - of these things: -

  1. Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable “work that - uses the Library”, as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.)

  2. Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with.

  3. Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution.

  4. If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place.

  5. Verify that the user has already received a copy of these - materials or that you have already sent this user a copy.

-

For an executable, the required form of the “work that uses the - Library” must include any data and utility programs needed for - reproducing the executable from it. However, as a special exception, - the materials to be distributed need not include anything that is - normally distributed (in either source or binary form) with the major - components (compiler, kernel, and so on) of the operating system on - which the executable runs, unless that component itself accompanies - the executable.

It may happen that this requirement contradicts the license - restrictions of other proprietary libraries that do not normally - accompany the operating system. Such a contradiction means you cannot - use both them and the Library together in an executable that you - distribute.

Section 7

You may place library facilities that are a work based on the - Library side-by-side in a single library together with other library - facilities not covered by this License, and distribute such a combined - library, provided that the separate distribution of the work based on - the Library and of the other library facilities is otherwise - permitted, and provided that you do these two things: -

  1. Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above.

  2. Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work.

-

Section 8

You may not copy, modify, sublicense, link with, or distribute - the Library except as expressly provided under this License. Any - attempt otherwise to copy, modify, sublicense, link with, or - distribute the Library is void, and will automatically terminate your - rights under this License. However, parties who have received copies, - or rights, from you under this License will not have their licenses - terminated so long as such parties remain in full compliance.

Section 9

You are not required to accept this License, since you have not - signed it. However, nothing else grants you permission to modify or - distribute the Library or its derivative works. These actions are - prohibited by law if you do not accept this License. Therefore, by - modifying or distributing the Library (or any work based on the - Library), you indicate your acceptance of this License to do so, and - all its terms and conditions for copying, distributing or modifying - the Library or works based on it.

Section 10

Each time you redistribute the Library (or any work based on the - Library), the recipient automatically receives a license from the - original licensor to copy, distribute, link with or modify the Library - subject to these terms and conditions. You may not impose any further - restrictions on the recipients' exercise of the rights granted herein. - You are not responsible for enforcing compliance by third parties with - this License.

Section 11

If, as a consequence of a court judgment or allegation of patent - infringement or for any other reason (not limited to patent issues), - conditions are imposed on you (whether by court order, agreement or - otherwise) that contradict the conditions of this License, they do not - excuse you from the conditions of this License. If you cannot - distribute so as to satisfy simultaneously your obligations under this - License and any other pertinent obligations, then as a consequence you - may not distribute the Library at all. For example, if a patent - license would not permit royalty-free redistribution of the Library by - all those who receive copies directly or indirectly through you, then - the only way you could satisfy both it and this License would be to - refrain entirely from distribution of the Library.

If any portion of this section is held invalid or unenforceable under any - particular circumstance, the balance of the section is intended to apply, - and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any - patents or other property right claims or to contest validity of any - such claims; this section has the sole purpose of protecting the - integrity of the free software distribution system which is - implemented by public license practices. Many people have made - generous contributions to the wide range of software distributed - through that system in reliance on consistent application of that - system; it is up to the author/donor to decide if he or she is willing - to distribute software through any other system and a licensee cannot - impose that choice.

This section is intended to make thoroughly clear what is believed to - be a consequence of the rest of this License.

Section 12

If the distribution and/or use of the Library is restricted in - certain countries either by patents or by copyrighted interfaces, the - original copyright holder who places the Library under this License may add - an explicit geographical distribution limitation excluding those countries, - so that distribution is permitted only in or among countries not thus - excluded. In such case, this License incorporates the limitation as if - written in the body of this License.

Section 13

The Free Software Foundation may publish revised and/or new - versions of the Lesser General Public License from time to time. - Such new versions will be similar in spirit to the present version, - but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Library - specifies a version number of this License which applies to it and - “any later version”, you have the option of following the terms and - conditions either of that version or of any later version published by - the Free Software Foundation. If the Library does not specify a - license version number, you may choose any version ever published by - the Free Software Foundation.

Section 14

If you wish to incorporate parts of the Library into other free - programs whose distribution conditions are incompatible with these, - write to the author to ask for permission. For software which is - copyrighted by the Free Software Foundation, write to the Free - Software Foundation; we sometimes make exceptions for this. Our - decision will be guided by the two goals of preserving the free status - of all derivatives of our free software and of promoting the sharing - and reuse of software generally.

NO WARRANTY Section 15

BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO - WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. - EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR - OTHER PARTIES PROVIDE THE LIBRARY “AS IS” WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE - LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME - THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

Section 16

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN - WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY - AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU - FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR - CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE - LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING - RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A - FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF - SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES.

END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Libraries

If you develop a new library, and you want it to be of the greatest - possible use to the public, we recommend making it free software that - everyone can redistribute and change. You can do so by permitting - redistribution under these terms (or, alternatively, under the terms of the - ordinary General Public License).

To apply these terms, attach the following notices to the library. It is - safest to attach them to the start of each source file to most effectively - convey the exclusion of warranty; and each file should have at least the - “copyright” line and a pointer to where the full notice is found.

<one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author>

This library 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 library 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 library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Also add information on how to contact you by electronic and paper mail.

You should also get your employer (if you work as a programmer) or your - school, if any, to sign a “copyright disclaimer” for the library, if - necessary. Here is a sample; alter the names:

Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker.

<signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice

That's all there is to it!

diff --git a/jboss/readme.html b/jboss/readme.html deleted file mode 100644 index a37d70fd08..0000000000 --- a/jboss/readme.html +++ /dev/null @@ -1,872 +0,0 @@ - - -JBoss -4.2.3.GA Readme -JBoss - A Division of Red Hat

JBoss -AS 4.2.3.GA -Release Notes

-

This is the 3rd bug fixing release of the JBoss Application -Server v4.2 series. The aim of this release is to -provide fixes for bugs reported by the -community against previous JBossAS -v4.2.x releases. There were some backwards compatible component -upgrades so switching to AS 4.2.3.GA from a previous -4.2.0/4.2.1/4.2.2 release should not present any problems. Please check -out the Detailed -Release Notes section for the full details.

-

A secondary target for this release was to -improve support for Java 6. JBossAS 4.2.3.GA can be build with -both JDK5 and JDK6. -The JDK5 compiled binaries have undergone more rigorous testing, they -constitute our certified version and can run under both Java 5 -& 6 VMs (with a few configuration changes for JDK6, see the -configuration section below). The JDK6 compiled binaries include -support for the JDBC 4 APIs, but this should be considered experimental -at this point.

JBoss AS 4.2 -is a stepping stone from JBoss 4.0 to JBoss 5.0. It combines a lot (but -not all) of the exciting new features of JBoss 5, but based on the -stable 4.x MicroKernel architecture.

-

JBoss AS 4.2 is also used as the basis for the -JBoss Enterprise Application Platform. The Application -Platform bundles JBoss AS and -JBoss Seam  -in a software package for which commercial support -is offered -by JBoss/Red Hat. Please read -Sacha's -blog if you are interested to learn more about the new -development, distribution and support model for JBoss.

-

For information on the APIs that make up Java EE 1.4, see Java EE -v1.4 Documentation. For a comprehensive tutorial on Java EE -1.4, see -The Java EE™ 1.4 Tutorial. A jboss-4.2.x getting -started guide that is based on contents from the tutorial can be found -in JBoss -Application Server Documentation Library

-

Note: The 4.2.x release of the JBoss Application -Server provides support for certain JavaEE5 features, such as EJB3, but -it is not Java EE5 certified.

-

Overview

-

Highlights of -JBoss AS 4.2 -series

-
  • JBoss -EJB3 is now deployed *by default* in JBossAS 4.2.x The fact -that we base on JDK5 makes our life easier in this regard, meaning we -don't have to maintain jdk5 code retro-weaved for jdk1.4 runtimes, and -we can include by default components that require jdk5 to run.
  • JBoss -Web v2.x is the web container in JBossAS 4.2, an -implementation based on Apache Tomcat that includes the Apache Portable -Runtime (APR) and Tomcat native technologies to achieve scalability and -performance characteristics that match and exceed the Apache Http -server. In the absence of the native libraries, -JBoss Web falls back to the standard non-native connector mode. The -native libraries need to be downloaded -and installed separately in JBOSS_HOME/bin/native.
  • -
  • JBoss -Transactions v4.2 is the default transaction manager for -JBossAS 4.2. JBoss Transactions is founded on industry proven -technology and 18 year history as a leader in distributed transactions, -and is one of the most interoperable implementations available. The JTA -version of JBoss Transactions included with the server provides for -fully recoverable transactions. For distributed transaction support the -JTS version of JBoss Transactions will need to be used. Furthermore, it -is always possible to fall back to the legacy JBossTM fast in-memory -transaction manager implementation, although it should be noted -that JBoss TM will not be supported in future JBossAS versions.
  • -
  • JBoss -WS -is the web services stack for JBoss 4.2 providing Java EE compatible -web services.
  • -
  • JGroups/JBossCache -is already configured -to support channel multiplexing, when it becomes available.
  • -
  • JBoss -Remoting was upgraded to the latest stable 2.2.x version. -This was done in order to align dependencies with the thirdparty -libraries required by the new JBoss Messaging, -which means that, if you want, you can replace the default JBossMQ -messaging provider with JBoss Messaging, without having to revert to a -scoped deployment.
  • -

Compatibility -Issues

-This lists the changes that could affect compatibility.
-
According to our product -versioning rules, JBossAS 4.2.3 should be fully compatible -with previous JBossAS 4.2.x releases. However you may want to check the -release notes of -the individual JBoss -and Thirdparty libraries updated with this release. Some -related issues from previous JBoss releases that you should be aware of -are listed below:
-

JBossAS 4.2.2.GA

  • JBossWS 1.2.1 -supported JAX-WS only as -a technology preview while JBossWS 2.0.1 used in AS 4.2.2 -provides -full JAX-WS support. If you have used in your code -the annotation org.jboss.ws.annotation.WebContext this -must be replaced by org.jboss.wsf.spi.annotation.WebContext.
  • JBoss -WS 1.0.x due to a deployer limitation used a proprietary .jse -extension for deploying WS endpoints nested in .sar -files. -This was deprecated with JBoss WS 1.2.x. and with JBoss WS 2.x this -proprietary extension is not supported anymore as it is possible to use -the standard .war extension for deploying nested WS endpoints. -If -you see: INIT_WAITING_DEPLOYER error messages for .jse files, -re-package them using a .war extension, JBWS-1854.
  • Another -known limitation is that EJB3 web service endpoints can only -be -specified using annotations and not metadata in jboss.xml. This is -something that will be addressed in a future release, JBAS-4852, -JBWS-1813.
  • Finding -the default local business interface on a ejb3 bean may not work in -certain inheritance scenarios. You may workaround this known -problem by annotating the local business interface. -Read more -about this at EJBTHREE-1062.
  • EJB -Timer -related fixes, JBAS-3379, -JBAS-4053.
  • JBossMQ -related fixes, JBAS-4525, JBAS-4555, JBAS-4559, JBAS-4607, JBAS-4625, -JBAS-4699
  • JSP compiler now set to compile JDK 1.5 -source code by default, JBAS-4605.
  • The -mail-ra.rar resource adapter was missing from the distro, JBAS-4659.
  • HSQLDB -(which shouldn't be used in production) v1.8.0.8 has a known bug when -used in server mode, JBAS-4694. -This doesn't affect the default jboss installation where HSQLDB is used -in in-process mode.
  • Serialization -of HomeHandleImplIIOP has changed. In the unlikely case of a -compatibility problem, define the system property --Dorg.jboss.proxy.ejb.old.homehandle.serialization=true to fall back to -the legacy serialization mode, JBAS-4801. -

JBossAS -4.2.1.GA -

  • JBoss TS, the new default transaction -manager will not let -you enlist multiple 1-phase participants in the same transaction. This -was *not* the default behavior with the legacy JBoss TM that would log -a warning and continue. There are good reasons for this change, mainly -to avoid heuristic outcomes in the case of system crashes, which is the -primary reason of using a transaction manager anyway! If your come -across this problem you should try to fix it by switching to XA -resources or implementing some form of compensating transactions. -However, if this is not option and you are fully aware of the -consequences you can override this behavior by setting -com.arjuna.ats.jta.allowMultipleLastResources to true in -conf/jbossjta-properties.xml. For more details read the wiki on Multiple1PC, -or consult the JBoss -Transactions documentation.
  • -
  • A major problem related to the cleaning up of threads after -user transaction timeouts was corrected in JBAS-4481. -If you happen to be using User Transactions make sure you follow the correct -pattern for committing or rolling them back.
  • -
  • Another serious classloading issue that could lead to a -hanging JBoss with a 100% CPU utilization was fixed with JBAS-4441.
  • -

JBossAS 4.2.0.GA

-
  • A JavaSE 5 runtime is required -to run JBossAS 4.2. A full -JDK with tools.jar support is no longer needed by jboss, since JBoss -Web packages the eclipse JDT compiler for compiling JSP pages and -javassist has its own internal compiler. JAVA_HOME can point to a JRE, JBAS-4161.
  • -
  • When compared to previous 4.0.x releases, the various JBoss -APIs should be stable but backwards -compatibility for individual component implementations may not be -guaranteed, e.g. interoperating with another JBoss instance that uses -an older version of JGroups.
  • -
  • Tomcat 6 is now bundled as part of JBoss Web. -deploy/jbossweb-tomcat55.sar has been replaced by -deploy/jboss-web.deployer.
  • -
  • conf/log4j.xml has been renamed to conf/jboss-log4j.xml, to -allow log4j.properties override from scoped deployments, JBAS-1853.
  • -
  • log4j and commons-logging have both been upgraded. -commons-logging is patched in addition, JBAS-2823.
  • -
  • Since the latest log4j includes a trace level, there is no -need to reference the custom jboss TRACE level in conf/jboss-log4j.xml -configs, JBAS-4163.
    -Instead of: <category -name="org.jboss.system"><priority value="TRACE" -class="org.jboss.logging.XLevel"/></category>
    -you can use: <category -name="org.jboss.system"><priority -value="TRACE"/></category>
  • -
  • Better integration with WebSphere MQ 5.x, JBAS-3183.
  • -
  • The MyFaces JSF implementation has been replaced by the -Glassfish JSF 1.2 one, JBAS-3897.
  • -
  • Hibernate, hibernate-annotations and -hibernate-entity-manager have all been upgraded. to v3.2.1.
  • -
  • The default invoker for EJBs has been changed from the -rmi-invoker to the unified-invoker, provided by JBoss Remoting, JBAS-3950.
  • -
  • Apache commons http-client and apache-codec were removed -from jbossall-client.jar, JBAS-4365.
  • -
  • The address that is stored in the host portion of the RMI -codebase URL can now be set correctly, JBAS-3325.
  • -
  • The java2ClassLoadingCompliance setting in jboss-web.xml -was ignored; this has been fixed, JBAS-3047.
  • -
  • In JBoss 4.2 the unified invokers based on JBoss Remoting -are the default transport for accessing EJBs. Using the unified -invokers JBoss 4.2 can interoperate safely with JBoss AS -4.0.4.GA/4.0.5.GA, using the flag --Djboss.remoting.pre_2_0_compatible=true on the JBoss 4.2.x side. For -interoperating with older JBoss AS versions (3.2.8.SP1 to 4.0.3.SP1) -the legacy rmi or pooled invokers need to be used. See JBAS-4407 -and the wiki page on -JBoss Version Compatibility.
  • -

Configuration -Issues

-This lists the changes that could affect configuration.
-

JBossAS 4.2.3.GA

  • JBossAS -4.2.3.GA can be compiled with both Java5 & Java6. The Java5 -compiled binary is our primary/recommended binary distribution. It has -undergone rigorous testing and can run under both a Java 5 and a Java 6 -runtime. When running under Java 6 you need to manually copy the -following libraries from the JBOSS_HOME/client directory to the -JBOSS_HOME/lib/endorsed directory, so that the JAX-WS 2.0 apis -supported by JBossWS are used:
    • jboss-jaxrpc.jar
    • jboss-jaxws.jar
    • jboss-jaxws-ext.jar
    • jboss-saaj.jar
    • jaxb-api.jar
  • If -you still have problems using JBoss with a Sun Java 6 -runtime, you may want to set  -Dsun.lang.ClassLoader.allowArraySyntax=true, -as described in JBAS-4491. -Other potential problems under a Java 6 runtime include:
    • ORB -getting prematurely destroyed when using Sun JDK 6 (see Sun Bug ID: 6520484)
    • Unimplemented -methods in Hibernate for JDK6 interfaces.
  • When JBossAS -4.2.3 is compiled with Java 6, support for the extended JDBC 4 API is -included in the binary, however this can only be used under a -Java 6 runtime. In this case no manual configuration steps are -necessary. It should be noted however that the Java 6 compiled -distribution of JBoss AS 4.2.3.GA is still in experimental stage.

JBossAS -4.2.2.GA

  • Extensions to -LdapExtLoginModule, JBAS-4619.
  • Escape -syntax for mysql and postgresql in jboss CMP, JBAS-4463.
  • Introduced -a new system -property org.jboss.mx.loading.UnifiedLoaderRepository.notifyMode to -provide fine-grained control over the emission of notifications -whenever Unified Classloaders are created. Classloader leaks -can -appear if those notifications are send to remote jmx agents, so the -usage of the flag can avoid this problem, JBAS-4953. -

JBossAS 4.2.1.GA

-
  • %PATH% is not removed from java.library.path in the -presence of JAVA_HOME/bin/native, so e.g. native jdbc drivers can be -loaded, JBAS-4418.
  • -

JBossAS 4.2.0.GA -

  • JBossAS now binds its services to -localhost (127.0.0.1) *by -default*, instead of binding to all available interfaces (0.0.0.0). -This was primarily done for security reasons because of concerns of -users going to production without having secured -their servers properly. -To enable remote access by binding -JBoss services to a particular interface, simply run jboss with the -b -option. To bind to all available interfaces and re-enable the legacy -behaviour use -b 0.0.0.0. In any case, be aware you still need -to secure -you server properly.
  • -
  • There now distinct properties to configure the various -mcast ports, JBAS-4021.
  • -
  • When running under Linux, run.sh forces the use of IPv4, -due to a jdk bug, JBAS-4332.
  • -
  • JBoss EJB3 is now included by default. If you don't -need/want EJB3 support, simply remove deploy/ejb3.deployer.
  • -
  • When using native libraries for JBoss Web store them in -JBOSS_HOME/bin/native, which is automatically included in the -classpath, JBAS-4162.
  • -
  • JBoss Transactions is the new default transaction manager -in JBoss. It is configured in conf/jboss-service.xml and has additional -properties defined in conf/jbossjta-properties.xml. The transaction log -is stored by default at server/default/data/tx-object-store.
  • -
  • If you are on Red Hat Linux, check out the changes in -bin/jboss_init_redhat.sh, JBAS-4041.
  • -
  • The JBossAS distributions usually include the installer -(.jar), the sources (.tar.gz) and the canonical binary release (.zip). -Unzipping the binary distribution (.zip) with a native unzip utility -will restore correctly the executable permission in the /bin/*.sh -files. However, unzipping using the JDK jar utility ignores the -executable bit, so this need to be set manually.
  • -
  • bin/shutdown.sh no longer sources run.conf, JBAS-4155.
  • -

Library Updates

-For a full list of the JBoss and thirdparty libraries used -with JBoss AS 4.2.3 see  build-thirdparty.xml. -

JBossAS 4.2.3.GA

JBoss Library Updates

  • javassist -upgraded to v3.8.0.GA (from v3.6.0.GA)
  • jboss cache -upgraded to v1.4.1.SP9 (from v1.4.1.SP5)
  • jboss jaxr -upgraded to v1.2.0.SP1 (from v1.2.0.GA)
  • jboss -transactions upgraded to v4.2.3.SP7 (from v4.2.3.SP6)
  • jboss -ws upgraded to v3.0.1 / native v2.0.4 (from v2.0.1.SP2)
  • jboss -xb upgraded to v1.0.0.SP3 (from v1.0.0.SP1)
  • jboss -remoting upgraded to v2.2.2.SP8 (from v2.2.2.SP1)

Thirdparty -Library Updates

  • jfreechart upgraded to -v1.0.2 (from v0.9.20)
  • oswego-concurrent upgraded to -v1.3.4-jboss-update1 (from v1.3.4-jboss)
  • sun-jsf -upgraded to v1.2_09-b01 (from v1.2_04_P02)
  • codehaus-jettison -was introduced at v1.0-RC2

JBossAS -4.2.2.GA

JBoss Library Updates -
  • javassist upgraded to v3.6.0.GA (from v3.5.0.GA)
  • jboss -aop upgraded to v1.5.6.GA (from 1.5.5.GA)
  • jboss -cache upgraded to v1.4.1.SP5 (from 1.4.1.SP3)
  • jboss -common upgraded to v1.2.1.GA (from v1.2.0.GA)
  • jboss -remoting upgraded to v2.2.2.SP1 (from v2.2.1.GA)
  • jboss -ts upgraded to v4.2.3.SP6 (from v4.2.3.SP5)
  • jboss -web upgraded to v2.0.1.GA (from v2.0.0.GA)
  • jboss ws -upgraded to v2.0.1.SP2 (from v1.2.1.GA)
  • jboss xb -upgraded to v1.0.0.SP1 (from v1.0.0.GA)
  • jgroups -upgraded to v2.4.1.SP4 (from v2.4.1.SP3)
Thirdparty -Library Updates -
  • hsqldb upgraded to v1.8.0.8 (from v1.8.0.2)
  • jacorb -upgraded to v2.3.0jboss.patch5 (from v2.3.0jboss.patch4)
  • oswego-concurrent -upgraded to v1.3.4-jboss (from v1.3.4)

JBossAS -4.2.1.GA

-JBoss Library Updates -
  • hibernate, upgraded to v3.2.4.SP1_CP01 -(from v3.2.3.GA)
  • -
  • jboss-ts14, upgraded to v4.2.3.SP5 -(from v4.2.3.SP3)
  • -
  • jboss-remoting, upgraded to v2.2.1.GA (from v2.2.0.SP4)
  • -
Thirdparty Library Updates -
  • jacorb, upgraded to v2.3.0jboss.patch4 (from -v2.2.4jboss.patch1)
  • -
  • sun-jsf, upgraded to v1.2_04_P02 (from v1.2_04_P01)
  • -

Detailed Release Notes -

JBossAS-4.2.3.GA

Feature -Request

  • [ JBAS-3051 -] change jmx console title to display the name of the jboss server -configuration with the machine name
  • [ JBAS-4156 -] [jmx-console] Add additional informatin to page header
  • -[ JBAS-4455 -] LoadBalancePolicy that tries to pin all requests associated with a tx -to one server
  • [ JBAS-4501 -] JBoss AS 4.2 won't build with JDK 1.6
  • [ JBAS-4804 -] GenericHeaderAuthenticator injection of ssoid, sessioncookie name
  • -
  • [ JBAS-4986 -] Remove compile-time dependency on Debugger from ClusterPartition
  • -
  • [ JBAS-5035 -] MySQLValidConnectionChecker has driver name com.mysql.jdbc.Driver -hard coded
  • [ JBAS-5139 -] Support injection-target properties within service-ref declarations
  • -
  • [ JBAS-5704 -] Provide JAAS credentials in org.jboss.ant.JMX task so that calls can -be made to security protected MBeans
-

Bug

  • [ JBAS-1901 -] web-console shows dead archives after redeploy
  • -[ JBAS-2477 -] Exception in web-console j2ee domain after undeploy of application
  • -
  • [ JBAS-3402 -] Web Console and Firefox
  • [ JBAS-3406 -] JMX Console throws 500 exception on regular expressions
  • -[ JBAS-3637 -] twiddle ignores environment properties when creating its -InitialContext
  • [ JBAS-4246 -] JBoss logo not displayed for web status when accessed from web -console
  • [ JBAS-4287 -] run.sh can consume 100% single CPU resources on Solaris
  • -[ JBAS-4343 -] NullPointerException causing bad password exception in -LdapLoginModule when the role attribute is not set for a given entry
  • -
  • [ JBAS-4453 -] SerializableResultSetMetaData did not have the classname for the -column set.
  • [ JBAS-4662 -] XADatasource property names are not using the javabean convention
  • -
  • [ JBAS-4673 -] SARDeployer should throw an error if there is more than one loader -repository
  • [ JBAS-4753 -] ExternalContext can pass duplicate interfaces to -Proxy.newProxyInstance(loader, interfaces, handler)
  • -[ JBAS-4766 -] HTTP session replication failover failures with async buddy -replication
  • [ JBAS-4805 -] InitialContextFactory.getHAContext() should not use hardcoded -localhost for lookup
  • [ JBAS-4815 -] UnifiedInvokerProxyHA - Client instance check and assignment should -be atomic
  • [ JBAS-4870 -] Redelivery flags not updated in case of JBossMQ node failure
  • -
  • [ JBAS-4892 -] WebService ignores java.rmi.server.codebase system property
  • -
  • [ JBAS-4897 -] CVE-2007-5461: Information Leak in Tomcat Webdav Servlet
  • -
  • [ JBAS-4911 -] MSSQLValidConnectionChecker throws exception with MS SQL Server 2005 -JDBC driver
  • [ JBAS-4921 -] Web service deployment: web.xml modified to web.xml.org - Subsequent -runs fail
  • [ JBAS-4927 -] Code added in 4.2.1 breaks web app that works in 4.2.0
  • -[ JBAS-4934 -] JBossCacheWrapper should not re-use data gravitation option
  • -
  • [ JBAS-4938 -] source tarball contains non free code
  • [ JBAS-4943 -] jboss-ds_1_5.dtd is wrong
  • [ JBAS-4945 -] Messages transfered from DLQ to working queue will never be resent to -DLQ
  • [ JBAS-4950 -] Transaction failover authorisation is broken within -UnifiedInvokerHAProxy
  • [ JBAS-4964 -] txFailoverAuthorizations should be keyed on transaction propagation -context
  • [ JBAS-4969 -] Security-domain name entry in options map causing exception in custom -login modules
  • [ JBAS-4975 -] Usage of read-ahead on-find with entity beans containing binary -attributes (mapped to BLOB, VARBINAR, ...) breaks eager loading.
  • -
  • [ JBAS-4994 -] ReplyHeaderFilter reports old versions: Servlet 2.4, Tomcat-5.5
  • -
  • [ JBAS-5014 -] EJBMethodPermission implies should check for null methodname and -methodSig==""
  • [ JBAS-5015 -] Deploy entity beans in Oracle 11g on JBoss 4.2.1 and JBoss 4.2.1
  • -
  • [ JBAS-5020 -] Incorrect system property usage in JMX console clustering service
  • -
  • [ JBAS-5026 -] NPE in JvmRouteValve.handleJvmRoute
  • [ JBAS-5049 -] NoInitialContextException on deployment of EAR that contains MDB and -persistence.xml
  • [ JBAS-5063 -] JBoss 4.2.2 doesn't work with JSF RI 1.2_07
  • -[ JBAS-5068 -] Possible NullPointerException in DistributedReplicantManager#_add()
  • -
  • [ JBAS-5072 -] Fix null pointer exception when getting keys, values, or entry's in -the ConcurrentHashmap
  • [ JBAS-5080 -] Need to check transaction status on SQL operations
  • -[ JBAS-5091 -] BuddyCommunicationTimeout is too low
  • [ JBAS-5105 -] PostgreSQL Entity Command for jdbc2pm is Not Working Properly
  • -
  • [ JBAS-5108 -] Twiddle should print out 'invoke' results, even when no -propertyeditor for the returned object is found
  • -[ JBAS-5109 -] Web context and servlet paramters not available in WebMetaData
  • -
  • [ JBAS-5112 -] WebXMLRewriter leaks input stream
  • [ JBAS-5127 -] Hardcoded partition name in cluster-examples-service.xml
  • -
  • [ JBAS-5142 -] cmp2.x jdbc2 pm: missing a join in a collection path translating -"member of"
  • [ JBAS-5149 -] 'webservices' meta data (jboss.xml) not available for ejb3 web -service endpoints
  • [ JBAS-5189 -] Txn-Manager arjuna commits data after timeout in long transactions
  • -
  • [ JBAS-5206 -] Can't start JBoss 5 with a pure JRE installation
  • -[ JBAS-5220 -] twiddle not displaying info regarding java.lang:* beans when --Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl -is used .
  • [ JBAS-5228 -] Race condition maintaining acknowledgements when pushing messages to -the client
  • [ JBAS-5275 -] org.jboss.test.security.test.XMLLoginModulesUnitTestCase failing on -Z-servers
  • [ JBAS-5317 -] org.jboss.test.security.test.HttpsUnitTestCase failing with the IBM -jvm
  • [ JBAS-5354 -] Need to improve error handling around thread pool errors
  • -
  • [ JBAS-5364 -] UnifiedInvokerHAProxy can throw NullPointerException under load
  • -
  • [ JBAS-5428 -] Addition of undocumented feature has caused a bug in normal behaviour -
  • [ JBAS-5431 -] PooledInvokerProxy is not using the TPC factory setup by the -UserTransaction client
  • [ JBAS-5444 -] remove twiddle.bat/shutdown.bat %ARGS% processing in favour of %*
  • -
  • [ JBAS-5459 -] JDBCStartCommand fails with index already exists
  • -[ JBAS-5475 -] NullPointerException when no invoker proxy bindings configured
  • -
  • [ JBAS-5479 -] SSLSessionInterceptor has a copy/paste error in invokeHome method
  • -
  • [ JBAS-5492 -] ClusteredSingleSignOn dead member cleaner throws NPE
  • -[ JBAS-5502 -] Enabling JBossMQ XA recovery fails
  • [ JBAS-5526 -] DB Connections established which fail check-valid-connection-sql do -not immediatly close their connection
  • [ JBAS-5528 -] If SingletonStatelessSessionInstancePool is used for a SLSB, -container MBean state is reported incorrectly
  • -[ JBAS-5568 -] sample-binding.xml does not work for jboss-messaging-1.4
  • -
  • [ JBAS-5571 -] When JBossMQ does XA recovery it should always write the XID to the -log
  • [ JBAS-5574 -] Don't log an error for BMT Stateful not completing their transactions -
  • [ JBAS-5608 -] Removing a session from a clustered sso entry removes all sessions
  • -
  • [ JBAS-5612 -] MySQLValidConnectionChecker is not serializable
  • -[ JBAS-5613 -] OracleValidConnectionChecker is not serializable
  • -[ JBAS-5623 -] JMS ActivationSpec 'acknowledgeMode' does not follow spec -recommendation
  • [ JBAS-5639 -] org.jboss.test.util.test.PropertyEditorsUnitTestCase failing on -Z-systems
  • [ JBAS-5644 -] Incorrect containerName attribute setting in valves
  • -[ JBAS-5657 -] JSP source code exposure in jmx-console
  • [ JBAS-5670 -] Using MessageConsumers with Message Selector make messages stuck in -queue
  • [ JBAS-5678 -] closed jdbc connection before transaction rollback is called
  • -
  • [ JBAS-5696 -] removal of entity with self-referencing CMR and fk-constraint
  • -
  • [ JBAS-5706 -] Default session metadata replication too infrequent
  • -[ JBAS-5735 -] Session not reliably bound to SessionReplicationContext if -SecurityAssocationValve not present

Task

-
  • [ JBAS-4148 -] Replace Gjt code used in the ejb 2.x validation phase
  • -[ JBAS-4424 -] WebAuthentication:Generate a SSOID
  • [ JBAS-4811 -] Integrate the JBossWS core testsuite in the release QA
  • -[ JBAS-4874 -] Track JBoss and thirdparty dependencies for JBossAS 4.2.3
  • -
  • [ JBAS-4876 -] Re-enable JGroups message bundling
  • [ JBAS-4918 -] replace ${jboss.server.home.dir}/log references with -${jboss.server.log.dir}
  • [ JBAS-5057 -] testsuite regression -org.jboss.test.security.test.EJBPermissionUnitTestCase
  • -[ JBAS-5059 -] Update Service Binding configuration for JBossMessaging
  • -[ JBAS-5060 -] Upgrade jfreechart to v1.0.2
  • [ JBAS-5088 -] Failing -org.jboss.test.jbossmq.test.ConnectionConsumerErrorFiredUnitTestCase.testExceptionListenerFiredOnError -(jrockit)
  • [ JBAS-5094 -] org.jboss.test.jaxr.scout failures
  • [ JBAS-5101 -] Re-enable JGroups message bundling
  • [ JBAS-5210 -] Expose sub-pool statistics for Improved Management.
  • -[ JBAS-5226 -] ClientUserTransaction should be configured with Unified invoker
  • -
  • [ JBAS-5331 -] AOP deployer should include pluggable instrumentor jar(s)
  • -
  • [ JBAS-5402 -] Keep JBoss Cache jars out of default
  • [ JBAS-5485 -] Add mdbsessionpoolclear testcase from EJB3
  • [ -JBAS-5648 -] Upgrade to jboss-jaxr-1.0.2.SP1
  • [ JBAS-5650 -] Merge clustering fixes from EAP branch
  • [ JBAS-5677 -] Add discussion of usage of FC to Clustering Guide
  • -[ JBAS-5702 -] Add JDBC4 support to DataSourceInterceptor
  • [ -JBAS-5710 -] Get the JBoss-AS-4.2.x-TestSuite-sun15 passing
  • -[ JBAS-5711 -] Get the JBoss-AS-4.2.x-TestSuite-jrockit15 passing
  • -[ JBAS-5712 -] Add JDBC4 support to Branch_4_2
  • [ JBAS-5720 -] Get a JBoss-AS-4.2.x-TestSuite-sun15-sun16 going
  • -[ JBAS-5721 -] Get a JBoss-AS-4.2.x-TestSuite-sun16-sun16 going
  • -[ JBAS-5722 -] Get all the testsuites passing
  • [ JBAS-5723 -] Verify JBoss-AS-4.2.x-CompatibilityMatrix
  • [ JBAS-5724 -] Verify TCK1.4 tests are passing
  • [ JBAS-5725 -] Verify EJB3 tests are passing
  • [ JBAS-5726 -] Verify JBossWS testsuite
  • [ JBAS-5731 -] JaxWS 2.0 / JaxWS 2.1 support for Branch_4_2
  • -[ JBAS-5748 -] Update links in ROOT.war/index.html
  • [ JBAS-5750 -] Update the interoperability tests matrix with 4.2.2.GA client libs
  • -
  • [ JBAS-5765 -] Make release notes for 4.2.3.GA

Sub-task

-
  • [ JBAS-4875 -] Upgrade jboss transactions to 4.2.3.SP7 (from 4.2.3.SP6)
  • -
  • [ JBAS-4877 -] Upgrade JSF to 1.2_08
  • [ JBAS-4925 -] Upgrade jboss cache to 1.4.1.SP7 (from 1.4.1.SP5)
  • -[ JBAS-4933 -] Upgrade to jbossxb 1.0.0.SP3 (from 1.0.0.SP1)
  • -[ JBAS-4955 -] All the known bind address properties should be set to the default -bind address
  • [ JBAS-4962 -] Upgrade jboss remoting to v2.2.2.SP5 (from v2.2.2.SP1)
  • -[ JBAS-4981 -] Transaction variable is not reset in ejb2 inflow interceptor
  • -
  • [ JBAS-4996 -] Upgrade jbossws to 2.0.4.GA (from 2.0.1.SP2)
  • -[ JBAS-5082 -] Add a transaction status interface for the connection manager and -implement it in TxConnectionManager
  • [ JBAS-5083 -] Add the transaction active check to the jdbc resource adapter
  • -
  • [ JBAS-5084 -] Add the transaction active check to the jms resource adapter
  • -
  • [ JBAS-5170 -] 4.2.x fix to get HA Singleton election policies working in -heterogeneous topologies
  • [ JBAS-5498 -] JDK6: org.jboss.test.security.test.LoginModulesUnitTestCase
  • -
  • [ JBAS-5727 -] Upgrade javassist to 3.8.0.GA
  • [ JBAS-5729 -] Upgrade jboss remoting to v2.2.2.SP8 (from v2.2.2.SP5)
  • -[ JBAS-5753 -] fix org.jboss.test.jbossmx.compliance.objectname.MalformedTestCase
  • -
  • [ JBAS-5754 -] Get tests-webservice passing
  • [ JBAS-5755 -] -org.jboss.test.jca.test.StatisticsFormatterUnitTestCase.testXmlFormatterStatistics -
  • [ JBAS-5758 -] fix iiop tests
  • [ JBAS-5764 -] Upgrade to the latest JSF implementation 1.2_09 (from 1.2_08)
  • -
  • [ JBAS-5768 -] Upgrade JBoss Cache to 1.4.1.SP9
  • [ JBAS-5769 -] Fix -org.jboss.test.jca.test.BackgroundValidationUnitTestCase.testDeployedBackgroundValidationFailure -
  • [ JBAS-5770 -] fix 3 -org.jboss.test.jca.test.JDBCStatementTestsConnectionUnitTestCase -failures
  • [ JBAS-5772 -] -org.jboss.test.cluster.test/FamilyClusterInfoUnitTestCase(Default-TCP)/testSynchronization -

Patch

  • -[ JBAS-4478 -] ignore local ant options when building
  • [ JBAS-5073 -] fix build authenticated proxy (there seems to have been a cut and -paste error at some point)
  • [ JBAS-5527 -] jboss_4_0.dtd should include support for -SingletonStatelessSessionInstancePool

-

JBossAS-4.2.2.GA

-

Feature Request

  • [ JBAS-4093 -] Example XA datasource configuration for Sybase
  • -[ JBAS-4465 -] Rename hsqldb-jdbc-state-service.xml to jdbc-state-service.xml
  • -
  • [ JBAS-4479 -] It'd be nice for listThreadDump() to return a timestamp as well
  • -
  • [ JBAS-4490 -] Update and document all HA Failover features for the jca datasources
  • -
  • [ JBAS-4595 -] Inconclusive exception thrown by HttpNamingContextFactory
  • -
  • [ JBAS-4619 -] Add parseRoleNameFromDN option to LdapExtLoginModule
  • -[ JBAS-4752 -] Session Expiration should also flush the JBoss Authentication Cache
  • -

Bug

  • [ JBAS-3379 -] BigIntegerTimerIdGenerator may create dupplicate timer IDs after -server crash
  • [ JBAS-4000 -] should come before -in standardjboss.xml
  • -
  • [ JBAS-4053 -] EJB TimerService createTimer swallows underlying exception
  • -
  • [ JBAS-4404 -] Tests testJdbc and testControlFlags in -org.jboss.test.security.test.LoginModulesUnitTestCase may fail -incorrectly
  • [ JBAS-4422 -] org.jboss.test.util.test.TwiddleUnitTestCase can't connect to host
  • -
  • [ JBAS-4463 -] escape syntax
  • [ JBAS-4464 -] NPE on shutdown in jacorb connection layer
  • [ -JBAS-4492 -] NullPointerException in org.jboss.util.propertyeditor.DateEditor -setValue(...)
  • [ JBAS-4525 -] JBossMQ WriteTask in UIL2 could block forever
  • -[ JBAS-4528 -] jboss-ds-1.5.dtd is not up-to-date
  • [ JBAS-4536 -] Isolated classloading is incorrectly isolating java.* classes
  • -
  • [ JBAS-4540 -] Port 8083, HTTP request revealing installation directory
  • -
  • [ JBAS-4541 -] Authentication Service (AS) Context stored in CSIv2 encoded IORs -shouldn't indicate EstablishTrustInClient supported when -AUTH_METHOD_NONE
  • [ JBAS-4546 -] Fix RunAsSecurityInterceptor
  • [ JBAS-4555 -] Connection.close() taking 2 minutes in JBossMQ
  • -[ JBAS-4559 -] JBossMQ security manager should have a dependency on the Jaas service -
  • [ JBAS-4575 -] resourceadapter-class should be optional
  • [ JBAS-4593 -] Leak in org/jboss/mx/loading/UnifiedClassLoader3
  • -[ JBAS-4597 -] CacheInvalidator.areInvalid doesn't lock partitions
  • -[ JBAS-4605 -] JSP compiler won't compile JDK 1.5 source
  • [ JBAS-4607 -] Transaction timeout is not raising a JMSException in the JBossMQ -Persistence manager or StateManager
  • [ JBAS-4611 -] HTTP Session Repl Cache configured with CacheLoader can cause slow AS -shutdowns
  • [ JBAS-4614 -] UnifiedInvokerHAProxy does not implement InvokerProxyHA
  • -[ JBAS-4615 -] NamingContext caches stale Naming stub
  • [ JBAS-4622 -] Can't flush bad naming stub if no java.naming.provider.url specified
  • -
  • [ JBAS-4623 -] org.jboss.web.tomcat.service.session.JBossCacheCluster creates -MBeanServer with incorrent domain name
  • [ JBAS-4625 -] Connection leak if failure to setup connection in jms inbound -resource adapter
  • [ JBAS-4655 -] HandleImplIIOP not retrieving EJBObject correctly
  • -[ JBAS-4659 -] jboss-4.2.1.GA.zip distribution doesn't include mail-ra.rar
  • -
  • [ JBAS-4667 -] Wrong logic in -CachedConnectionManager.getCloseConnectionSynchronization()
  • -
  • [ JBAS-4680 -] Update example for JBossWS Message TRACE in jboss-log4j.xml
  • -
  • [ JBAS-4681 -] Generated Corba stub throws BAD_OPERATION on toString() when not -connected to the ORB
  • [ JBAS-4691 -] JACC: Unchecked WebUserDataPermission(s) for excluded and transport -guarantee use cases
  • [ JBAS-4697 -] Use of EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap.toArray() -is not thread safe and should be replace with -java.util.concurrent.ConcurrentHashMap when using MQ transactions.
  • -
  • [ JBAS-4701 -] JaasSecurityDomain doesn't handle encrypted truststore passwords -properly
  • [ JBAS-4719 -] Implementations of Invoker should implement equals as an equality -check rather than relying on Object.equals, this is important for -cluster fail-over support
  • [ JBAS-4729 -] HARMIClient fails over on UnmarshalException
  • -[ JBAS-4748 -] TransactionLocal.get() not sufficiently pluggable
  • [ -JBAS-4801 -] HomeHandleImplIIOP not using the HandleDelegate
-

Task

  • [ JBAS-3142 -] Add UnifiedInvoker (JBSer and JavaSer) into Version MatrixTestSuite
  • -
  • [ JBAS-4092 -] Clean up the tests-webservice-ssl target
  • [ JBAS-4523 -] Verify installation of jbossws tools jars
  • [ JBAS-4526 -] JBossMQ UIL2 Read/Write Tasks should not be doing initialization
  • -
  • [ JBAS-4549 -] Track JBoss and thirdparty dependencies for JBossAS 4.2.2
  • -
  • [ JBAS-4572 -] EJB 3 testsuite 100%
  • [ JBAS-4600 -] Rename JBossMQ variables from jboss-messaging to -jboss.messaging-mq.lib
  • [ JBAS-4601 -] Add example sybase-xa-ds.xml from the forums
  • -[ JBAS-4638 -] fix org.jboss.test.web.test.ssl.SSLUnitTestCase caused by upgrade to -JBoss Web 2.0.1.CR6.
  • [ JBAS-4640 -] JmsActivation reconnection could start multiple threads
  • -[ JBAS-4641 -] Move XMLJUnitMultipleResultFormatter from testsuite module to test -module
  • [ JBAS-4649 -] Upgrade to JBoss Cache 1.4.1.SP4
  • [ JBAS-4695 -] Update the release notes for JBossAS 4.2.2.GA
  • -[ JBAS-4696 -] Arrange community documents for 4.2.2.GA
  • [ JBAS-4698 -] Oswego Concurrent needs checking for bug fixes
  • -[ JBAS-4699 -] JBossMQ should use XA_RMFAIL as the default XA error code
  • -
  • [ JBAS-4737 -] Include the CSIv2-patched JacORB
  • [ JBAS-4754 -] Do a full CTS1.4 run to check for regressions.
-

Sub-task

  • [ JBAS-3572 -] Fix the NPEs (better error handling) identified by the new -ServiceController testsuite
  • [ JBAS-3613 -] failing test in -org.jboss.test.iiop.test.ParameterPassingStressTestCase
  • -[ JBAS-4152 -] Upgrade to hsql 1.8.0.8 causes -org.jboss.test.cmp2.idxandusersql.test.IdxAndUsersqlUnitTestCase::testCMRmn2 -to fail
  • [ JBAS-4550 -] Upgrade to JBossWeb 2.0.1 (from 2.0.0.GA)
  • [ JBAS-4578 -] Upgrade jboss remoting to v2.2.2.SP1 (from v2.2.1.GA)
  • -[ JBAS-4663 -] Replace JBossClusteredTestCase usage of RMIAdaptor
  • -[ JBAS-4664 -] Move JBossClusteredTestCase to test module in Branch_4_2
  • -
  • [ JBAS-4675 -] TransactionLocal cannot be locked when transaction is marked rollback -only
  • [ JBAS-4690 -] TransactionLocal tests are not run against the proper transaction -manager
  • [ JBAS-4694 -] Upgrade hsqldb to v1.8.0.8 (from 1.8.0.2)
  • [ JBAS-4715 -] Upgrade jboss common to 1.2.1.GA (from 1.2.0.GA)
  • -[ JBAS-4723 -] Upgrade JGroups to 2.4.1.SP4
  • [ JBAS-4731 -] Upgrade to JBoss Cache 1.4.1.SP5
  • [ JBAS-4740 -] HARMIClient to give preference to wrapping NoSuchObjectException
  • -
  • [ JBAS-4759 -] Upgrade jboss transactions to 4.2.3.SP6 (from 4.2.3.SP5)
  • -
  • [ JBAS-4760 -] Upgrade to javassist 3.6.0.GA (from 3.5.0.GA)
  • -[ JBAS-4761 -] Upgrade to JBoss AOP 1.5.6.GA (from 1.5.5.GA)
  • -[ JBAS-4767 -] Upgrade jbossws to 2.0.1 (from 1.2.1.GA)
-

JBossAS-4.2.1.GA

-

Feature Request

-
  • [JBAS-3158] -- Need a way to detect collisions between JSF RI and JSF MyFaces
  • -
  • [JBAS-4408] -- LIMIT/OFFSET support in StoreManager2
  • -
  • [JBAS-4454] -- Upgrade to JSF RI 1.2_04 P02
  • -

Bug

-
  • [JBAS-4415] -- ClusterFileTransferTestCase.testFarmDeploy fails to delete and copy
  • -
  • [JBAS-4418] -- run.bat should include %PATH% in java.library.path when bin/native -exists
  • -
  • [JBAS-4425] -- ConnectionFactoryTemplate.xsl incorrectly sets isSameRM-override-value
  • -
  • [JBAS-4427] -- Misnamed FK index name for CMP2
  • -
  • [JBAS-4429] -- Classloader leak to JBossTS ReaperThread
  • -
  • [JBAS-4441] -- Jboss hangs at startup with 100% CPU utilization
  • -
  • [JBAS-4444] -- The invoker-proxy-binding in the base container configuration is -ignored on sub-configurations.
  • -
  • [JBAS-4461] -- new InitialContext().rebind("x", null) throws NullPointerException
  • -
  • [JBAS-4462] -- mod() function not supported in SQL server 2005
  • -
  • [JBAS-4473] -- Java to IDL mapping erroneously treats a 'get' method as an attribute
  • -
  • [JBAS-4481] -- Transaction timeouts leave garbage Status.ROLLEDBACK UserTransaction -object bound to the thread
  • -

Task

-
  • [JBAS-4198] -- Align EJB3 Security with JEE 1.4 Behavior
  • -
  • [JBAS-4420] -- Separate classloader leak tests from the 'all' tests
  • -
  • [JBAS-4442] -- Need to update exception handling code in HypersonicDatabase.java
  • -
  • [JBAS-4467] -- Document in the release notes a configuration for multiple 1PC with -JBossTS
  • -
  • [JBAS-4480] -- Upgrade hibernate to v3.2.4.SP1_CP01
  • -
  • [JBAS-4482] -- Add compatibility runs against 4.2.0.GA in Branch_4_2
  • -
  • [JBAS-4503] -- Update the release notes for JBossAS 4.2.1.GA
  • -
  • [JBAS-4510] -- Upgrade jboss remoting to v2.2.1.GA (from v2.2.0.SP4)
  • -

Documentation -and Help

The JBossAS community -project is hosted on jboss.org . Documentation and help -may -be obtained from the following locations. -

Licenses

-

JBoss Application Server  is licensed under the LGPL, -as explained in the JBoss End -User License Agreement. The licence texts for JBoss and the -thirdparty components it uses may be found in the docs/licenses -directory of the distribution. Browse -Licences -

About JBoss, a -division of RedHat

-

JBoss, a division of Red -Hat, is in the business of providing -superior technical support to our customers. Our goal is to make -Professional Open Source™ the SAFE CHOICE -for you. We accomplish this by backing up our open source Java products -with technical support services that are delivered by the core -developers themselves. We can help you to train your staff and provide -you with support at every stage of the application lifecycle - from -development and integration through deployment and maintenance. Visit -the JBoss -Services page for more information.

- \ No newline at end of file diff --git a/jboss/server/adempiere/conf/jboss-log4j.xml b/jboss/server/adempiere/conf/jboss-log4j.xml deleted file mode 100644 index b09e3f516a..0000000000 --- a/jboss/server/adempiere/conf/jboss-log4j.xml +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jboss/server/adempiere/conf/jboss-minimal.xml b/jboss/server/adempiere/conf/jboss-minimal.xml deleted file mode 100644 index 504c463900..0000000000 --- a/jboss/server/adempiere/conf/jboss-minimal.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - resource:jboss-log4j.xml - - - - - - - - - JBoss System Threads - System Threads - - 60000 - - 10 - - 1000 - - run - - - - - - - - - - - - - false - - 1099 - - ${jboss.bind.address} - - 1098 - - ${jboss.bind.address} - - jboss.system:service=ThreadPool - - jboss:service=NamingBeanImpl - - - - - - - - - - jboss.system:service=MainDeployer - - - org.jboss.deployment.DeploymentSorter - - - org.jboss.deployment.scanner.DeploymentFilter - - 5000 - - - - deploy/ - - - - - diff --git a/jboss/server/adempiere/conf/jboss-serviceTemplate.xml b/jboss/server/adempiere/conf/jboss-serviceTemplate.xml deleted file mode 100644 index 07855f9801..0000000000 --- a/jboss/server/adempiere/conf/jboss-serviceTemplate.xml +++ /dev/null @@ -1,696 +0,0 @@ - - - - - - - - - - - - - - - - - - jboss.system:service=MainDeployer - jboss.system:service=ServiceDeployer - jboss.j2ee:service=EARDeployer - jboss.ejb:service=EJBDeployer - jboss.jca:service=RARDeployer - jboss.jca:service=ConnectionFactoryDeployer - jboss.web:service=WebServer - jboss.j2ee:service=ClientDeployer - jboss:service=Mail - jboss.mq:service=DestinationManager - jboss:service=Naming - jboss:service=TransactionManager - jboss:service=ClientUserTransaction - jboss:service=CorbaORB - - - - - - - - - - - - - - - - - - JBoss System Threads - System Threads - - 60000 - - 10 - - 1000 - - run - - - - - - - - - - resource:jboss-log4j.xml - - true - - 60 - - - - - - - - - - - - - java.rmi.server.RMIClassLoaderSpi - org.jboss.system.JBossRMIClassLoader - - - - - - - - - - - - - - - - - - - ${jboss.bind.address} - 8083 - - ${java.rmi.server.hostname} - - true - - false - - - jboss.system:service=ThreadPool - - - - - - - - - - - - - false - - @ADEMPIERE_JNP_PORT@ - - ${jboss.bind.address} - - 1098 - - ${jboss.bind.address} - - jboss.system:service=ThreadPool - - jboss:service=NamingBeanImpl - - - - - jboss:service=HAJNDI - - - - - - - - jboss.security:service=XMLLoginConfig - - - login-config.xml - - - - - - true - org.jboss.security.plugins.JaasSecurityManager - anonymous - - 1800 - - 60 - - false - - - - - - - - - - - - - - - - 300 - ${jboss.server.data.dir}/tx-object-store - - - - - - - jboss:service=invoker,type=unified - jboss:service=ClientUserTransaction - UserTransactionSessionFactory - org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory - - - org.jboss.proxy.ClientMethodInterceptor - org.jboss.invocation.InvokerInterceptor - - - jboss:service=invoker,type=unified - - - - - jboss:service=invoker,type=unified - jboss:service=ClientUserTransaction - - org.jboss.tm.usertx.interfaces.UserTransactionSession - - - org.jboss.proxy.ClientMethodInterceptor - org.jboss.invocation.InvokerInterceptor - - - jboss:service=invoker,type=unified - - - - - - - - - - - - - - - - jboss:service=TransactionManager - jboss.remoting:service=Connector,transport=socket - - - - - 4444 - ${jboss.bind.address} - - jboss:service=TransactionManager - - - - - jboss:service=TransactionManager - - - - 1 - 300 - 300 - 60000 - ${jboss.bind.address} - 4445 - ${jboss.bind.address} - 0 - 1 - false - - - jboss:service=TransactionManager - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - invocation - org.jboss.invocation.unified.marshall.InvocationMarshaller - org.jboss.invocation.unified.marshall.InvocationUnMarshaller - - - - - - - 600000 - ${jboss.bind.address} - 4446 - - - true - - - - - - - - - - - - - - - - - - - - - - - - - jboss:service=invoker,type=unified - - - - jboss.remoting:service=NetworkRegistry - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jboss.system:service=MainDeployer - - - org.jboss.deployment.DeploymentSorter - - - - - - - #,%,\,,.,_$ - - #,$,%,~,\,v,.BAK,.bak,.old,.orig,.tmp,.rej,.sh,.bsh - - .make.state,.nse_depinfo,CVS,CVS.admin,RCS,RCSLOG,SCCS,TAGS,core,tags - - - - 5000 - - - true - - - - deploy/ - - - - True - - - - diff --git a/jboss/server/adempiere/conf/jbossjta-properties.xml b/jboss/server/adempiere/conf/jbossjta-properties.xml deleted file mode 100644 index c52151c8f7..0000000000 --- a/jboss/server/adempiere/conf/jbossjta-properties.xml +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jboss/server/adempiere/conf/jndi.properties b/jboss/server/adempiere/conf/jndi.properties deleted file mode 100644 index 17e8a87e3d..0000000000 --- a/jboss/server/adempiere/conf/jndi.properties +++ /dev/null @@ -1,4 +0,0 @@ -# DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING -# -java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces diff --git a/jboss/server/adempiere/conf/login-configTemplate.xml b/jboss/server/adempiere/conf/login-configTemplate.xml deleted file mode 100644 index a762d6156e..0000000000 --- a/jboss/server/adempiere/conf/login-configTemplate.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - true - - - - - - - - - guest - java:/DefaultDS - SELECT PASSWD FROM JMS_USERS WHERE USERID=? - SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=? - - - - - - - - - - - sa - sa - - jboss.jca:service=LocalTxCM,name=DefaultDS - - - - - - - - guest - guest - guest - jboss.jca:service=TxCM,name=JmsXA - - - - - - - - - props/jmx-console-users.properties - props/jmx-console-roles.properties - - - - - - - - - web-console-users.properties - web-console-roles.properties - - - - - - - - - props/jbossws-users.properties - props/jbossws-roles.properties - anonymous - - - - - - - - - - - - - - - - - anonymous - - - - - diff --git a/jboss/server/adempiere/conf/props/jbossws-roles.properties b/jboss/server/adempiere/conf/props/jbossws-roles.properties deleted file mode 100644 index 3aa243dc2e..0000000000 --- a/jboss/server/adempiere/conf/props/jbossws-roles.properties +++ /dev/null @@ -1,2 +0,0 @@ -# A sample roles.properties file for use with the UsersRolesLoginModule -kermit=friend \ No newline at end of file diff --git a/jboss/server/adempiere/conf/props/jbossws-users.properties b/jboss/server/adempiere/conf/props/jbossws-users.properties deleted file mode 100644 index 1f3533572b..0000000000 --- a/jboss/server/adempiere/conf/props/jbossws-users.properties +++ /dev/null @@ -1,2 +0,0 @@ -# A sample users.properties file for use with the UsersRolesLoginModule -kermit=thefrog \ No newline at end of file diff --git a/jboss/server/adempiere/conf/props/jmx-console-roles.properties b/jboss/server/adempiere/conf/props/jmx-console-roles.properties deleted file mode 100644 index 211d157f21..0000000000 --- a/jboss/server/adempiere/conf/props/jmx-console-roles.properties +++ /dev/null @@ -1,2 +0,0 @@ -# A sample roles.properties file for use with the UsersRolesLoginModule -admin=JBossAdmin,HttpInvoker diff --git a/jboss/server/adempiere/conf/props/jmx-console-users.properties b/jboss/server/adempiere/conf/props/jmx-console-users.properties deleted file mode 100644 index 6dc8aa5181..0000000000 --- a/jboss/server/adempiere/conf/props/jmx-console-users.properties +++ /dev/null @@ -1,2 +0,0 @@ -# A sample users.properties file for use with the UsersRolesLoginModule -admin=admin diff --git a/jboss/server/adempiere/conf/standardjboss.xml b/jboss/server/adempiere/conf/standardjboss.xml deleted file mode 100644 index 9939c89e39..0000000000 --- a/jboss/server/adempiere/conf/standardjboss.xml +++ /dev/null @@ -1,1216 +0,0 @@ - - - - - - - - - - - - true - - - - - entity-unified-invoker - jboss:service=invoker,type=unified - org.jboss.proxy.ejb.ProxyFactory - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.EntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.ListEntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - clustered-entity-unified-invoker - jboss:service=invoker,type=unifiedha - org.jboss.proxy.ejb.ProxyFactoryHA - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.EntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.ListEntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - stateless-unified-invoker - jboss:service=invoker,type=unified - org.jboss.proxy.ejb.ProxyFactory - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatelessSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - clustered-stateless-unified-invoker - jboss:service=invoker,type=unifiedha - org.jboss.proxy.ejb.ProxyFactoryHA - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatelessSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - stateful-unified-invoker - jboss:service=invoker,type=unified - org.jboss.proxy.ejb.ProxyFactory - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatefulSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - clustered-stateful-unified-invoker - jboss:service=invoker,type=unifiedha - org.jboss.proxy.ejb.ProxyFactoryHA - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatefulSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - entity-rmi-invoker - jboss:service=invoker,type=jrmp - org.jboss.proxy.ejb.ProxyFactory - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.EntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.ListEntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - clustered-entity-rmi-invoker - jboss:service=invoker,type=jrmpha - org.jboss.proxy.ejb.ProxyFactoryHA - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.EntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.ListEntityInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - stateless-rmi-invoker - jboss:service=invoker,type=jrmp - org.jboss.proxy.ejb.ProxyFactory - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatelessSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - clustered-stateless-rmi-invoker - jboss:service=invoker,type=jrmpha - org.jboss.proxy.ejb.ProxyFactoryHA - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatelessSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - stateful-rmi-invoker - jboss:service=invoker,type=jrmp - org.jboss.proxy.ejb.ProxyFactory - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatefulSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - clustered-stateful-rmi-invoker - jboss:service=invoker,type=jrmpha - org.jboss.proxy.ejb.ProxyFactoryHA - - - - org.jboss.proxy.ejb.HomeInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - org.jboss.proxy.ejb.StatefulSessionInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.proxy.ejb.SingleRetryInterceptor - org.jboss.invocation.InvokerInterceptor - org.jboss.invocation.MarshallingInvokerInterceptor - - - - - - - message-driven-bean - default - org.jboss.ejb.plugins.jms.JMSContainerInvoker - - DefaultJMSProvider - StdJMSPool - true - - 1 - 15 - 30000 - 1 - - 10 - - queue/DLQ - 10 - 0 - - - - - - - - - singleton-message-driven-bean - default - org.jboss.ejb.plugins.jms.JMSContainerInvoker - - DefaultJMSProvider - StdJMSPool - true - - 1 - 1 - 30000 - 1 - - 10 - - queue/DLQ - 10 - 0 - - - - - - - message-inflow-driven-bean - default - org.jboss.ejb.plugins.inflow.JBossMessageEndpointFactory - - - org.jboss.proxy.ClientMethodInterceptor - org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - - - - - - iiop - jboss:service=invoker,type=iiop - org.jboss.proxy.ejb.IORFactory - - org.jboss.iiop.WebCL - per-servant - true - iiop - false - - - - - jms-message-inflow-driven-bean - default - org.jboss.ejb.plugins.inflow.JBossJMSMessageEndpointFactory - - - - providerAdapterJNDI - DefaultJMSProvider - - - minSession - 1 - - - maxSession - 15 - - - keepAlive - 60000 - - - maxMessages - 1 - - - reconnectInterval - 10 - - - useDLQ - true - - - DLQHandler - org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler - - - DLQJNDIName - queue/DLQ - - - DLQMaxResent - 10 - - - - org.jboss.proxy.ClientMethodInterceptor - org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor - org.jboss.proxy.TransactionInterceptor - org.jboss.invocation.InvokerInterceptor - - - - - - - - - Standard CMP 2.x EntityBean - false - entity-unified-invoker - false - false - true - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.InvalidableEntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - B - - - - - cmp2.x jdbc2 pm - false - entity-unified-invoker - false - true - true - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - org.jboss.ejb.plugins.cmp.jdbc2.RelationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.PerTxEntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc2.JDBCStoreManager2 - org.jboss.ejb.plugins.lock.NoLock - - - 500 - 10000 - - - - 10 - - - - - - 100 - - C - - - - Clustered CMP 2.x EntityBean - false - clustered-entity-unified-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.CleanShutdownInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.EntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - B - - ${jboss.partition.name:DefaultPartition} - - - - - Standard CMP 2.x EntityBean with cache invalidation - false - entity-unified-invoker - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - org.jboss.cache.invalidation.triggers.EntityBeanCacheBatchInvalidatorInterceptor - org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.InvalidableEntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - A - - - - Instance Per Transaction CMP 2.x EntityBean - false - entity-unified-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.PerTxEntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.NoLock - - - 100 - - C - - - - Standard CMP EntityBean - false - entity-unified-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.EntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - A - - - - Clustered CMP EntityBean - false - clustered-entity-unified-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.CleanShutdownInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.EntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - A - - ${jboss.partition.name:DefaultPartition} - - - - - Instance Per Transaction CMP EntityBean - false - entity-unified-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.PerTxEntityInstanceCache - org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager - org.jboss.ejb.plugins.lock.NoLock - - - 100 - - C - - - - Standard Stateless SessionBean - false - stateless-unified-invoker - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor - - org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor - org.jboss.ejb.plugins.TxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - - org.jboss.ejb.plugins.StatelessSessionInstancePool - - - - 100 - - - - - Clustered Stateless SessionBean - false - clustered-stateless-unified-invoker - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.CleanShutdownInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor - - org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor - org.jboss.ejb.plugins.TxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - - org.jboss.ejb.plugins.StatelessSessionInstancePool - - - - 100 - - - ${jboss.partition.name:DefaultPartition} - - - - - - Standard Stateful SessionBean - false - stateful-unified-invoker - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor - - org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor - org.jboss.ejb.plugins.TxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - - org.jboss.ejb.plugins.StatefulSessionInstanceCache - org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager - - org.jboss.ejb.plugins.LRUStatefulContextCachePolicy - - 50 - 1000000 - 1800 - 1800 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - - - - Clustered Stateful SessionBean - false - clustered-stateful-unified-invoker - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.CleanShutdownInterceptor - org.jboss.ejb.plugins.LogInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor - - org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor - org.jboss.ejb.plugins.TxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.StatefulHASessionSynchronisationInterceptor - - org.jboss.ejb.plugins.StatefulHASessionInstanceCache - org.jboss.ejb.plugins.StatefulHASessionPersistenceManager - - org.jboss.ejb.plugins.LRUStatefulContextCachePolicy - - 50 - 1000000 - 1800 - 1800 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - - ${jboss.partition.name:DefaultPartition} - - - - - Standard BMP EntityBean - false - entity-unified-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.EntityInstanceCache - org.jboss.ejb.plugins.BMPPersistenceManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - A - - - - Clustered BMP EntityBean - false - clustered-entity-unified-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.CleanShutdownInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.EntityInstanceCache - org.jboss.ejb.plugins.BMPPersistenceManager - org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock - - org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy - - 50 - 1000000 - 300 - 600 - 400 - 60 - 1 - 0.75 - - - - 100 - - A - - ${jboss.partition.name:DefaultPartition} - - - - - Instance Per Transaction BMP EntityBean - false - entity-unified-invoker - false - false - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.SecurityInterceptor - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.EntityCreationInterceptor - org.jboss.ejb.plugins.EntityLockInterceptor - org.jboss.ejb.plugins.EntityInstanceInterceptor - org.jboss.ejb.plugins.EntityReentranceInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - org.jboss.ejb.plugins.EntitySynchronizationInterceptor - - org.jboss.ejb.plugins.EntityInstancePool - org.jboss.ejb.plugins.PerTxEntityInstanceCache - org.jboss.ejb.plugins.BMPPersistenceManager - org.jboss.ejb.plugins.lock.NoLock - - - 100 - - C - - - - Standard Message Driven Bean - false - message-driven-bean - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.RunAsSecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstancePool - - - - 100 - - - - - Singleton Message Driven Bean - false - singleton-message-driven-bean - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.RunAsSecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstancePool - - - - 100 - - - - - Standard Message Inflow Driven Bean - false - message-inflow-driven-bean - - org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor - org.jboss.ejb.plugins.LogInterceptor - org.jboss.ejb.plugins.RunAsSecurityInterceptor - - org.jboss.ejb.plugins.TxInterceptorCMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor - org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT - org.jboss.ejb.plugins.CallValidationInterceptor - org.jboss.resource.connectionmanager.CachedConnectionInterceptor - - org.jboss.ejb.plugins.MessageDrivenInstancePool - - - - 100 - - - - - - diff --git a/jboss/server/adempiere/conf/standardjbosscmp-jdbc.xml b/jboss/server/adempiere/conf/standardjbosscmp-jdbc.xml deleted file mode 100644 index ad56169af8..0000000000 --- a/jboss/server/adempiere/conf/standardjbosscmp-jdbc.xml +++ /dev/null @@ -1,3103 +0,0 @@ - - - - - - - - - - - - - - - java:/DefaultDS - - - true - false - false - 300000 - false - true - false - foreign-key - - on-load - 1000 - * - - 1000 - false - - - UUIDKeyGeneratorFactory - java.lang.String - VARCHAR - VARCHAR(32) - - - - org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLCompiler - false - - - - - FirstSQL/J - - PRIMARY KEY (?2) - FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 32 - true - 1 - 0 - - - concat - (?1 || ?2) - - - substring - substring(?1 FROM ?2 FOR ?3) - - - lcase - lower(?1) - - - length - char_length(?1) - - - locate - position(?1 IN ?2) - - - abs - math.abs(?1) - - - sqrt - math.sqrt(CAST(?1 AS DOUBLE)) - - - ucase - upper(?1) - - - count - count(?1) - - - - java.lang.Boolean - TINYINT - TINYINT - - - java.lang.Byte - TINYINT - TINYINT - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Long - BIGINT - BIGINT - - - java.lang.Float - REAL - REAL - - - java.lang.Double - DOUBLE - DOUBLE - - - java.lang.Character - CHAR - CHAR - - - java.lang.String - VARCHAR - - VARCHAR(256) - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - TIME - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.util.Date - TIMESTAMP - TIMESTAMP - - - java.math.BigDecimal - DECIMAL - DECIMAL - - - java.lang.Object - - LONGVARBINARY - VARCHAR(2147483500) - - - - - Ingres - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - ALTER TABLE ?1 ADD CONSTRAINT ?2 PRIMARY KEY (?3) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 32 - true - TRUE - FALSE - - - concat - concat(?1,?2) - - - substring - left(?1,?2) - - - lcase - lower(?1) - - - length - length(?1) - - - locate - locate(?1,?2) - - - abs - abs(?1) - - - sqrt - sqrt(?1) - - - ucase - upper(?1) - - - count - count(?1) - - - - - java.lang.Boolean - INTEGER - INTEGER - - - java.lang.Byte - TINYINT - INT1 - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Long - BIGINT - INTEGER4 - - - java.lang.Float - FLOAT - FLOAT4 - - - java.lang.Double - DOUBLE - FLOAT8 - - - java.lang.Character - CHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR(256) - - - java.util.Date - TIMESTAMP - DATE - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - DATE - - - java.sql.Timestamp - TIMESTAMP - DATE - - - java.math.BigDecimal - DOUBLE - FLOAT8 - - - - java.lang.Object - JAVA_OBJECT - LONG VARCHAR - - - - McKoi - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 32 - true - TRUE - FALSE - - - count - count(?1) - - - - java.lang.Boolean - BIT - BOOLEAN - - - java.lang.Byte - TINYINT - SMALLINT - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Long - BIGINT - BIGINT - - - java.lang.Float - REAL - FLOAT - - - java.lang.Double - DOUBLE - DOUBLE - - - java.lang.Character - CHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR(64) - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - TIME - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.lang.Object - JAVA_OBJECT - JAVA_OBJECT - - - - - Firebird - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 31 - true - 1 - 0 - - - count - count(?1) - - - - java.lang.Boolean - BIT - SMALLINT default 0 - - - java.lang.Byte - TINYINT - SMALLINT default 0 - - - java.lang.Short - SMALLINT - SMALLINT default 0 - - - java.lang.Integer - INTEGER - INTEGER default 0 - - - java.lang.Long - BIGINT - NUMERIC(18,0) default 0 - - - java.lang.Float - REAL - FLOAT default 0 - - - java.lang.Double - DOUBLE - DOUBLE PRECISION default 0 - - - java.lang.Character - VARCHAR - CHAR - - - - java.lang.String - VARCHAR - VARCHAR(64) - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - TIME - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.lang.Object - JAVA_OBJECT - BLOB - - - - - InterBase - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 31 - true - 1 - 0 - - - count - count(?1) - - - - java.lang.Boolean - BIT - SMALLINT default 0 - - - java.lang.Byte - TINYINT - SMALLINT default 0 - - - java.lang.Short - SMALLINT - SMALLINT default 0 - - - java.lang.Integer - INTEGER - INTEGER default 0 - - - java.lang.Long - BIGINT - NUMERIC(18,0) default 0 - - - java.lang.Float - REAL - FLOAT default 0 - - - java.lang.Double - DOUBLE - DOUBLE PRECISION default 0 - - - java.lang.Character - VARCHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR(64) - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - TIME - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.lang.Object - JAVA_OBJECT - VARCHAR(2000) - - - - - DB2 - - - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 18 - true - 1 - 0 - - - count - count(?1) - - - locate - locate(CAST(?1 as VARCHAR(254)), - CAST(?2 as VaRCHAR(254)),?3) - - - - java.lang.Boolean - BIT - SMALLINT - - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Long - BIGINT - BIGINT - - - java.lang.Float - REAL - REAL - - - java.lang.Double - DOUBLE - DOUBLE - - - java.lang.Character - CHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR(254) - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - TIME - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - - java.lang.Object - VARBINARY - BLOB(2000) - - - - - Derby - - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 18 - true - 1 - 0 - - - concat - (?1 || ?2) - - - substr - substr(?1, ?2, ?3) - - - lcase - lower(?1) - - - length - length(?1) - - - locate - locate(?2, ?1, ?3) - - - abs - abs(?1) - - - sqrt - sqrt(?1) - - - ucase - upper(?1) - - - count - count(?1) - - - - java.math.BigDecimal - NUMERIC - DECIMAL - - - java.lang.Boolean - BIT - BOOLEAN - - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Long - BIGINT - BIGINT - - - java.lang.Float - REAL - REAL - - - java.lang.Double - DOUBLE - DOUBLE PRECISION - - - java.lang.Character - CHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR(256) - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - TIME - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.lang.Object - BLOB - BLOB - - - - - Oracle9i - - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 30 - true - 1 - 0 - - - concat - (?1 || ?2) - - - substring - substr(?1, ?2, ?3) - - - lcase - lower(?1) - - - length - length(?1) - - - locate - instr(?2, ?1, ?3) - - - abs - abs(?1) - - - sqrt - sqrt(?1) - - - ucase - upper(?1) - - - count - count(?1) - - - - java.lang.Boolean - BIT - NUMBER(1) - - - java.lang.Byte - SMALLINT - NUMBER(3) - - - java.lang.Short - NUMERIC - - NUMBER(5) - - - java.lang.Integer - INTEGER - NUMBER(10) - - - java.lang.Long - BIGINT - NUMBER(19) - - - java.lang.Float - REAL - NUMBER(38,7) - - - java.math.BigDecimal - DECIMAL - NUMBER(38,15) - - - java.lang.Double - DOUBLE - NUMBER(38,15) - - - java.lang.Character - VARCHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR2(255) - - - java.util.Date - TIMESTAMP - TIMESTAMP(3) - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - DATE - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP(9) - - - java.lang.Object - BLOB - BLOB - - - - - - Oracle8 - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 30 - true - 1 - 0 - - - concat - (?1 || ?2) - - - substring - substr(?1, ?2, ?3) - - - lcase - lower(?1) - - - length - length(?1) - - - locate - instr(?2, ?1, ?3) - - - abs - abs(?1) - - - sqrt - sqrt(?1) - - - ucase - upper(?1) - - - count - count(?1) - - - - java.lang.Boolean - BIT - NUMBER(1) - - - java.lang.Byte - NUMERIC - NUMBER(3) - - - java.lang.Short - NUMERIC - NUMBER(5) - - - java.lang.Integer - INTEGER - NUMBER(10) - - - java.lang.Long - BIGINT - NUMBER(19) - - - java.lang.Float - REAL - NUMBER(38,7) - - - java.math.BigDecimal - DECIMAL - NUMBER(38,15) - - - java.lang.Double - DOUBLE - NUMBER(38,15) - - - java.lang.Character - VARCHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR2(255) - - - - java.util.Date - TIMESTAMP - DATE - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - DATE - - - - java.sql.Timestamp - TIMESTAMP - DATE - - - java.lang.Object - BLOB - BLOB - - - - - - Oracle7 - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 30 - true - 1 - 0 - - - concat - (?1 || ?2) - - - substring - substr(?1, ?2, ?3) - - - lcase - lower(?1) - - - length - length(?1) - - - locate - instr(?2, ?1, ?3) - - - abs - abs(?1) - - - sqrt - sqrt(?1) - - - ucase - upper(?1) - - - count - count(?1) - - - - java.lang.Boolean - BIT - NUMBER(1) - - - java.lang.Byte - NUMERIC - NUMBER(3) - - - java.lang.Short - NUMERIC - NUMBER(5) - - - java.lang.Integer - INTEGER - NUMBER(10) - - - java.lang.Long - BIGINT - NUMBER(19) - - - java.lang.Float - REAL - NUMBER(38,7) - - - java.lang.Double - DOUBLE - NUMBER(38,15) - - - java.lang.Character - VARCHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR2(255) - - - - java.util.Date - TIMESTAMP - DATE - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - DATE - - - - java.sql.Timestamp - TIMESTAMP - DATE - - - java.lang.Object - LONGVARBINARY - LONG RAW - - - - - - Sybase - - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 30 - true - 1 - 0 - - - count - count(?1) - - - length - char_length(?1) - - - - java.lang.Boolean - BIT - BIT - - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Long - NUMERIC - NUMERIC(38,0) - - - java.lang.Float - REAL - REAL - - - java.lang.Double - DOUBLE - DOUBLE PRECISION - - - java.lang.Character - CHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR(255) - - - java.util.Date - TIMESTAMP - DATETIME - - - java.sql.Date - DATE - DATETIME - - - java.sql.Time - TIME - SMALLDATETIME - - - java.sql.Timestamp - TIMESTAMP - DATETIME - - - java.lang.Object - JAVA_OBJECT - IMAGE - - - - - PostgreSQL - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - ?1 - t - _ - 32 - true - TRUE - FALSE - - - concat - (?1 || ?2) - - - substring - substring(?1 FROM ?2 FOR ?3) - - - lcase - lower(?1) - - - length - length(?1) - - - locate - (CASE position(?1 in substring(?2 from ?3)) WHEN 0 THEN 0 ELSE position(?1 in substring(?2 from ?3)) + ?3 - 1 END) - - - abs - abs(?1) - - - sqrt - sqrt(CAST(?1 AS double precision)) - - - ucase - upper(?1) - - - count - count(?1) - - - - java.lang.Boolean - CHAR - BOOLEAN - - - java.lang.Byte - TINYINT - INT2 - - - java.lang.Short - SMALLINT - INT2 - - - java.lang.Integer - INTEGER - INT4 - - - java.lang.Long - BIGINT - INT8 - - - java.lang.Float - FLOAT - FLOAT(7) - - - java.lang.Double - DOUBLE - FLOAT8 - - - java.lang.Character - CHAR - CHAR(1) - - - java.lang.String - VARCHAR - TEXT - - - java.util.Date - TIMESTAMP - TIMESTAMP with time zone - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - TIME - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP with time zone - - - java.math.BigDecimal - NUMERIC - NUMERIC - - - java.lang.Object - VARBINARY - BYTEA - - - - - PostgreSQL 8.0 - - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - ?1 - t - _ - 32 - true - TRUE - FALSE - - - concat - (?1 || ?2) - - - substring - substring(?1 FROM ?2 FOR ?3) - - - lcase - lower(?1) - - - length - length(?1) - - - locate - (CASE position(?1 in substring(?2 from ?3)) WHEN 0 THEN 0 ELSE position(?1 in substring(?2 from ?3)) + ?3 - 1 END) - - - abs - abs(?1) - - - sqrt - sqrt(CAST(?1 AS double precision)) - - - ucase - upper(?1) - - - count - count(?1) - - - - java.lang.Boolean - BOOLEAN - BOOLEAN - - - java.lang.Byte - TINYINT - INT2 - - - java.lang.Short - SMALLINT - INT2 - - - java.lang.Integer - INTEGER - INT4 - - - java.lang.Long - BIGINT - INT8 - - - java.lang.Float - FLOAT - FLOAT(7) - - - java.lang.Double - DOUBLE - FLOAT8 - - - java.lang.Character - CHAR - CHAR(1) - - - java.lang.String - VARCHAR - TEXT - - - java.util.Date - TIMESTAMP - TIMESTAMP - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - TIME - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.math.BigDecimal - NUMERIC - NUMERIC - - - java.lang.Object - VARBINARY - BYTEA - - - - - PostgreSQL 7.2 - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - ?1 - t - _ - 32 - true - TRUE - FALSE - - - concat - (?1 || ?2) - - - substring - substring(?1 FROM ?2 FOR ?3) - - - lcase - lower(?1) - - - length - length(?1) - - - locate - (CASE position(?1 in substring(?2 from ?3)) WHEN 0 THEN 0 ELSE position(?1 in substring(?2 from ?3)) + ?3 - 1 END) - - - abs - abs(?1) - - - sqrt - sqrt(CAST(?1 AS double precision)) - - - ucase - upper(?1) - - - count - count(?1) - - - - java.lang.Boolean - CHAR - BOOLEAN - - - java.lang.Byte - TINYINT - INT2 - - - java.lang.Short - SMALLINT - INT2 - - - java.lang.Integer - INTEGER - INT4 - - - java.lang.Long - BIGINT - INT8 - - - java.lang.Float - FLOAT - FLOAT(7) - - - java.lang.Double - DOUBLE - FLOAT8 - - - java.lang.Character - CHAR - CHAR(1) - - - java.lang.String - VARCHAR - TEXT - - - java.util.Date - TIMESTAMP - TIMESTAMP - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - TIME - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.math.BigDecimal - NUMERIC - NUMERIC - - - java.lang.Object - VARBINARY - BYTEA - - - - - Hypersonic SQL - - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - ?1 IDENTITY - ALTER TABLE ?1 ADD COLUMN ?2 ?3 - ALTER TABLE ?1 DROP COLUMN ?2 - t - _ - 32 - true - (1=1) - (1=0) - - - concat - (?1 || ?2) - - - substring - SUBSTRING(?1, ?2, ?3) - - - lcase - lcase(?1) - - - length - LENGTH(?1) - - - locate - LOCATE(?1, ?2, ?3) - - - abs - ABS(?1) - - - sqrt - SQRT(?1) - - - ucase - ucase(?1) - - - count - count(?1) - - - - java.lang.Byte - SMALLINT - SMALLINT - - - java.util.Date - TIMESTAMP - TIMESTAMP - - - java.lang.Boolean - BIT - BIT - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Object - - VARBINARY - VARBINARY - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Character - CHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR(256) - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - TIME - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.lang.Float - REAL - REAL - - - java.lang.Long - BIGINT - BIGINT - - - java.lang.Double - DOUBLE - DOUBLE - - - java.math.BigDecimal - DECIMAL - DECIMAL - - - - - PointBase - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 32 - true - TRUE - FALSE - - - lcase - lower(?1) - - - ucase - upper(?1) - - - count - count(?1) - - - locate - position(?1 IN ?2) - - - - java.lang.Character - CHAR - CHAR - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Long - BIGINT - INTEGER - - - java.lang.Double - DOUBLE - FLOAT - - - java.lang.Float - FLOAT - FLOAT - - - java.lang.Boolean - BIT - BOOLEAN - - - java.lang.String - VARCHAR - VARCHAR(256) - - - java.lang.Byte - SMALLINT - SMALLINT - - - java.lang.Object - BLOB - BLOB - - - java.lang.Integer - INTEGER - INTEGER - - - java.util.Date - DATE - DATE - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - - - SOLID - - PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 32 - true - 1 - 0 - - - count - count(?1) - - - - java.lang.Character - CHAR - CHAR - - - java.lang.Byte - TINYINT - TINYINT - - - java.lang.Short - INTEGER - INTEGER - - - java.lang.Double - DOUBLE - DOUBLE - - - java.lang.Object - BLOB - BLOB - - - java.lang.String - VARCHAR - VARCHAR(256) - - - java.lang.Integer - INTEGER - INTEGER - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.lang.Boolean - BIT - BIT - - - java.lang.Float - FLOAT - FLOAT - - - java.lang.Long - BIGINT - BIGINT - - - java.util.Date - TIMESTAMP - TIMESTAMP - - - - - mySQL - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - - ALTER TABLE ?1 ADD INDEX (?3), ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - ?1 auto_increment - ALTER TABLE ?1 MODIFY ?2 ?3 - t - _ - 32 - false - 1 - 0 - - - concat - concat(?1, ?2) - - - substring - substring(?1 FROM ?2 FOR ?3) - - - lcase - lower(?1) - - - length - length(?1) - - - locate - locate(?1, ?2, ?3) - - - abs - abs(?1) - - - sqrt - sqrt(?1) - - - ucase - upper(?1) - - - count - count(?1) - - - - java.lang.Float - FLOAT - FLOAT - - - java.lang.Double - DOUBLE - DOUBLE - - - java.lang.Boolean - TINYINT - TINYINT - - - java.math.BigDecimal - DOUBLE - DOUBLE - - - java.lang.Object - BLOB - LONGBLOB - - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Short - SMALLINT - SMALLINT - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - - java.lang.Byte - TINYINT - TINYINT - - - java.lang.Character - CHAR - CHAR - - - java.lang.Long - BIGINT - BIGINT - - - java.lang.String - VARCHAR - VARCHAR(250) BINARY - - - java.util.Date - TIMESTAMP - DATETIME - - - - java.sql.Date - DATE - DATETIME - - - java.sql.Time - TIME - TIME - - - - - MS SQLSERVER - SELECT ?1 FROM ?2 with (updlock) WHERE ?3 ORDER BY ?4 - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - ?1 IDENTITY - ALTER TABLE ?1 ALTER COLUMN ?2 ?3 - t - _ - 32 - true - 1 - 0 - - - concat - (?1 + ?2) - - - substring - substring(?1, ?2, ?3) - - - lcase - lower(?1) - - - length - len(?1) - - - locate - charindex(?1, ?2, ?3) - - - abs - abs(?1) - - - sqrt - sqrt(?1) - - - ucase - upper(?1) - - - count - count(?1) - - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Character - CHAR - CHAR - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Double - DOUBLE - DOUBLE - - - java.lang.Long - DECIMAL - DECIMAL(20) - - - java.math.BigDecimal - VARCHAR - VARCHAR(256) - - - java.lang.String - VARCHAR - VARCHAR(256) - - - java.lang.Object - JAVA_OBJECT - IMAGE - - - java.lang.Byte - TINYINT - TINYINT - - - - java.sql.Timestamp - TIMESTAMP - DATETIME - - - java.sql.Date - DATE - DATETIME - - - java.sql.Time - TIME - DATETIME - - - java.util.Date - TIMESTAMP - DATETIME - - - java.lang.Boolean - BIT - BIT - - - java.lang.Float - FLOAT - FLOAT - - - - - MS SQLSERVER2000 - - SELECT ?1 FROM ?2 with (xlock) WHERE ?3 ORDER BY ?4 - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - ?1 IDENTITY - t - _ - 32 - true - 1 - 0 - - - concat - (?1 + ?2) - - - substring - substring(?1, ?2, ?3) - - - lcase - lower(?1) - - - length - len(?1) - - - locate - charindex(?1, ?2, ?3) - - - abs - abs(?1) - - - sqrt - sqrt(?1) - - - ucase - upper(?1) - - - count - count(?1) - - - mod - (?1 % ?2) - - - - java.lang.Integer - INTEGER - INTEGER - - - - java.lang.Character - CHAR - CHAR - - - - java.lang.Short - SMALLINT - SMALLINT - - - - java.lang.Long - BIGINT - BIGINT - - - - java.math.BigDecimal - VARCHAR - VARCHAR(256) - - - - java.lang.String - VARCHAR - VARCHAR(256) - - - - java.lang.Object - LONGVARBINARY - IMAGE - - - - java.lang.Byte - TINYINT - TINYINT - - - - - java.sql.Timestamp - TIMESTAMP - DATETIME - - - - java.sql.Date - DATE - DATETIME - - - - java.sql.Time - TIME - DATETIME - - - - java.util.Date - TIMESTAMP - DATETIME - - - - java.lang.Boolean - BIT - BIT - - - - java.lang.Float - REAL - REAL - - - - java.lang.Double - DOUBLE - FLOAT - - - - - DB2/400 - - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 18 - true - 1 - 0 - - - count - count(?1) - - - - java.lang.Character - CHAR - CHAR(1) - - - java.lang.String - VARCHAR - VARCHAR(256) - - - - java.util.Date - TIMESTAMP - TIMESTAMP - - - java.sql.Time - TIME - TIME - - - java.lang.Float - FLOAT - FLOAT - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Double - DOUBLE - DOUBLE - - - java.lang.Long - BIGINT - INTEGER - - - java.lang.Boolean - CHAR - CHAR(5) - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Object - JAVA_OBJECT - VARCHAR(4096) FOR BIT DATA - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - - - SapDB - - - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD FOREIGN KEY ?2 (?3) REFERENCES ?4 (?5) - t - _ - 32 - true - 1 - 0 - - - count - count(?1) - - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Character - CHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR(256) - - - java.lang.Object - JAVA_OBJECT - LONG BYTE - - - java.lang.Byte - TINYINT - CHAR BYTE - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.util.Date - TIMESTAMP - TIMESTAMP - - - java.sql.Time - TIME - TIME - - - java.lang.Boolean - BIT - BOOLEAN - - - java.lang.Float - FLOAT - FLOAT - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Double - DOUBLE - DOUBLE PRECISION - - - java.lang.Long - DECIMAL - DECIMAL(20) - - - - - MaxDB - SELECT ?1 FROM ?2 WHERE ?3 ORDER BY ?4 FOR UPDATE - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD FOREIGN KEY ?2 (?3) REFERENCES ?4 (?5) - ?1 - t - _ - 32 - true - true - false - - - count - count(?1) - - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Character - CHAR - CHAR - - - java.lang.String - VARCHAR - VARCHAR(256) - - - java.lang.Object - JAVA_OBJECT - LONG BYTE - - - java.lang.Byte - TINYINT - CHAR BYTE - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.util.Date - TIMESTAMP - TIMESTAMP - - - java.sql.Time - TIME - TIME - - - java.lang.Boolean - BOOLEAN - BOOLEAN - - - java.lang.Float - FLOAT - FLOAT - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Double - DOUBLE - DOUBLE PRECISION - - - java.lang.Long - DECIMAL - DECIMAL(20) - - - - - Cloudscape - - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 32 - true - 1 - 0 - - - count - count(?1) - - - - java.math.BigDecimal - LONGVARCHAR - LONG VARCHAR - - - java.lang.Boolean - BIT - BOOLEAN - - - java.lang.Byte - TINYINT - TINYINT - - - java.lang.Short - SMALLINT - SMALLINT - - - java.lang.Integer - INTEGER - INTEGER - - - java.lang.Long - BIGINT - LONGINT - - - java.lang.Float - REAL - REAL - - - java.lang.Double - DOUBLE - DOUBLE PRECISION - - - java.lang.Character - CHAR - CHAR - - - java.lang.String - LONGVARCHAR - LONG VARCHAR - - - - java.sql.Date - DATE - DATE - - - java.sql.Time - TIME - TIME - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - java.lang.Object - JAVA_OBJECT - LONG VARBINARY - - - - - - InformixDB - select ?1 from ?2 where ?3 order by ?4 for update - PRIMARY KEY (?2) CONSTRAINT ?1 - ALTER TABLE ?1 ADD CONSTRAINT FOREIGN KEY (?3) REFERENCES ?4 (?5) CONSTRAINT ?2 - t - _ - 32 - true - 1 - 0 - - - count - count(?1) - - - - java.lang.Character - CHAR - CHAR(1) - - - - java.lang.String - VARCHAR - VARCHAR(255,0) - - - - java.math.BigDecimal - NUMERIC - DECIMAL - - - - java.lang.Boolean - BIT - SMALLINT - - - - java.lang.Integer - INTEGER - INTEGER - - - - java.lang.Long - BIGINT - NUMERIC(18,0) - - - - java.lang.Float - REAL - FLOAT - - - - java.lang.Double - DOUBLE - DOUBLE PRECISION - - - - java.lang.Byte - TINYINT - SMALLINT - - - - java.lang.Short - SMALLINT - SMALLINT - - - - java.util.Date - TIMESTAMP - DATETIME YEAR TO FRACTION(3) - - - - java.sql.Date - DATE - DATE - - - - java.sql.Time - TIME - TIME - - - - java.sql.Timestamp - TIMESTAMP - DATETIME YEAR TO FRACTION(3) - - - - java.lang.Object - BLOB - BLOB - - - - - Mimer SQL - - CONSTRAINT ?1 PRIMARY KEY (?2) - ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5) - t - _ - 32 - true - 1 - 0 - - - java.lang.Boolean - BIT - SMALLINT - - - - java.lang.Byte - TINYINT - SMALLINT - - - - java.lang.Short - SMALLINT - SMALLINT - - - - java.lang.Integer - INTEGER - INTEGER - - - - java.lang.Long - BIGINT - BIGINT - - - - java.lang.Float - REAL - REAL - - - - java.lang.Double - DOUBLE - DOUBLE PRECISION - - - - java.lang.Character - CHAR - CHAR - - - - java.lang.String - VARCHAR - VARCHAR(5000) - - - - java.sql.Date - DATE - DATE - - - - java.sql.Time - TIME - TIME - - - - java.sql.Timestamp - TIMESTAMP - TIMESTAMP - - - - java.lang.Object - JAVA_OBJECT - VARBINARY(5000) - - - - - - - - - - - jboss.jdbc:service=SQLExceptionProcessor - - - - - - SELECT CURRENT_TIMESTAMP - - - - - - - - TEST_SEQUENCE - - - - - %%t_seq - - - - - - - - - - - - - - - - - - - - - - - - - - - - UUIDKeyGeneratorFactory - - - - - - - - - SELECT CURRENT_TIMESTAMP - - - - - - - - - - - - - - - - - alias - alter - between - char - column - commit - create - date - default - delete - drop - file - from - grant - group - index - integer - join - number - on - order - primary - public - revoke - rollback - row - select - set - session - size - table - trigger - update - unique - user - varchar - view - - diff --git a/jboss/server/adempiere/conf/xmdesc/AttributePersistenceService-xmbean.xml b/jboss/server/adempiere/conf/xmdesc/AttributePersistenceService-xmbean.xml deleted file mode 100644 index a60da5e074..0000000000 --- a/jboss/server/adempiere/conf/xmdesc/AttributePersistenceService-xmbean.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - XMBean Attribute Persistence Service - - - - - org.jboss.system.pm.AttributePersistenceService - - - - Specifies whether to call destroy() on the AttributePersistenceManager implementation, upon service stop - ApmDestroyOnServiceStop - boolean - - - - - - - The actual AttributePersistenceManager implementation - AttributePersistenceManagerClass - java.lang.String - - - - - - - The XML configuration that is passed to the AttributePersistenceManager implementation - AttributePersistenceManagerConfig - org.w3c.dom.Element - - - - - - - The version tag to use for stored/loaded Attribute data - VersionTag - java.lang.String - - - - - - &defaultAttributes; - - - - Factory method returning the active AttributePersistenceManager implementation, for internal usage - apmCreate - org.jboss.mx.persistence.AttributePersistenceManager - - - - Delegated to the active APM returns true when a persisted image with this id exists - apmExists - - The id of the persisted attribute image - id - java.lang.String - - boolean - - - - Delegated to the active APM removes the specified persisted attribute image - apmRemove - - The id of the persisted attribute image - id - java.lang.String - - void - - - - Delegated to the active APM removes the persisted attribute images - apmRemoveAll - void - - - - Delegated to the active APM it returns a list with the ids of all persisted attribute images - apmListAll - [Ljava.lang.String; - - - - Delegated to the active APM it returns a single string with the ids of all persisted attribute images - apmListAllAsString - java.lang.String - - - &defaultOperations; - - \ No newline at end of file diff --git a/jboss/server/adempiere/conf/xmdesc/ClientUserTransaction-xmbean.xml b/jboss/server/adempiere/conf/xmdesc/ClientUserTransaction-xmbean.xml deleted file mode 100644 index dc4598400f..0000000000 --- a/jboss/server/adempiere/conf/xmdesc/ClientUserTransaction-xmbean.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ClientUserTransaction Service. - org.jboss.tm.usertx.server.ClientUserTransactionService - &defaultAttributes; - - Set the name of the proxy factory service used for the UserTransactionSession - TxProxyName - javax.management.ObjectName - - - - Expose UserTransactionSession and UserTransactionSessionFactory interfaces via JMX to invokers. - invoke - - A pointer to the invocation object - invocation - org.jboss.invocation.Invocation - - java.lang.Object - - - &defaultOperations; - \ No newline at end of file diff --git a/jboss/server/adempiere/conf/xmdesc/JNDIView-xmbean.xml b/jboss/server/adempiere/conf/xmdesc/JNDIView-xmbean.xml deleted file mode 100644 index 4855e6fbfa..0000000000 --- a/jboss/server/adempiere/conf/xmdesc/JNDIView-xmbean.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - JNDIView Service. List deployed application java:comp namespaces, - the java: namespace as well as the global InitialContext JNDI namespace. - - org.jboss.naming.JNDIView - &defaultAttributes; - - The HANamingService service name - HANamingService - java.lang.String - - - Output JNDI info as text - list - - If true, list the class of each object in addition to its name - verbose - boolean - - java.lang.String - - - Output JNDI info in XML format - listXML - java.lang.String - - &defaultOperations; - \ No newline at end of file diff --git a/jboss/server/adempiere/conf/xmdesc/Log4jService-xmbean.xml b/jboss/server/adempiere/conf/xmdesc/Log4jService-xmbean.xml deleted file mode 100644 index b030d9278b..0000000000 --- a/jboss/server/adempiere/conf/xmdesc/Log4jService-xmbean.xml +++ /dev/null @@ -1,110 +0,0 @@ - - -]> - - - - This MBean allows to get and set Log4j specific options. -See also resource:log4j.xml - - org.jboss.logging.Log4jService - - The default constructor - Log4jService - - - &defaultAttributes; - - - The URL of the log4j.xml config file. - ConfigurationURL - java.net.URL - - - Should data writen to standard error be caught and integrated into the log output. - CatchSystemErr - boolean - - - Should data writen to standard output be caught and integrated into the log output. - CatchSystemOut - boolean - - - Sets the log4j quite mode. For log4j 1.2.8 this must stay on true. - Log4jQuietMode - boolean - - - The time in seconds between checking for new config. - RefreshPeriod - int - - - - Displays the log level of a given logger. - getLoggerLevel - - The name of the logger to display. - logger - java.lang.String - - java.lang.String - - - Sets the log level for a given logger. - setLoggerLevel - - The name of the logger to set. - logger - java.lang.String - - - The log level to set. - level - java.lang.String - - void - - - Sets the levels of each logger specified by the given comma - seperated list of logger names. - setLoggerLevels - - The list of loggers - loggers - java.lang.String - - - The log level to set - level - java.lang.String - - void - - - Force the logging system to reconfigure. - reconfigure - void - - - Force the logging system to reconfigure with the given URL. - reconfigure - - The url for the new configuration. - url - java.lang.String - - void - - - - &defaultOperations; - - \ No newline at end of file diff --git a/jboss/server/adempiere/conf/xmdesc/NamingBean-xmbean.xml b/jboss/server/adempiere/conf/xmdesc/NamingBean-xmbean.xml deleted file mode 100644 index dc5d3eece9..0000000000 --- a/jboss/server/adempiere/conf/xmdesc/NamingBean-xmbean.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - The JNDI pojo bean - - org.jnp.server.NamingBeanImpl - - - The default constructor - NamingBeanImpl - - - - The NamingInstance - NamingInstance - org.jnp.interfaces.Naming - - - - - The start lifecycle op - start - void - - - The stop lifecycle op - stop - void - - - diff --git a/jboss/server/adempiere/conf/xmdesc/NamingService-xmbean.xml b/jboss/server/adempiere/conf/xmdesc/NamingService-xmbean.xml deleted file mode 100644 index 22562de752..0000000000 --- a/jboss/server/adempiere/conf/xmdesc/NamingService-xmbean.xml +++ /dev/null @@ -1,196 +0,0 @@ - - -]> - - - - The standard JBoss JNDI naming server with a custom - ProxyFactoryInterceptor interceptor that does replacement of NamingContext - objects with the detached invoker proxy. - - - - - - - - - - - - org.jboss.naming.NamingService - - - The default constructor - NamingService - - - &defaultAttributes; - - - MethodMap - java.util.Map - - - Underlying Naming bean instance - Naming - org.jnp.server.NamingBean - - - Underlying Naming bean instance - NamingInstance - org.jnp.interfaces.Naming - - - The call by value mode. true if all lookups are unmarshalled using - the caller's TCL, false if in VM lookups return the value by reference. - CallByValue - boolean - - - The bind address of the bootstrap lookup socket. - BindAddress - java.lang.String - - - The listening port for the bootstrap JNP service. Set this to -1 - to run the NamingService without the JNP invoker listening port. - Port - int - - - The bootstrap socket backlog count. - Backlog - int - - - The bootstrap socket javax.net.ServerSocketFactory class name - JNPServerSocketFactory - java.lang.String - - - The bootstrap socket javax.net.ServerSocketFactory - JNPServerSocketFactoryBean - javax.net.ServerSocketFactory - - - - The port of the RMI naming service, 0 == anonymous. This - is only used if an explicit InvokerProxyFactory has not been set. - RmiPort - int - - - The RMI service bind address. Empty == all addresses - RmiBindAddress - java.lang.String - - - The RMI service java.rmi.server.RMIClientSocketFactory class name - ClientSocketFactory - java.lang.String - - - The RMI service java.rmi.server.RMIServerSocketFactory instance - ClientSocketFactoryBean - java.rmi.server.RMIClientSocketFactory - - - The RMI service java.rmi.server.RMIServerSocketFactory class name - ServerSocketFactory - java.lang.String - - - The RMI service java.rmi.server.RMIServerSocketFactory instance - ServerSocketFactory - java.rmi.server.RMIServerSocketFactory - - - - Ghe InstallGlobalService which defines whether the MainMBean's - Naming server will be installed as the NamingContext.setLocal global - value. - InstallGlobalService - boolean - - - The UseGlobalService which defines whether the MainMBean's - Naming server will initialized from the existing NamingContext.setLocal global - value. - UseGlobalService - boolean - - - The thread pool service used to control the bootstrap lookups - LookupPool - org.jboss.util.threadpool.BasicThreadPoolMBean - - - The detached invoker proxy factory to use for the naming - service transport. - InvokerProxyFactory - org.jboss.invocation.jrmp.server.JRMPProxyFactoryMBean - - - - - The generic invocation operation used by detached invokers - to route requests to the service - - invoke - - The Naming interface method invocation encapsulation - - invocation - org.jboss.invocation.Invocation - - java.lang.Object - - - Create an alias in jndi - - createAlias - - The from name - - fromName - java.lang.String - - - The to name - - toName - java.lang.String - - void - - - Remove an alias from jndi - - removeAlias - - The name - - name - java.lang.String - - void - - - &defaultOperations; - - diff --git a/jboss/server/adempiere/conf/xmdesc/TransactionManagerService-xmbean.xml b/jboss/server/adempiere/conf/xmdesc/TransactionManagerService-xmbean.xml deleted file mode 100644 index 58d6e00783..0000000000 --- a/jboss/server/adempiere/conf/xmdesc/TransactionManagerService-xmbean.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - TransactionManager Service. - org.jboss.tm.TransactionManagerService - &defaultAttributes; - - Should be set to true for transaction demarcation over IIOP - GlobalIdsEnabled - boolean - - - Whether to interrupt threads at transaction timeout - InterruptThreads - boolean - - - The transaction timeout in seconds - TransactionTimeout - int - - - Name of the xidFactory - XidFactory - javax.management.ObjectName - - - Transaction Integrity Policy - TransactionIntegrityFactory - org.jboss.tm.integrity.TransactionIntegrityFactory - - - Returns the TransactionManager managed by this service - TransactionManager - javax.transaction.TransactionManager - - - Returns the XATerminator managed by this service - XATerminator - org.jboss.tm.JBossXATerminator - - - Counts the number of active transactions - TransactionCount - long - - - Counts the number of commited transactions - CommitCount - long - - - Counts the number of transactions that have been rolled back - RollbackCount - long - - - - Register a XAException Formatter - registerXAExceptionFormatter - - The class of the formatter - clazz - java.lang.Class - - - A XAExceptionFromatter value - formatter - org.jboss.tm.XAExceptionFormatter - - void - - - Unregister a XAException Formatter - unregisterXAExceptionFormatter - - The class of the formatter - clazz - java.lang.Class - - void - - - &defaultOperations; - \ No newline at end of file diff --git a/jboss/server/adempiere/conf/xmdesc/org.jboss.deployment.JARDeployer-xmbean.xml b/jboss/server/adempiere/conf/xmdesc/org.jboss.deployment.JARDeployer-xmbean.xml deleted file mode 100644 index 42591af2bc..0000000000 --- a/jboss/server/adempiere/conf/xmdesc/org.jboss.deployment.JARDeployer-xmbean.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - The JARDeployer adds archives that do not contain META-INF/*.xml - files. The pattern of xml files that correspond to deployment descriptors - can be specified using the DescriptorNames attribute. - - org.jboss.deployment.JARDeployer - - - The list of suffixes that define deployment descriptors which - if found in an archive META-INF directory indicate non-jar deployments - which should be ignored by the JARDeployer - - DescriptorNames - [Ljava.lang.String; - - - - - - - - - - Allow the override of supported suffixes and relative order - EnhancedSuffixes - [Ljava.lang.String; - - - &deployerAttributes; - &defaultAttributes; - - &deployerOperations; - &defaultOperations; - - diff --git a/jboss/server/adempiere/conf/xmdesc/org.jboss.deployment.MainDeployer-xmbean.xml b/jboss/server/adempiere/conf/xmdesc/org.jboss.deployment.MainDeployer-xmbean.xml deleted file mode 100644 index 7579a6bc2d..0000000000 --- a/jboss/server/adempiere/conf/xmdesc/org.jboss.deployment.MainDeployer-xmbean.xml +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - - - - The Main deployer is the service which acts as the entry - point for the deployment/undeployment requests. - - org.jboss.deployment.MainDeployer - - - - CopyFiles - boolean - - - - - - - ServiceController - javax.management.ObjectName - - - - ServiceName - javax.management.ObjectName - - - The suffix order used when sorting deployments, constructed dynamically by registering deployers - SuffixOrder - [Ljava.lang.String; - - - Allows the override of the suffix order declared by subdeployers, using the syntax [order:]suffix - - EnhancedSuffixOrder - [Ljava.lang.String; - - - - - - - - TempDir - java.io.File - - - - TempDirString - java.lang.String - - - &defaultAttributes; - - - - addDeployer - - deployer - org.jboss.deployment.SubDeployer - - void - - - - removeDeployer - - deployer - org.jboss.deployment.SubDeployer - - void - - - - deploy - - url - java.lang.String - - void - - - - deploy - - url - java.net.URL - - void - - - - deploy - - sdi - org.jboss.deployment.DeploymentInfo - - void - - - starts a package identified by a URL - start - - urlspec - java.lang.String - - void - - - stops a package identified by a URL - stop - - urlspec - java.lang.String - - void - - - - getDeployment - - url - java.net.URL - - org.jboss.deployment.DeploymentInfo - - - - getWatchUrl - - url - java.net.URL - - java.net.URL - - - - isDeployed - - url - java.net.URL - - boolean - - - - isDeployed - - url - java.lang.String - - boolean - - - - listDeployed - java.util.Collection - - - - listDeployedAsString - java.lang.String - - - - listDeployedModules - java.util.Collection - - - - listDeployers - java.util.Collection - - - Check the current deployment states and generate a - IncompleteDeploymentException if there are mbeans waiting for depedencies. - - checkIncompleteDeployments - void - - - - listIncompletelyDeployed - java.util.Collection - - - - listWaitingForDeployer - java.util.Collection - - - - redeploy - - url - java.lang.String - - void - - - - redeploy - - url - java.net.URL - - void - - - - redeploy - - sdi - org.jboss.deployment.DeploymentInfo - - void - - - - shutdown - void - - - - undeploy - - url - java.lang.String - - void - - - - undeploy - - url - java.net.URL - - void - - - - undeploy - - sdi - org.jboss.deployment.DeploymentInfo - - void - - - &defaultOperations; - - \ No newline at end of file diff --git a/jboss/server/adempiere/conf/xmdesc/org.jboss.deployment.SARDeployer-xmbean.xml b/jboss/server/adempiere/conf/xmdesc/org.jboss.deployment.SARDeployer-xmbean.xml deleted file mode 100644 index dffcb236f7..0000000000 --- a/jboss/server/adempiere/conf/xmdesc/org.jboss.deployment.SARDeployer-xmbean.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - The SAR deployer handles the JBoss service archive deployments. - org.jboss.deployment.SARDeployer - - - A flag passed to the JAXP DocumentBuilderFactory setNamespaceAware method - UseNamespaceAwareParser - boolean - - - - - - - - Allow the override of supported suffixes and relative order - EnhancedSuffixes - [Ljava.lang.String; - - - - - - - &deployerAttributes; - &defaultAttributes; - - - Get the associated service DeploymentInfo if found, null otherwise - getService - - serviceName - javax.management.ObjectName - - org.jboss.deployment.DeploymentInfo - - - &deployerOperations; - &defaultOperations; - - \ No newline at end of file diff --git a/jboss/server/adempiere/deploy/cache-invalidation-service.xml b/jboss/server/adempiere/deploy/cache-invalidation-service.xml deleted file mode 100644 index 6331cb4ccf..0000000000 --- a/jboss/server/adempiere/deploy/cache-invalidation-service.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/jboss/server/adempiere/deploy/client-deployer-service.xml b/jboss/server/adempiere/deploy/client-deployer-service.xml deleted file mode 100644 index 4376ac6622..0000000000 --- a/jboss/server/adempiere/deploy/client-deployer-service.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - The J2EE Application Client Deployer - org.jboss.deployment.ClientDeployer - - - - The service state name - StateString - java.lang.String - - - The service state value - State - int - - - - - The create lifecycle operation - create - - - The start lifecycle operation - start - - - The stop lifecycle operation - stop - - - The destroy lifecycle operation - destroy - - - - - - - diff --git a/jboss/server/adempiere/deploy/ear-deployer.xml b/jboss/server/adempiere/deploy/ear-deployer.xml deleted file mode 100644 index 99a9306bfe..0000000000 --- a/jboss/server/adempiere/deploy/ear-deployer.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - false - - false - - true - - diff --git a/jboss/server/adempiere/deploy/ejb-deployer.xml b/jboss/server/adempiere/deploy/ejb-deployer.xml deleted file mode 100644 index e04e38c4a2..0000000000 --- a/jboss/server/adempiere/deploy/ejb-deployer.xml +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - - - - - jboss.ejb:service=EJBTimerService,retryPolicy=fixedDelay - jboss.ejb:service=EJBTimerService,persistencePolicy=database - org.jboss.ejb.txtimer.BigIntegerTimerIdGenerator - org.jboss.ejb.txtimer.TimedObjectInvokerImpl - - jboss:service=TransactionManager - - - - - - 100 - - - - - - - - jboss.jca:service=DataSourceBinding,name=DefaultDS - - org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin - - TIMERS - - - - - - - - - - - - The EJBDeployer responsible for ejb jar deployment - - - - - - - org.jboss.ejb.EJBDeployer - - - - The class name of the MBean - Name - java.lang.String - - - - The status of the MBean - State - int - - - - The status of the MBean in text form - StateString - java.lang.String - - - - - The JMX ObjectName of the service that provides the SubDeployer - ServiceName - javax.management.ObjectName - - - - An array of suffixes of interest to this subdeployer - Suffixes - [Ljava.lang.String; - - - - The relative order of the specified suffixes - RelativeOrder - int - - - - - Allow the override of supported suffixes and relative order - EnhancedSuffixes - [Ljava.lang.String; - - - - - The dynamic class loading simple web server - WebServiceName - javax.management.ObjectName - - - - Control the bean verifier (on/off) - VerifyDeployments - boolean - - - - Control the verbose mode of the bean verifier - VerifierVerbose - boolean - - - - Control the strictness of the bean verifier - StrictVerifier - boolean - - - - Enable/disable call-by-value semantics - CallByValue - boolean - - - - Enable/disable the validation of deployment descriptors - ValidateDTDs - boolean - - - - Enable/disable the metrics interceptor for containers - MetricsEnabled - boolean - - - - The transaction manager service to use - TransactionManagerServiceName - javax.management.ObjectName - - - - - List the deployed applications - listDeployedApplications - java.util.Iterator - - - - - Standard MBean lifecycle method - create - - - - The start lifecycle operation - start - - - - The stop lifecycle operation - stop - - - - The destroy lifecycle operation - destroy - - - - The detyped lifecycle operation (for internal use only) - jbossInternalLifecycle - - The lifecycle operation - method - java.lang.String - - void - - - - - Accept a module for deployment - accepts - - info - org.jboss.deployment.DeploymentInfo - - boolean - - - - Initialize deployment step - init - - info - org.jboss.deployment.DeploymentInfo - - - - - Create deployment step - create - - info - org.jboss.deployment.DeploymentInfo - - - - - Start deployment step - start - - info - org.jboss.deployment.DeploymentInfo - - - - - Stop deployment step - stop - - info - org.jboss.deployment.DeploymentInfo - - - - - Destroy deployment step - destroy - - info - org.jboss.deployment.DeploymentInfo - - - - - - Add dynamically an operation interceptor - addOperationInterceptor - - The Interceptor - interceptor - org.jboss.mx.interceptor.Interceptor - - - - - Remove dynamically an operation interceptor - removeOperationInterceptor - - The Interceptor - interceptor - org.jboss.mx.interceptor.Interceptor - - - - - - - true - - false - - true - - true - - - jboss:service=TransactionManager - - jboss:service=WebService - - - - diff --git a/jboss/server/adempiere/deploy/ejb3-interceptors-aop.xml b/jboss/server/adempiere/deploy/ejb3-interceptors-aop.xml deleted file mode 100644 index 150b3dff2a..0000000000 --- a/jboss/server/adempiere/deploy/ejb3-interceptors-aop.xml +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000) - - - - - - - - - - - - - - - - - - - - - - - - - - - - @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000) - - - - - - - @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class) - - - @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class) - - - @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0) - - - - - @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class) - - - @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000) - - - - - @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class) - - - @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class) - - - @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0) - - - - - @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class) - - - @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0) - - - - - - - @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.NoPassivationCache.class) - - - - - - - - - - - - - - - - - @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=15, timeout=10000) - - - - - - - - - - - - - - - - - - - - - @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=15, timeout=10000) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/jboss/server/adempiere/deploy/ejb3.deployer/META-INF/jboss-service.xml b/jboss/server/adempiere/deploy/ejb3.deployer/META-INF/jboss-service.xml deleted file mode 100644 index 23666202aa..0000000000 --- a/jboss/server/adempiere/deploy/ejb3.deployer/META-INF/jboss-service.xml +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - jboss.aop:service=AspectDeployer - socket://${jboss.bind.address}:3873 - - - org.jboss.aspects.remoting.AOPRemotingInvocationHandler - - - - - - - - - snmp-adaptor.jar, - otherimages.jar, - applet.jar, - jcommon.jar, - console-mgr-classes.jar, - jfreechart.jar, - juddi-service.jar, - wsdl4j.jar, - commons-collections.jar, - commons-pool.jar, - juddi.jar, - commons-discovery.jar, - uddi4j.jar, - axis.jar, - commons-dbcp.jar, - jboss-juddiaxis.jar, - trove.jar, - javassist.jar, - jboss-aop-jdk50.jar, - jboss-aspect-library-jdk50.jar, - ejb3-persistence.jar, - commons-validator-1.1.3.jar, - commons-collections.jar, - commons-fileupload.jar, - commons-pool.jar, - hibernate-entitymanager.jar, - jboss-ejb3x.jar, - commons-digester-1.6.jar, - cglib-2.1.1.jar, - commons-discovery.jar, - jboss-annotations-ejb3.jar, - jaxen-1.1-beta-4.jar, - hibernate-annotations.jar, - commons-httpclient.jar, - commons-logging.jar, - commons-vfs.jar, - hibernate3.jar, - commons-logging-api.jar, - asm.jar, - asm-attrs.jar, - commons-lang-2.0.jar, - commons-beanutils.jar, - jboss-ejb3.jar, - dom4j.jar, - commons-codec-1.2.jar, - wsdl4j.jar, - xmlsec.jar, - jbossws.jar, - jboss-bean-deployer.jar, - jboss-microcontainer.jar, - jboss-dependency.jar, - jboss-container.jar, - tomcat-coyote.jar, - commons-collections.jar, - myfaces.jar, - jstl.jar, - commons-digester-1.6.jar, - myfaces-impl.jar, - commons-beanutils.jar, - myfaces-jsf-api.jar, - commons-codec-1.2.jar, - catalina-optional.jar, - tomcat-util.jar, - jasper-compiler.jar, - commons-el.jar, - jasper-compiler-jdt.jar, - tomcat-http.jar, - catalina-manager.jar, - jasper-runtime.jar, - tomcat55-service.jar, - servlets-invoker.jar, - catalina.jar, - naming-resources.jar, - servlets-default.jar, - tomcat-ajp.jar, - commons-modeler.jar, - tomcat-apr.jar, - servlets-webdav.jar - - - - - - false - - - - The EJB3Deployer responsible for ejb3 deployment - - - - - - - org.jboss.ejb3.EJB3Deployer - - - - The class name of the MBean - Name - java.lang.String - - - - The status of the MBean - State - int - - - - The status of the MBean in text form - StateString - java.lang.String - - - - - The ObjectName of the Subdeployer - ServiceName - javax.management.ObjectName - - - - The suffixes of interest to this deployer - Suffixes - [Ljava.lang.String; - - - - The relative order of the suffixes in the global suffixes list - RelativeOrder - int - - - - - DefaultProperties - java.util.Properties - - - - If true, .jars will not be examined for annotations, 3.0 descriptors - DeployEjb3ExtensionOnly - boolean - - - - mbean that has list of jars to ignore - JarsIgnoredForScanning - org.jboss.ejb3.JarsIgnoredForScanningMBean - - - - - Standard MBean lifecycle method - create - - - - The start lifecycle operation - start - - - - The stop lifecycle operation - stop - - - - The destroy lifecycle operation - destroy - - - - The detyped lifecycle operation (for internal use only) - jbossInternalLifecycle - - The lifecycle operation - method - java.lang.String - - void - - - - - Accept a module for deployment - accepts - - info - org.jboss.deployment.DeploymentInfo - - boolean - - - - Initialize deployment step - init - - info - org.jboss.deployment.DeploymentInfo - - - - - Create deployment step - create - - info - org.jboss.deployment.DeploymentInfo - - - - - Start deployment step - start - - info - org.jboss.deployment.DeploymentInfo - - - - - Stop deployment step - stop - - info - org.jboss.deployment.DeploymentInfo - - - - - Destroy deployment step - destroy - - info - org.jboss.deployment.DeploymentInfo - - - - - - Add dynamically an operation interceptor - addOperationInterceptor - - The Interceptor - interceptor - org.jboss.mx.interceptor.Interceptor - - - - - Remove dynamically an operation interceptor - removeOperationInterceptor - - The Interceptor - interceptor - org.jboss.mx.interceptor.Interceptor - - - - - - jboss.aop:service=AspectDeployer - jboss.ejb:service=EJBDeployer - jboss.ejb3:service=JarsIgnoredForScanning - - - diff --git a/jboss/server/adempiere/deploy/ejb3.deployer/META-INF/persistence.properties b/jboss/server/adempiere/deploy/ejb3.deployer/META-INF/persistence.properties deleted file mode 100644 index 4c600c71f9..0000000000 --- a/jboss/server/adempiere/deploy/ejb3.deployer/META-INF/persistence.properties +++ /dev/null @@ -1,17 +0,0 @@ -hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup -#hibernate.connection.release_mode=after_statement -#hibernate.transaction.flush_before_completion=false -#hibernate.transaction.auto_close_session=false -#hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory -#hibernate.hbm2ddl.auto=create-drop -#hibernate.hbm2ddl.auto=create -hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider -# Clustered cache with TreeCache -#hibernate.cache.provider_class=org.jboss.ejb3.entity.TreeCacheProviderHook -#hibernate.treecache.mbean.object_name=jboss.cache:service=EJB3EntityTreeCache -#hibernate.dialect=org.hibernate.dialect.HSQLDialect -hibernate.jndi.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces -hibernate.bytecode.use_reflection_optimizer=false -# I don't think this is honored, but EJB3Deployer uses it -hibernate.bytecode.provider=javassist \ No newline at end of file diff --git a/jboss/server/adempiere/deploy/hsqldb-ds.xml b/jboss/server/adempiere/deploy/hsqldb-ds.xml deleted file mode 100644 index b50ff3eab8..0000000000 --- a/jboss/server/adempiere/deploy/hsqldb-ds.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - DefaultDS - - - - - jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB - - - org.hsqldb.jdbcDriver - - - sa - - - - - - - - - - 5 - - - 20 - - - - - 0 - - - - - - - - - - - - - - HsqlDbRealm - - - - - 32 - - - - Hypersonic SQL - - - - jboss:service=Hypersonic,database=localDB - - - - - - - - localDB - true - - - diff --git a/jboss/server/adempiere/deploy/jboss-aop-jdk50.deployer/META-INF/jboss-service.xml b/jboss/server/adempiere/deploy/jboss-aop-jdk50.deployer/META-INF/jboss-service.xml deleted file mode 100644 index 7b5ca5e1e0..0000000000 --- a/jboss/server/adempiere/deploy/jboss-aop-jdk50.deployer/META-INF/jboss-service.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - false - - true - true - org.jboss.test, org.jboss.injbossaop - org.jboss. - - true - false - - - - - - diff --git a/jboss/server/adempiere/deploy/jboss-aop-jdk50.deployer/base-aop.xml b/jboss/server/adempiere/deploy/jboss-aop-jdk50.deployer/base-aop.xml deleted file mode 100644 index 7eb6373183..0000000000 --- a/jboss/server/adempiere/deploy/jboss-aop-jdk50.deployer/base-aop.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - javax.management.DynamicMBean - org.jboss.aspects.jmx.JmxIntrospectingMixin - new org.jboss.aspects.jmx.JmxIntrospectingMixin(this) - - - - - - - - - - - - - - - org.jboss.aspects.asynch.AsynchProvider,org.jboss.aspects.asynch.FutureHolder - org.jboss.aspects.asynch.AsynchMixin - - - - - - - - - - - - - - - - org.jboss.aspects.asynchronous.aspects.AsynchronousFacade - - org.jboss.aspects.asynchronous.aspects.AsynchronousFacadeImpl - new org.jboss.aspects.asynchronous.aspects.AsynchronousFacadeImpl() - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jboss/server/adempiere/deploy/jboss-bean.deployer/META-INF/jboss-service.xml b/jboss/server/adempiere/deploy/jboss-bean.deployer/META-INF/jboss-service.xml deleted file mode 100644 index aea8aa59c7..0000000000 --- a/jboss/server/adempiere/deploy/jboss-bean.deployer/META-INF/jboss-service.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - .beans - META-INF/jboss-beans.xml - - - diff --git a/jboss/server/adempiere/deploy/jboss-ha-local-jdbc.rar b/jboss/server/adempiere/deploy/jboss-ha-local-jdbc.rar deleted file mode 100644 index cf97ae7509..0000000000 Binary files a/jboss/server/adempiere/deploy/jboss-ha-local-jdbc.rar and /dev/null differ diff --git a/jboss/server/adempiere/deploy/jboss-ha-xa-jdbc.rar b/jboss/server/adempiere/deploy/jboss-ha-xa-jdbc.rar deleted file mode 100644 index 59fcb27259..0000000000 Binary files a/jboss/server/adempiere/deploy/jboss-ha-xa-jdbc.rar and /dev/null differ diff --git a/jboss/server/adempiere/deploy/jboss-local-jdbc.rar b/jboss/server/adempiere/deploy/jboss-local-jdbc.rar deleted file mode 100644 index 810b9a2db5..0000000000 Binary files a/jboss/server/adempiere/deploy/jboss-local-jdbc.rar and /dev/null differ diff --git a/jboss/server/adempiere/deploy/jboss-web.deployer/META-INF/jboss-service.xml b/jboss/server/adempiere/deploy/jboss-web.deployer/META-INF/jboss-service.xml deleted file mode 100644 index b751e6cbfc..0000000000 --- a/jboss/server/adempiere/deploy/jboss-web.deployer/META-INF/jboss-service.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - - - - - - BASIC - org.apache.catalina.authenticator.BasicAuthenticator - - - CLIENT-CERT - org.apache.catalina.authenticator.SSLAuthenticator - - - DIGEST - org.apache.catalina.authenticator.DigestAuthenticator - - - FORM - org.apache.catalina.authenticator.FormAuthenticator - - - NONE - org.apache.catalina.authenticator.NonLoginAuthenticator - - - - - - java:/jaas/other - - - false - - false - - javax.servlet - - true - - - false - - - org.jboss.web.tomcat.service.session.JBossCacheManager - - - - - - - - - - instant - 2000 - - - false - - - 60 - - jboss.web - - - jboss.security:service=JaasSecurityManager - - - - - - jboss:service=TransactionManager - - - jboss.jca:service=CachedConnectionManager - - - - diff --git a/jboss/server/adempiere/deploy/jboss-web.deployer/META-INF/webserver-xmbean.xml b/jboss/server/adempiere/deploy/jboss-web.deployer/META-INF/webserver-xmbean.xml deleted file mode 100644 index 7160053608..0000000000 --- a/jboss/server/adempiere/deploy/jboss-web.deployer/META-INF/webserver-xmbean.xml +++ /dev/null @@ -1,195 +0,0 @@ - - - - - The JBoss Web Deployer responsible for war deployment - - - - - - - org.jboss.web.tomcat.service.JBossWeb - - - - - Authenticators - java.util.Properties - - - - UseJBossWebLoader - boolean - - - - AllowSelfPrivilegedWebApps - boolean - - - - DeleteWorkDirOnContextDestroy - boolean - - - - HttpHeaderForSSOAuth - java.lang.String - - - - SessionCookieForSSOAuth - java.lang.String - - - - SubjectAttributeName - java.lang.String - - - - CacheName - java.lang.String - - - - UnpackWars - boolean - - - - AcceptNonWarDirs - boolean - - - - Config - org.w3c.dom.Element - - - - LenientEjbLink - boolean - - - - UseJK - boolean - - - - MaxUnreplicatedInterval - int - - - - Domain - java.lang.String - - - - FilteredPackages - [Ljava.lang.String; - - - - Java2ClassLoadingCompliance - boolean - - - - DefaultSecurityDomain - java.lang.String - - - - SnapshotMode - java.lang.String - - - - SnapshotInterval - int - - - - ConfigFile - java.lang.String - - - - UseLocalCache - boolean - - - - SessionIdAlphabet - java.lang.String - - - - ContextMBeanCode - java.lang.String - - - - ManagerClass - java.lang.String - - - - DeployedApplications - java.util.Iterator - - - - SecurityManagerService - org.jboss.security.plugins.JaasSecurityManagerServiceMBean - - - - - Allow the override of supported suffixes and relative order - EnhancedSuffixes - [Ljava.lang.String; - - - &deployerAttributes; - &defaultAttributes; - - - - See if a war is deployed - isDeployed - - warUrl - java.lang.String - - boolean - - - - Start all connectors of the Domain - startConnectors - - - - Stop all connectors of the Domain - stopConnectors - - - &deployerOperations; - &defaultOperations; - &interceptable; - - diff --git a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/WEB-INF/web.xml b/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/WEB-INF/web.xml deleted file mode 100644 index b2be5de3ef..0000000000 --- a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/WEB-INF/web.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Welcome to JBoss - - Welcome to JBoss - - - Status Servlet - org.jboss.web.tomcat.service.StatusServlet - - - Status Servlet - /status - - diff --git a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/favicon.ico b/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/favicon.ico deleted file mode 100644 index 66dd49e318..0000000000 Binary files a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/favicon.ico and /dev/null differ diff --git a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/index.html b/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/index.html deleted file mode 100644 index c97dfa1829..0000000000 --- a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Welcome to JBoss™ - - - - - - - - - - - - - -

JBoss Online Resources

- - -

JBoss Management

- - - - - - - - diff --git a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/jboss.css b/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/jboss.css deleted file mode 100644 index f0838a6d94..0000000000 --- a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/jboss.css +++ /dev/null @@ -1,143 +0,0 @@ -body { - margin: 13px 0px 10px 0px; - background-color: #ffffff; - font-size: 10px; - font-family: verdana, arial, "sans-serif"; - color: #606060; - } -img { - border: 0px; - } -#header { - background-color: #003D6E; - background-repeat: no-repeat; - width: 100%; - height: 80px; - } -#header #banner { - float: right; - margin: 8px 5px 0px 0px; - } -#logo { - position: absolute; - top: 2px; - left: 4px; - z-index: 200; -} -#navigation_bar { - background-color: #f0f0f0; - border-bottom: 1px dotted #999999; - height: 20px; - } -#items { - font-size: 12px; - width: 600px; - margin: 5px 5px 5px 170px; - position: relative; - z-index: 300; - } -#items .item { - margin-right: 10px; - } -.side_block { - margin: 15px 5px 10px 5px; - background-color: #fbfbfb; - border: 1px solid #f0f0f0; - } -.side_block h3 { - font-size: 11px; - font-weight: 100; - width: 100%; - margin: 0px 0px 5px 0px; - padding: 4px 4px 4px 10x; - background-color: #f0f0f0; - } -.side_block h4 { - font-size: 11px; - color: #003D6E; - font-weight: bold; - margin: 10px 5px 4px 5px; - } -.side_block p { - margin: 5px 5px 3px 5px; - } -.side_block form { - margin: 0px 0px 0px 5px; - } -.side_block #login { - font-size: 9px; - } -.side_block p img { - text-align: center; - } -#content { - width: 90%; - margin: 10px auto; - } -#left { - float: left; - width: 14%; - } -#right { - float: right; - width: 14%; - } -.content_block { - text-align: justify; - border: 1px solid #999999; - margin: 5px; - width: 31%; - float: left; - } -.content_block p { - margin: 0px 5px 3px 5px; - } -.content_block h3 { - font-size: 11px; - font-weight: bold; - color: #000000; - margin: 0px 0px 5px 0px; - padding: 4px 4px 4px 4x; - text-align: center; - background-color: #f0f0f0; - border-bottom: 1px solid #999999 - } -.content_block h4 { - font-size: 11px; - color: #003D6E; - text-align: left; - font-weight: bold; - margin: 10px 5px 4px 5px; - } -#footer { - clear: both; - border-top: 1px dotted #999999; - } -#credits { - background-color: #f0f0f0; - padding: 5px; - text-align: center; - } -#footer_bar { - height: 20px; - width: 100%; - background-color: #003D6E; - } -.hide { - display: none; - } -.spacer { - clear: both; - } -.spacer hr { - display: none; - } -.center { - text-align: center; - } -#youcandoit { - background-image: url("youcandoit.jpg"); - background-repeat: repeat-x; - height: 165px; - margin: 0px 30px 0px 30px; - } diff --git a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/logo.gif b/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/logo.gif deleted file mode 100644 index d33ddf6660..0000000000 Binary files a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/logo.gif and /dev/null differ diff --git a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/manager/xform.xsl b/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/manager/xform.xsl deleted file mode 100644 index c5ced3ba11..0000000000 --- a/jboss/server/adempiere/deploy/jboss-web.deployer/ROOT.war/manager/xform.xsl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - Tomcat Status - - - -
Tomcat Status
- - - - - -
- - - - - - - - - - - - -
JVM:free: total: max:

-
- - - Connector --
- - - - -
- - - - - - - - - - -
threadInfo maxThreads: minSpareThreads: maxSpareThreads: currentThreadCount: currentThreadsBusy:

-
- - - - - - - - - - - -
requestInfo maxTime: processingTime: requestCount: errorCount: bytesReceived: bytesSent:

-
- - - - - - -
StageTimeB SentB RecvClientVHostRequest

-
- - - - - - - - - - ? - - - -
diff --git a/jboss/server/adempiere/deploy/jboss-web.deployer/conf/web.xml b/jboss/server/adempiere/deploy/jboss-web.deployer/conf/web.xml deleted file mode 100644 index ef15dd2b20..0000000000 --- a/jboss/server/adempiere/deploy/jboss-web.deployer/conf/web.xml +++ /dev/null @@ -1,1248 +0,0 @@ - - - - - - - - - - - - - - - - - - com.sun.faces.injectionProvider - org.jboss.web.jsf.integration.injection.JBossInjectionProvider - - - - - CommonHeadersFilter - org.jboss.web.tomcat.filters.ReplyHeaderFilter - - X-Powered-By - Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0 - - - - - CommonHeadersFilter - /* - - - - - - - - - - org.jboss.web.tomcat.security.SecurityFlushSessionListener - - - - - - org.jboss.web.jsf.integration.config.JBossJSFConfigureListener - - - - - - - com.sun.faces.application.WebappLifecycleListener - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - org.apache.catalina.servlets.DefaultServlet - - debug - 0 - - - listings - false - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jsp - org.apache.jasper.servlet.JspServlet - - fork - false - - - xpoweredBy - false - - - compilerSourceVM - 1.5 - - - - engineOptionsClass - org.jboss.web.tomcat.service.jasper.JspServletOptions - - - - JSF standard tlds - tagLibJar0 - jsf-libs/jsf-impl.jar - - - JSTL standard tlds - tagLibJar1 - jstl.jar - - - 3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - default - / - - - - - - - - jsp - *.jsp - - - - jsp - *.jspx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 30 - - - - - - - - - - - - abs - audio/x-mpeg - - - ai - application/postscript - - - aif - audio/x-aiff - - - aifc - audio/x-aiff - - - aiff - audio/x-aiff - - - aim - application/x-aim - - - art - image/x-jg - - - asf - video/x-ms-asf - - - asx - video/x-ms-asf - - - au - audio/basic - - - avi - video/x-msvideo - - - avx - video/x-rad-screenplay - - - bcpio - application/x-bcpio - - - bin - application/octet-stream - - - bmp - image/bmp - - - body - text/html - - - cdf - application/x-cdf - - - cer - application/x-x509-ca-cert - - - class - application/java - - - cpio - application/x-cpio - - - csh - application/x-csh - - - css - text/css - - - dib - image/bmp - - - doc - application/msword - - - dtd - application/xml-dtd - - - dv - video/x-dv - - - dvi - application/x-dvi - - - eps - application/postscript - - - etx - text/x-setext - - - exe - application/octet-stream - - - gif - image/gif - - - gtar - application/x-gtar - - - gz - application/x-gzip - - - hdf - application/x-hdf - - - hqx - application/mac-binhex40 - - - htc - text/x-component - - - htm - text/html - - - html - text/html - - - hqx - application/mac-binhex40 - - - ief - image/ief - - - jad - text/vnd.sun.j2me.app-descriptor - - - jar - application/java-archive - - - java - text/plain - - - jnlp - application/x-java-jnlp-file - - - jpe - image/jpeg - - - jpeg - image/jpeg - - - jpg - image/jpeg - - - js - text/javascript - - - jsf - text/plain - - - jspf - text/plain - - - kar - audio/x-midi - - - latex - application/x-latex - - - m3u - audio/x-mpegurl - - - mac - image/x-macpaint - - - man - application/x-troff-man - - - mathml - application/mathml+xml - - - me - application/x-troff-me - - - mid - audio/x-midi - - - midi - audio/x-midi - - - mif - application/x-mif - - - mov - video/quicktime - - - movie - video/x-sgi-movie - - - mp1 - audio/x-mpeg - - - mp2 - audio/x-mpeg - - - mp3 - audio/x-mpeg - - - mpa - audio/x-mpeg - - - mpe - video/mpeg - - - mpeg - video/mpeg - - - mpega - audio/x-mpeg - - - mpg - video/mpeg - - - mpv2 - video/mpeg2 - - - ms - application/x-wais-source - - - nc - application/x-netcdf - - - oda - application/oda - - - - odb - application/vnd.oasis.opendocument.database - - - - odc - application/vnd.oasis.opendocument.chart - - - - odf - application/vnd.oasis.opendocument.formula - - - - odg - application/vnd.oasis.opendocument.graphics - - - - odi - application/vnd.oasis.opendocument.image - - - - odm - application/vnd.oasis.opendocument.text-master - - - - odp - application/vnd.oasis.opendocument.presentation - - - - ods - application/vnd.oasis.opendocument.spreadsheet - - - - odt - application/vnd.oasis.opendocument.text - - - ogg - application/ogg - - - - otg - application/vnd.oasis.opendocument.graphics-template - - - - oth - application/vnd.oasis.opendocument.text-web - - - - otp - application/vnd.oasis.opendocument.presentation-template - - - - ots - application/vnd.oasis.opendocument.spreadsheet-template - - - - ott - application/vnd.oasis.opendocument.text-template - - - pbm - image/x-portable-bitmap - - - pct - image/pict - - - pdf - application/pdf - - - pgm - image/x-portable-graymap - - - pic - image/pict - - - pict - image/pict - - - pls - audio/x-scpls - - - png - image/png - - - pnm - image/x-portable-anymap - - - pnt - image/x-macpaint - - - ppm - image/x-portable-pixmap - - - ppt - application/powerpoint - - - ps - application/postscript - - - psd - image/x-photoshop - - - qt - video/quicktime - - - qti - image/x-quicktime - - - qtif - image/x-quicktime - - - ras - image/x-cmu-raster - - - rdf - application/rdf+xml - - - rgb - image/x-rgb - - - rm - application/vnd.rn-realmedia - - - roff - application/x-troff - - - rtf - application/rtf - - - rtx - text/richtext - - - sh - application/x-sh - - - shar - application/x-shar - - - - smf - audio/x-midi - - - sit - application/x-stuffit - - - snd - audio/basic - - - src - application/x-wais-source - - - sv4cpio - application/x-sv4cpio - - - sv4crc - application/x-sv4crc - - - swf - application/x-shockwave-flash - - - t - application/x-troff - - - tar - application/x-tar - - - tcl - application/x-tcl - - - tex - application/x-tex - - - texi - application/x-texinfo - - - texinfo - application/x-texinfo - - - tif - image/tiff - - - tiff - image/tiff - - - tr - application/x-troff - - - tsv - text/tab-separated-values - - - txt - text/plain - - - ulw - audio/basic - - - ustar - application/x-ustar - - - vxml - application/voicexml+xml - - - xbm - image/x-xbitmap - - - xht - application/xhtml+xml - - - xhtml - application/xhtml+xml - - - xml - application/xml - - - xpm - image/x-xpixmap - - - xsl - application/xml - - - xslt - application/xslt+xml - - - xul - application/vnd.mozilla.xul+xml - - - xwd - image/x-xwindowdump - - - wav - audio/x-wav - - - svg - image/svg+xml - - - svgz - image/svg+xml - - - vsd - application/x-visio - - - - wbmp - image/vnd.wap.wbmp - - - - wml - text/vnd.wap.wml - - - - wmlc - application/vnd.wap.wmlc - - - - wmls - text/vnd.wap.wmlscript - - - - wmlscriptc - application/vnd.wap.wmlscriptc - - - wrl - x-world/x-vrml - - - Z - application/x-compress - - - z - application/x-compress - - - zip - application/zip - - - xls - application/vnd.ms-excel - - - doc - application/vnd.ms-word - - - ppt - application/vnd.ms-powerpoint - - - - - - - - - - - - - - - - index.html - index.htm - index.jsp - - - diff --git a/jboss/server/adempiere/deploy/jboss-web.deployer/context.xml b/jboss/server/adempiere/deploy/jboss-web.deployer/context.xml deleted file mode 100644 index cb1d2b02ee..0000000000 --- a/jboss/server/adempiere/deploy/jboss-web.deployer/context.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - org.jboss.web.tomcat.security.RunAsListener - - diff --git a/jboss/server/adempiere/deploy/jboss-web.deployer/serverTemplate.xml b/jboss/server/adempiere/deploy/jboss-web.deployer/serverTemplate.xml deleted file mode 100644 index 2f85d71fa4..0000000000 --- a/jboss/server/adempiere/deploy/jboss-web.deployer/serverTemplate.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jboss/server/adempiere/deploy/jboss-xa-jdbc.rar b/jboss/server/adempiere/deploy/jboss-xa-jdbc.rar deleted file mode 100644 index c5bd01d947..0000000000 Binary files a/jboss/server/adempiere/deploy/jboss-xa-jdbc.rar and /dev/null differ diff --git a/jboss/server/adempiere/deploy/jbossjca-service.xml b/jboss/server/adempiere/deploy/jbossjca-service.xml deleted file mode 100644 index b9f53b2806..0000000000 --- a/jboss/server/adempiere/deploy/jbossjca-service.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - WorkManager - - 1024 - - 100 - - 60000 - - - - jboss.jca:service=WorkManagerThreadPool - jboss:service=TransactionManager - - - - jboss.jca:service=WorkManager - jboss:service=TransactionManager - - - - -ds.xml - 300:-ds.xml - stylesheets/ConnectionFactoryTemplate.xsl - false - - - - - jboss:service=TransactionManager - - - true - - - - diff --git a/jboss/server/adempiere/deploy/jmx-invoker-service.xml b/jboss/server/adempiere/deploy/jmx-invoker-service.xml deleted file mode 100644 index e17d05452f..0000000000 --- a/jboss/server/adempiere/deploy/jmx-invoker-service.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - jboss:service=invoker,type=jrmp - - jboss.jmx:type=adaptor,name=Invoker - - jmx/invoker/RMIAdaptor - - org.jboss.jmx.adaptor.rmi.RMIAdaptor, - org.jboss.jmx.adaptor.rmi.RMIAdaptorExt - - - - org.jboss.proxy.ClientMethodInterceptor - org.jboss.proxy.SecurityInterceptor - org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor - org.jboss.invocation.InvokerInterceptor - - - jboss:service=Naming - - - - - jboss.jmx:type=adaptor,name=Invoker,protocol=jrmp,service=proxyFactory - - - - - jmx/rmi/RMIAdaptor - jmx/invoker/RMIAdaptor - jboss:service=Naming - - - - - - The JMX Detached Invoker Service - org.jboss.jmx.connector.invoker.InvokerAdaptorService - - - - The class name of the MBean - Name - java.lang.String - - - The status of the MBean - State - int - - - The status of the MBean in text form - StateString - java.lang.String - - - The interfaces the invoker proxy supports - ExportedInterfaces - [Ljava.lang.Class; - - - Map(Long hash, Method) of the proxy interface methods - MethodMap - java.util.Map - - - - The start lifecycle operation - start - - - The stop lifecycle operation - stop - - - The detyped lifecycle operation (for internal use only) - jbossInternalLifecycle - - The lifecycle operation - method - java.lang.String - - void - - - - The detached invoker entry point - invoke - - The method invocation context - invocation - org.jboss.invocation.Invocation - - java.lang.Object - - - - - - - - - - - org.jboss.jmx.adaptor.rmi.RMIAdaptor, - org.jboss.jmx.adaptor.rmi.RMIAdaptorExt - - - - diff --git a/jboss/server/adempiere/deploy/jsr88-service.xml b/jboss/server/adempiere/deploy/jsr88-service.xml deleted file mode 100644 index 69261f5dbc..0000000000 --- a/jboss/server/adempiere/deploy/jsr88-service.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - jboss.j2ee:service=EARDeployer - jboss.ejb:service=EJBDeployer - jboss.jca:service=RARDeployer - jboss.web:service=WebServer - jboss.j2ee:service=ClientDeployer - ${jboss.server.temp.dir}/jsr88 - jboss.system:service=MainDeployer - - false - - false - - diff --git a/jboss/server/adempiere/deploy/mail-ra.rar b/jboss/server/adempiere/deploy/mail-ra.rar deleted file mode 100644 index bbfdd6fdfd..0000000000 Binary files a/jboss/server/adempiere/deploy/mail-ra.rar and /dev/null differ diff --git a/jboss/server/adempiere/deploy/monitoring-service.xml b/jboss/server/adempiere/deploy/monitoring-service.xml deleted file mode 100644 index f764a1ba75..0000000000 --- a/jboss/server/adempiere/deploy/monitoring-service.xml +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - Console Alert - - - - - - - - - - - - - - diff --git a/jboss/server/adempiere/deploy/properties-service.xml b/jboss/server/adempiere/deploy/properties-service.xml deleted file mode 100644 index 2566b018e8..0000000000 --- a/jboss/server/adempiere/deploy/properties-service.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jboss/server/adempiere/deploy/schedule-manager-service.xml b/jboss/server/adempiere/deploy/schedule-manager-service.xml deleted file mode 100644 index 2b1570b6ff..0000000000 --- a/jboss/server/adempiere/deploy/schedule-manager-service.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/jboss/server/adempiere/deploy/scheduler-service.xml b/jboss/server/adempiere/deploy/scheduler-service.xml deleted file mode 100644 index e2350b1a80..0000000000 --- a/jboss/server/adempiere/deploy/scheduler-service.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/jboss/server/adempiere/deploy/sqlexception-service.xml b/jboss/server/adempiere/deploy/sqlexception-service.xml deleted file mode 100644 index ab78d85f03..0000000000 --- a/jboss/server/adempiere/deploy/sqlexception-service.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/jboss/server/adempiere/deploy/uuid-key-generator.sar/META-INF/jboss-service.xml b/jboss/server/adempiere/deploy/uuid-key-generator.sar/META-INF/jboss-service.xml deleted file mode 100644 index 5407275ab9..0000000000 --- a/jboss/server/adempiere/deploy/uuid-key-generator.sar/META-INF/jboss-service.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - jboss:service=TransactionManager - - - - - jboss.jca:service=DataSourceBinding,name=DefaultDS - - - HILOSEQUENCES - - - SEQUENCENAME - - - HIGHVALUES - - - - create table HILOSEQUENCES (SEQUENCENAME varchar(50) not null, HIGHVALUES integer not null, constraint hilo_pk primary key (SEQUENCENAME)) - - - - - - true - - - false - - - - - HiLoKeyGeneratorFactory - - - general - - - 10 - - - - diff --git a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/hilo/HiLoKeyGenerator.class b/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/hilo/HiLoKeyGenerator.class deleted file mode 100755 index a96f1f33a6..0000000000 Binary files a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/hilo/HiLoKeyGenerator.class and /dev/null differ diff --git a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/hilo/HiLoKeyGeneratorFactory.class b/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/hilo/HiLoKeyGeneratorFactory.class deleted file mode 100755 index fbf7981455..0000000000 Binary files a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/hilo/HiLoKeyGeneratorFactory.class and /dev/null differ diff --git a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/hilo/HiLoKeyGeneratorFactoryMBean.class b/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/hilo/HiLoKeyGeneratorFactoryMBean.class deleted file mode 100755 index 2aee6a228a..0000000000 Binary files a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/hilo/HiLoKeyGeneratorFactoryMBean.class and /dev/null differ diff --git a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGenerator.class b/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGenerator.class deleted file mode 100755 index e35beda348..0000000000 Binary files a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGenerator.class and /dev/null differ diff --git a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGeneratorFactory.class b/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGeneratorFactory.class deleted file mode 100755 index 08ec6e8169..0000000000 Binary files a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGeneratorFactory.class and /dev/null differ diff --git a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGeneratorFactoryService.class b/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGeneratorFactoryService.class deleted file mode 100755 index b4776042d1..0000000000 Binary files a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGeneratorFactoryService.class and /dev/null differ diff --git a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGeneratorFactoryServiceMBean.class b/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGeneratorFactoryServiceMBean.class deleted file mode 100755 index 3186be289b..0000000000 Binary files a/jboss/server/adempiere/deploy/uuid-key-generator.sar/org/jboss/ejb/plugins/keygenerator/uuid/UUIDKeyGeneratorFactoryServiceMBean.class and /dev/null differ diff --git a/jbossfacet/.classpath b/jbossfacet/.classpath deleted file mode 100644 index 751c8f2e50..0000000000 --- a/jbossfacet/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/jbossfacet/.project b/jbossfacet/.project deleted file mode 100644 index 1a5341a63f..0000000000 --- a/jbossfacet/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - jbossfacet - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/jbossfacet/META-INF/MANIFEST.MF b/jbossfacet/META-INF/MANIFEST.MF deleted file mode 100644 index 718025aa4d..0000000000 --- a/jbossfacet/META-INF/MANIFEST.MF +++ /dev/null @@ -1,11 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: jbossfacet -Bundle-SymbolicName: org.adempiere.jbossfacet;singleton:=true -Bundle-Version: 0.0.0.1 -Bundle-ClassPath: jbossfacet.jar -Export-Package: org.adempiere.as.jboss -Require-Bundle: org.adempiere.jboss;bundle-version="0.0.0" -Import-Package: org.adempiere.as, - org.compiere.util - diff --git a/jbossfacet/build.properties b/jbossfacet/build.properties deleted file mode 100644 index 8d2492d81d..0000000000 --- a/jbossfacet/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.jbossfacet.jar = src/,\ - bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - jbossfacet.jar -output.jbossfacet.jar = bin/ diff --git a/jbossfacet/build.xml b/jbossfacet/build.xml deleted file mode 100644 index 99afc190bb..0000000000 --- a/jbossfacet/build.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/jbossfacet/plugin.xml b/jbossfacet/plugin.xml deleted file mode 100644 index b143c32bd0..0000000000 --- a/jbossfacet/plugin.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/jbossfacet/src/org/adempiere/as/jboss/AdempiereLoginModule.java b/jbossfacet/src/org/adempiere/as/jboss/AdempiereLoginModule.java deleted file mode 100644 index 652c1d58c4..0000000000 --- a/jbossfacet/src/org/adempiere/as/jboss/AdempiereLoginModule.java +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 2007 Adempiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * - * Copyright (C) 2007 Low Heng Sin hengsin@avantz.com - * _____________________________________________ - *****************************************************************************/ -package org.adempiere.as.jboss; - -import java.io.IOException; -import java.util.Map; - -import javax.security.auth.Subject; -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; -import javax.security.auth.login.LoginException; -import javax.security.auth.spi.LoginModule; - -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Login; -import org.jboss.security.SimpleGroup; -import org.jboss.security.SimplePrincipal; - -/** - * JAAS login module for adempiere - * @author Low Heng Sin - */ -public class AdempiereLoginModule implements LoginModule { - - private String unauthenticatedIdentity; - private CallbackHandler handler; - private Subject subject; - private KeyNamePair[] roles; - private String name; - - /** - * abort authentication process, reset state - */ - public boolean abort() throws LoginException { - roles = null; - name = null; - return true; - } - - /** - * commit/complete the authentication project, add identity and roles to subject. - */ - public boolean commit() throws LoginException { - //note that jboss require all user role to be put under the group Roles - if (roles == null || roles.length == 0) - { - //not authenticated or authentication failed - subject.getPrincipals().add(new SimplePrincipal(unauthenticatedIdentity)); - SimpleGroup roleGroup = new SimpleGroup("Roles"); - subject.getPrincipals().add(roleGroup); - } - else - { - subject.getPrincipals().add(new SimplePrincipal(name)); - SimpleGroup roleGroup = new SimpleGroup("Roles"); - //fixed role use in ejb deployment descriptor - roleGroup.addMember(new SimplePrincipal("adempiereUsers")); - //dynamic role loaded from db, can be use with isCallerInRole for - //additional security check - for(int i = 0; i < roles.length; i++) - { - roleGroup.addMember(new SimplePrincipal(roles[i].getName())); - } - subject.getPrincipals().add(roleGroup); - } - return true; - } - - /** - * Initialize the login module, get options from configuration - */ - public void initialize(Subject subject, CallbackHandler callbackHandler, - Map sharedState, Map options) { - unauthenticatedIdentity = (String)options.get("unauthenticatedIdentity"); - handler = callbackHandler; - this.subject = subject; - } - - /** - * Perform login process - */ - public boolean login() throws LoginException { - //get username and password from standard callback - Callback callbacks[] = new Callback[]{new NameCallback("Login:"), new PasswordCallback("Password:", false)}; - try { - handler.handle(callbacks); - } catch (IOException e) { - } catch (UnsupportedCallbackException e) { - } - name = ((NameCallback)callbacks[0]).getName(); - char[] pass = ((PasswordCallback)callbacks[1]).getPassword(); - String passwd = pass != null ? new String(pass) : null; - - //do authentication - if (name != null && passwd != null) - { - //perform db authentication - Login login = new Login(Env.getCtx()); - roles = login.getRoles(name, passwd); - } - else - { - //no username or password - roles = null; - } - - return true; - } - - /** - * logout, reset state - */ - public boolean logout() throws LoginException { - roles = null; - name = null; - - return true; - } - -} diff --git a/jbossfacet/src/org/adempiere/as/jboss/JBoss.java b/jbossfacet/src/org/adempiere/as/jboss/JBoss.java deleted file mode 100644 index 524fdd59f2..0000000000 --- a/jbossfacet/src/org/adempiere/as/jboss/JBoss.java +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2008 Low Heng Sin * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - *****************************************************************************/ -package org.adempiere.as.jboss; - -import java.util.Hashtable; - -import javax.naming.Context; - -import org.adempiere.as.IApplicationServer; - -/** - * - * @author Low Heng Sin - * - */ -public class JBoss implements IApplicationServer { - - //ensure client library is installed - static { - try { - Class.forName("org.jboss.security.jndi.JndiLoginInitialContextFactory"); - } catch (ClassNotFoundException e) { - throw new IllegalStateException(e); - } - } - - /** - * @see IApplicationServer#getInitialContextEnvironment(String, int, String, String) - */ - public Hashtable getInitialContextEnvironment( - String AppsHost, int AppsPort, String principal, String credential) { - Hashtable env = new Hashtable(); - String connect = AppsHost; - if (AppsHost.indexOf("://") == -1) - connect = "jnp://" + AppsHost + ":" + AppsPort; - env.put (Context.PROVIDER_URL, connect); - env.put (Context.URL_PKG_PREFIXES, "org.jboss.naming.client"); - // HTTP - default timeout 0 - env.put (org.jnp.interfaces.TimedSocketFactory.JNP_TIMEOUT, "5000"); // timeout in ms - env.put (org.jnp.interfaces.TimedSocketFactory.JNP_SO_TIMEOUT, "5000"); - // JNP - default timeout 5 sec - env.put(org.jnp.interfaces.NamingContext.JNP_DISCOVERY_TIMEOUT, "5000"); - - if (principal != null && credential != null) - { - env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.security.jndi.JndiLoginInitialContextFactory"); - env.put(Context.SECURITY_PRINCIPAL, principal); - env.put(Context.SECURITY_CREDENTIALS, credential); - } - else - { - env.put (Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); - } - - return env; - } - - public int getDefaultNamingServicePort() { - return 1099; - } -} diff --git a/posterita/.classpath b/posterita/.classpath deleted file mode 100644 index b8bfb8eeed..0000000000 --- a/posterita/.classpath +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/.project b/posterita/.project deleted file mode 100644 index 74ab5b9df6..0000000000 --- a/posterita/.project +++ /dev/null @@ -1,18 +0,0 @@ - - - posterita - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - com.sysdeo.eclipse.tomcat.tomcatnature - - diff --git a/posterita/.settings/org.eclipse.jdt.core.prefs b/posterita/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 850ee4c73b..0000000000 --- a/posterita/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,328 +0,0 @@ -#Mon Apr 14 16:31:16 MUT 2008 (Ashley G Ramdass) -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=ignore -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=true -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=next_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=80 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/posterita/.settings/org.eclipse.jdt.ui.prefs b/posterita/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 5a515244bf..0000000000 --- a/posterita/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,10 +0,0 @@ -#Tue May 27 10:52:59 MUT 2008 (Ashley G Ramdass) -eclipse.preferences.version=1 -formatter_profile=_Posterita -formatter_settings_version=11 -org.eclipse.jdt.ui.exception.name=e -org.eclipse.jdt.ui.gettersetter.use.is=true -org.eclipse.jdt.ui.javadoc=false -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/posterita/.tomcatplugin b/posterita/.tomcatplugin deleted file mode 100644 index 2b55a22921..0000000000 --- a/posterita/.tomcatplugin +++ /dev/null @@ -1,11 +0,0 @@ - - - / - false - true - true - true - - - /posterita - diff --git a/posterita/commons/BuildPatch/Adempiere/jboss/bin/run.conf b/posterita/commons/BuildPatch/Adempiere/jboss/bin/run.conf deleted file mode 100644 index 518084d856..0000000000 --- a/posterita/commons/BuildPatch/Adempiere/jboss/bin/run.conf +++ /dev/null @@ -1,53 +0,0 @@ -## -*- shell-script -*- ###################################################### -## ## -## JBoss Bootstrap Script Configuration ## -## ## -############################################################################## - -### $Id: run.conf,v 1.3 2005/09/04 17:52:33 jjanke Exp $ - -# -# This file is optional; it may be removed if not needed. -# - -# -# Specify the maximum file descriptor limit, use "max" or "maximum" to use -# the default, as queried by the system. -# -# Defaults to "maximum" -# -#MAX_FD="maximum" - -# -# Specify the profiler configuration file to load. -# -# Default is to not load profiler configuration file. -# -#PROFILER="" - -# -# Specify the location of the Java home directory. If set then $JAVA will -# be defined to $JAVA_HOME/bin/java, else $JAVA will be "java". -# -#JAVA_HOME="/opt/java/jdk" - -# -# Specify the exact Java VM executable to use. -# -#JAVA="" - -# -# Specify options to pass to the Java VM. -# -if [ "x$JAVA_OPTS" = "x" ]; then - JAVA_OPTS="-server -Xms128m -Xmx128m" -fi - -# Sample JPDA settings for remote socket debuging -#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y" - -# Sample JPDA settings for shared memory debugging -#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss" - -# AspectJ integration -JAVA_OPTS="$JAVA_OPTS -javaagent:$ADEMPIERE_HOME/lib/aspectjweaver.jar" diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/build.xml b/posterita/commons/Migration/1.0-1.5 (AD331b)/build.xml deleted file mode 100644 index c0b65f816f..0000000000 --- a/posterita/commons/Migration/1.0-1.5 (AD331b)/build.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - File ${file.name} status ${sqlplus.result} - - - - - - diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/001_ad_changes.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/001_ad_changes.sql deleted file mode 100644 index 6336c6c293..0000000000 --- a/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/001_ad_changes.sql +++ /dev/null @@ -1,32 +0,0 @@ -INSERT INTO ad_element -(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, -columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) -VALUES(52027, 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 'isPresentForProduct', -'U', 'isPresentForProduct', 'Present for Product', NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO ad_column -(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, - description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, - ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, -isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, -ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) - VALUES( 52071, 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, -'isPresentForProduct', 'Price List appears in Product Screen', '', 0, 'U', 'isPresentForProduct', - 255, 20, NULL, NULL, 1, NULL, 'N', 'N', 'N', 'Y', NULL, -'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', - 52027, NULL, 'N', 'N', NULL, NULL); - -INSERT INTO ad_column -(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, - name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, -ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, -isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, -valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, -isalwaysupdateable, columnsql, mandatorylogic) - VALUES(52072 , -0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, 'Mandatory', 'Data entry is required in this column', -'The field must have a value for the record to be saved to the database.', 0, 'U', 'IsMandatory', -255, 20, NULL, NULL, 1, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', - 392, NULL, 'N', 'N', NULL, NULL); - - diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/002_ad_message.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/002_ad_message.sql deleted file mode 100644 index 73d279f394..0000000000 --- a/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/002_ad_message.sql +++ /dev/null @@ -1,65 +0,0 @@ -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52441 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.price.list', 'Price List', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52442 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'pmenu.help', 'Help', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52443 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'list.price', 'List Price', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52444 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'standard.price', 'Standard Price', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52445 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'limit.price', 'Limit Price', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52446 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'tax.incl', 'Tax Incl', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52447 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'tax.excl', 'Tax Excl', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52448 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'type.of.price.list', 'Type of Price List', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52449 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'purchase', 'Purchase', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52450 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'sales', 'Sales', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52451 , 0, 0, 'Y', TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_DATE('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'isPresentForProduct', 'Present for Product', ' ', 'I', 'D'); diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/003_m_pricelist.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/003_m_pricelist.sql deleted file mode 100644 index 753cec73ea..0000000000 --- a/posterita/commons/Migration/1.0-1.5 (AD331b)/oracle/003_m_pricelist.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE m_pricelist ADD ismandatory char(1) DEFAULT 'N'; - -ALTER TABLE m_pricelist ADD ispresentforproduct char(1) DEFAULT 'N'; - - diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/001_ad_changes.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/001_ad_changes.sql deleted file mode 100644 index ea9358ee4d..0000000000 --- a/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/001_ad_changes.sql +++ /dev/null @@ -1,32 +0,0 @@ -INSERT INTO ad_element -(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, -columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) -VALUES(52027, 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 'isPresentForProduct', -'U', 'isPresentForProduct', 'Present for Product', NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO ad_column -(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, - description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, - ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, -isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, -ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) - VALUES( 52071, 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, -'isPresentForProduct', 'Price List appears in Product Screen', '', 0, 'U', 'isPresentForProduct', - 255, 20, NULL, NULL, 1, NULL, 'N', 'N', 'N', 'Y', NULL, -'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', - 52027, NULL, 'N', 'N', NULL, NULL); - -INSERT INTO ad_column -(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, - name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, -ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, -isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, -valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, -isalwaysupdateable, columnsql, mandatorylogic) - VALUES(52072 , -0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, 'Mandatory', 'Data entry is required in this column', -'The field must have a value for the record to be saved to the database.', 0, 'U', 'IsMandatory', -255, 20, NULL, NULL, 1, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', - 392, NULL, 'N', 'N', NULL, NULL); - - diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/002_ad_message.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/002_ad_message.sql deleted file mode 100644 index baf54a2aa5..0000000000 --- a/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/002_ad_message.sql +++ /dev/null @@ -1,65 +0,0 @@ -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52441 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.price.list', 'Price List', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52442 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'pmenu.help', 'Help', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52443 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'list.price', 'List Price', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52444 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'standard.price', 'Standard Price', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52445 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'limit.price', 'Limit Price', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52446 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'tax.incl', 'Tax Incl', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52447 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'tax.excl', 'Tax Excl', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52448 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'type.of.price.list', 'Type of Price List', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52449 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'purchase', 'Purchase', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52450 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'sales', 'Sales', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52451 , 0, 0, 'Y', TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-03-28 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'isPresentForProduct', 'Present for Product', ' ', 'I', 'D'); diff --git a/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/003_m_pricelist.sql b/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/003_m_pricelist.sql deleted file mode 100644 index fe0893a52e..0000000000 --- a/posterita/commons/Migration/1.0-1.5 (AD331b)/postgresql/003_m_pricelist.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE m_pricelist ADD COLUMN ismandatory char(1) DEFAULT 'N'; - -ALTER TABLE m_pricelist ADD COLUMN ispresentforproduct char(1) DEFAULT 'N'; - - diff --git a/posterita/commons/Migration/1.6(AD340)/build.xml b/posterita/commons/Migration/1.6(AD340)/build.xml deleted file mode 100644 index 219ea01d3b..0000000000 --- a/posterita/commons/Migration/1.6(AD340)/build.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - File ${file.name} status ${sqlplus.result} - - - - - - diff --git a/posterita/commons/Migration/1.6(AD340)/oracle/001_ad_Changes for C_Currency.sql b/posterita/commons/Migration/1.6(AD340)/oracle/001_ad_Changes for C_Currency.sql deleted file mode 100644 index 1d921d56e4..0000000000 --- a/posterita/commons/Migration/1.6(AD340)/oracle/001_ad_Changes for C_Currency.sql +++ /dev/null @@ -1,14 +0,0 @@ -INSERT INTO AD_Element -(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, -columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) -VALUES(52073, 0, 0, 'Y', TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'RoundOffFactor', 'U', 'Round Off Factor', 'Round Off Factor', 'Used to Round Off Payment Amount', NULL, NULL, NULL, NULL, NULL); - -INSERT INTO ad_column -(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, -description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, -ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, -isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, -ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) -VALUES(52074, 0, 0, 'Y', TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, 'RoundOffFactor' , 'Used to Round Off Payment Amount', NULL, 0, 'U', 'RoundOffFactor', 141, 22, NULL, NULL, 14, 1, 'N', 'N', 'Y', 'Y', NULL, -'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52073, NULL, 'N', 'N', NULL, NULL); diff --git a/posterita/commons/Migration/1.6(AD340)/oracle/002_ad_message.sql b/posterita/commons/Migration/1.6(AD340)/oracle/002_ad_message.sql deleted file mode 100644 index a0c8df625c..0000000000 --- a/posterita/commons/Migration/1.6(AD340)/oracle/002_ad_message.sql +++ /dev/null @@ -1,11 +0,0 @@ -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52467 , 0, 0, 'Y', TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.currency', 'Currency', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52468 , 0, 0, 'Y', TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.delete.price.on.pricelist', 'Delete Price On Price List', ' ', 'I', 'D'); diff --git a/posterita/commons/Migration/1.6(AD340)/oracle/003_C_Currency.sql b/posterita/commons/Migration/1.6(AD340)/oracle/003_C_Currency.sql deleted file mode 100644 index 8ac2e6a7fd..0000000000 --- a/posterita/commons/Migration/1.6(AD340)/oracle/003_C_Currency.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE C_Currency ADD roundOffFactor NUMBER; - diff --git a/posterita/commons/Migration/1.6(AD340)/postgresql/001_ad_Changes for C_Currency.sql b/posterita/commons/Migration/1.6(AD340)/postgresql/001_ad_Changes for C_Currency.sql deleted file mode 100644 index 1d921d56e4..0000000000 --- a/posterita/commons/Migration/1.6(AD340)/postgresql/001_ad_Changes for C_Currency.sql +++ /dev/null @@ -1,14 +0,0 @@ -INSERT INTO AD_Element -(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, -columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) -VALUES(52073, 0, 0, 'Y', TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, -'RoundOffFactor', 'U', 'Round Off Factor', 'Round Off Factor', 'Used to Round Off Payment Amount', NULL, NULL, NULL, NULL, NULL); - -INSERT INTO ad_column -(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, -description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, -ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, -isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, -ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) -VALUES(52074, 0, 0, 'Y', TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2008-04-17 16:00:00','YYYY-MM-DD HH24:MI:SS'), 100, 100, 'RoundOffFactor' , 'Used to Round Off Payment Amount', NULL, 0, 'U', 'RoundOffFactor', 141, 22, NULL, NULL, 14, 1, 'N', 'N', 'Y', 'Y', NULL, -'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52073, NULL, 'N', 'N', NULL, NULL); diff --git a/posterita/commons/Migration/1.6(AD340)/postgresql/002_ad_message.sql b/posterita/commons/Migration/1.6(AD340)/postgresql/002_ad_message.sql deleted file mode 100644 index 9ca9c4eee5..0000000000 --- a/posterita/commons/Migration/1.6(AD340)/postgresql/002_ad_message.sql +++ /dev/null @@ -1,18 +0,0 @@ -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52467 , 0, 0, 'Y', TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.currency', 'Currency', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52468 , 0, 0, 'Y', TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.delete.price.on.pricelist', 'Delete Price On Price List', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52469 , 0, 0, 'Y', TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-04-25 14:30:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.organisation', 'Organisation', ' ', 'I', 'D'); - diff --git a/posterita/commons/Migration/1.6(AD340)/postgresql/003_C_Currency.sql b/posterita/commons/Migration/1.6(AD340)/postgresql/003_C_Currency.sql deleted file mode 100644 index 1743c49096..0000000000 --- a/posterita/commons/Migration/1.6(AD340)/postgresql/003_C_Currency.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE C_Currency ADD COLUMN roundOffFactor NUMERIC; - diff --git a/posterita/commons/Migration/1.7.0/build.xml b/posterita/commons/Migration/1.7.0/build.xml deleted file mode 100644 index 2a97b78db4..0000000000 --- a/posterita/commons/Migration/1.7.0/build.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - File ${file.name} status ${sqlplus.result} - - - - - - diff --git a/posterita/commons/Migration/1.7.0/oracle/001_MixedPayment.sql b/posterita/commons/Migration/1.7.0/oracle/001_MixedPayment.sql deleted file mode 100644 index 266516c722..0000000000 --- a/posterita/commons/Migration/1.7.0/oracle/001_MixedPayment.sql +++ /dev/null @@ -1,24 +0,0 @@ --- May 22, 2008 10:57:07 AM GMT+04:00 --- Create Mixed in the payment rules list -INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,195,52000,TO_DATE('2008-05-22 10:55:30','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Mixed',TO_DATE('2008-05-22 10:55:30','YYYY-MM-DD HH24:MI:SS'),100,'M') -; - --- May 22, 2008 10:57:11 AM GMT+04:00 --- Update the translation -INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52000 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) -; - --- May 22, 2008 11:28:12 AM GMT+04:00 --- Creates new Validation rule so that rich client does not get Mixed rule -INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,52002,'AD_Ref_List.Value <> ''M''',TO_DATE('2008-05-22 11:28:12','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','All_Payment Rule - No mixed','S',TO_DATE('2008-05-22 11:28:12','YYYY-MM-DD HH24:MI:SS'),100) -; - --- May 22, 2008 11:30:02 AM GMT+04:00 --- Updates all columns in AD where the payment rule list is used with the validation created earlier -UPDATE AD_Column SET AD_Val_Rule_ID=52002 WHERE AD_Reference_Value_ID=195 AND AD_Val_Rule_ID IS NULL -; - --- May 22, 2008 11:31:15 AM GMT+04:00 --- Updates all columns in AD where an existing validation rule exist and set it to ignore the Mixed rule -UPDATE AD_Val_Rule SET Code='AD_Ref_List.Value <> ''B'' AND AD_Ref_List.Value <> ''M''' WHERE AD_Val_Rule_ID=161 -; diff --git a/posterita/commons/Migration/1.7.0/oracle/002_Terminals_newTableStructure.sql b/posterita/commons/Migration/1.7.0/oracle/002_Terminals_newTableStructure.sql deleted file mode 100644 index 0c4aaf8e63..0000000000 --- a/posterita/commons/Migration/1.7.0/oracle/002_Terminals_newTableStructure.sql +++ /dev/null @@ -1,629 +0,0 @@ --- Jun 2, 2008 9:19:48 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Table (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Table_ID,CopyColumnsFromTable,Created,CreatedBy,EntityType,ImportTable,IsActive,IsChangeLog,IsDeleteable,IsHighVolume,IsSecurityEnabled,IsView,LoadSeq,Name,ReplicationType,TableName,Updated,UpdatedBy) VALUES ('1',0,0,52004,'N',TO_DATE('2008-06-02 21:19:47','YYYY-MM-DD HH24:MI:SS'),100,'A','N','Y','N','Y','N','N','N',0,'POS Terminal','L','U_POSTerminal',TO_DATE('2008-06-02 21:19:47','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:19:48 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=52004 AND EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Table_ID!=t.AD_Table_ID) -; - --- Jun 2, 2008 9:21:23 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52077,102,0,19,52004,129,'AD_Client_ID',TO_DATE('2008-06-02 21:21:22','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Client_ID@','Client/Tenant for this installation.','A',22,'A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Y','N','N','N','N','Y','N','N','N','N','Y','Client',0,TO_DATE('2008-06-02 21:21:22','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:21:23 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52077 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:22:32 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52078,113,0,19,52004,130,'AD_Org_ID',TO_DATE('2008-06-02 21:22:32','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Org_ID@','Organizational entity within client','A',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','N','N','N','N','Y','N','N','N','N','Y','Organization',0,TO_DATE('2008-06-02 21:22:32','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:22:32 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52078 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - - --- Jun 2, 2008 9:23:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52030,0,'AutoLock',TO_DATE('2008-06-02 21:23:51','YYYY-MM-DD HH24:MI:SS'),100,'Whether to automatically lock the terminal when till is closed','A','Y','Auto Lock','Auto Lock',TO_DATE('2008-06-02 21:23:51','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:23:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52030 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:24:30 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52079,52030,0,20,52004,'AutoLock',TO_DATE('2008-06-02 21:24:30','YYYY-MM-DD HH24:MI:SS'),100,'N','Whether to automatically lock the terminal when till is closed','A',1,'Y','N','N','N','N','Y','N','N','N','N','Y','Auto Lock',0,TO_DATE('2008-06-02 21:24:30','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:24:30 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52079 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:26:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52031,0,'CashBookTransferType',TO_DATE('2008-06-02 21:26:51','YYYY-MM-DD HH24:MI:SS'),100,'Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book','A','Y','Cash Book Transfer Type','Cash Book Transfer Type',TO_DATE('2008-06-02 21:26:51','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:26:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52031 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:29:14 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52002,TO_DATE('2008-06-02 21:29:14','YYYY-MM-DD HH24:MI:SS'),100,'Where money should be transfered to','A','Y','_TransferType',TO_DATE('2008-06-02 21:29:14','YYYY-MM-DD HH24:MI:SS'),100,'L') -; - --- Jun 2, 2008 9:29:14 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52002 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) -; - --- Jun 2, 2008 9:29:42 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,52002,52001,TO_DATE('2008-06-02 21:29:42','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Bank Account',TO_DATE('2008-06-02 21:29:42','YYYY-MM-DD HH24:MI:SS'),100,'B') -; - --- Jun 2, 2008 9:29:42 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52001 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) -; - --- Jun 2, 2008 9:29:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,52002,52002,TO_DATE('2008-06-02 21:29:51','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','CashBook',TO_DATE('2008-06-02 21:29:51','YYYY-MM-DD HH24:MI:SS'),100,'C') -; - --- Jun 2, 2008 9:29:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52002 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) -; - --- Jun 2, 2008 9:30:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52080,52031,0,17,52002,52004,'CashBookTransferType',TO_DATE('2008-06-02 21:30:13','YYYY-MM-DD HH24:MI:SS'),100,'Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book','A',1,'Y','N','N','N','N','Y','N','N','N','N','Y','Cash Book Transfer Type',0,TO_DATE('2008-06-02 21:30:13','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:30:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52080 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:32:22 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52032,0,'CashTransferBankAccount_ID',TO_DATE('2008-06-02 21:32:22','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which to transfer all Cash transactions','A','Y','Transfer Cash trx to','Transfer Cash trx to',TO_DATE('2008-06-02 21:32:22','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:32:22 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52032 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:33:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52003,TO_DATE('2008-06-02 21:33:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','C_BankAccount',TO_DATE('2008-06-02 21:33:15','YYYY-MM-DD HH24:MI:SS'),100,'T') -; - --- Jun 2, 2008 9:33:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52003 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) -; - --- Jun 2, 2008 9:33:52 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,3074,3077,0,52003,297,TO_DATE('2008-06-02 21:33:52','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','N',TO_DATE('2008-06-02 21:33:52','YYYY-MM-DD HH24:MI:SS'),100,'C_BankAccount.IsActive=''Y''') -; - --- Jun 2, 2008 9:34:10 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52081,52032,0,18,52003,52004,'CashTransferBankAccount_ID',TO_DATE('2008-06-02 21:34:10','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which to transfer all Cash transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Cash trx to',0,TO_DATE('2008-06-02 21:34:10','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:34:10 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52081 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:35:28 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52033,0,'CashTransferCashBook_ID',TO_DATE('2008-06-02 21:35:28','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Cash transactions','A','Y','Transfer Cash trx to','Transfer Cash trx to',TO_DATE('2008-06-02 21:35:28','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:35:28 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52033 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:36:18 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52004,TO_DATE('2008-06-02 21:36:18','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','C_CashBook',TO_DATE('2008-06-02 21:36:18','YYYY-MM-DD HH24:MI:SS'),100,'T') -; - --- Jun 2, 2008 9:36:18 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52004 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) -; - --- Jun 2, 2008 9:36:54 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,5268,5260,0,52004,408,TO_DATE('2008-06-02 21:36:54','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','N',TO_DATE('2008-06-02 21:36:54','YYYY-MM-DD HH24:MI:SS'),100,'C_CashBook.IsActive=''Y''') -; - --- Jun 2, 2008 9:37:11 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52082,52033,0,18,52004,52004,'CashTransferCashBook_ID',TO_DATE('2008-06-02 21:37:11','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Cash transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Cash trx to',0,TO_DATE('2008-06-02 21:37:11','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:37:11 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52082 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:37:53 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52083,1463,0,19,52004,'C_CashBook_ID',TO_DATE('2008-06-02 21:37:53','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book for recording petty cash transactions','A',22,'The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','N','N','N','N','Y','N','N','N','N','Y','Cash Book',0,TO_DATE('2008-06-02 21:37:53','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:37:53 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52083 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:39:00 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52034,0,'C_CashBPartner_ID',TO_DATE('2008-06-02 21:39:00','YYYY-MM-DD HH24:MI:SS'),100,'BPartner to be used for Cash transactions','A','Y','Cash BPartner','Cash BPartner',TO_DATE('2008-06-02 21:39:00','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:39:00 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52034 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:39:32 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52084,52034,0,18,173,52004,'C_CashBPartner_ID',TO_DATE('2008-06-02 21:39:32','YYYY-MM-DD HH24:MI:SS'),100,'BPartner to be used for Cash transactions','A',22,'Y','N','N','N','N','Y','N','N','N','N','Y','Cash BPartner',0,TO_DATE('2008-06-02 21:39:32','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:39:32 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52084 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:41:11 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52035,0,'Check_BankAccount_ID',TO_DATE('2008-06-02 21:41:11','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account to be used for processing Check transactions','A','Y','Check Bank Account','Check Bank Account',TO_DATE('2008-06-02 21:41:11','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:41:11 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52035 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:41:34 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52085,52035,0,18,52003,52004,'Check_BankAccount_ID',TO_DATE('2008-06-02 21:41:34','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account to be used for processing Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Check Bank Account',0,TO_DATE('2008-06-02 21:41:34','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:41:34 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52085 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:42:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52036,0,'CheckTransferBankAccount_ID',TO_DATE('2008-06-02 21:42:50','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Check transactions','A','Y','Tranfer Check trx to','Transfer Check trx to',TO_DATE('2008-06-02 21:42:50','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:42:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52036 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:43:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52086,52036,0,18,52003,52004,'CheckTransferBankAccount_ID',TO_DATE('2008-06-02 21:43:15','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Tranfer Check trx to',0,TO_DATE('2008-06-02 21:43:15','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:43:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52086 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:44:12 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52037,0,'CheckTransferType',TO_DATE('2008-06-02 21:44:12','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Check Transfer Type','Check Transfer Type',TO_DATE('2008-06-02 21:44:12','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:44:12 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52037 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:44:39 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52087,52037,0,17,52002,52004,'CheckTransferType',TO_DATE('2008-06-02 21:44:39','YYYY-MM-DD HH24:MI:SS'),100,'A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Check Transfer Type',0,TO_DATE('2008-06-02 21:44:39','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:44:39 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52087 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:46:05 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52038,0,'Card_BankAccount_ID',TO_DATE('2008-06-02 21:46:05','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which card transactions will be processed','A','Y','Card Bank Account','Card Bank Account',TO_DATE('2008-06-02 21:46:05','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:46:05 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52038 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:46:28 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52088,52038,0,18,52003,52004,'Card_BankAccount_ID',TO_DATE('2008-06-02 21:46:28','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which card transactions will be processed','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Card Bank Account',0,TO_DATE('2008-06-02 21:46:28','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:46:28 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52088 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:47:33 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52039,0,'CardTransferBankAccount_ID',TO_DATE('2008-06-02 21:47:33','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Card transactions','A','Y','Transfer Card trx to','Transfer Card trx to',TO_DATE('2008-06-02 21:47:33','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:47:33 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52039 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:47:59 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52089,52039,0,18,52003,52004,'CardTransferBankAccount_ID',TO_DATE('2008-06-02 21:47:59','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Card transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Card trx to',0,TO_DATE('2008-06-02 21:47:59','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:47:59 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52089 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:48:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52040,0,'CardTransferCashBook_ID',TO_DATE('2008-06-02 21:48:55','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Card transactions','A','Y','Transfer Card trx to','Transfer Card trx to',TO_DATE('2008-06-02 21:48:55','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:48:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52040 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:49:35 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52090,52040,0,18,52004,52004,'CardTransferCashBook_ID',TO_DATE('2008-06-02 21:49:35','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Card transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Card trx to',0,TO_DATE('2008-06-02 21:49:35','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:49:35 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52090 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:50:21 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52041,0,'CardTransferType',TO_DATE('2008-06-02 21:50:21','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Card Transfer Type','Card Transfer Type',TO_DATE('2008-06-02 21:50:21','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:50:21 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52041 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:50:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52091,52041,0,17,52002,52004,'CardTransferType',TO_DATE('2008-06-02 21:50:40','YYYY-MM-DD HH24:MI:SS'),100,'A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Card Transfer Type',0,TO_DATE('2008-06-02 21:50:40','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:50:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52091 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:51:10 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52092,245,0,16,52004,'Created',TO_DATE('2008-06-02 21:51:10','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was created','A',7,'The Created field indicates the date that this record was created.','Y','N','N','N','N','Y','N','N','N','N','N','Created',0,TO_DATE('2008-06-02 21:51:10','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:51:10 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52092 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:52:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52093,246,0,18,110,52004,'CreatedBy',TO_DATE('2008-06-02 21:52:01','YYYY-MM-DD HH24:MI:SS'),100,'User who created this records','A',22,'The Created By field indicates the user who created this record.','Y','N','N','N','N','Y','N','N','N','N','N','Created By',0,TO_DATE('2008-06-02 21:52:01','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:52:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52093 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:53:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52042,0,'C_TemplateBPartner_ID',TO_DATE('2008-06-02 21:53:39','YYYY-MM-DD HH24:MI:SS'),100,'BPartner that is to be used as template when new customers are created','A','Y','Template BPartner','Template BPartner',TO_DATE('2008-06-02 21:53:39','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:53:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52042 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:54:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52094,52042,0,18,173,52004,'C_TemplateBPartner_ID',TO_DATE('2008-06-02 21:54:16','YYYY-MM-DD HH24:MI:SS'),100,'BPartner that is to be used as template when new customers are created','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Template BPartner',0,TO_DATE('2008-06-02 21:54:16','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:54:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52094 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:55:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52095,275,0,10,52004,'Description',TO_DATE('2008-06-02 21:55:01','YYYY-MM-DD HH24:MI:SS'),100,'Optional short description of the record','A',255,'A description is limited to 255 characters.','Y','N','N','N','N','N','N','N','N','N','Y','Description',0,TO_DATE('2008-06-02 21:55:01','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:55:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52095 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:55:37 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52096,326,0,14,52004,'Help',TO_DATE('2008-06-02 21:55:37','YYYY-MM-DD HH24:MI:SS'),100,'Comment or Hint','A',2000,'The Help field contains a hint, comment or help about the use of this item.','Y','N','N','N','N','N','N','N','N','N','Y','Comment/Help',0,TO_DATE('2008-06-02 21:55:37','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:55:37 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52096 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:56:03 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52097,348,0,20,52004,'IsActive',TO_DATE('2008-06-02 21:56:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','The record is active in the system','A',1,'There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. -There are two reasons for de-activating and not deleting records: -(1) The system requires the record for audit purposes. -(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','N','N','N','N','N','N','N','N','N','Y','Active',0,TO_DATE('2008-06-02 21:56:02','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:56:03 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52097 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:56:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52043,0,'LastLockTime',TO_DATE('2008-06-02 21:56:55','YYYY-MM-DD HH24:MI:SS'),100,'Last time at which the terminal was locked','A','Y','Last Lock Time','Last Lock Time',TO_DATE('2008-06-02 21:56:55','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:56:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52043 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:57:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52098,52043,0,16,52004,'LastLockTime',TO_DATE('2008-06-02 21:57:13','YYYY-MM-DD HH24:MI:SS'),100,'Last time at which the terminal was locked','A',7,'Y','N','N','N','N','N','N','N','N','N','Y','Last Lock Time',0,TO_DATE('2008-06-02 21:57:13','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:57:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52098 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:58:06 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52044,0,'Locked',TO_DATE('2008-06-02 21:58:06','YYYY-MM-DD HH24:MI:SS'),100,'Whether the terminal is locked','A','Y','Locked','Locked',TO_DATE('2008-06-02 21:58:06','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:58:06 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52044 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:58:26 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52099,52044,0,20,52004,'Locked',TO_DATE('2008-06-02 21:58:26','YYYY-MM-DD HH24:MI:SS'),100,'N','Whether the terminal is locked','A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Locked',0,TO_DATE('2008-06-02 21:58:26','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:58:26 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52099 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:59:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52045,0,'LockTime',TO_DATE('2008-06-02 21:59:13','YYYY-MM-DD HH24:MI:SS'),100,'Time in minutes the terminal should be kept in a locked state.','A','Y','Lock Time','Lock Time',TO_DATE('2008-06-02 21:59:13','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:59:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52045 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:59:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,ValueMin,Version) VALUES (0,52100,52045,0,11,52004,'LockTime',TO_DATE('2008-06-02 21:59:40','YYYY-MM-DD HH24:MI:SS'),100,'Time in minutes the terminal should be kept in a locked state.','A',10,'Y','N','N','N','N','N','N','N','N','N','Y','Lock Time',0,TO_DATE('2008-06-02 21:59:40','YYYY-MM-DD HH24:MI:SS'),100,'0',0) -; - --- Jun 2, 2008 9:59:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52100 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:00:25 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52101,459,0,19,52004,'M_Warehouse_ID',TO_DATE('2008-06-02 22:00:24','YYYY-MM-DD HH24:MI:SS'),100,'Storage Warehouse and Service Point','A',22,'The Warehouse identifies a unique Warehouse where products are stored or Services are provided.','Y','N','N','N','N','N','N','N','N','N','Y','Warehouse',0,TO_DATE('2008-06-02 22:00:24','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:00:25 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52101 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:00:44 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52102,469,0,10,52004,'Name',TO_DATE('2008-06-02 22:00:44','YYYY-MM-DD HH24:MI:SS'),100,'Alphanumeric identifier of the entity','A',60,'The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','Y','N','N','N','N','N','N','N','N','N','Y','Name',0,TO_DATE('2008-06-02 22:00:44','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:00:44 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52102 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:02:07 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52103,480,0,18,166,52004,'PO_PriceList_ID',TO_DATE('2008-06-02 22:02:07','YYYY-MM-DD HH24:MI:SS'),100,'Price List used by this Business Partner','A',22,'Identifies the price list used by a Vendor for products purchased by this organization.','Y','N','N','N','N','N','N','N','N','N','Y','Purchase Pricelist',0,TO_DATE('2008-06-02 22:02:07','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:02:07 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52103 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:02:37 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52104,2051,0,10,52004,'PrinterName',TO_DATE('2008-06-02 22:02:37','YYYY-MM-DD HH24:MI:SS'),100,'Name of the Printer','A',60,'Internal (Opereating System) Name of the Printer; Please mote that the printer name may be different on different clients. Enter a printer name, which applies to ALL clients (e.g. printer on a server).

-If none is entered, the default printer is used. You specify your default printer when you log in. You can also change the default printer in Preferences.','Y','N','N','N','N','N','N','N','N','N','Y','Printer Name',0,TO_DATE('2008-06-02 22:02:37','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:02:37 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52104 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:03:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52105,1063,0,18,316,52004,'SalesRep_ID',TO_DATE('2008-06-02 22:03:16','YYYY-MM-DD HH24:MI:SS'),100,'Sales Representative or Company Agent','A',22,'The Sales Representative indicates the Sales Rep for this Region. Any Sales Rep must be a valid internal user.','Y','N','N','N','N','N','N','N','N','N','Y','Sales Representative',0,TO_DATE('2008-06-02 22:03:16','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:03:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52105 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:04:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52046,0,'SO_PriceList_ID',TO_DATE('2008-06-02 22:04:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Sales Pricelist','Sales Pricelist',TO_DATE('2008-06-02 22:04:15','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 10:04:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52046 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 10:04:46 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52106,52046,0,18,166,52004,'SO_PriceList_ID',TO_DATE('2008-06-02 22:04:46','YYYY-MM-DD HH24:MI:SS'),100,'A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Sales Pricelist',0,TO_DATE('2008-06-02 22:04:46','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:04:46 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52106 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:05:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52047,0,'UnlockingTime',TO_DATE('2008-06-02 22:05:16','YYYY-MM-DD HH24:MI:SS'),100,'Time at which the terminal should be unlocked','A','Y','UnlockingTime','UnlockingTime',TO_DATE('2008-06-02 22:05:16','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 10:05:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52047 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 10:05:34 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52107,52047,0,16,52004,'UnlockingTime',TO_DATE('2008-06-02 22:05:34','YYYY-MM-DD HH24:MI:SS'),100,'Time at which the terminal should be unlocked','A',7,'Y','N','N','N','N','N','N','N','N','N','Y','UnlockingTime',0,TO_DATE('2008-06-02 22:05:34','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:05:34 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52107 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:05:58 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52108,607,0,16,52004,'Updated',TO_DATE('2008-06-02 22:05:58','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was updated','A',7,'The Updated field indicates the date that this record was updated.','Y','N','N','N','N','Y','N','N','N','N','N','Updated',0,TO_DATE('2008-06-02 22:05:58','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:05:58 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52108 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:06:30 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52109,608,0,18,110,52004,'UpdatedBy',TO_DATE('2008-06-02 22:06:30','YYYY-MM-DD HH24:MI:SS'),100,'User who updated this records','A',22,'The Updated By field indicates the user who updated this record.','Y','N','N','N','N','N','N','N','N','N','Y','Updated By',0,TO_DATE('2008-06-02 22:06:30','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:06:30 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52109 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:29:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52048,0,'U_POSTerminal_ID',TO_DATE('2008-06-02 22:29:01','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','POS Terminal','POS Terminal',TO_DATE('2008-06-02 22:29:01','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 10:29:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52048 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 10:29:54 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52110,52048,0,13,52004,'U_POSTerminal_ID',TO_DATE('2008-06-02 22:29:54','YYYY-MM-DD HH24:MI:SS'),100,'A',22,'Y','N','N','N','Y','Y','N','N','N','N','N','POS Terminal',0,TO_DATE('2008-06-02 22:29:54','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:29:54 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52110 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:48:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52049,0,'CheckTransferCashBook_ID',TO_DATE('2008-06-02 22:48:55','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Check transactions','A','Y','Transfer Check trx to','Transfer Check trx to',TO_DATE('2008-06-02 22:48:55','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 10:48:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52049 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 10:49:35 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52111,52049,0,18,52004,52004,'CheckTransferCashBook_ID',TO_DATE('2008-06-02 22:49:35','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Check trx to',0,TO_DATE('2008-06-02 22:49:35','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:49:35 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52111 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 3, 2008 2:27:59 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Sequence (AD_Client_ID,AD_Org_ID,AD_Sequence_ID,Created,CreatedBy,CurrentNext,CurrentNextSys,Description,IncrementNo,IsActive,IsAudited,IsAutoSequence,IsTableID,Name,StartNewYear,StartNo,Updated,UpdatedBy) VALUES (0,0,52006,TO_DATE('2008-06-03 14:27:59','YYYY-MM-DD HH24:MI:SS'),100,1000000,100,'Table U_POSTerminal',1,'Y','N','Y','Y','U_POSTerminal','N',1000000,TO_DATE('2008-06-03 14:27:59','YYYY-MM-DD HH24:MI:SS'),100) -; \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.0/oracle/003_Terminals_TransferConfiguration.sql b/posterita/commons/Migration/1.7.0/oracle/003_Terminals_TransferConfiguration.sql deleted file mode 100644 index 79f6330932..0000000000 --- a/posterita/commons/Migration/1.7.0/oracle/003_Terminals_TransferConfiguration.sql +++ /dev/null @@ -1,75 +0,0 @@ -ALTER TABLE AD_OrgInfo ADD TransferBank_ID NUMBER(10); -ALTER TABLE AD_OrgInfo ADD TransferCashBook_ID NUMBER(10); - -ALTER TABLE AD_OrgInfo - ADD CONSTRAINT "cbank_adorginfo" - FOREIGN KEY(TransferBank_ID) - REFERENCES C_Bank(C_Bank_ID); - - -ALTER TABLE AD_OrgInfo - ADD CONSTRAINT "ccashbook_adorginfo" - FOREIGN KEY(TransferCashBook_ID) - REFERENCES C_CashBook(C_CashBook_ID); - - - - --- May 26, 2008 23:25:51 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52028,0,'TransferBank_ID',TO_DATE('2008-05-26 23:25:50','YYYY-MM-DD HH24:MI:SS'),100,'Bank account depending on currency will be used from this bank for doing transfers','D','Y','Bank for transfers','Bank for transfers',TO_DATE('2008-05-26 23:25:50','YYYY-MM-DD HH24:MI:SS'),100) -; - --- May 26, 2008 23:25:51 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52028 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- May 26, 2008 23:26:38 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52001,TO_DATE('2008-05-26 23:26:38','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','C_Bank',TO_DATE('2008-05-26 23:26:38','YYYY-MM-DD HH24:MI:SS'),100,'T') -; - --- May 26, 2008 23:26:38 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52001 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) -; - --- May 26, 2008 23:28:08 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,3039,3031,0,52001,296,TO_DATE('2008-05-26 23:28:08','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_DATE('2008-05-26 23:28:08','YYYY-MM-DD HH24:MI:SS'),100,'C_Bank.IsOwnBank=''Y''') -; - --- May 26, 2008 23:28:33 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52075,52028,0,18,52001,228,'TransferBank_ID',TO_DATE('2008-05-26 23:28:33','YYYY-MM-DD HH24:MI:SS'),100,'Bank account depending on currency will be used from this bank for doing transfers','D',22,'Y','N','N','N','N','N','N','N','N','N','Y','Bank for transfers',0,TO_DATE('2008-05-26 23:28:33','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- May 26, 2008 23:28:33 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52075 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - - - --- Cash Book - --- May 26, 2008 23:29:40 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52029,0,'TransferCashBook_ID',TO_DATE('2008-05-23 23:29:40','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','CashBook for transfers','CashBook for transfers',TO_DATE('2008-05-23 23:29:40','YYYY-MM-DD HH24:MI:SS'),100) -; - --- May 26, 2008 23:29:40 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52029 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- May 26, 2008 23:30:32 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52076,52029,0,18,52004,228,'TransferCashBook_ID',TO_DATE('2008-05-23 23:30:31','YYYY-MM-DD HH24:MI:SS'),100,'D',22,'Y','N','N','N','N','N','N','N','N','N','Y','CashBook for transfers',0,TO_DATE('2008-05-23 23:30:31','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- May 26, 2008 23:30:32 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52076 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; diff --git a/posterita/commons/Migration/1.7.0/oracle/004_Terminals_newTableDDL.sql b/posterita/commons/Migration/1.7.0/oracle/004_Terminals_newTableDDL.sql deleted file mode 100644 index 61e4efab46..0000000000 --- a/posterita/commons/Migration/1.7.0/oracle/004_Terminals_newTableDDL.sql +++ /dev/null @@ -1,4 +0,0 @@ --- Jun 2, 2008 23:58:02 AM GMT+04:00 --- Default comment for updating dictionary -CREATE TABLE U_POSTerminal (AD_Client_ID NUMBER(10) DEFAULT NULL NOT NULL, AD_Org_ID NUMBER(10) DEFAULT NULL NOT NULL, AutoLock CHAR(1) DEFAULT 'N' CHECK (AutoLock IN ('Y','N')) NOT NULL, Card_BankAccount_ID NUMBER(10), CardTransferBankAccount_ID NUMBER(10), CardTransferCashBook_ID NUMBER(10), CardTransferType CHAR(1), CashBookTransferType CHAR(1) NOT NULL, CashTransferBankAccount_ID NUMBER(10), CashTransferCashBook_ID NUMBER(10), C_CashBook_ID NUMBER(10) NOT NULL, C_CashBPartner_ID NUMBER(10) NOT NULL, Check_BankAccount_ID NUMBER(10), CheckTransferBankAccount_ID NUMBER(10), CheckTransferCashBook_ID NUMBER(10), CheckTransferType CHAR(1), Created DATE NOT NULL, CreatedBy NUMBER(10) NOT NULL, C_TemplateBPartner_ID NUMBER(10), Description NVARCHAR2(255), Help NVARCHAR2(2000), IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')), LastLockTime DATE, Locked CHAR(1) DEFAULT 'N' CHECK (Locked IN ('Y','N')), LockTime NUMBER(10), M_Warehouse_ID NUMBER(10), Name NVARCHAR2(60), PO_PriceList_ID NUMBER(10), PrinterName NVARCHAR2(60), SalesRep_ID NUMBER(10), SO_PriceList_ID NUMBER(10), UnlockingTime DATE, Updated DATE NOT NULL, UpdatedBy NUMBER(10), U_POSTerminal_ID NUMBER(10) NOT NULL, CONSTRAINT U_POSTerminal_Key PRIMARY KEY (U_POSTerminal_ID)) -; \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.0/oracle/005_Messages.sql b/posterita/commons/Migration/1.7.0/oracle/005_Messages.sql deleted file mode 100644 index 3f4c27d750..0000000000 --- a/posterita/commons/Migration/1.7.0/oracle/005_Messages.sql +++ /dev/null @@ -1,190 +0,0 @@ --- Jun 9, 2008 1:24:35 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52452,0,TO_DATE('2008-06-09 13:24:35','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Organisation','I',TO_DATE('2008-06-09 13:24:35','YYYY-MM-DD HH24:MI:SS'),100,'smenu.organisation') -; - --- Jun 9, 2008 1:25:48 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52453,0,TO_DATE('2008-06-09 13:25:48','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Terminals','I',TO_DATE('2008-06-09 13:25:48','YYYY-MM-DD HH24:MI:SS'),100,'smenu.terminal') -; - --- Jun 9, 2008 1:26:06 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52454,0,TO_DATE('2008-06-09 13:26:06','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cash Books','I',TO_DATE('2008-06-09 13:26:06','YYYY-MM-DD HH24:MI:SS'),100,'smenu.cashbook') -; - --- Jun 9, 2008 1:26:30 PM GMT+04:00 --- Default comment for updating dictionary -UPDATE AD_Message SET MsgTip='Maintain POS Terminals',Updated=TO_DATE('2008-06-09 13:26:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=52453 -; - --- Jun 9, 2008 1:26:39 PM GMT+04:00 --- Default comment for updating dictionary -UPDATE AD_Message SET MsgTip='Maintain Cash Books',Updated=TO_DATE('2008-06-09 13:26:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=52454 -; - --- Jun 9, 2008 1:27:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52455,0,TO_DATE('2008-06-09 13:27:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Completed','I',TO_DATE('2008-06-09 13:27:15','YYYY-MM-DD HH24:MI:SS'),100,'document.status.completed') -; - --- Jun 9, 2008 1:28:05 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52456,0,TO_DATE('2008-06-09 13:28:04','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Drafted','I',TO_DATE('2008-06-09 13:28:04','YYYY-MM-DD HH24:MI:SS'),100,'document.status.drafted') -; - --- Jun 9, 2008 1:28:27 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52457,0,TO_DATE('2008-06-09 13:28:27','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','In Progress','I',TO_DATE('2008-06-09 13:28:27','YYYY-MM-DD HH24:MI:SS'),100,'document.status.inprogress') -; - --- Jun 9, 2008 1:28:44 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52458,0,TO_DATE('2008-06-09 13:28:44','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Invalid','I',TO_DATE('2008-06-09 13:28:44','YYYY-MM-DD HH24:MI:SS'),100,'document.status.invalid') -; - --- Jun 9, 2008 1:28:58 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52459,0,TO_DATE('2008-06-09 13:28:58','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Closed','I',TO_DATE('2008-06-09 13:28:58','YYYY-MM-DD HH24:MI:SS'),100,'document.status.closed') -; - --- Jun 9, 2008 1:29:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52460,0,TO_DATE('2008-06-09 13:29:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cash','I',TO_DATE('2008-06-09 13:29:15','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.cash') -; - --- Jun 9, 2008 1:29:27 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52461,0,TO_DATE('2008-06-09 13:29:27','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Card','I',TO_DATE('2008-06-09 13:29:27','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.card') -; - --- Jun 9, 2008 1:29:42 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52462,0,TO_DATE('2008-06-09 13:29:41','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cheque','I',TO_DATE('2008-06-09 13:29:41','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.cheque') -; - --- Jun 9, 2008 1:29:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52463,0,TO_DATE('2008-06-09 13:29:55','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Mixed','I',TO_DATE('2008-06-09 13:29:55','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.mixed') -; - --- Jun 9, 2008 1:30:14 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52464,0,TO_DATE('2008-06-09 13:30:13','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Credit','I',TO_DATE('2008-06-09 13:30:13','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.credit') -; - --- Jun 9, 2008 1:30:46 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52465,0,TO_DATE('2008-06-09 13:30:46','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Amount Paid','I',TO_DATE('2008-06-09 13:30:46','YYYY-MM-DD HH24:MI:SS'),100,'AmountPaid') -; - ---------------------------------------------------------------------------------------------------------------------------------------------------- - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52470 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'html', 'HTML', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52471 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'pdf', 'PDF', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52472 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'csv', 'CSV', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52473 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.sales.report', 'Sales Report', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52474 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.best.selling.items', 'Best Selling Items', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52475 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.stock.sales.report', 'Stock Sales Report', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52476 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.transfer.stock', 'Stock Transfer', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52477 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.inventory.move', 'Inventory Move', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52478 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.move.confirmation', 'Move Confirmation', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52479 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.barcode.printing', 'Barcode Printing', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52480 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'basePriceList', 'Base Price List', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52481, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'isDeleteOldRecords', 'Delete Old Records', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52482, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'sales.price.list', 'Sales Price List', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52483, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'purchase.price.list', 'Purchase Price List', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52484, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'pos.terminal', 'Terminal', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52485, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'pos.version', 'Version', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52486, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'pmenu.new.reports', 'Reports', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52487, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'isCreatePriceList', 'Create Price List', ' ', 'I', 'D'); - diff --git a/posterita/commons/Migration/1.7.0/postgresql/001_MixedPayment.sql b/posterita/commons/Migration/1.7.0/postgresql/001_MixedPayment.sql deleted file mode 100644 index 266516c722..0000000000 --- a/posterita/commons/Migration/1.7.0/postgresql/001_MixedPayment.sql +++ /dev/null @@ -1,24 +0,0 @@ --- May 22, 2008 10:57:07 AM GMT+04:00 --- Create Mixed in the payment rules list -INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,195,52000,TO_DATE('2008-05-22 10:55:30','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Mixed',TO_DATE('2008-05-22 10:55:30','YYYY-MM-DD HH24:MI:SS'),100,'M') -; - --- May 22, 2008 10:57:11 AM GMT+04:00 --- Update the translation -INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52000 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) -; - --- May 22, 2008 11:28:12 AM GMT+04:00 --- Creates new Validation rule so that rich client does not get Mixed rule -INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,52002,'AD_Ref_List.Value <> ''M''',TO_DATE('2008-05-22 11:28:12','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','All_Payment Rule - No mixed','S',TO_DATE('2008-05-22 11:28:12','YYYY-MM-DD HH24:MI:SS'),100) -; - --- May 22, 2008 11:30:02 AM GMT+04:00 --- Updates all columns in AD where the payment rule list is used with the validation created earlier -UPDATE AD_Column SET AD_Val_Rule_ID=52002 WHERE AD_Reference_Value_ID=195 AND AD_Val_Rule_ID IS NULL -; - --- May 22, 2008 11:31:15 AM GMT+04:00 --- Updates all columns in AD where an existing validation rule exist and set it to ignore the Mixed rule -UPDATE AD_Val_Rule SET Code='AD_Ref_List.Value <> ''B'' AND AD_Ref_List.Value <> ''M''' WHERE AD_Val_Rule_ID=161 -; diff --git a/posterita/commons/Migration/1.7.0/postgresql/002_Terminals_newTableStructure.sql b/posterita/commons/Migration/1.7.0/postgresql/002_Terminals_newTableStructure.sql deleted file mode 100644 index 0c4aaf8e63..0000000000 --- a/posterita/commons/Migration/1.7.0/postgresql/002_Terminals_newTableStructure.sql +++ /dev/null @@ -1,629 +0,0 @@ --- Jun 2, 2008 9:19:48 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Table (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Table_ID,CopyColumnsFromTable,Created,CreatedBy,EntityType,ImportTable,IsActive,IsChangeLog,IsDeleteable,IsHighVolume,IsSecurityEnabled,IsView,LoadSeq,Name,ReplicationType,TableName,Updated,UpdatedBy) VALUES ('1',0,0,52004,'N',TO_DATE('2008-06-02 21:19:47','YYYY-MM-DD HH24:MI:SS'),100,'A','N','Y','N','Y','N','N','N',0,'POS Terminal','L','U_POSTerminal',TO_DATE('2008-06-02 21:19:47','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:19:48 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=52004 AND EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Table_ID!=t.AD_Table_ID) -; - --- Jun 2, 2008 9:21:23 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52077,102,0,19,52004,129,'AD_Client_ID',TO_DATE('2008-06-02 21:21:22','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Client_ID@','Client/Tenant for this installation.','A',22,'A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Y','N','N','N','N','Y','N','N','N','N','Y','Client',0,TO_DATE('2008-06-02 21:21:22','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:21:23 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52077 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:22:32 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52078,113,0,19,52004,130,'AD_Org_ID',TO_DATE('2008-06-02 21:22:32','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Org_ID@','Organizational entity within client','A',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','N','N','N','N','Y','N','N','N','N','Y','Organization',0,TO_DATE('2008-06-02 21:22:32','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:22:32 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52078 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - - --- Jun 2, 2008 9:23:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52030,0,'AutoLock',TO_DATE('2008-06-02 21:23:51','YYYY-MM-DD HH24:MI:SS'),100,'Whether to automatically lock the terminal when till is closed','A','Y','Auto Lock','Auto Lock',TO_DATE('2008-06-02 21:23:51','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:23:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52030 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:24:30 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52079,52030,0,20,52004,'AutoLock',TO_DATE('2008-06-02 21:24:30','YYYY-MM-DD HH24:MI:SS'),100,'N','Whether to automatically lock the terminal when till is closed','A',1,'Y','N','N','N','N','Y','N','N','N','N','Y','Auto Lock',0,TO_DATE('2008-06-02 21:24:30','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:24:30 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52079 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:26:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52031,0,'CashBookTransferType',TO_DATE('2008-06-02 21:26:51','YYYY-MM-DD HH24:MI:SS'),100,'Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book','A','Y','Cash Book Transfer Type','Cash Book Transfer Type',TO_DATE('2008-06-02 21:26:51','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:26:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52031 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:29:14 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52002,TO_DATE('2008-06-02 21:29:14','YYYY-MM-DD HH24:MI:SS'),100,'Where money should be transfered to','A','Y','_TransferType',TO_DATE('2008-06-02 21:29:14','YYYY-MM-DD HH24:MI:SS'),100,'L') -; - --- Jun 2, 2008 9:29:14 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52002 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) -; - --- Jun 2, 2008 9:29:42 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,52002,52001,TO_DATE('2008-06-02 21:29:42','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Bank Account',TO_DATE('2008-06-02 21:29:42','YYYY-MM-DD HH24:MI:SS'),100,'B') -; - --- Jun 2, 2008 9:29:42 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52001 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) -; - --- Jun 2, 2008 9:29:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,52002,52002,TO_DATE('2008-06-02 21:29:51','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','CashBook',TO_DATE('2008-06-02 21:29:51','YYYY-MM-DD HH24:MI:SS'),100,'C') -; - --- Jun 2, 2008 9:29:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=52002 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) -; - --- Jun 2, 2008 9:30:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52080,52031,0,17,52002,52004,'CashBookTransferType',TO_DATE('2008-06-02 21:30:13','YYYY-MM-DD HH24:MI:SS'),100,'Where the money in the cash book should be transfered to. Either a Bank Account or another Cash Book','A',1,'Y','N','N','N','N','Y','N','N','N','N','Y','Cash Book Transfer Type',0,TO_DATE('2008-06-02 21:30:13','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:30:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52080 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:32:22 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52032,0,'CashTransferBankAccount_ID',TO_DATE('2008-06-02 21:32:22','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which to transfer all Cash transactions','A','Y','Transfer Cash trx to','Transfer Cash trx to',TO_DATE('2008-06-02 21:32:22','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:32:22 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52032 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:33:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52003,TO_DATE('2008-06-02 21:33:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','C_BankAccount',TO_DATE('2008-06-02 21:33:15','YYYY-MM-DD HH24:MI:SS'),100,'T') -; - --- Jun 2, 2008 9:33:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52003 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) -; - --- Jun 2, 2008 9:33:52 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,3074,3077,0,52003,297,TO_DATE('2008-06-02 21:33:52','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','N',TO_DATE('2008-06-02 21:33:52','YYYY-MM-DD HH24:MI:SS'),100,'C_BankAccount.IsActive=''Y''') -; - --- Jun 2, 2008 9:34:10 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52081,52032,0,18,52003,52004,'CashTransferBankAccount_ID',TO_DATE('2008-06-02 21:34:10','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which to transfer all Cash transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Cash trx to',0,TO_DATE('2008-06-02 21:34:10','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:34:10 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52081 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:35:28 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52033,0,'CashTransferCashBook_ID',TO_DATE('2008-06-02 21:35:28','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Cash transactions','A','Y','Transfer Cash trx to','Transfer Cash trx to',TO_DATE('2008-06-02 21:35:28','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:35:28 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52033 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:36:18 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52004,TO_DATE('2008-06-02 21:36:18','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','C_CashBook',TO_DATE('2008-06-02 21:36:18','YYYY-MM-DD HH24:MI:SS'),100,'T') -; - --- Jun 2, 2008 9:36:18 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52004 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) -; - --- Jun 2, 2008 9:36:54 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,5268,5260,0,52004,408,TO_DATE('2008-06-02 21:36:54','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','N',TO_DATE('2008-06-02 21:36:54','YYYY-MM-DD HH24:MI:SS'),100,'C_CashBook.IsActive=''Y''') -; - --- Jun 2, 2008 9:37:11 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52082,52033,0,18,52004,52004,'CashTransferCashBook_ID',TO_DATE('2008-06-02 21:37:11','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Cash transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Cash trx to',0,TO_DATE('2008-06-02 21:37:11','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:37:11 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52082 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:37:53 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52083,1463,0,19,52004,'C_CashBook_ID',TO_DATE('2008-06-02 21:37:53','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book for recording petty cash transactions','A',22,'The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','N','N','N','N','Y','N','N','N','N','Y','Cash Book',0,TO_DATE('2008-06-02 21:37:53','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:37:53 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52083 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:39:00 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52034,0,'C_CashBPartner_ID',TO_DATE('2008-06-02 21:39:00','YYYY-MM-DD HH24:MI:SS'),100,'BPartner to be used for Cash transactions','A','Y','Cash BPartner','Cash BPartner',TO_DATE('2008-06-02 21:39:00','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:39:00 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52034 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:39:32 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52084,52034,0,18,173,52004,'C_CashBPartner_ID',TO_DATE('2008-06-02 21:39:32','YYYY-MM-DD HH24:MI:SS'),100,'BPartner to be used for Cash transactions','A',22,'Y','N','N','N','N','Y','N','N','N','N','Y','Cash BPartner',0,TO_DATE('2008-06-02 21:39:32','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:39:32 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52084 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:41:11 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52035,0,'Check_BankAccount_ID',TO_DATE('2008-06-02 21:41:11','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account to be used for processing Check transactions','A','Y','Check Bank Account','Check Bank Account',TO_DATE('2008-06-02 21:41:11','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:41:11 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52035 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:41:34 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52085,52035,0,18,52003,52004,'Check_BankAccount_ID',TO_DATE('2008-06-02 21:41:34','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account to be used for processing Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Check Bank Account',0,TO_DATE('2008-06-02 21:41:34','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:41:34 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52085 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:42:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52036,0,'CheckTransferBankAccount_ID',TO_DATE('2008-06-02 21:42:50','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Check transactions','A','Y','Tranfer Check trx to','Transfer Check trx to',TO_DATE('2008-06-02 21:42:50','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:42:51 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52036 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:43:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52086,52036,0,18,52003,52004,'CheckTransferBankAccount_ID',TO_DATE('2008-06-02 21:43:15','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Tranfer Check trx to',0,TO_DATE('2008-06-02 21:43:15','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:43:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52086 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:44:12 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52037,0,'CheckTransferType',TO_DATE('2008-06-02 21:44:12','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Check Transfer Type','Check Transfer Type',TO_DATE('2008-06-02 21:44:12','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:44:12 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52037 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:44:39 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52087,52037,0,17,52002,52004,'CheckTransferType',TO_DATE('2008-06-02 21:44:39','YYYY-MM-DD HH24:MI:SS'),100,'A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Check Transfer Type',0,TO_DATE('2008-06-02 21:44:39','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:44:39 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52087 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:46:05 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52038,0,'Card_BankAccount_ID',TO_DATE('2008-06-02 21:46:05','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which card transactions will be processed','A','Y','Card Bank Account','Card Bank Account',TO_DATE('2008-06-02 21:46:05','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:46:05 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52038 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:46:28 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52088,52038,0,18,52003,52004,'Card_BankAccount_ID',TO_DATE('2008-06-02 21:46:28','YYYY-MM-DD HH24:MI:SS'),100,'Bank Account on which card transactions will be processed','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Card Bank Account',0,TO_DATE('2008-06-02 21:46:28','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:46:28 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52088 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:47:33 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52039,0,'CardTransferBankAccount_ID',TO_DATE('2008-06-02 21:47:33','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Card transactions','A','Y','Transfer Card trx to','Transfer Card trx to',TO_DATE('2008-06-02 21:47:33','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:47:33 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52039 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:47:59 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52089,52039,0,18,52003,52004,'CardTransferBankAccount_ID',TO_DATE('2008-06-02 21:47:59','YYYY-MM-DD HH24:MI:SS'),100,'Bank account on which to transfer Card transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Card trx to',0,TO_DATE('2008-06-02 21:47:59','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:47:59 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52089 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:48:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52040,0,'CardTransferCashBook_ID',TO_DATE('2008-06-02 21:48:55','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Card transactions','A','Y','Transfer Card trx to','Transfer Card trx to',TO_DATE('2008-06-02 21:48:55','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:48:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52040 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:49:35 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52090,52040,0,18,52004,52004,'CardTransferCashBook_ID',TO_DATE('2008-06-02 21:49:35','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Card transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Card trx to',0,TO_DATE('2008-06-02 21:49:35','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:49:35 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52090 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:50:21 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52041,0,'CardTransferType',TO_DATE('2008-06-02 21:50:21','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Card Transfer Type','Card Transfer Type',TO_DATE('2008-06-02 21:50:21','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:50:21 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52041 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:50:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52091,52041,0,17,52002,52004,'CardTransferType',TO_DATE('2008-06-02 21:50:40','YYYY-MM-DD HH24:MI:SS'),100,'A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Card Transfer Type',0,TO_DATE('2008-06-02 21:50:40','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:50:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52091 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:51:10 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52092,245,0,16,52004,'Created',TO_DATE('2008-06-02 21:51:10','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was created','A',7,'The Created field indicates the date that this record was created.','Y','N','N','N','N','Y','N','N','N','N','N','Created',0,TO_DATE('2008-06-02 21:51:10','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:51:10 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52092 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:52:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52093,246,0,18,110,52004,'CreatedBy',TO_DATE('2008-06-02 21:52:01','YYYY-MM-DD HH24:MI:SS'),100,'User who created this records','A',22,'The Created By field indicates the user who created this record.','Y','N','N','N','N','Y','N','N','N','N','N','Created By',0,TO_DATE('2008-06-02 21:52:01','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:52:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52093 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:53:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52042,0,'C_TemplateBPartner_ID',TO_DATE('2008-06-02 21:53:39','YYYY-MM-DD HH24:MI:SS'),100,'BPartner that is to be used as template when new customers are created','A','Y','Template BPartner','Template BPartner',TO_DATE('2008-06-02 21:53:39','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:53:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52042 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:54:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52094,52042,0,18,173,52004,'C_TemplateBPartner_ID',TO_DATE('2008-06-02 21:54:16','YYYY-MM-DD HH24:MI:SS'),100,'BPartner that is to be used as template when new customers are created','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Template BPartner',0,TO_DATE('2008-06-02 21:54:16','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:54:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52094 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:55:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52095,275,0,10,52004,'Description',TO_DATE('2008-06-02 21:55:01','YYYY-MM-DD HH24:MI:SS'),100,'Optional short description of the record','A',255,'A description is limited to 255 characters.','Y','N','N','N','N','N','N','N','N','N','Y','Description',0,TO_DATE('2008-06-02 21:55:01','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:55:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52095 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:55:37 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52096,326,0,14,52004,'Help',TO_DATE('2008-06-02 21:55:37','YYYY-MM-DD HH24:MI:SS'),100,'Comment or Hint','A',2000,'The Help field contains a hint, comment or help about the use of this item.','Y','N','N','N','N','N','N','N','N','N','Y','Comment/Help',0,TO_DATE('2008-06-02 21:55:37','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:55:37 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52096 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:56:03 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52097,348,0,20,52004,'IsActive',TO_DATE('2008-06-02 21:56:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','The record is active in the system','A',1,'There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports. -There are two reasons for de-activating and not deleting records: -(1) The system requires the record for audit purposes. -(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','N','N','N','N','N','N','N','N','N','Y','Active',0,TO_DATE('2008-06-02 21:56:02','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:56:03 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52097 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:56:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52043,0,'LastLockTime',TO_DATE('2008-06-02 21:56:55','YYYY-MM-DD HH24:MI:SS'),100,'Last time at which the terminal was locked','A','Y','Last Lock Time','Last Lock Time',TO_DATE('2008-06-02 21:56:55','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:56:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52043 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:57:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52098,52043,0,16,52004,'LastLockTime',TO_DATE('2008-06-02 21:57:13','YYYY-MM-DD HH24:MI:SS'),100,'Last time at which the terminal was locked','A',7,'Y','N','N','N','N','N','N','N','N','N','Y','Last Lock Time',0,TO_DATE('2008-06-02 21:57:13','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:57:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52098 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:58:06 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52044,0,'Locked',TO_DATE('2008-06-02 21:58:06','YYYY-MM-DD HH24:MI:SS'),100,'Whether the terminal is locked','A','Y','Locked','Locked',TO_DATE('2008-06-02 21:58:06','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:58:06 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52044 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:58:26 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52099,52044,0,20,52004,'Locked',TO_DATE('2008-06-02 21:58:26','YYYY-MM-DD HH24:MI:SS'),100,'N','Whether the terminal is locked','A',1,'Y','N','N','N','N','N','N','N','N','N','Y','Locked',0,TO_DATE('2008-06-02 21:58:26','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 9:58:26 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52099 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 9:59:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52045,0,'LockTime',TO_DATE('2008-06-02 21:59:13','YYYY-MM-DD HH24:MI:SS'),100,'Time in minutes the terminal should be kept in a locked state.','A','Y','Lock Time','Lock Time',TO_DATE('2008-06-02 21:59:13','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 9:59:13 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52045 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 9:59:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,ValueMin,Version) VALUES (0,52100,52045,0,11,52004,'LockTime',TO_DATE('2008-06-02 21:59:40','YYYY-MM-DD HH24:MI:SS'),100,'Time in minutes the terminal should be kept in a locked state.','A',10,'Y','N','N','N','N','N','N','N','N','N','Y','Lock Time',0,TO_DATE('2008-06-02 21:59:40','YYYY-MM-DD HH24:MI:SS'),100,'0',0) -; - --- Jun 2, 2008 9:59:40 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52100 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:00:25 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52101,459,0,19,52004,'M_Warehouse_ID',TO_DATE('2008-06-02 22:00:24','YYYY-MM-DD HH24:MI:SS'),100,'Storage Warehouse and Service Point','A',22,'The Warehouse identifies a unique Warehouse where products are stored or Services are provided.','Y','N','N','N','N','N','N','N','N','N','Y','Warehouse',0,TO_DATE('2008-06-02 22:00:24','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:00:25 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52101 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:00:44 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52102,469,0,10,52004,'Name',TO_DATE('2008-06-02 22:00:44','YYYY-MM-DD HH24:MI:SS'),100,'Alphanumeric identifier of the entity','A',60,'The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','Y','N','N','N','N','N','N','N','N','N','Y','Name',0,TO_DATE('2008-06-02 22:00:44','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:00:44 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52102 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:02:07 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52103,480,0,18,166,52004,'PO_PriceList_ID',TO_DATE('2008-06-02 22:02:07','YYYY-MM-DD HH24:MI:SS'),100,'Price List used by this Business Partner','A',22,'Identifies the price list used by a Vendor for products purchased by this organization.','Y','N','N','N','N','N','N','N','N','N','Y','Purchase Pricelist',0,TO_DATE('2008-06-02 22:02:07','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:02:07 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52103 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:02:37 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52104,2051,0,10,52004,'PrinterName',TO_DATE('2008-06-02 22:02:37','YYYY-MM-DD HH24:MI:SS'),100,'Name of the Printer','A',60,'Internal (Opereating System) Name of the Printer; Please mote that the printer name may be different on different clients. Enter a printer name, which applies to ALL clients (e.g. printer on a server).

-If none is entered, the default printer is used. You specify your default printer when you log in. You can also change the default printer in Preferences.','Y','N','N','N','N','N','N','N','N','N','Y','Printer Name',0,TO_DATE('2008-06-02 22:02:37','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:02:37 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52104 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:03:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52105,1063,0,18,316,52004,'SalesRep_ID',TO_DATE('2008-06-02 22:03:16','YYYY-MM-DD HH24:MI:SS'),100,'Sales Representative or Company Agent','A',22,'The Sales Representative indicates the Sales Rep for this Region. Any Sales Rep must be a valid internal user.','Y','N','N','N','N','N','N','N','N','N','Y','Sales Representative',0,TO_DATE('2008-06-02 22:03:16','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:03:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52105 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:04:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52046,0,'SO_PriceList_ID',TO_DATE('2008-06-02 22:04:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Sales Pricelist','Sales Pricelist',TO_DATE('2008-06-02 22:04:15','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 10:04:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52046 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 10:04:46 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52106,52046,0,18,166,52004,'SO_PriceList_ID',TO_DATE('2008-06-02 22:04:46','YYYY-MM-DD HH24:MI:SS'),100,'A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Sales Pricelist',0,TO_DATE('2008-06-02 22:04:46','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:04:46 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52106 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:05:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52047,0,'UnlockingTime',TO_DATE('2008-06-02 22:05:16','YYYY-MM-DD HH24:MI:SS'),100,'Time at which the terminal should be unlocked','A','Y','UnlockingTime','UnlockingTime',TO_DATE('2008-06-02 22:05:16','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 10:05:16 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52047 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 10:05:34 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52107,52047,0,16,52004,'UnlockingTime',TO_DATE('2008-06-02 22:05:34','YYYY-MM-DD HH24:MI:SS'),100,'Time at which the terminal should be unlocked','A',7,'Y','N','N','N','N','N','N','N','N','N','Y','UnlockingTime',0,TO_DATE('2008-06-02 22:05:34','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:05:34 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52107 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:05:58 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52108,607,0,16,52004,'Updated',TO_DATE('2008-06-02 22:05:58','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was updated','A',7,'The Updated field indicates the date that this record was updated.','Y','N','N','N','N','Y','N','N','N','N','N','Updated',0,TO_DATE('2008-06-02 22:05:58','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:05:58 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52108 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:06:30 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52109,608,0,18,110,52004,'UpdatedBy',TO_DATE('2008-06-02 22:06:30','YYYY-MM-DD HH24:MI:SS'),100,'User who updated this records','A',22,'The Updated By field indicates the user who updated this record.','Y','N','N','N','N','N','N','N','N','N','Y','Updated By',0,TO_DATE('2008-06-02 22:06:30','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:06:30 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52109 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:29:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52048,0,'U_POSTerminal_ID',TO_DATE('2008-06-02 22:29:01','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','POS Terminal','POS Terminal',TO_DATE('2008-06-02 22:29:01','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 10:29:01 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52048 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 10:29:54 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52110,52048,0,13,52004,'U_POSTerminal_ID',TO_DATE('2008-06-02 22:29:54','YYYY-MM-DD HH24:MI:SS'),100,'A',22,'Y','N','N','N','Y','Y','N','N','N','N','N','POS Terminal',0,TO_DATE('2008-06-02 22:29:54','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:29:54 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52110 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 2, 2008 10:48:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52049,0,'CheckTransferCashBook_ID',TO_DATE('2008-06-02 22:48:55','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Check transactions','A','Y','Transfer Check trx to','Transfer Check trx to',TO_DATE('2008-06-02 22:48:55','YYYY-MM-DD HH24:MI:SS'),100) -; - --- Jun 2, 2008 10:48:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52049 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- Jun 2, 2008 10:49:35 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52111,52049,0,18,52004,52004,'CheckTransferCashBook_ID',TO_DATE('2008-06-02 22:49:35','YYYY-MM-DD HH24:MI:SS'),100,'Cash Book on which to transfer all Check transactions','A',22,'Y','N','N','N','N','N','N','N','N','N','Y','Transfer Check trx to',0,TO_DATE('2008-06-02 22:49:35','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- Jun 2, 2008 10:49:35 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52111 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Jun 3, 2008 2:27:59 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Sequence (AD_Client_ID,AD_Org_ID,AD_Sequence_ID,Created,CreatedBy,CurrentNext,CurrentNextSys,Description,IncrementNo,IsActive,IsAudited,IsAutoSequence,IsTableID,Name,StartNewYear,StartNo,Updated,UpdatedBy) VALUES (0,0,52006,TO_DATE('2008-06-03 14:27:59','YYYY-MM-DD HH24:MI:SS'),100,1000000,100,'Table U_POSTerminal',1,'Y','N','Y','Y','U_POSTerminal','N',1000000,TO_DATE('2008-06-03 14:27:59','YYYY-MM-DD HH24:MI:SS'),100) -; \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.0/postgresql/003_Terminals_TransferConfiguration.sql b/posterita/commons/Migration/1.7.0/postgresql/003_Terminals_TransferConfiguration.sql deleted file mode 100644 index dab9bf8b1b..0000000000 --- a/posterita/commons/Migration/1.7.0/postgresql/003_Terminals_TransferConfiguration.sql +++ /dev/null @@ -1,75 +0,0 @@ -ALTER TABLE AD_OrgInfo ADD COLUMN TransferBank_ID NUMERIC; -ALTER TABLE AD_OrgInfo ADD COLUMN TransferCashBook_ID NUMERIC; - -ALTER TABLE AD_OrgInfo - ADD CONSTRAINT "cbank_adorginfo" - FOREIGN KEY(TransferBank_ID) - REFERENCES C_Bank(C_Bank_ID); - - -ALTER TABLE AD_OrgInfo - ADD CONSTRAINT "ccashbook_adorginfo" - FOREIGN KEY(TransferCashBook_ID) - REFERENCES C_CashBook(C_CashBook_ID); - - - - --- May 26, 2008 23:25:51 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52028,0,'TransferBank_ID',TO_DATE('2008-05-26 23:25:50','YYYY-MM-DD HH24:MI:SS'),100,'Bank account depending on currency will be used from this bank for doing transfers','D','Y','Bank for transfers','Bank for transfers',TO_DATE('2008-05-26 23:25:50','YYYY-MM-DD HH24:MI:SS'),100) -; - --- May 26, 2008 23:25:51 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52028 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- May 26, 2008 23:26:38 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,52001,TO_DATE('2008-05-26 23:26:38','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','C_Bank',TO_DATE('2008-05-26 23:26:38','YYYY-MM-DD HH24:MI:SS'),100,'T') -; - --- May 26, 2008 23:26:38 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=52001 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) -; - --- May 26, 2008 23:28:08 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,3039,3031,0,52001,296,TO_DATE('2008-05-26 23:28:08','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_DATE('2008-05-26 23:28:08','YYYY-MM-DD HH24:MI:SS'),100,'C_Bank.IsOwnBank=''Y''') -; - --- May 26, 2008 23:28:33 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52075,52028,0,18,52001,228,'TransferBank_ID',TO_DATE('2008-05-26 23:28:33','YYYY-MM-DD HH24:MI:SS'),100,'Bank account depending on currency will be used from this bank for doing transfers','D',22,'Y','N','N','N','N','N','N','N','N','N','Y','Bank for transfers',0,TO_DATE('2008-05-26 23:28:33','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- May 26, 2008 23:28:33 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52075 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - - - --- Cash Book - --- May 26, 2008 23:29:40 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,52029,0,'TransferCashBook_ID',TO_DATE('2008-05-23 23:29:40','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','CashBook for transfers','CashBook for transfers',TO_DATE('2008-05-23 23:29:40','YYYY-MM-DD HH24:MI:SS'),100) -; - --- May 26, 2008 23:29:40 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=52029 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) -; - --- May 26, 2008 23:30:32 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,52076,52029,0,18,52004,228,'TransferCashBook_ID',TO_DATE('2008-05-23 23:30:31','YYYY-MM-DD HH24:MI:SS'),100,'D',22,'Y','N','N','N','N','N','N','N','N','N','Y','CashBook for transfers',0,TO_DATE('2008-05-23 23:30:31','YYYY-MM-DD HH24:MI:SS'),100,0) -; - --- May 26, 2008 23:30:32 AM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52076 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; diff --git a/posterita/commons/Migration/1.7.0/postgresql/004_Terminals_newTableDDL.sql b/posterita/commons/Migration/1.7.0/postgresql/004_Terminals_newTableDDL.sql deleted file mode 100644 index 408b569bfa..0000000000 --- a/posterita/commons/Migration/1.7.0/postgresql/004_Terminals_newTableDDL.sql +++ /dev/null @@ -1,4 +0,0 @@ --- Jun 2, 2008 23:58:02 AM GMT+04:00 --- Default comment for updating dictionary -CREATE TABLE U_POSTerminal (AD_Client_ID NUMERIC(10) DEFAULT NULL NOT NULL, AD_Org_ID NUMERIC(10) DEFAULT NULL NOT NULL, AutoLock CHAR(1) DEFAULT 'N' CHECK (AutoLock IN ('Y','N')) NOT NULL, Card_BankAccount_ID NUMERIC(10), CardTransferBankAccount_ID NUMERIC(10), CardTransferCashBook_ID NUMERIC(10), CardTransferType CHAR(1), CashBookTransferType CHAR(1) NOT NULL, CashTransferBankAccount_ID NUMERIC(10), CashTransferCashBook_ID NUMERIC(10), C_CashBook_ID NUMERIC(10) NOT NULL, C_CashBPartner_ID NUMERIC(10) NOT NULL, Check_BankAccount_ID NUMERIC(10), CheckTransferBankAccount_ID NUMERIC(10), CheckTransferCashBook_ID NUMERIC(10), CheckTransferType CHAR(1), Created TIMESTAMP NOT NULL, CreatedBy NUMERIC(10) NOT NULL, C_TemplateBPartner_ID NUMERIC(10), Description VARCHAR(255), Help VARCHAR(2000), IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')), LastLockTime TIMESTAMP, Locked CHAR(1) DEFAULT 'N' CHECK (Locked IN ('Y','N')), LockTime NUMERIC(10), M_Warehouse_ID NUMERIC(10), Name VARCHAR(60), PO_PriceList_ID NUMERIC(10), PrinterName VARCHAR(60), SalesRep_ID NUMERIC(10), SO_PriceList_ID NUMERIC(10), UnlockingTime TIMESTAMP, Updated TIMESTAMP NOT NULL, UpdatedBy NUMERIC(10), U_POSTerminal_ID NUMERIC(10) NOT NULL, CONSTRAINT U_POSTerminal_Key PRIMARY KEY (U_POSTerminal_ID)) -; \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.0/postgresql/005_Messages.sql b/posterita/commons/Migration/1.7.0/postgresql/005_Messages.sql deleted file mode 100644 index 10f0b71a0b..0000000000 --- a/posterita/commons/Migration/1.7.0/postgresql/005_Messages.sql +++ /dev/null @@ -1,189 +0,0 @@ --- Jun 9, 2008 1:24:35 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52452,0,TO_DATE('2008-06-09 13:24:35','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Organisation','I',TO_DATE('2008-06-09 13:24:35','YYYY-MM-DD HH24:MI:SS'),100,'smenu.organisation') -; - --- Jun 9, 2008 1:25:48 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52453,0,TO_DATE('2008-06-09 13:25:48','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Terminals','I',TO_DATE('2008-06-09 13:25:48','YYYY-MM-DD HH24:MI:SS'),100,'smenu.terminal') -; - --- Jun 9, 2008 1:26:06 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52454,0,TO_DATE('2008-06-09 13:26:06','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cash Books','I',TO_DATE('2008-06-09 13:26:06','YYYY-MM-DD HH24:MI:SS'),100,'smenu.cashbook') -; - --- Jun 9, 2008 1:26:30 PM GMT+04:00 --- Default comment for updating dictionary -UPDATE AD_Message SET MsgTip='Maintain POS Terminals',Updated=TO_DATE('2008-06-09 13:26:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=52453 -; - --- Jun 9, 2008 1:26:39 PM GMT+04:00 --- Default comment for updating dictionary -UPDATE AD_Message SET MsgTip='Maintain Cash Books',Updated=TO_DATE('2008-06-09 13:26:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=52454 -; - --- Jun 9, 2008 1:27:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52455,0,TO_DATE('2008-06-09 13:27:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Completed','I',TO_DATE('2008-06-09 13:27:15','YYYY-MM-DD HH24:MI:SS'),100,'document.status.completed') -; - --- Jun 9, 2008 1:28:05 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52456,0,TO_DATE('2008-06-09 13:28:04','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Drafted','I',TO_DATE('2008-06-09 13:28:04','YYYY-MM-DD HH24:MI:SS'),100,'document.status.drafted') -; - --- Jun 9, 2008 1:28:27 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52457,0,TO_DATE('2008-06-09 13:28:27','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','In Progress','I',TO_DATE('2008-06-09 13:28:27','YYYY-MM-DD HH24:MI:SS'),100,'document.status.inprogress') -; - --- Jun 9, 2008 1:28:44 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52458,0,TO_DATE('2008-06-09 13:28:44','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Invalid','I',TO_DATE('2008-06-09 13:28:44','YYYY-MM-DD HH24:MI:SS'),100,'document.status.invalid') -; - --- Jun 9, 2008 1:28:58 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52459,0,TO_DATE('2008-06-09 13:28:58','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Closed','I',TO_DATE('2008-06-09 13:28:58','YYYY-MM-DD HH24:MI:SS'),100,'document.status.closed') -; - --- Jun 9, 2008 1:29:15 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52460,0,TO_DATE('2008-06-09 13:29:15','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cash','I',TO_DATE('2008-06-09 13:29:15','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.cash') -; - --- Jun 9, 2008 1:29:27 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52461,0,TO_DATE('2008-06-09 13:29:27','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Card','I',TO_DATE('2008-06-09 13:29:27','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.card') -; - --- Jun 9, 2008 1:29:42 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52462,0,TO_DATE('2008-06-09 13:29:41','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Cheque','I',TO_DATE('2008-06-09 13:29:41','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.cheque') -; - --- Jun 9, 2008 1:29:55 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52463,0,TO_DATE('2008-06-09 13:29:55','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Mixed','I',TO_DATE('2008-06-09 13:29:55','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.mixed') -; - --- Jun 9, 2008 1:30:14 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52464,0,TO_DATE('2008-06-09 13:30:13','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Credit','I',TO_DATE('2008-06-09 13:30:13','YYYY-MM-DD HH24:MI:SS'),100,'payment.rule.credit') -; - --- Jun 9, 2008 1:30:46 PM GMT+04:00 --- Default comment for updating dictionary -INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,52465,0,TO_DATE('2008-06-09 13:30:46','YYYY-MM-DD HH24:MI:SS'),100,'A','Y','Amount Paid','I',TO_DATE('2008-06-09 13:30:46','YYYY-MM-DD HH24:MI:SS'),100,'AmountPaid') -; - --------------------------------------------------------------------------------------------------------------------------------------------------- -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52470 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'html', 'HTML', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52471 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'pdf', 'PDF', ' ', 'I', 'D'); - -INSERT INTO AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52472 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'csv', 'CSV', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52473 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.sales.report', 'Sales Report', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52474 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.best.selling.items', 'Best Selling Items', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52475 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.stock.sales.report', 'Stock Sales Report', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52476 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.transfer.stock', 'Stock Transfer', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52477 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.inventory.move', 'Inventory Move', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52478 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.move.confirmation', 'Move Confirmation', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52479 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'smenu.barcode.printing', 'Barcode Printing', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52480 , 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'basePriceList', 'Base Price List', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52481, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'isDeleteOldRecords', 'Delete Old Records', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52482, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'sales.price.list', 'Sales Price List', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52483, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'purchase.price.list', 'Purchase Price List', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52484, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'pos.terminal', 'Terminal', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52485, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'pos.version', 'Version', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52486, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'pmenu.new.reports', 'Reports', ' ', 'I', 'D'); - -INSERT INTO adempiere.AD_MESSAGE -(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, -updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype) -VALUES(52487, 0, 0, 'Y', TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, TO_TIMESTAMP('2008-06-20 10:40:00','YYYY-MM-DD HH24:MI:SS'), 100, -'isCreatePriceList', 'Create Price List', ' ', 'I', 'D'); - diff --git a/posterita/commons/Migration/1.7.1/build.xml b/posterita/commons/Migration/1.7.1/build.xml deleted file mode 100644 index 2d4b5fad85..0000000000 --- a/posterita/commons/Migration/1.7.1/build.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - File ${file.name} status ${sqlplus.result} - - - - - - diff --git a/posterita/commons/Migration/1.7.1/oracle/001_M_Inventory.sql b/posterita/commons/Migration/1.7.1/oracle/001_M_Inventory.sql deleted file mode 100644 index 545cf9f12e..0000000000 --- a/posterita/commons/Migration/1.7.1/oracle/001_M_Inventory.sql +++ /dev/null @@ -1,2 +0,0 @@ --- Add QtyCsv in M_inventoryLine -ALTER TABLE M_INVENTORYLINE ADD ( QTYCSV NUMBER(10, 0) DEFAULT 0 NOT NULL); diff --git a/posterita/commons/Migration/1.7.1/postgresql/001_M_Inventory.sql b/posterita/commons/Migration/1.7.1/postgresql/001_M_Inventory.sql deleted file mode 100644 index cf41dc0d88..0000000000 --- a/posterita/commons/Migration/1.7.1/postgresql/001_M_Inventory.sql +++ /dev/null @@ -1,2 +0,0 @@ ---Add QtyCSV -ALTER TABLE m_inventoryline ADD COLUMN qtycsv numeric NOT NULL DEFAULT 0; \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.2/build.xml b/posterita/commons/Migration/1.7.2/build.xml deleted file mode 100644 index 6426742ad6..0000000000 --- a/posterita/commons/Migration/1.7.2/build.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - File ${file.name} status ${sqlplus.result} - - - - - - diff --git a/posterita/commons/Migration/1.7.2/oracle/001_ADRole.sql b/posterita/commons/Migration/1.7.2/oracle/001_ADRole.sql deleted file mode 100644 index eae1b645aa..0000000000 --- a/posterita/commons/Migration/1.7.2/oracle/001_ADRole.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Additional Role Configuration for Discount -ALTER TABLE AD_ROLE ADD (IsDiscountUptoLimitPrice char(1) DEFAULT 'N' NOT NULL); -ALTER TABLE AD_ROLE ADD (IsDiscountAllowedOnTotal char(1) DEFAULT 'N' NOT NULL); \ No newline at end of file diff --git a/posterita/commons/Migration/1.7.2/postgresql/001_ADRole.sql b/posterita/commons/Migration/1.7.2/postgresql/001_ADRole.sql deleted file mode 100644 index 0117237506..0000000000 --- a/posterita/commons/Migration/1.7.2/postgresql/001_ADRole.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Additional Role Configuration for Discount -ALTER TABLE ad_role ADD COLUMN IsDiscountUptoLimitPrice char(1) NOT NULL DEFAULT 'N'; -ALTER TABLE ad_role ADD COLUMN IsDiscountAllowedOnTotal char(1) NOT NULL DEFAULT 'N'; \ No newline at end of file diff --git a/posterita/commons/Migration/oracle.properties b/posterita/commons/Migration/oracle.properties deleted file mode 100644 index 2feedd7454..0000000000 --- a/posterita/commons/Migration/oracle.properties +++ /dev/null @@ -1,6 +0,0 @@ -#ORACLE_HOME -#Example Value: oracle.home=C:/oracle/xe/app/oracle/product/10.2.0/server -oracle.home=C:/adempiere-cd/progs/oracle-xe/app/oracle/product/10.2.0/server - -#sqlplus connection string -oracle.connect.param=ademstbl/adempiere \ No newline at end of file diff --git a/posterita/commons/Migration/oracle.properties.template b/posterita/commons/Migration/oracle.properties.template deleted file mode 100644 index 37b4aec842..0000000000 --- a/posterita/commons/Migration/oracle.properties.template +++ /dev/null @@ -1,6 +0,0 @@ -#ORACLE_HOME -#Example Value: oracle.home=C:/oracle/xe/app/oracle/product/10.2.0/server -oracle.home=C:/adempiere-cd/progs/oracle-xe/app/oracle/product/10.2.0/server - -#sqlplus connection string -oracle.connect.param=adempiere/adempiere \ No newline at end of file diff --git a/posterita/commons/Migration/trunk/build.xml b/posterita/commons/Migration/trunk/build.xml deleted file mode 100644 index f9f01b20f0..0000000000 --- a/posterita/commons/Migration/trunk/build.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - File ${file.name} status ${sqlplus.result} - - - - - - diff --git a/posterita/commons/Migration/trunk/oracle/002_ADMessage.sql b/posterita/commons/Migration/trunk/oracle/002_ADMessage.sql deleted file mode 100644 index 35e47626c5..0000000000 --- a/posterita/commons/Migration/trunk/oracle/002_ADMessage.sql +++ /dev/null @@ -1,14 +0,0 @@ -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52488, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'discount.upto.price.limit', 'Enforce Discount Upto Limit Price', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52489, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'over.ride.limit.price', 'Enforce Overide Limit Price', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52490, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'discount.allowed.total', 'Allowed Discount On Total Sales', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52491, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'smenu.pos.purchase.report', 'Purchases Report', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52492, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'smenu.settle.payment.credit.purchase', 'Settle Payment For Purchases On Credit', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52493, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'smenu.user.manual', 'User Manual', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52494, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'smenu.contactus', 'Contact Us', NULL, 'I', 'U'); diff --git a/posterita/commons/Migration/trunk/oracle/003_AD_OrgInfo.sql b/posterita/commons/Migration/trunk/oracle/003_AD_OrgInfo.sql deleted file mode 100644 index 4d39cae971..0000000000 --- a/posterita/commons/Migration/trunk/oracle/003_AD_OrgInfo.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE ad_orginfo ADD (receiptfootermsg varchar(1023)); diff --git a/posterita/commons/Migration/trunk/oracle/004_AD_Changes for AD_OrgInfo.sql b/posterita/commons/Migration/trunk/oracle/004_AD_Changes for AD_OrgInfo.sql deleted file mode 100644 index cdd020cb42..0000000000 --- a/posterita/commons/Migration/trunk/oracle/004_AD_Changes for AD_OrgInfo.sql +++ /dev/null @@ -1,15 +0,0 @@ -INSERT INTO AD_Element -(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, -columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) -VALUES(52050, 0, 0, 'Y', sysdate, 100, sysdate, 100, -'ReceiptFooterMsg', 'U', 'Receipt Footer Msg', 'Receipt Footer Msg', 'This message will be displayed at the bottom of a receipt when doing a sales or purchase', NULL, NULL, NULL, NULL, NULL); - - -INSERT INTO ad_column -(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, -description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, -ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, -isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, -ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) -VALUES(52112, 0, 0, 'Y', sysdate, sysdate, 100, 100, 'ReceiptFooterMsg' , 'This message will be displayed at the bottom of a receipt when doing a sales or purchase', NULL, 0, 'U', 'ReceiptFooterMsg', 228, 10, NULL, NULL, 1024, 1, 'N', 'N', 'Y', 'Y', NULL, -'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52050, NULL, 'N', 'N', NULL, NULL); diff --git a/posterita/commons/Migration/trunk/oracle/005_MissingIDs.sql b/posterita/commons/Migration/trunk/oracle/005_MissingIDs.sql deleted file mode 100644 index c2142b123d..0000000000 --- a/posterita/commons/Migration/trunk/oracle/005_MissingIDs.sql +++ /dev/null @@ -1,20 +0,0 @@ --- Missing Ids for M_InventoryLine & AD_Role --- AD Element -INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) - VALUES(52051, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'IsDiscountUptoLimitPrice', 'U', 'IsDiscountUptoLimitPrice', 'IsDiscountUptoLimitPrice', NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) - VALUES(52052, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'IsDiscountAllowedOnTotal', 'U', 'IsDiscountAllowedOnTotal', 'IsDiscountAllowedOnTotal', NULL, NULL, NULL, NULL, NULL, NULL); - --- AD Column -INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) - VALUES(52113, 0, 0, 'Y', sysdate, sysdate, 100, 100, 'IsDiscountUptoLimitPrice', NULL, NULL, 0, 'U', 'IsDiscountUptoLimitPrice', 156, 20, NULL, NULL, 1, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52051, NULL, 'N', 'N', NULL, NULL, NULL); -INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) - VALUES(52114, 0, 0, 'Y', sysdate, sysdate, 100, 100, 'IsDiscountAllowedOnTotal', NULL, NULL, 0, 'U', 'IsDiscountAllowedOnTotal', 156, 20, NULL, NULL, 1, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52052, NULL, 'N', 'N', NULL, NULL, NULL); - --- AD Element -INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) - VALUES(52053, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'QtyCsv', 'U', 'QtyCsv', 'QtyCsv', NULL, NULL, NULL, NULL, NULL, NULL); - --- AD Column -INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) - VALUES(52115, 0, 0, 'Y', sysdate, sysdate, 100, 100, 'QtyCsv', NULL, NULL, 0, 'U', 'QtyCsv', 322, 29, NULL, NULL, 131089, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52053, NULL, 'N', 'N', NULL, NULL, NULL); diff --git a/posterita/commons/Migration/trunk/oracle/006_PackSize_MProduct.sql b/posterita/commons/Migration/trunk/oracle/006_PackSize_MProduct.sql deleted file mode 100644 index b4e2943c21..0000000000 --- a/posterita/commons/Migration/trunk/oracle/006_PackSize_MProduct.sql +++ /dev/null @@ -1,10 +0,0 @@ --- The Units Per Pack indicates the no of units of a product packed together. -ALTER TABLE M_Product ADD (UnitsPerPack number(10,0) default 1 not null ); - --- AD Element -- -INSERT INTO AD_ELEMENT(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) - VALUES(52054, 0, 0, 'Y', sysdate, 100, sysdate, 100, 'UnitsPerPack', 'U', 'UnitsPerPack', 'UnitsPerPack', 'The Units Per Pack indicates the no of units of a product packed together.', NULL, NULL, NULL, NULL, NULL); - --- AD Column -- -INSERT INTO AD_COLUMN(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) - VALUES(52116, 0, 0, 'Y', sysdate, sysdate, 100, 100, 'UnitsPerPack', 'The Units Per Pack indicates the no of units of a product packed together.', NULL, 0, 'U', 'UnitsPerPack', 208, 11, NULL, NULL, 14, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52054, NULL, 'N', 'N', NULL, NULL, NULL); diff --git a/posterita/commons/Migration/trunk/oracle/007_CashPayment.sql b/posterita/commons/Migration/trunk/oracle/007_CashPayment.sql deleted file mode 100644 index 6a20e40e85..0000000000 --- a/posterita/commons/Migration/trunk/oracle/007_CashPayment.sql +++ /dev/null @@ -1,85 +0,0 @@ ---- Alter table -- oracle ---- Table: C_Payment ----------------------------------------------------------- -ALTER TABLE C_Payment -MODIFY C_BankAccount_ID NUMBER(10,0) NULL; - - -ALTER TABLE C_Payment -ADD C_CashBook_ID NUMBER(10,0); - -ALTER TABLE C_Payment -ADD CONSTRAINT C_Payment__C_CashBo_C_CashBook -FOREIGN KEY(C_CashBook_ID) REFERENCES C_CashBook(C_CashBook_ID); - --------------------------------------------------------------------------------- -ALTER TABLE C_CashLine -ADD C_Payment_ID NUMBER(10); - ---- Migration scripts ---------------------------------------------------------- --- Aug 26, 2008 11:49:31 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) -VALUES (0,52117,1463,0,19,335,'C_CashBook_ID',sysdate,100,'Cash Book for recording petty cash transactions','U',10,'The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','N','N','N','N','N','N','N','N','Y','Cash Book',sysdate,100,0); - --- Aug 26, 2008 11:49:31 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52117 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID); - - --- Aug 26, 2008 11:50:27 AM MUT --- Default comment for updating dictionary -UPDATE AD_Column SET IsMandatory='N',Updated=sysdate,UpdatedBy=100 WHERE AD_Column_ID=3880; - - --- Aug 26, 2008 11:50:27 AM MUT --- Default comment for updating dictionary -UPDATE AD_Field SET Name='Bank Account', Description='Account at the Bank', Help='The Bank Account identifies an account at this Bank.' WHERE AD_Column_ID=3880 AND IsCentrallyMaintained='Y'; - - --- Aug 26, 2008 11:51:40 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) -VALUES (0,52117,52052,0,330,sysdate,100,'Cash Book for recording petty cash transactions',10,'U','The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','Y','Y','N','N','N','N','N','Cash Book',sysdate,100); - - --- Aug 26, 2008 11:51:40 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=52052 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID); - - --- Aug 26, 2008 11:51:40 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) -VALUES (0,13705,52053,0,330,sysdate,100,10,'D','Y','Y','Y','N','N','N','N','N','Referenced Payment',sysdate,100); - - --- Aug 26, 2008 11:51:40 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=52053 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID); - - --- Aug 26, 2008 11:52:11 AM MUT --- Default comment for updating dictionary -UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=52053; - - --- Aug 26, 2008 11:52:11 AM MUT --- Default comment for updating dictionary -UPDATE AD_Field SET SeqNo=660,IsDisplayed='Y' WHERE AD_Field_ID=52052; - - --- Aug 26, 2008 11:52:56 AM MUT --- Default comment for updating dictionary -UPDATE AD_Field SET DisplayLogic='@TenderType@ !''X''',Updated=sysdate,UpdatedBy=100 WHERE AD_Field_ID=4030; - - --- Aug 26, 2008 11:54:17 AM MUT --- Default comment for updating dictionary -UPDATE AD_Field SET DisplayLength=14, DisplayLogic='@TenderType@=''X''', IsSameLine='Y',Updated=sysdate,UpdatedBy=100 WHERE AD_Field_ID=52052; - - --- Aug 26, 2008 11:54:42 AM MUT --- Default comment for updating dictionary -UPDATE AD_Tab SET WhereClause=NULL,Updated=sysdate,UpdatedBy=100 WHERE AD_Tab_ID=330; - - diff --git a/posterita/commons/Migration/trunk/postgresql/002_ADMessage.sql b/posterita/commons/Migration/trunk/postgresql/002_ADMessage.sql deleted file mode 100644 index 3b2096d498..0000000000 --- a/posterita/commons/Migration/trunk/postgresql/002_ADMessage.sql +++ /dev/null @@ -1,18 +0,0 @@ -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52488, 0, 0, 'Y', now(), 100, now(), 100, 'discount.upto.price.limit', 'Enforce Discount Upto Limit Price', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52489, 0, 0, 'Y', now(), 100, now(), 100, 'over.ride.limit.price', 'Enforce Overide Limit Price', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52490, 0, 0, 'Y', now(), 100, now(), 100, 'discount.allowed.total', 'Allowed Discount On Total Sales', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52491, 0, 0, 'Y', now(), 100, now(), 100, 'smenu.pos.purchase.report', 'Purchases Report', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52492, 0, 0, 'Y', now(), 100, now(), 100, 'smenu.settle.payment.credit.purchase', 'Settle Payment For Purchases On Credit', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52493, 0, 0, 'Y', now(), 100, now(), 100, 'smenu.user.manual', 'User Manual', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52494, 0, 0, 'Y', now(), 100, now(), 100, 'smenu.contactus', 'Contact Us', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52495, 0, 0, 'Y', now(), 100, now(), 100, 'discount.amt.order.level', 'Discount Amount', NULL, 'I', 'U'); -INSERT INTO ad_message(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, msgtext, msgtip, msgtype, entitytype) - VALUES(52496, 0, 0, 'Y', now(), 100, now(), 100, 'write.off.amt.order.level', 'Writeoff Amount', NULL, 'I', 'U'); diff --git a/posterita/commons/Migration/trunk/postgresql/003_AD_OrgInfo.sql b/posterita/commons/Migration/trunk/postgresql/003_AD_OrgInfo.sql deleted file mode 100644 index b4d0793838..0000000000 --- a/posterita/commons/Migration/trunk/postgresql/003_AD_OrgInfo.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE ad_orginfo ADD COLUMN receiptfootermsg varchar(1023); diff --git a/posterita/commons/Migration/trunk/postgresql/004_AD_Changes for AD_OrgInfo.sql b/posterita/commons/Migration/trunk/postgresql/004_AD_Changes for AD_OrgInfo.sql deleted file mode 100644 index ab403e3f47..0000000000 --- a/posterita/commons/Migration/trunk/postgresql/004_AD_Changes for AD_OrgInfo.sql +++ /dev/null @@ -1,15 +0,0 @@ -INSERT INTO AD_Element -(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, -columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) -VALUES(52050, 0, 0, 'Y', now() , 100, now(), 100, -'ReceiptFooterMsg', 'U', 'Receipt Footer Msg', 'Receipt Footer Msg', 'This message will be displayed at the bottom of a receipt when doing a sales or purchase', NULL, NULL, NULL, NULL, NULL); - - -INSERT INTO ad_column -(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, -description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, -ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, -isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, -ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic) -VALUES(52112, 0, 0, 'Y', now(), now(), 100, 100, 'ReceiptFooterMsg' , 'This message will be displayed at the bottom of a receipt when doing a sales or purchase', NULL, 0, 'U', 'ReceiptFooterMsg', 228, 10, NULL, NULL, 1024, 1, 'N', 'N', 'Y', 'Y', NULL, -'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52050, NULL, 'N', 'N', NULL, NULL); diff --git a/posterita/commons/Migration/trunk/postgresql/005_MissingIDs.sql b/posterita/commons/Migration/trunk/postgresql/005_MissingIDs.sql deleted file mode 100644 index 230c7a4b97..0000000000 --- a/posterita/commons/Migration/trunk/postgresql/005_MissingIDs.sql +++ /dev/null @@ -1,20 +0,0 @@ --- Missing Ids for M_InventoryLine & AD_Role --- AD Element -INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) - VALUES(52051, 0, 0, 'Y', now(), 100, now(), 100, 'IsDiscountUptoLimitPrice', 'U', 'IsDiscountUptoLimitPrice', 'IsDiscountUptoLimitPrice', NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) - VALUES(52052, 0, 0, 'Y', now(), 100, now(), 100, 'IsDiscountAllowedOnTotal', 'U', 'IsDiscountAllowedOnTotal', 'IsDiscountAllowedOnTotal', NULL, NULL, NULL, NULL, NULL, NULL); - --- AD Column -INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) - VALUES(52113, 0, 0, 'Y', now(), now(), 100, 100, 'IsDiscountUptoLimitPrice', NULL, NULL, 0, 'U', 'IsDiscountUptoLimitPrice', 156, 20, NULL, NULL, 1, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52051, NULL, 'N', 'N', NULL, NULL, NULL); -INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) - VALUES(52114, 0, 0, 'Y', now(), now(), 100, 100, 'IsDiscountAllowedOnTotal', NULL, NULL, 0, 'U', 'IsDiscountAllowedOnTotal', 156, 20, NULL, NULL, 1, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52052, NULL, 'N', 'N', NULL, NULL, NULL); - --- AD Element -INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) - VALUES(52053, 0, 0, 'Y', now(), 100, now(), 100, 'QtyCsv', 'U', 'QtyCsv', 'QtyCsv', NULL, NULL, NULL, NULL, NULL, NULL); - --- AD Column -INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) - VALUES(52115, 0, 0, 'Y', now(), now(), 100, 100, 'QtyCsv', NULL, NULL, 0, 'U', 'QtyCsv', 322, 29, NULL, NULL, 131089, NULL, 'N', 'N', 'Y', 'Y', NULL, 'N', NULL, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52053, NULL, 'N', 'N', NULL, NULL, NULL); diff --git a/posterita/commons/Migration/trunk/postgresql/006_PackSize_MProduct.sql b/posterita/commons/Migration/trunk/postgresql/006_PackSize_MProduct.sql deleted file mode 100644 index d324689318..0000000000 --- a/posterita/commons/Migration/trunk/postgresql/006_PackSize_MProduct.sql +++ /dev/null @@ -1,10 +0,0 @@ --- The Units Per Pack indicates the no of units of a product packed together. -ALTER TABLE M_Product ADD COLUMN UnitsPerPack numeric(10,0) not null default 1; - --- AD Element -- -INSERT INTO ad_element(ad_element_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, columnname, entitytype, name, printname, description, help, po_name, po_printname, po_description, po_help) - VALUES(52054, 0, 0, 'Y', now(), 100, now(), 100, 'UnitsPerPack', 'U', 'UnitsPerPack', 'UnitsPerPack', 'The Units Per Pack indicates the no of units of a product packed together.', NULL, NULL, NULL, NULL, NULL); - --- AD Column -- -INSERT INTO ad_column(ad_column_id, ad_client_id, ad_org_id, isactive, created, updated, createdby, updatedby, name, description, help, version, entitytype, columnname, ad_table_id, ad_reference_id, ad_reference_value_id, ad_val_rule_id, fieldlength, defaultvalue, iskey, isparent, ismandatory, isupdateable, readonlylogic, isidentifier, seqno, istranslated, isencrypted, callout, vformat, valuemin, valuemax, isselectioncolumn, ad_element_id, ad_process_id, issyncdatabase, isalwaysupdateable, columnsql, mandatorylogic, infofactoryclass) - VALUES(52116, 0, 0, 'Y', now(), now(), 100, 100, 'UnitsPerPack', 'The Units Per Pack indicates the no of units of a product packed together.', NULL, 0, 'U', 'UnitsPerPack', 208, 11, NULL, NULL, 14, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 52054, NULL, 'N', 'N', NULL, NULL, NULL); diff --git a/posterita/commons/Migration/trunk/postgresql/007_CashPayment.sql b/posterita/commons/Migration/trunk/postgresql/007_CashPayment.sql deleted file mode 100644 index 365ee8e988..0000000000 --- a/posterita/commons/Migration/trunk/postgresql/007_CashPayment.sql +++ /dev/null @@ -1,87 +0,0 @@ --- Alter table -- postgres - ---- Table: C_Payment ----------------------------------------------------------- -ALTER TABLE C_Payment -ALTER COLUMN C_BankAccount_ID DROP NOT NULL; - - -ALTER TABLE C_Payment -ADD C_CashBook_ID NUMERIC(10); - -ALTER TABLE C_Payment -ADD CONSTRAINT C_Payment__C_CashBo_C_CashBook -FOREIGN KEY(C_CashBook_ID) REFERENCES C_CashBook(C_CashBook_ID); - --------------------------------------------------------------------------------- -ALTER TABLE C_CashLine -ADD C_Payment_ID NUMERIC(10); - ---- Migration scripts ---------------------------------------------------------- --- Aug 26, 2008 11:49:31 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,Version) -VALUES (0,52117,1463,0,19,335,'C_CashBook_ID',now(),100,'Cash Book for recording petty cash transactions','U',10,'The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','N','N','N','N','N','N','N','N','Y','Cash Book',now(),100,0) -; - --- Aug 26, 2008 11:49:31 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=52117 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) -; - --- Aug 26, 2008 11:50:27 AM MUT --- Default comment for updating dictionary -UPDATE AD_Column SET IsMandatory='N',Updated=now(),UpdatedBy=100 WHERE AD_Column_ID=3880 -; - --- Aug 26, 2008 11:50:27 AM MUT --- Default comment for updating dictionary -UPDATE AD_Field SET Name='Bank Account', Description='Account at the Bank', Help='The Bank Account identifies an account at this Bank.' WHERE AD_Column_ID=3880 AND IsCentrallyMaintained='Y' -; - --- Aug 26, 2008 11:51:40 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) -VALUES (0,52117,52052,0,330,now(),100,'Cash Book for recording petty cash transactions',10,'U','The Cash Book identifies a unique cash book. The cash book is used to record cash transactions.','Y','Y','Y','N','N','N','N','N','Cash Book',now(),100) -; - --- Aug 26, 2008 11:51:40 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=52052 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) -; - --- Aug 26, 2008 11:51:40 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) -VALUES (0,13705,52053,0,330,now(),100,10,'D','Y','Y','Y','N','N','N','N','N','Referenced Payment',now(),100) -; - --- Aug 26, 2008 11:51:40 AM MUT --- Default comment for updating dictionary -INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=52053 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) -; - --- Aug 26, 2008 11:52:11 AM MUT --- Default comment for updating dictionary -UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=52053 -; - --- Aug 26, 2008 11:52:11 AM MUT --- Default comment for updating dictionary -UPDATE AD_Field SET SeqNo=660,IsDisplayed='Y' WHERE AD_Field_ID=52052 -; - --- Aug 26, 2008 11:52:56 AM MUT --- Default comment for updating dictionary -UPDATE AD_Field SET DisplayLogic='@TenderType@ !''X''',Updated=now(),UpdatedBy=100 WHERE AD_Field_ID=4030 -; - --- Aug 26, 2008 11:54:17 AM MUT --- Default comment for updating dictionary -UPDATE AD_Field SET DisplayLength=14, DisplayLogic='@TenderType@=''X''', IsSameLine='Y',Updated=now(),UpdatedBy=100 WHERE AD_Field_ID=52052 -; - --- Aug 26, 2008 11:54:42 AM MUT --- Default comment for updating dictionary -UPDATE AD_Tab SET WhereClause=NULL,Updated=now(),UpdatedBy=100 WHERE AD_Tab_ID=330 -; - diff --git a/posterita/commons/build.xml b/posterita/commons/build.xml deleted file mode 100644 index c3a2633ba2..0000000000 --- a/posterita/commons/build.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/commons/properties.xml b/posterita/commons/properties.xml deleted file mode 100644 index be1e2401c9..0000000000 --- a/posterita/commons/properties.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - This project file sets all properties needed during build and - installation. This file is imported in all other build.xml - files. This file provides a central place for managing - properties. - - - - - - - - - - diff --git a/posterita/posterita/build.properties b/posterita/posterita/build.properties deleted file mode 100644 index a73faed711..0000000000 --- a/posterita/posterita/build.properties +++ /dev/null @@ -1 +0,0 @@ -posterita.dev.home=./../../adempiere/Adempiere diff --git a/posterita/posterita/build.xml b/posterita/posterita/build.xml deleted file mode 100644 index 4fc8a1a44a..0000000000 --- a/posterita/posterita/build.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/posterita/properties.xml b/posterita/posterita/properties.xml deleted file mode 100644 index be1e2401c9..0000000000 --- a/posterita/posterita/properties.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - This project file sets all properties needed during build and - installation. This file is imported in all other build.xml - files. This file provides a central place for managing - properties. - - - - - - - - - - diff --git a/posterita/posterita/src/aspect/org/posterita/aspect/POAspect.aj b/posterita/posterita/src/aspect/org/posterita/aspect/POAspect.aj deleted file mode 100644 index 186fe56bf3..0000000000 --- a/posterita/posterita/src/aspect/org/posterita/aspect/POAspect.aj +++ /dev/null @@ -1,83 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ - -package org.posterita.aspect; - -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.exceptions.POException; -import org.posterita.exceptions.TerminalLockedException; -import org.compiere.model.PO; -import org.compiere.model.X_C_Order; -import org.compiere.process.DocAction; -import org.compiere.util.CLogger; -import org.compiere.util.ValueNamePair; - -/** - * @author ashley - */ -public aspect POAspect -{ - pointcut savePO(): - call(public boolean PO.save()); - - boolean around() : savePO() - { - if (thisJoinPoint.getTarget() instanceof X_C_Order) - { - X_C_Order order = (X_C_Order)thisJointPoint.getTarget(); - int terminalId = order.getC_POS_ID(); - - if (terminalId > 0 && POSTerminalManager.isTerminalLocked(po.getCtx(), terminalId)) - { - throw new POException("Terminal is locked"); - } - } - - boolean val = proceed(); - - if (!val) - { - Exception ex = CLogger.retrieveException(); - ValueNamePair err = CLogger.retrieveError(); - String msg; - - if (ex != null) - { - msg = ex.getMessage(); - } - else if (err != null) - { - msg = err.getValue() + " " + err.getName(); - } - else if (thisJoinPoint.getTarget() instanceof DocAction) - { - msg = ((DocAction)thisJoinPoint.getTarget()).getProcessMsg(); - } - else - { - msg = "Unknown"; - } - - throw new POException("Could not save PO - Class: " + thisJoinPoint.getTarget().getClass().getName() + " Cause: " + msg); - } - - return val; - } -} \ No newline at end of file diff --git a/posterita/posterita/src/aspect/org/posterita/aspect/TrxAspect.aj b/posterita/posterita/src/aspect/org/posterita/aspect/TrxAspect.aj deleted file mode 100644 index 059b06abac..0000000000 --- a/posterita/posterita/src/aspect/org/posterita/aspect/TrxAspect.aj +++ /dev/null @@ -1,36 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.aspect; - -import org.compiere.util.Trx; - -/** - * @author ashley - */ -public aspect TrxAspect -{ - pointcut closeTrx(): - call(public boolean Trx.close()); - - before() : closeTrx() - { - ((Trx)thisJoinPoint.getTarget()).rollback(); - } -} diff --git a/posterita/posterita/src/ear/application.xml b/posterita/posterita/src/ear/application.xml deleted file mode 100644 index 5d4534ee8b..0000000000 --- a/posterita/posterita/src/ear/application.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - Adempiere Web POS - - AdempiereSLib.jar - - - Adempiere.jar - - - adempiereApps.jar - - - - posterita.war - /posterita - - - diff --git a/posterita/posterita/src/main/ApproveOrderEmailTemplate.properties b/posterita/posterita/src/main/ApproveOrderEmailTemplate.properties deleted file mode 100644 index 043228afef..0000000000 --- a/posterita/posterita/src/main/ApproveOrderEmailTemplate.properties +++ /dev/null @@ -1,6 +0,0 @@ -subject=Tamak Webstore - Order Approved -action=action -content=,
Your order has been approved. -signin.info=Order Information -link=Your products will be shipped shortly. An email will be sent to notify you when it has been shipped. -emailRegards=Regards,
Tamak Webmaster \ No newline at end of file diff --git a/posterita/posterita/src/main/CreateCustomerEmailTemplate.properties b/posterita/posterita/src/main/CreateCustomerEmailTemplate.properties deleted file mode 100644 index b5d2c7c746..0000000000 --- a/posterita/posterita/src/main/CreateCustomerEmailTemplate.properties +++ /dev/null @@ -1,12 +0,0 @@ -subject=Tamak Webstore Account -action=action -&email=&username -&password=&password -signin.info=Your Login Information -login=Login: -password=Password: -content=Thank you for creating an account on Tamak.com - -link=Please click on the link below to automatically log you on Tamak.com. Enjoy! - -emailRegards=Regards,
Tamak Webmaster diff --git a/posterita/posterita/src/main/CreateOrderEmailTemplate.properties b/posterita/posterita/src/main/CreateOrderEmailTemplate.properties deleted file mode 100644 index 6da43c37d7..0000000000 --- a/posterita/posterita/src/main/CreateOrderEmailTemplate.properties +++ /dev/null @@ -1,6 +0,0 @@ -subject=Tamak Webstore - New Order Received -action=action -content=has created a new order on Tamak Webstore -signin.info=New Order Information -link=Please login on the Administration section to view the order for approval and shipping. -emailRegards=Regards,
Tamak Webmaster diff --git a/posterita/posterita/src/main/Factory.properties b/posterita/posterita/src/main/Factory.properties deleted file mode 100644 index 0cc35a30ec..0000000000 --- a/posterita/posterita/src/main/Factory.properties +++ /dev/null @@ -1,127 +0,0 @@ -#Factory -#Mon Oct 24 12:14:38 GST 2005 -attribute.car.model.id=1016505 -smenu.order.history=1025273 -smenu.product.restriction.id=1056362 -smenu.dealer.transfer.request.id=1050047 -attributeset.car.id=1003664 -smenintu.dealer.transfer.history.id=1050050 -attributeset.bike.id=1003665 -pmenu.dealer.transfer.id=1050045 -smenu.view.all.users.id=1056370 -smenu.messagessent.id=1050002 -discountschema.id=1004556 -pmenu.ordersreceived.id=1050030 -taxCategory.default.id=1003155 -smenu.purchase.order.create.id=1050019 -attribute.bike.modelGroup.id=1016511 -smenu.dealer.order.history=1031333 -smenu.messagescompose.id=1050003 -smenu.movement.id=1056365 -smenu.createsco.id=1050028 -attribute.bike.model.id=1016510 -menu.createLocator.id=1056361 -productCategory.car.id=1003699 -smenu.mmovement.id=1031380 -smenu.allocation.edit.id=1050073 -smenu.view.all.banks.id=1056360 -attribute.bike.trx.id=1016513 -car.assetgroup.id=1000621 -role.HsafAutoAdmin.id=1016896 -smenu.purchase.order.history.id=1050021 -smenu.receive.new.vehicles.id=1050040 -smenu.group.models.id=1056369 -productCategory.usedCar.id=1003700 -pmenu.natis.release.id=1031345 -smenu.inquire.on.vin.number.id=1050014 -superUser.id=1016038 -smenu.createBankAccount.id=1056366 -role.udiAdmin.id=1016895 -smenu.inquiry.id=1031329 -smenu.role.id=1056373 -attribute.car.year.id=1016509 -smenu.view.wholesale.report.id=1050082 -smenu.special.colour.order.received.id=1031337 -smenu.dealer.order.received.id=1050052 -smenu.sell.release.vehicle.id=1050057 -smenu.view.sco.products.id=1031390 -smenu.allocation.orders.view.id=1050075 -smenu.my.certificates.id=1050059 -smenu.release.vehicle.id=1031347 -smenu.my.stock.id=1050012 -wholesale.priceList.purchase.id=1005554 -priceLV.sales.id=1005891 -role.stock.controller.id=1016893 -smenu.search.vin.number.id=1056374 -smenu.dealer.order.reeived.id=1031336 -smenu.view.all.orgs.id=1056371 -smenu.price.listing=1056372 -smenu.view.retail.report.id=1050081 -smenu.licensing.district.id=1031346 -pmenu.sales.id=1050055 -pmenu.stock.inquiry.id=1050008 -role.test.id=1016894 -smenu.view.sales.report.without.trans.id=1050080 -smenu.sco.history.id=1050027 -pmenu.invoice.id=1031338 -smenu.warehouse.id=1056359 -attribute.car.colour.id=1016507 -pmenu.my.details.id=1050004 -smenu.allocation.create.id=1050068 -pmenu.home.id=1049999 -pmenu.messages.id=1050000 -pmenu.payment.id=1031340 -attribute.car.make.id=1016504 -smenu.payment.history=1031341 -attribute.bike.colour.id=1016512 -role.sales.person.id=1016892 -smenu.create.customer.id=1056375 -smenu.new.car.stock.inquiry.id=1050009 -smenu.create.target.sales.id=1056368 -priceLV.purchase.id=1005889 -smenu.allocation.history.id=1050077 -smenu.invoice.history=1031339 -smenu.wholesale.order.history=1050038 -attribute.car.modelGroup.id=1016506 -smenu.productAttribute.id=1056367 -smenu.messagesinbox.id=1050001 -smenu.allocations.view.id=1031354 -role.sales.manager.id=1016891 -smenu.view.certificate.id=1031348 -smenu.upload.cvs.file.id=1050042 -pmenu.dealer.order.id=1050017 -attribute.car.trx.id=1016508 -role.system.administrator.id=1016889 -pmenu.specialcolourorder.id=1050025 -smenu.changeemail.id=1050007 -pricelist.sales.id=1005553 -pricelist.purchase.id=1005552 -pmenu.reports.id=1050078 -smenu.specialcolourorderreceived.id=1050034 -pmenu.admin.id=1050084 -smenu.allocation.order.create.id=1050071 -wholesale.priceLV.purchase.id=1005890 -smenu.create.shipper.id=1056376 -role.HsafWingAdmin.id=1016897 -smenu.view.my.details.ic=1050005 -pmenu.allocation.id=1050065 -smenu.my.used.car.stock.id=1050011 -smenu.sales.history.id=1050063 -smenu.createProduct.id=1056364 -tax.default.id=1002758 -smenu.view.receipt.history=1031344 -pmenu.logout.id=1056377 -smenu.trade.in.id=1050061 -usedCar.assetgroup.id=1000627 -pmenu.inOut.id=1031342 -smenu.view.sales.report.with.trans.id=1050079 -role.dealer.principal.id=1016890 -smenu.view.shipment.history=1031343 -smenu.closemenu.id=1031363 -smenu.changeuserpassword.id=1050006 -smenu.product.inquiry=1031373 -attribute.bike.year.id=1016514 -pmenu.allocations.id=1031350 -pmenu.wholesaler.order.id=1050036 -pmenu.history.id=1050083 -menu.createBPartner.id=1056358 diff --git a/posterita/posterita/src/main/MessageResources.properties b/posterita/posterita/src/main/MessageResources.properties deleted file mode 100644 index fcd0203544..0000000000 --- a/posterita/posterita/src/main/MessageResources.properties +++ /dev/null @@ -1,1266 +0,0 @@ -asset.natisrelease.no=NaTIS Release No -asset.natiscontrol.no=NaTIS Control No -asset.register.no=Register No - -assetstatus.hsaf.stock=In Stock -assetstatus.onwater.stock=On Water -assetstatus.retailed=Retailed -assetStatus.wholesaled=Wholesaled - -#Tamak specific -#footer.copyright=All Contents ©2006 Tamak ICT -#title.welcome=Welcome to Tamak POS -#title.POS=Tamak POS - -footer.copyright=All Contents ©2006 Tamak ICT -title.welcome=Welcome to Tamak POS -title.POS=Tamak POS - - - -scostatus.update =Update SCO Status - -# -- standard errors -- -errors.header=

    -errors.prefix=
  • -errors.suffix=
  • -errors.footer=
-# -- validator -- - -error.minlength.customerID=Customer ID should be of 13 digits -error.natiscustomer.alreadyexist=This customer already exists on your database.Please select the link "Existing Customer?" and choose the customer. -error.dataAccessException=Your request cannot be processed because some important data is missing. Please contact the System Administrator for more details. -error.operationException=Please specify an order to view -error.systemException=An error has been detected. Please contact the System Administrator for more information. -error.runtimeException=An runtime error has occurred. Please contact the System Administrator for more details -errorpage.title=Errror Page -errorpage.heading=You have performed an illegal operation. -errors.invalid={0} is invalid. -error.required={0} is required. -error.match={0} do not match. -error.date.prior.today=ArrivalDate cannot be prior to today's date. -error.dateRangeNotValidException=Date range is not valid. Please try another one -error.match.password=Your passwords do not match. Please retype your new password. -error.match.newPassword=Your passwords do not match. Please retype your new password. -error.match.newEmail=Your emails do not match. Please retype your new email. -errors.maxlength={0} can not be greater than {1} characters. -errors.minlength={0} can not be less than {1} characters. -errors.range={0} is not in the range {1} through {2}. -errors.required={0} is required. -errors.byte={0} must be a byte. -errors.date={0} is not a date. -errors.double={0} must be a double. -errors.float={0} must be a float. -errors.integer={0} must be an integer. -errors.long={0} must be a long. -errors.short={0} must be a short. -errors.creditcard={0} is not a valid credit card number. -errors.email={0} is an invalid e-mail address. -error.numberformatexception.quantity=Please enter a numeric value for quantity. -error.numberformatexception.customerIdBookNumber=Please enter a numeric value for customer ID Book Number. -error.numberformatexception.customerID=Please enter numeric values only for customerID. -error.role.Invalid=Role cannot be found. Please try login again with another role. Contact your System Administrator if the problem persists. -error.illegal.access=You cannot view this order because it does not belong to you. -error.noStock.Available=Quantity available in stock is less than input quantity for {0} {1} {2} {3} -error.webstore.noStock.Available=Quantity available for {0} is {1}. You cannot order for an amount more than {1} -error.orderedQuantity.invalid=Ordered quantity must be greater than 0 -error.productquantity.invalid=Ordered quantiry must be greater than 0. -error.invoice.nolineselected=Please select at least one line to generate invoice. -error.csvfile.invalid=There are errors in File, please delete the old file and download again to see the errors. -error.file.not.found=Please attach a file -error.stock.not.available=The Required Stock is Not Available. {0} -error.inventory=No Inventory Available. {0} -error.inventory.not.available=Insufficient Inventory Available. {0} -error.vehicle.alreadyReleased=The vehicle has already been released. -error.shipper.alreadyExists=Shipper already exists. Please choose another name. -error.allocationname.alreadyused=The name you supplied has already been used. Please input another one. -error.notallvins.available=Not all VIN numbers are currently available. -error.poReference.invalid=Please enter a valid reference number. -error.ftp.file=The file contains a VIN number that is already present in the system. This file may have already been processed. -error.naamsaModelCode.exist=The code you have entered already exist. Please enter another one. -error.naamsaDealerCode.exist=The code you have entered already exist. Please enter another one. -error.salesrep.required = Please select a sales representative. -error.date.notselected = Please choose a date. -error.emptycart = Your cart is empty! -error.trackingNo.not.found=Please Specify the Tracking Number of FedEx. -error.in.file=There is an error in the file, Please check for the for the ";" in the file and replace it by ","
and no field should be empty
If there is no discount and limit price, please make them same a the one for the List Price.
also check whether the tax rate that has been defined in the file exists. -error.invalid.address=The Customer does not has any address, Please Edit the customer. -error.invalid.orderType=The Order is not a POS Order, Please check the Document No -error.no.checkbox.selected=Please select a checkbox - -error.client.alreadyexist=Client with the name provided already exist -error.client.create=Could not create client with the details provided.
Please contact POSterita (support@posterita.org) for support.
Cause:{0} - - -error.allocation.notclosable=Cannot close allocation because one or more lines are not Accepted yet -error.allocation.report.notselected=Please select an allocation to generate report. -error.allocation.notselected=Please select an allocation to generate order. -error.vin.already.exists=VIN number has already been used. -error.role.already.exists = The name has already been used. Please enter another name. -error.role.edit=Could not edit role -error.attributevalue.description.exception = Please enter a description -error.too.many.invoice=Only one invoice at a time can be allocated with payments and credit memo. -error.allocation.amt.exceeds.openamt=Allocation amount is more than the open amount for invoice, can not allocate -error.no.invoice.to.allocate=Please select an invoice to allocate. -error.securityException=You are trying to view an order, that does not belong to your organisation. -error.required.agreement=You must agree to the terms and conditions before confirmation. -error.required.checkbox=Please make a selection. -error.required.sernoAttributeSetInstanceIds=Please select a product. - -error.notfound={0} not found. -error.required.productChange={0} -error.required.model=model. -error.required.colour=colour. -error.required.transmission=transmission. -error.required.year=year. -error.required.bpartnerId=Please enter the customer -error.required.amount.given=Please enter the amount given -error.required.paymentTermId=Please select a Payment term -error.product.name.required=Please enter a product -error.cannot.deactivate.paymentTermName=Cannot Deactivate PaymentTerm, Some customers are associated with it; - -error.required.username=Name is required. -error.required.userSurname=Surname is required. -error.required.password=Password is required. -error.required.oldPassword=Please enter your old password. -error.required.newPassword=Please enter your new password. -error.required.confirmPassword = Please confirm your new password. -error.required.creditCardNumber=Credit Card Number is required. -error.required.address1=Address is required -error.required.city = City is required -error.required.postalAddress = Postal Address is required -error.required.email = Please enter Email Address. -error.required.newEmail=Please enter your new email address. -error.required.confirmEmail=Please confirm your new email address. -error.wrong.old.password=The Old Password is wrong. -error.wrong.password.matching=The passwords do not match -error.wrong.password.length=The passweod should be at least six characters long - -error.required.warehouseName = Warehouse Name is required. -error.required.orgName = Organisation Name is required -error.required.poReference = Please enter a reference no. -error.required.orderId=Please enter a valid order Id -error.update.sequence=An error has been encountered while updating sequence, Please check database connection - -error.required.poreference=Please enter the purchase order number. -error.required.assetID=Please choose a VIN number. -error.required.description= Please enter description. -error.required.priceEntered=Please enter purchase price. -error.required.vinNumber=Please enter a VIN Number. -error.numberformatexception.priceEntered=Please enter a numeric value for purchase price. -error.invalid.barcode=Invalid Barcode! Barcode is either empty or null. - -error.required.name=Please enter name. -error.required.Surname=Please enter surname. -error.required.custIdNumber=Please enter customerID. -error.required.physicalCity=Please enter physical city. -error.required.physicalPostalCode=Please enter physical postal code. -error.required.physicalStreet1=Please enter physical street1. -error.required.postalCity=Please enter postal city. -error.required.postalPostalCode=Please enter postal code. -error.required.phone1=Please enter home Tel. -error.required.phoneNo=Please enter work tel. -error.required.cell=Please enter cell no. -error.required.aaCardnumber=Please enter card AA No. -error.natisRelease.firebird=Your vehicle has been transmitted to NaTIS and is queued for release. -error.duplicate.reference=You have already used this reference. Please use another one. -error.usernameAlreadyUsed=The username you provided already exists. Please choose another username. -error.name.exists=The name and surname you provided already exists. Please login with your email address. -error.email.exists=The email already exists. Please use another email address. -error.customer.id=Only numeric values are allowed for Customer Id Number. -error.email=Email has not been sent -error.duplicate.vin=You have selected vehicles with the same VIN number. Please make sure that all vehicles have been assigned different VIN numbers. -error.warehouse.alreadyexists = Warehouse already exists. Please choose another name. -error.targetQuantity.invalid = Please enter valid quantity. - -error.cannot.delete.order=Cannot Delete order as it has been invoiced -error.bp.alreadyexist=This customer already exists in your database. Please select the link /"Existing Customer" and choose the correct customer. -error.model.alreadyGrouped = Model already grouped -error.bank.already.exist=Bank already exists -error.attributevalue.alreadyexist = Value already exists -error.year.attributevalue.invalid = Please enter a valid year -error.product.alreadyexist = Product Already Exists, Please enter a new one -error.year.attributevalue.formatting.exception = Please enter numerical values for year -error.year.length.invalid = Invalid year. Length should be 4. -error.product.not.selected = Please select a product -error.bp.notselected=Please choose a Customer -error.no.vin.number=Please Specify a complete VIN Number -error.invalid.period=Start date should not be greater than end date. -error.required.fromDate = Please select start date. -error.required.toDate = Please select end date. -error.already.released= The Vehicle is already released, Can not swap the Vehicle -error.product.selected.not.same.warehouse=Warehouse of the selected products are different,please select the products from same warehouse -error.cannot.create.inventory.line==Cannot create Inventory line for the products which are service,
Please make the product item and then make a purchase. -error.ftp.novehicles = There is no vehicle for your Organisation in the FTP file uploaded - -error.vehicle.vinAlreadyPresent = The vin number entered is already present in the system. -error.vehicle.unitNumberPresent = The unit number entered is already present in the system. -error.numberformatexception.enginePower = Please enter a numeric value for Engine Power. -error.numberformatexception.natisModelNo = Please enter a numeric value for NaTIS Model Number. -error.numberformatexception.noOfWheels = Please enter a numeric value for No. of wheels. -error.numberformatexception.tare = Please enter a numeric value for Tare. -error.numberformatexception.engineCapacity = Please enter a numeric value for Engine Capacity. - - -error.modelmatching.notfound = Model Matching not found. -error.modelmatching.alreadyexist = Model Matching already exist -error.deactivatingproductinstock = Cannot deactivate product(s) as there are still some in HSAF or Dealers' stock. -error.orderId.null = Please enter an Order Id. -error.order.notExist = The Order does not exist. Please enter a valid Order Id. -error.order.noOrderline.selected = Please select at least one orderline to delete. - -error.product.keywords.required=Keywords are mandatory. Please set them before making a product featured in Webstore. - -error.colourmatching.alreadyexist=Colour Code Matching Already Exist -error.colourmatching.invalid=Colour Code Matching is invalid -error.colourmatching.errorsave=Could not save Colour Code Matching details - -error.import.nolineselected=You should choose at least one import line for processing -error.invalid.inputQty=Please enter a quantity greater than 0 -error.invalid.totalQty=Please enter a quantity per Size! -error.quantity.notAvailable=Entered quantity not available for {0} -error.updating.product=Could not update the status of the selected products -error.product.not.found=Product Not Found! -error.check.inserted.value=Please check the value inserted qty and the barcode should be separated by + sign -error.product.attributes.different=Cannot update Products with different attributes -error.updating.attribute=Could not change the specified Attribute Value -error.product.price.not.found=Product is Not On PriceList {0} -error.product.already.exists=Product already exists -error.barcode.already.exists=Barcode already exists -error.barcode.required = Barcode is required -error.reason.required = Please type in the reason -error.qty.required = Quantity is required -error.total.zero = Please check total amount. Cannot be zero -error.product.cannot.inactivate=product cannot be inactivated /Make it Services {0} -error.invalid.content= The Content of the uploaded file are wrong, should be an image -error.pos.no.orderline=There are no orderline in the order, please create a new order -error.no.transfer.amount=Please enter some amount -error.transferAmt.exceeds.endingBalance=Amount exceeding the ending balance, can not create transaction -error.cannot.close.till=The Till is already closed, can not transfer any amount until a new cash order is created
To transfer only card and cheque amount insert transfer amount as 0 and press submit -error.invalid.number=Please insert a valid number -tax.rate.not.defined=The Tax rate is not defined,Please define it {0} -error.required.revenue.recognition=Please enter Revenue Recognition -error.duplicate.product=Duplicate product name in the file Or the product already exists in the system {0} -error.duplicate.barcode=Duplicate barcode in the file Or the barcode already exists in the system {0} -error.cannot.adjust.till=The till is closed,cannot adjust the amount now -error.till.already.close=The Till is closed, can not close it again
To transfer only card and cheque amount just press submit -error.duplicate.userpin=The User Pin Already exists. -error.paymentTermName.duplicate=The Payment Term Name already Exists. -error.net.days.cannot.be.negative=Net Days cannot be negative or null. -error.name.mandatory = Please type the name -error.bpartner.over.credit.limit=Customer exceeds Credit Limit
{0} -error.bpartner.no.payment.term=Customer does not has a Payment Term,Please create one -error.insufficient.qty={0} -error.limit.price.violated={0} - -error.taxname.duplicate=Tax name already exists -error.taxrate.duplicate=Tax rate already exists -error.name.required=Please Insert the Name -error.required.field=field required {0} -error.tax.rate.nagative=tax rate cannot be negative -error.discount.nagative=Discount(s) cannot be negative -cannot.inactivate.tax=Cannot deactivate tax, some products have this tax - - -error.pos.payment.invalidCashAmount=Please enter a numeric value for Cash Amt. -error.pos.payment.invalidCardAmount=Please enter a numeric value for Card Amt. -error.pos.payment.invalidChequeAmount=Please enter a numeric value for Cheque Amt. -error.pos.incorrect.tendered.amount=Please enter the exact tender amount. -error.paymentamount.mandatory=Please enter Payment Amount. -error.allocate.amt.exceeds=Allocated Amt. exceeds the open amt of Invoice {0} -error.allocate.amt.payamt.notequal=Allocated Amt is not equal to the Payment Amt {0} - -error.collection.dir=Image Collection directory does not exist: {0} -error.inactive.collection.dir=Inactive Image Collection directory does not exist: {0} -error.errors.dir=Error image directory does not exist: {0} -error.synchronize.products.collection=Could not synchronize product collections: {0} - -error.related.product=No product found related with this attribute value -error.invalid.datetime=The date and time provided is invalid - -error.order.delete=Could not delete this order - -error.sessions.exceeded=You cannot log into the system.
Number of Licensed Sessions, ({0}), will be exceeded.
Please contact your administrator for further details. -error.requests.exceeded=The number of operations that you have performed has exceeded the limit that has been set for your license of Tamak ICT POS.
Please contact your administrator for further details. -error.license.invalid=Your license is invalid. Please change your licensing details as appropriate. -error.license.unexpected=An unexpected error has occurred. Please try to perform again all the operations that caused this error.
In case this error occurs again, please contact your administrator.
Details: {0} -error.licensinginfo.update=Licensing information could not be updated. Cause\: {0} -login.passwordError= Password is invalid -error.invalid.pin=Invalid User PIN -error.duplicate.pin=More than one user has the same PIN -error.customer.not.exists=The customer is either not present or is not active -error.vendor.not.exists=The vendor is either not present or is not active -# -- other -- -errors.cancel=Operation cancelled. -errors.detail={0} -errors.general=The process did not complete. Details should follow. -errors.token=Request could not be completed. Operation is not in sequence. - -error.required.vin.number=Please enter a VIN number -error.invalid.orderId=Order does not exist! -error.invoke.status=Cannot invoke order with status: {0} -# -- welcome -- - - -address = Address: -postaladdress = Postal Address: -city = City: -region = Region: - -welcome.title=Struts Blank Application -welcome.heading=Welcome! -welcome.message=To get started on your own application, copy the struts-blank.war to a new WAR file using the name for your application. Place it in your container's "webapp" folder (or equivalent), and let your container auto-deploy the application. Edit the skeleton configuration files as needed, restart your container, and you are on your way! (You can find the application.properties file with this message in the /WEB-INF/src/java/resources folder.) -login.emailNotFound=There is no email set for you please check with your administrator -login.userNotFound=Your Username can not be found on the system. -login.alreadyLogin=You are already logged in! Please logout before you attempt to login again. - -admin.changeEmail.title=Change My Email Address -admin.changeEmail.oldEmail=Old Email Address: -admin.changeEmail.newEmail=New Email Address: -admin.changeEmail.confirmEmail=Retype New Email Address: -admin.viewRoles.title=View All Roles - -admin.changePassword.title=Change My Password -admin.changePassword.old=Old Password: -admin.changePassword.new=New Password\: -admin.changePassword.confirm=Retype New Password\: - -admin.home.title=Dealer Admin - Document Storage -admin.home.link.stocks=My Stock -admin.home.link.certificates=My Certificates -admin.home.link.invoices=Invoices -admin.home.link.creditNotes=Credit Notes -admin.home.link.statements=Statements -admin.home.link.rebates=Rebates -admin.home.link.other=Other -admin.home.link.changePassword=Change Password -admin.home.link.changeEmail=Change Email Address -admin.home.link.viewMyDetails=View My Details -admin.invalidEmailError=You entered an invalid email address. -admin.wrongPasswordError=You wrongly entered your old password. - -admin.emailChanged.title=Email Address changed -admin.emailChanged.message=Your email has been changed. -admin.myCertificates.title=My Certificates -admin.myStocks.title=Available Stock - Not Yet Released -admin.passwordChanged.title=Password changed -admin.passwordChanged.message=Your password has been changed. -admin.userDeleted.title=User deleted -admin.userDeleted.message=You have successfully deleted the User. -admin.userDetails.title=User Details -admin.userForm.title=Create User -admin.userForm.select=Select User Role: -admin.viewMyDetails.title=My Details -admin.viewMyDetails.email=Email Address\: -admin.viewMyDetails.dealerName=Dealer Name: -admin.viewMyDetails.dealerCode=Dealer Code: -admin.viewMyDetails.phone=Phone Number: -admin.viewMyDetails.fax=Fax Number: -admin.viewMyDetails.deliveryAddress=Delivery Address: -admin.viewUsers.title=View All Users -admin.viewUsers.username=Username -admin.viewUsers.userRole=User Role -admin.viewUsers.editDelete=Edit/Delete User - -allocation.home.title=Allocations -allocation.home.link.result=Allocations -allocation.home.link.request=Allocation Requests -allocation.home.link.swap=Swap -allocation.request.confirm=Please confirm your allocation request -allocation.results.title=Allocations -allocation.results.vehicle.allocation=Your vehicle allocations for March 2005 are as follows: -allocation.results.eta=ETA -allocation.results.action=Action -allocation.results.accept=Accept -allocation.results.reject=Reject - -mmovement.title=Material Movement\t\t\t\t\t\t\t -mmovement.warehouse=Warehouse -mmovement.documentNo=Document No: -mmovement.description=Description: -mmovement.locator=Locator: -mmovement.destinationLocator=Destination Locator: -mmovement.header=Material Movement -mmovement.product.name=Name -mmovement.product.details=Details -mmovement.product.quantity=Quantity -mmovement.product.move=Move -mmovement.region=Region -mmovement.move=Move -mmovement.track=Track -mmovement.allWarehouses=All -mmovement.selectWarehouse=Move to Warehouse: -mmovement.button.confirm=Confirm -mmovement.button.complete=Complete -mmovement.button.delete=Delete -mmovement.button.cancel=Cancel -mmovement.documentStatus=Document Status: - - -mmovement.track.title=Track Material Movement -mmovement.track.header=Track Material Movement - -allocation.results.time.remaining=Time Remaining for this allocation: -allocation.results.time.numDays=22 days -allocation.results.swap.allocation=*NB: Should you choose to swap an allocated vehicle, the system will automatically accept that allocation. -allocation.resultsConfirm.title=Allocation - Allocation submitted -allocation.resultsConfirm.message=Thank You. Your allocations have been submitted. -allocation.status=Allocation Status -allocation.swap.title=Vehicle Allocation Request -allocation.swap.heading=Vehicle Allocation Request -allocation.swap.vehicles=Vehicles available for swap -allocation.swapConfirm.submit=Your request for swap has been submitted. -allocation.swapProcess.title=Swap Process -allocation.swap=Swap - -asset.status= Asset Status - -days.old=Days Old - -button.add=Add -button.cancel=Cancel -button.confirm=Confirm -button.create=Create Order -button.delete=Delete -button.edit=Edit User -button.process=Process Order -button.search=Search -button.submit=Submit -button.save=Save -button.reply = Reply -button.complete=Complete -button.createwarehouse=Create Warehouse -button.invoice = Create Invoice - - -dealer.order=Order -dealerOrder.cancelOrder.title=Dealer Order - Order cancelled -dealerOrder.cancelOrder.message=This order has been cancelled. -dealerOrder.createOrder.title=Dealer Order -dealerOrder.home.title=Orders -dealerOrder.home.link.result=Dealer Orders -dealerOrder.home.link.specialColour=Special Colour Orders -dealerOrder.home.printOrder=Dealer Order - Print Order -dealerOrder.input.all=Please input all values. -dealerOrder.process.title=Dealer Order - Order processed -dealerOrder.process.message=Thank You, Your orders have been processed -dealerOrder.results.title=Dealer Order - Results -dealerOrder.specialColour.title=Special Colour Orders -dealerOrder.specialColour.submission=*NB: Must be submitted four months in advance for Accord, All other models - 3 months in advance. -dealerOrder.createSpecialColour.title=Create Special Colour Order - -dealerOrder.terms.title=Dealer Order - Terms and Conditions -dealerOrder.terms.heading=Terms and Conditions -dealerOrder.terms.term1=All orders placed by the dealer (whose name and details appear on this order form) ("the Dealer") shall be final and binding on the Dealer once the Dealer has signed this order form and delivered the original signed order form or a copy thereof to Honda South Africa (Pty) Ltd (registration number 2000/010675/07) ("HSAF"). The Dealer shall not be entitled to cancel its order, return any of the Honda Products reflected on this order form or obtain a credit for Honda Products without HSAF's prior written consent. - -dealerOrder.terms.term2=The Dealer's order shall not be binding on HSAF until acceptance thereof by HSAF (whether in whole or in part) by the duly authorized HSAF divisional manager signing this order form in the space provided therefor. - -dealerOrder.terms.term3=Ownership in and to Honda Products forming the subject matter of this order form shall remain vested with HSAF until those Honda Products have been delivered to or collected by the Dealer, as the case may be, and HSAF has received payment in full of the total amounts reflected on this order form. The risk of loss and damage to the Honda Products reflected on this order form shall pass to the Dealer upon the collection or the delivery of those Honda Products to the Dealer, notwithstanding the fact that the Dealer has not paid HSAF in full for those Honda Products and that the Dealer is not the owner of those Honda Products. - -dealerOrder.terms.term4=Any purported variation on this order form of the provisions of any written agreement(s) concluded between HSAF and the Dealer in respect of the Honda Products shall not take precedence over the terms of those written agreements, notwithstanding HSAF's signature on this order form. - -dealerOrder.terms.term5=By the Dealer's signature of this order form, the Dealer acknowledges and agrees that it has read and understood the terms and conditions set out on this order form and agrees to be bound to those terms and conditions. - -dealerOrder.terms.term6=HSAF reserves the right at any time and from time to time to change or modify, without notice, the terms and conditions set out in this order form. - -dealerOrder.terms.term7=Notwithstanding the signature hereof by HSAF, HSAF will have obligation, under any circumstances, to accept orders for any Honda Products which are not in this current inventory. - -dealerOrder.terms.term8=For the purposes of this order form, Honda products means: -dealerOrder.terms.term8a=such new motorcycles and automobiles as are from time to time offered for sale by HSAF to Dealer for resale as part of HSAF's motorcycle or automobile line as determined by HSAF in its sole discretion; and/or - -dealerOrder.terms.term8b=all industrial and domestic engines manufactured by HSAF which form part of HSAF's engine line as determined by HSAF in its sole discretion; and/or\t\t\t - -dealerOrder.terms.term8c=all power products which form part of HSAF's power product line as determined by HSAF in its sole discretion, including without limitation, all HSAF generators, lawn mowers, brushcutters and water pumps; and/or - -dealerOrder.terms.term8d=all parts, accessories and optional equipment marketed by HSAF for use of with motorcycles, engines, automobiles and power products referred to above. - - -dealerOrder.qty.greaterThanZero=The quantity specified must be greater than zero. -dealerOrder.noOrders=Please add at least an order. - -dealerOrder.must.agree=You must agree to the terms and conditions before confirmation. - - -include.footer.poweredBy=Powered by UDI Technology -include.footer.allContent=All Content © 2005 Honda South Africa -include.header.link.loginSuccess=  Home -include.header.link.stockAction=  Stock Inquiries -include.header.link.dealerOrderHome=  Dealer Orders -include.header.link.natisReleaseHome=  NaTIS Release -include.header.link.allocationHome=  Allocations -include.header.link.interDealerHome=  Inter Dealer Transfers -include.header.link.adminHome=  Dealer Admin -include.header.link.loginActionNoInput=  Logout -include.header.link.myorders=My Orders - -interdealer.transfer=Transfer -interDealer.cancelTransfer.message=You have cancelled this request. -interDealer.dealerTransferOrder.title = Inter Dealer Transfer -interDealer.dealerTransferOrder.heading = Dealer Transfer: Request -interDealer.home.title=Dealer Transfers -interDealer.home.link.request=Request -interDealer.home.link.receiving=Receiving -interDealer.process.title=Dealer Transfer - Request sent -interDealer.process.message=Your request has been transmitted. -interDealer.request.title=Dealer Transfer - Requests -interDealer.receiving.title=Dealer Transfer - Receiving -interDealer.receiving.from=From: -interDealer.receiving.accept=Accept -interDealer.receiving.reject=Reject -interDealer.receiving.reason=Reason for rejection - -login.choose.title=Please choose a User from any of these Dealers -login.forgot.forgotPassword=Forgot your password?
Please enter your username and we will send your password to your email address -login.forgot.username=Username\: -login.forgot.sendPassword=Send Password -login.home.title=Welcome to Posterita POS -login.home.title.part1=Welcome to -login.home.title.part2=Posterita POS -login.home.login=Please Login -login.home.username=Username\: -login.home.password=Password: -login.home.loginButton=Login -login.home.loginForgot=Forgot password? -login.loginForm.message=Please enter your username and password.Remember your email is your username
NB: Case sensitive. -login.logout.logoutSuccess=You have successfully logged out. -login.logout.backToLogin=  Click Here to go back to the Login Screen -login.password.passwordSent=Your password has been sent you should receive it in a few minutes -login.password.backToLogin=  Click Here to go back to the Login Screen -login.password.emailTitle= Your password reminder. -login.password.emailSubject=The password to log in into the POS System is: -login.success.welcome=Welcome to Posterita
POS System -login.userInactive=Your user has been set inactive. - -menu.title = Menu -menu.close = Close Menu -menu.closed = Menu Closed -menu.isActive = Is Active -menu.list = List of Menu -menu.description = Description - -#============Email Errors============ -email.subject.error = Please enter a subject for the email -email.message.error = Please enter your message -email.send.error = Email cannot be sent. Please Check if you have properly configured your smtp host. - -#==================================== - -message.title = Create Message -message.from = From: -message.to = To: -message.recto = To -message.subject = Subject: -message.recsubject = Subject -message.writemessage = Message: -message.senttitle = Message Sent -message.sent = Your Message has been sent -message.sentmessages = Sent Messages -message.mymessages = My Messages -message.received = Received Messages -message.sender = Sender -message.date = Date -message.viewdate = Date: -message.view = View Message -message.markas = Mark as -message.delete = Delete -message.reply = Reply Message -message.viewreceivedmessage = View Received Message -message.viewsentmessage = View Sent Message -message.sendbutton = Send -message.goback = Go Back - -myorders.home.title=My Orders - Home -myorders.home.heading=My Orders - -myorders.orders.dealerorders.link=Dealer Orders -myorders.orders.scoorders.link=Special Colour Orders -myorders.orders.requesttransferorders.link=Dealer Transfer Orders - -myorders.purchaseorders.home.link=Purchase Orders -upload.file = Please attach the file for creating orders -download.file=Download file - -myorders.result.title=My Orders Result -myorders.result.heading=My Orders - Result -myorders.result.dateOrdered=Date Ordered -myorders.result.bpartnerName=Dealer -myorders.result.docStatus=Doc Status -myorders.result.hsafRef=HSAF Ref ID -myorders.result.poreference=PO Reference -myorders.result.grandTotal=Grand Total -myorders.result.viewOrder=View Order -myorders.result.orderfrom=Ordered From - - - -myorders.salesorders.home.link=Sales Orders -myorders.purchase.order= Purchase Order - -mycertificate.title = My Certificates -mycertificate.viewCertificate = View Certificate - - -natisRelease.home.title=NaTIS Release -natisRelease.process.title=NaTIS Release - Vehicle released -natisRelease.process.message=Thank you, the Vehicle has been released -natisRelease.release.name=Name -natisRelease.release.surname=Surname -natisRelease.release.idNumber=ID Number\: -natisRelease.release.physicalAddress=Physical Address -natisRelease.release.postalAddress=Postal Address -natisRelease.release.homeTelephone=Home Telephone -natisRelease.release.workTelephone=Work Telephone -natisRelease.release.cell=Cell -natisRelease.release.fax=Fax -natisRelease.viewCertificate.title=View Certificate -natisRelease.viewCertificate.message=Your NaTIS Certificate for this vehicle has been released. -natisRelease.viewCertificate.download=Click here for your certificate. -natis.order.history = NaTIS Release Sales History - -order.dealerPONo=Dealer Purchase Order No:  -order.HSAFRefNo=HSAF Ref No:  -order.terms=Terms and Conditions compulsory -order.specialColour=Special Colour Order -order.print=Printer Friendly Version - -orderView.orderFooter.use=FOR OFFICE USE -orderView.orderFooter.roNo=R/O NUMBER -orderView.orderFooter.invoiceNo=INVOICE NUMBER -orderView.orderFooter.dealerAuthor=DEALER AUTHORISATION: -orderView.orderFooter.signature=SIGNATURE: -orderView.orderFooter.recvBy=HSAF RECEIVED BY: -orderView.orderFooter.divMgr=AUTHORISED DIV MANAGER:  (Name & Sign.) - -orderView.orderHeader.honda=HONDA S.A AUTOMOBILE
DEALER ORDER -orderView.orderHeader.att=ATT: -orderView.orderHeader.fax=FAX: -orderView.orderHeader.tel=TEL: -orderView.orderHeader.date=DATE: -orderView.orderHeader.orderNo=DEALER ORDER NO: -orderView.orderHeader.dealerCode=DEALER CODE: -orderView.orderHeader.dealerName=DEALER NAME: -orderView.orderHeader.delAddress=DELIVERY ADDRESS: - -orderView.orderPriceDetails.subTotal=SUB TOTAL -orderView.orderPriceDetails.vat=VAT -orderView.orderPriceDetails.orderTotal=ORDER TOTAL - -product.create.car = Create New Car -product.create.bike = Create New Bike -product.create.usedcar = Create Used Car -product.create.usedbike = Create Used Bike -product.create.usedcar.attributevalue = Create Used Car Attribute Value -product.create.usedbike.attributevalue = Create Used Bike Attribute Value -product.create.car.attributevalue = Create New Car Attribute Value -product.create.bike.attributevalue = Create New Bike Attribute Value - -product.create = Create Product -product.details = Product Details -product.make=Make -product.model=Model -product.colour=Colour -product.transmission=Transmission -product.year =Year -product.purchase.price = Purchase Price -product.sales.price = Sales Price -product.wholesale.price= Wholesale Price -product.retail.price= Retail Price -product.quantity=Quantity -product.price=Price -product.vinNo=VIN No. -product.order=Order -product.salesRegion=Sales Region -product.request=Request -product.sendRequest=Send Request -product.release=Release -product.reserved=Reserved -product.status=Status -product.all=All -product.umodel=MODEL -product.ucolour=COLOUR -product.utransmission=TRANS -product.frameNo=FRAME NUMBER -product.uquantity=QTY -product.uprice=PRICE Ex VAT -product.uVAT=VAT -product.dealer=DEALER -product.uTotal=TOTAL -product.colourType=Colour Type -product.colour.group=Colour Group -product.wholesaleDate=Wholesale Date -product.natisApplicationDate=NaTIS Application Date -product.hide=Hide -product.refNo=Reference No -product.ordId=Order ID -product.ordBy=Order By -product.ordDate=Date Ordered -product.doctype=Doc Type -product.type = Product Type -product.home.title = Select Products For Order -product.isNatisReleased = Is NaTIS Released -product.description = Description -product.restriction = Product Restriction -product.name = Product Name -product.restrict = Restrict -product.pricelist = Pricelist -product.newprice = New Price -product.oldprice = Old Price -product.price.edit = Edit Product Price - -reprice.orders=Reprice Orders - - -customer.details=Customer's Details -customer.licensing.desc=Licensing Option Description -customer.finance.option=Finance Option Description -trade.in.make=Trade In Make -trade.in.makeModel=Trade In Make Model -trade.in.year=Trade In Year -customer.idBookNo=ID Book Number -engine.no=Engine Number -maintenance.contract=Maintenance Contract -registration.status=Registration Status - -sc.dealerOrder.home.quantity=Quantity - -target.sales.title = Target Sales -target.sales.month = Month -target.sales.year = Year -target.sales.ModelGroup = Model Group -target.sales.Quantity = Quantity -target.sales.organisation = Organisation - -stock.home.title=Stock Inquiry -stock.inquiry.show=Show ONLY stock from HSAF -stock.not.reserved.show=Show ONLY available stock -stock.process.title=Stock Inquiry - Request sent -stock.process.message=Thank You, your request has been sent -stock.filter.by=Filter by: - -error.workflow.violation=You can only progress in this application using the buttons and the menu that are offered. Hitting the browser's reload button or using the back button is not allowed. - -user.create = Create User -user.created = User Created -user.username=Username: -user.role=User Role: -user.password=Password: -user.address = Address: -user.city = City: -user.postaladdress = Postal Address: -user.region = Region -user.email=Email Address: -user.phone = Phone No: -user.cellphone=Cell Phone: -user.confirmPassword=Confirm Password: -user.isActive = Is Active -user.isSalesRep = Is Sales Representative -user.details = User Details -user.pin=User PIN -user.docBasisType=Document Basis for Commission -user.comm.per=% Commission for the sales rep -user.comm.fre=Calculation Frequency -user.substract.amt=Substract Amt** -user.substract.exp=**The Subtract Amount indicates the amount to subtract from the total amount prior to calculation of commission - -choose.VIN=Choose VIN Number - -select.month=Month -select.year=Year -select.status=Status -view.all=All - -calendar.day.default=Day -calendar.month.default=Month -calendar.year.default=Year -calendar.month1=Jan -calendar.month2=Feb -calendar.month3=Mar -calendar.month4=Apr -calendar.month5=May -calendar.month6=Jun -calendar.month7=Jul -calendar.month8=Aug -calendar.month9=Sep -calendar.month10=Oct -calendar.month11=Nov -calendar.month12=Dec -asset.owner=Owned By -queryVinNo.title=Query VIN No. -vinNo.search=Search VIN No. -vinNo.query=Query on the Status of VIN Number -vinNoDetails.title=VIN Number Details -searchOrderByRef.title=Query Order Reference Number -search.orderID=Search Order Ref No. -text.yes=Yes -text.no=No -query.dealers.stock.title=Query Dealers Stock - -bPartner.title = Business Partner -bPartner.create = Create Business Partner -bpartner.details = Business Partner Details -bpartner.name = Name -bpartner.name2 = Name2 -bPartner.address = Address -bPartner.address1 = Address1 -bPartner.address2 = Address2 -bPartner.postal.address = Postal Address -bPartner.city = City -bPartner.phone=Phone Number -bPartner.fax=Fax Number -bpartner.edit = Edit -bpartner.view = View -bPartner.isActive = Is Active: -bPartner.isCustomer = Is Customer: -bPartner.isVendor = Is Vendor: -bPartner.isEmployee = Is Employee: -bPartner.isSalesRep = Is Sales Rep: -bPartner.region = Region -bPartner.edit = Edit Business Partner Details -bPartner.credit.limit = Credit Limit -bPartner.credit.status = Credit Status -bPartner.dunning = Dunning - -bank.create = Create Bank -bank.name = Bank Name -bank.address = Address -bank.postaladdress = Postal Address -postal.address = Postal Address -bank.city = City -bank.routingnumber = Routing Number -bank.details = Bank Details - -locator.details = Locator Details -locator.create = Create Locator -locator.warehouse = Warehouse -locator.aisle = Aisle -locator.bin = Bin -locator.level = Level -locator.default = Is Default - -bAccount.create = Create Bank Account -bAccount.bank.name = Bank Name -bAccount.no = Account Number -bAccount.type = Account Type -bAccount.current.balance = Current Balance -bAccount.type.checking = Checking -bAccount.type.saving = Saving -bAccount.details=Bank Account Details - -order.history = Order History -invoice.history = Invoice History -payment.history = Payment History -inout.shipment.history = Shipment History -inout.receipt.history = Receipt History - - -history.receiptNumber = Receipt Number -history.shipmentNumber = Shipment Number -history.orderNumber = Order Number -history.invoiceNumber = Invoice Number -history.documentNumber = Document Number -history.documentStatus = Document Status -history.dealerName = Dealer Name -history.date = Date -history.dateInvoiced = Date Invoiced -history.dateOrdered = Date Ordered -history.grandTotal = Grand Total -history.isDelivered = Is Delivered -history.isInvoiced = Is Invoiced -history.isPaid = Is Paid -history.isReceipt = Is Receipt -history.paymentId = Payment Id -history.paymentAmt = Payment Amt \t -history.transactionDate = Transaction Date -history.orderReference = Order Reference -history.isSotrx = Is Sales Order - -warehouse.create = Create Warehouse -warehouse.created = Warehouse Created -warehouse.details = Warehouse Details -warehouse.wname = Warehouse Name -warehouse.name = Warehouse -warehouse.address = Address: -warehouse.postaladdress = Postal Address: -warehouse.city = City: -warehouse.region = Region -warehouse.isPublic = Is Accesible to Dealers -warehouse.isActive= Is Active -is.warehouse.allocation= Is Allocation Warehouse -warehouse.type=Warehouse Type -warehouse.all = All Warehouses -product.attribute.create = Create Product Attribute Value -product.attribute.set = Vehicle -product.attribute.name = Attribute -product.attribute.value = Value -product.attribute.value.created = Product Attribute Value Created -product.attribute.existingValues = Existing values -product.selected = Selected Products -quantity = Quantity - -engine.number= Engine Number -natis.application.date=NaTIS Application Date -natis.release.date=NaTIS Release Date -natis.control.number=NaTIS Control Number -natis.model.number=NaTIS Model Number -natis.unit.number=NaTIS Unit Number -natis.release.id=NaTIS Release Id -org.name=Dealer Name\: -register.number= Register Number - -customer.create.new=Create new customer -customer.information =NaTIS Release-Customer Information -customer.name = Customer Name: -customer.surname=Surname: -customer.id.number=ID Number: -customer.phy.add = Physical Address: -customer.street1 = Street 1: -customer.street2 = Street 2: -customer.city = city: -customer.postal.address = Postal Address: -postal.street1=Postal Street -postal.city=Postal city -postal.code = Postal Code: -customer.home.telephone =Home Telephone No: -customer.work.telephone =Work Telephone No: -customer.cell= Customer Cell\: \t -customer.aa.car.number=AA Card No\: \t -customer.maintenance.contract.number=Maintenance Contract No: -invoice.it = Invoice -unreserve.stock = Unreserve Stock -shipment.material.receipt=Shipment/Material Receipt - -#vehicle.createVehicle=Create Vehicle -#vehicle.unitNumber=Unit Number -#vehicle.vinNumber=Vin Number -#vehicle.engineNumber=Engine Number -#vehicle.natisModelDesc=Natis Model Desc -#vehicle.enginePower=Engine Power -#vehicle.engineCapacity=Engine Capacity -#vehicle.tare=Tare -#vehicle.noOfWheels=No. of Wheels -#vehicle.cntryOfImport=Country Of Import -#vehicle.colourCdHES=Colour Code HES -#vehicle.mainColourCd=Main Colour Code -#vehicle.natisModelNum=Natis Model Number - - -#========= DMS Messages - -error.required.attributeValue = Value is required -error.required.orgType = Choose a dealer type -error.required.vehicleType = Choose a product type -error.required.locator = Destination Locator required -error.required.warehouse = Destination Warehouse required -error.no.order.exists=The Order is already completed, Please make a new one - -org.create=Create Dealer -org.details = Dealer Details -reserved.for=Reserved For the Dealer: -org.type=Dealer Type: -org.product.type=Product Type: -click.order.id=Click this OrderId to get the Order: -org.retailer= Is Retailer: -org.wholesaler=Is Wholesaler: -org.automobile= Is Automobile: -org.motocycle=Is Motocycle: -org.address=Address: -org.address1=Address1: -org.address2=Address2: -org.city=City: -org.postalAddress=Postal Address: -org.region=Region: -org.isActive= Is Active -org.isVisible= Is Visible - -dealer.details = Dealer Details -dealer.name = Dealer Name -dealer.location = Location -dealer.phone = Phone -dealer.fax = Fax - -role.create = Create Role -role.name = Name -role.superuser = Access to all Dealers -role.accessibleToAll = Access to all Dealers -role.isActive = Is Active - -pos.name= POS Name -pos.begining.balance=Beginning Balance -pos.net.transaction=Net Cash Transaction -pos.cash.total=Cash Amount -pos.card.total=Card Amount -pos.cheque.total=Cheque Amount -pos.grandtotal=Grand Total -pos.current.till.balance= Current Till Balance - - -groupModel.title = Group Models -groupModel.group = Model Group -groupModel.model = Model - -licensing.district = Licensing District -licensing.district.code = Licensing District Code -licensing.district.description = Description -licensing.district.area = Licensing Area -licensing.district.area.domestic = Domestic -licensing.district.area.export = Export - -price.listing = Price Listing -pricelist.Version = PriceList Version -pricelist.name = PriceList Name -pricelist.listPrice = List Price - -error.required.currentBalance = Current Balance is required -error.required.accountNo = Account Number is required -error.required.accountType = Account Type is required -error.required.accountFile = Accounting File is required -error.required.partnerName = Business Partner Name is required -error.required.supplierName = Vendor Name is required -error.required.sizes = Please select some sizes or enter a custom size - - -error.required.stdPurchasePrice = Purchase Price is required -error.required.stdSalesPrice = Sales Price is required - -error.numberformatexception.currentBalance=Only numeric values are supported for Current Balance -error.numberformatexception=Please Enter a Numeric Value -error.numberformatexception.stdSalesPrice= Sales prices should be numeric -error.numberformatexception.stdPurchasePrice=Purchase prices should be numeric -error.numberformatexception.price=Please enter a numeric value for the prices -error.modelgroup.notExist=Please specify a Model Group -error.deactivatingattributeproductinstock = Unable to perform action. There are some products that use the attribute value. - -invoice.customer.print=Customer Invoice - Print -invoice.customer=Customer Invoice -invoice.no=Invoice No - -search.order = Search Order -search.order.title = Query Order ID -search.order.label = Order ID - -search.order.vin = Search Order For a VIN No. -search.order.vin.title = Search Order For a VIN No. -search.order.vin.label = Enter VIN No. -swap.vin.success=The vehicle has been swapped successfully -reprice.order.success=The Orders have been Repriced successfully - -error.orderId.not.found=Order Id not found -material.movement.success=The products have been moved successfully. -sequence.update.success= The sequences have been updated successfully -data.integrity.success=The data intregriy has been checked and mails have been send for the failed tests -naamsa.dealercode.create=Create NAAMSA Dealer Code -naamsa.dealercode.title=NAAMSA Dealer Code -naamsa.dealercode.edit.title=Edit NAAMSA Dealer Code -naamsa.dealer=Dealer -naamsa.dealercode=Dealer Code - -naamsa.modelcode=Model Code -naamsa.modelcode.create=Create NAAMSA Model Code -naamsa.modelcode.title=NAAMSA Model Code -naamsa.modelcode.edit.title=Edit NAAMSA Model Code - -wholesaleorder.ftp.title=Upload FTP File -wholesaleorder.csv.title=Create Wholesale Order -wholesaleorder.information=Please go to the following site and select the ftp file which consist of the vehicles which you want to insert in the system. -wholesaleorder.site=ftp://ftp.honda-eu.com -wholesaleorder.upload.button=Upload File -error.ftp.notvalid=The ftp file uploaded is not valid -wholesaleorder.csv.invalid=CSV File is invalid -wholesaleorder.csv.unknownerror=An Error has occurred, please contact your system administrator -error.ftp.novehicle=The FTP does not contain vehicles for your Organisation Type -wholesaleorder.csv.download=Download the CSV generated from the FTP file that you have input.
Check whether all the records are good. Take appropriate action for those that have error descriptions.
-wholesaleorder.csv.download1=Download the CSV generated from the FTP file that you have input.
Modify this file by inputing genuine information concerning the vehices.
-wholesaleorder.csv.information=Upload the CSV that you have modified in order to generate the wholesale order. -wholesaleorder.csv.uploadFile=CSV File to upload\: - -error.natis.release=Your request to release this vehicle is in progress.\n The system will automatically complete this order and release the vehicle on NaTIS after some time. -error.natis.release_old=Could not release vehicle on NaTIS. Please try again. \nIf the problem persists please contact the administrator. -vin.number.not.found=VIN number not found -error.vin.number.duplicate=Duplicate VIN number found. -natis.info.not.found=Natis info not found -natis.info.duplicate=Natis info duplicate -released.by=Released by - - - -modelmatch.title=Model Matching -modelmatch.natisModelDesc=Natis Model Desc -modelmatch.modelDesc=Model Desc -modelmatch.transmission=Transmission -modelmatch.year=Year -wesbank.status=Wesbank Status - - -colourmatch.title=Colour Code Matching -colourmatch.colourCode=Colour Code -colourmatch.colourDesc=Colour Description - -wesbank.ping.title=Ping WesBank -wesbank.response.action=Action -wesbank.response.recordtype=Record Type -wesbank.response.reason=Reason -wesbank.response.reasonDescription=Reason Description -wesbank.response.date=Date -wesbank.response.time=Time -wesbank.response.transId=Transaction Id -wesbank.response.status=Status -import.vehicleImported.title=Vehicle imported -import.vehicleUnimported.title=Vehicle Not Imported -import.vehicle.model=Model -import.vehicle.vinNumber=Vin Number -import.vehicle.engineNumber=Engine Number -import.vehicle.natisModelNo=Natis Model No -import.vehicle.colour=Colour -import.vehicle.transmission=Transmission -import.vehicle.year=Year -import.vehicle.natisModelDesc=Natis Model Desc -import.vehicle.modelMatchingDesc=Model Matching -import.vehicle.colourCode=Colour Code -import.vehicle.errorDesc=Error Description -import.vehicle.selProcess=Process -import.vehicle.selectAll=Select All -import.vehicle.reperformMatching=Reperform Matching -import.vehicle.importVehicle=Import Vehicles -error.attachment.empty = Please select a file -error.attachment.invalid.image = Please select an image -error.required.cvv=CVV is required. -error.creditCardExpMonth=Credit card expiry date cannot be prior to this month. Please enter a valid date. -error.required.creditCardExpMonth=Credit card expiry month required. -error.pos.shoppingcart.empty = Your shopping cart is empty. -error.required.accountName=Credit Card Owner name required. -error.required.paymentMethod=Please select the preferred payment method. -error.minlength.creditCardNumber=Please enter a valid credit card number (Length from 13 to 16) -error.minlength.cvv=Please enter a CVV number greater than 2 digits -error.sending.email=Error sending email -error.creditcard.number=Credit Card number is not valid -error.creditcard.type=Credit Card type is not supported -error.creditcard.expiry=Credit Card expiry is not valid -error.creditcard.cvv=Credit Card VV is not valid -error.required.startDate = Please select from date. -error.required.endDate = Please select to date. -error.pos.invoke.no.orderline=Cannot invoke order that has no orderlines. -error.access.not.allowed=you do not have the role to access the window, please contact your administrator -error.shipment.condition.required=Please specity whether the shipment should be generated along with the order and invoice - - -document.status.drafted=Drafted -document.status.inprogress=In Progress -document.status.completed=Completed -document.status.closed=Closed -document.status.invalid=Invalid -payment.rule.cash=Cash -payment.rule.card=Card -payment.rule.cheque=Cheque -payment.rule.mixed=Mixed - -error.store.default=Default Application could not be set. Cause: {0}.
If the problem persists please clear your browser cookies. - -########### CRM MESSAGES ########### - -## ERROR MESSAGES -error.request.view=Cannot view the desired request -error.request.assign=Could not assign request to the specified user -error.request.create=Could not create request -error.request.init.resolve=Could not initialise request for resolving -error.request.resolve=Could not resolve request -error.request.close=Could not close request -error.request.view.summary=Could not retrieve your requests, please contact you administrator - - -vendor.create=Create Vendor -vendor.details = Vendor Details -user.discount = %Discount Allowed - - -error.file.save=Error occurred when saving file. -error.source.file.notpresent=Source file not present. -error.create.bank.account=Error occurred while creating bank account -error.bank.not.found=Bank not found. -error.edit.bank=Editing bank information failed -error.get.partner.detail=Retrieval of partner details failed -error.getall.partners=Retrieval of all partner details failed -error.activate.customer=Could not activate customer -error.deactivate.customer=Could not deactivate customer -error.editing.user=Error occurred while editing user -error.activate.vendor=Could not activate vendor -error.deactivate.vendor=Could not deactivate vendor -error.orderid.notpresent=OrderId not present -error.creating.invoice=Could not create invoice -error.only.pos.order.supported=Only POS Orders are Supported, Please check the number -error.only.credit.order.supported=Only Credit Orders are Supported, Please check the number -error.credit.order.not.completed=The Credit Order is not completed, cannot create Credit Memo -error.pos.order.not.completed=The POS Order is not completed, cannot create Customer Return Order -error.pos.invalid.customerID = The Customer ID entered is not valid! -error.discountLimit.exceeded = Discount allowed limit has been exceeded! -error.print.fidelity.card = Cannot print fidelity card! Please select some active customers. - -error.bpartner.nolocation = Business Partner does not have a location, you should set it first to be able to complete the current operation. -error.userRegistration.failed = Registration failed. Problem with mail server. Please try later. -error.round.off.cannot.be.negative = Round Off Factor cannot be negative. -error.no.product.found.on.pricelist = No product found on price list. - -############Fidelity Card ##################### -fidelitycard.address= TAMAK GROUP,3 DRAPER AVE,Q.BORNES,MAURITIUS.EMAIL:tamak@tamak.com -fidelitycard.telephone=Office Tel: (230)4549555 -Fax: (230)454 1542 -Shop Tel: (230)427 0276 -fidelitycard.note1=THIS TAMAK FIDELITY CARD IS THE PROPERTY OF TAMAK -fidelitycard.note2=THIS CARD ENTITLES YOU TO SPECIAL DISCOUNTS OF 10% -fidelitycard.note3=APPLICABLE IN TAMAK WORLD & TAMAK SHOP. -fidelitycard.note4=NOT APPLICABLE ON DISCOUNTED ITEMS. -fidelitycard.customer.name=Nom: - -################### Messages for Receipt ###################### -receipt.VATRegNo=VAT 20176097 -receipt.company.name1=Tamak World -receipt.company.address=Rte St-Jean, Q.Bornes -receipt.company.phone=Tel:427-0276 -receipt.company.name2=(Tamak Retail LTD) - -################### Messages for POS ###################### -pos.description=Description -pos.qty=Qty -pos.price=Price -pos.VAT=VAT -pos.totalprice=Total Price -pos.discountpercentage=Discount % -pos.actualprice=Actual price -pos.tendertype=Tender Type -pos.cashamt=Cash Amt -pos.chequeamt=Cheque Amt -pos.chequeno=Cheque No -pos.cardamt=Card Amt -pos.cardno=Card No -pos.mixed=Mixed -pos.cash=Cash -pos.card=Card -pos.cheque=Cheque -pos.continue=Continue - -################### Messages for POS ###################### -message.product.saved = Product updated successfully -message.saved = Saved -config.message.saved = Settings saved successfully. - -################## User Registration ###################### -success.userRegistration.successful = Registration Successful -success.product.prices.on.pricelist.deleted.successfully = Product prices on price list deleted successfully -success.currency.updated.successfully = Currency updated successfully - - -error.process=Fail to process your request. Cause : {0} -error.precision=Precision entered is not valid. {0} -error.import.uom.not.present={0} -error.import.uom.precision.not.valid={0} -error.role.org.access.edit=Error occurred while trying to update Role Organisation Access. Please contact the Administrator. -error.no.edit.access=You do not have the right organisational access for editing -error.import.file.data={0} -error.import.uom.duplicate={0} -error.no.materialmovement.exists=The Material Movement is already completed, Please make a new one -error.terminal.locked=Terminal is locked -error.no.cashjournal.present=There is no Cash Journal present in the system. Please check whether you have done a transaction yet -current.terminal.updated=The current terminal has been updated.
Log out and Log in to be able to create transactions on the terminal. -current.terminal.reset=The current terminal has been reset.
Log out and Log in to chose again the current terminal from the list of available terminals. -error.operation=An error has occured while executing the operation you requested.
Please make sure that all data are correctly entered and try again. -error.terminal.cashbook=The cash book assigned on this terminal is already assigned to another terminal -error.deactivate.cashbook=Cash book cannot be deactivated as it is being used on a terminal -error.deactivate.terminal=Terminal cannot be deactivated as no active terminal will be available for login - diff --git a/posterita/posterita/src/main/MessageResources_BR.properties b/posterita/posterita/src/main/MessageResources_BR.properties deleted file mode 100644 index d27575de86..0000000000 --- a/posterita/posterita/src/main/MessageResources_BR.properties +++ /dev/null @@ -1,1260 +0,0 @@ -asset.natisrelease.no=NaTIS Release No -asset.natiscontrol.no=NaTIS Control No -asset.register.no=Register No - -assetstatus.hsaf.stock=In Stock -assetstatus.onwater.stock=On Water -assetstatus.retailed=Retailed -assetStatus.wholesaled=Wholesaled - -#Tamak specific -#footer.copyright=All Contents ©2006 Tamak ICT -#title.welcome=Welcome to Tamak POS -#title.POS=Tamak POS - -footer.copyright=All Contents ©2006 Tamak ICT -title.welcome=Welcome to Tamak POS -title.POS=Tamak POS - - - -scostatus.update =Update SCO Status - -# -- standard errors -- -errors.header=
    -errors.prefix=
  • -errors.suffix=
  • -errors.footer=
-# -- validator -- - -error.minlength.customerID= O ID do cliente deve ter 13 dígitos. -error.natiscustomer.alreadyexist=Este cliente já existe em sua base de dados.Por favor, clique no link "Cliente já existente?" e selecione o cliente. -error.dataAccessException=Sua requisição não pode ser processada porque algum dado está faltando. Por favor, entre em contato com o Administrador do sistema para maiores detalhes. -error.operationException=Por favor, especifique uma ordem para visualizar. -error.systemException=Um erro foi detectado. Por favor, entre em contato com o Administrador do sistema para maiores informações. -error.runtimeException=Ocorreu um erro de tempo de execução. Por favor, contate o Administrador do sistema para maiores informações. -errorpage.title=Página de Erro -errorpage.heading=Você realizou uma operação ilegal. -errors.invalid={0} é inválido(a). -error.required={0} é necessário(a). -error.match={0} não é adequado. -error.date.prior.today=A data de chegada não pode ser anterior à data de hoje. -error.dateRangeNotValidException=O intervalo de datas não é válido. Por favor, tente outra combinação. -error.match.password=Suas senhas não correspondem. Por favor, digite novamente sua senha. -error.match.newPassword=Suas senhas não correspondem. Por favor, digite novamente sua nova senha. -error.match.newEmail=Seu email e a confirmação não correspondem. Por favor, digite novamente seu e-mail. -errors.maxlength={0} não pode ter mais que {1} caracteres. -errors.minlength={0} não pode ter menos que {1} caracteres. -errors.range={0} não está no intervalo de {1} até {2}. -errors.required={0} é obrigatório(a). -errors.byte={0} deve ser um 'byte'. -errors.date={0} não é uma data. -errors.double={0} deve ser um 'double'. -errors.float={0} deve ser um 'float'. -errors.integer={0} deve ser um número inteiro. -errors.long={0} deve ser um 'long'. -errors.short={0} deve ser um número 'short'. -errors.creditcard={0} não é um número válido de cartão de crédito. -errors.email={0} é um endereço de e-mail inválido. -error.numberformatexception.quantity=Por favor, digite um valor numérico para 'quantidade'. -error.numberformatexception.customerIdBookNumber=Por favor, digite um valor numérico para 'customer ID book number'. -error.numberformatexception.customerID=Por favor, digite somente valores numéricos para o ID do cliente. -error.role.Invalid=Perfil não encontrado. Por favor, tento logar novamente com outro perfil. Contate seu Administrador de Sistema se o problema persistir. -error.illegal.access=Você não pode visualizar esta ordem porque ela não pertence a você. -error.noStock.Available=Quantidade disponível em estoque é menor do que a quantidade de entrada para {0} {1} {2} {3} -error.webstore.noStock.Available=Quantidade disponível para {0} é {1}. Você não pode comprar uma quantidade maior que {1} -error.orderedQuantity.invalid=Quantidade comprada deve ser maior que 0. -error.productquantity.invalid=Quantidade comprada deve ser maior que 0. -error.invoice.nolineselected=Por favor, selecione no mínimo uma linha para gerar a fatura. -error.csvfile.invalid=Existem erros no arquivo, por favor apague o arquivo antigo e faça o download de novo para ver os erros. -error.file.not.found=Por favor, anexe um arquivo. -error.stock.not.available=O estoque requisitado não está disponível. {0} -error.inventory=Inventário não disponível. {0} -error.inventory.not.available=Inventário insuficiente disponível. {0} -error.vehicle.alreadyReleased=O veículo já foi liberado. -error.shipper.alreadyExists=Transportadora já existe. Por favor, escolha outro nome. -error.allocationname.alreadyused=O nome que você forneceu já está sendo utilizado. Por favor, forneça outro. -error.notallvins.available=Nem todos os números VIN estão disponíveis no momento. -error.poReference.invalid=Por favor, entre com um número de referência válido. -error.ftp.file=O arquivo contém um número VIN que já está presente no sistema. Este arquivo pode já ter sido processado. -error.naamsaModelCode.exist=O código que você digitou já existe. Por favor forneça outro. -error.naamsaDealerCode.exist=O código que você digitou já existe. Por favor forneça outro. -error.salesrep.required = Por favor, selecione um representande de vendas. -error.date.notselected = Por favor, selecione uma data. -error.emptycart = Seu carrinho está vazio! -error.trackingNo.not.found=Por favor, especifique o número de rastreamento da FedEx. -error.in.file=Existe um erro no arquivo. Por favor verifique se existe ";" no arquivo e subtitua por ","
e nenhum campo deve estar vazio
Se não houver desconto e preço limite, deixe os dois iguais ao preço padrão.
Verifique também se a taxa definida existe. -error.invalid.address=O cliente não possui um endereço. Por favor, edite o cliente. -error.invalid.orderType=Esta ordem não é uma ordem de POS. Verifique o número do documento. -error.no.checkbox.selected=Por favor, selecione uma caixa de checagem. - -error.client.alreadyexist=Já existe um cliente com o nome fornecido. -error.client.create=Não foi possível criar um cliente com os detalhes fornecidos.
Por favor, entre em contato com POSterita (info@posterita.org) para suporte.
Cause:{0} - - -error.allocation.notclosable=Não é possível fechar a alocação porque uma ou mais linhas ainda não foram aprovadas. -error.allocation.report.notselected=Por favor, selecione uma alocação para gerar o relatório. -error.allocation.notselected=Por favor, selecione uma alocação para gerar a ordem. -error.vin.already.exists=Número VIN já está sendo usado. -error.role.already.exists = O nome está sendo usado. Por favor, forneça outro. -error.role.edit=Não é possível editar o perfil. -error.attributevalue.description.exception = Por favor, entre com uma descrição. -error.too.many.invoice=Somente uma fatura por vez pode ser alocada com pagamentos e memorando de crédito. -error.allocation.amt.exceeds.openamt=Montante de alocação é maior do que o montante em aberto para esta fatura. Não pode alocar. -error.no.invoice.to.allocate=Por favor, selecione uma fatura para alocar. -error.securityException=Você está tentando visualizar uma ordem que não pertence à sua organização. -error.required.agreement=Você deve concordar com os termos e condições antes da confirmação. -error.required.checkbox=Por favor, faça uma seleção. -error.required.sernoAttributeSetInstanceIds=Por favor, selecione um produto. - -error.notfound={0} não encontrado. -error.required.productChange={0} -error.required.model=modelo. -error.required.colour=cor. -error.required.transmission=transmissão. -error.required.year=ano. -error.required.bpartnerId=Por favor, insira o cliente -error.required.amount.given=Por favor, insira o montante pago -error.required.paymentTermId=Por favor, selecione um termo de pagamento -error.product.name.required=Por favor, insira um produto -error.cannot.deactivate.paymentTermName=Não é possível desativar o termo de pagamento. Alguns clientes estão associados com ele; - -error.required.username=Nome é obrigatório. -error.required.userSurname=Sobrenome é obrigatório. -error.required.password=Senha é obrigatória. -error.required.oldPassword=Por favor, insira sua senha antiga. -error.required.newPassword=Por favor, insira sua nova senha. -error.required.confirmPassword = Por favor, confirme sua nova senha. -error.required.creditCardNumber=Número do cartão de crédito é obrigatório. -error.required.address1=Endereço é obrigatório. -error.required.city = Cidade é obrigatória. -error.required.postalAddress = Endereço Postal é obrigatório -error.required.email = Por favor, insira seu endereço de email. -error.required.newEmail=Por favor, insira seu novo endereço de email. -error.required.confirmEmail=Por favor, confirme seu novo endereço de email. -error.wrong.old.password=Sua senha antiga está errada. -error.wrong.password.matching=As senhas não correspondem. -error.wrong.password.length=A senha deve ter, no mínimo, seis caracteres - -error.required.warehouseName = Nome do armazém é obrigatório. -error.required.orgName = Nome da organização é obrigatório. -error.required.poReference = Por favor, insira um número de referência. -error.required.orderId=Por favor, insira um número de ordem válido. -error.update.sequence=Um erro foi encontrado durante a atualização da sequência. Por favor, verifique a conexão do banco de dados. -error.required.poreference=Por favor, insira o número da ordem de compra. -error.required.assetID=Por favor, escolha um número VIM. -error.required.description= Por favor, insira uma descrição. -error.required.priceEntered=Por favor, insira o preço de compra. -error.required.vinNumber=Por favor, insira o número VIM. -error.numberformatexception.priceEntered=Por favor, insira um valor numérico para o preço de compra. -error.invalid.barcode=Código de barras inválido! Código de barras está vazio ou é nulo. - -error.required.name=Por favor insira o nome. -error.required.Surname=Por favor insira o sobrenome. -error.required.custIdNumber=Por favor, insira o ID do cliente. -error.required.physicalCity=Por favor, insira a cidade. -error.required.physicalPostalCode=Por favor, insira o código postal. -error.required.physicalStreet1=Por favor, insira a rua. -error.required.postalCity=Por favor, insira a cidade. -error.required.postalPostalCode=Por favor, insira o código postal. -error.required.phone1=Por favor, insira o telefone residencial. -error.required.phoneNo=Por favor, insira o telefone de trabalho. -error.required.cell=Por favor, insira um número de celular. -error.required.aaCardnumber=Por favor insira um número de cartão AA. -error.natisRelease.firebird=Seu veículo foi transmitido para NaTIS e está na fila para liberação. -error.duplicate.reference=Você já usou esta referência. Por favor, use outra. -error.usernameAlreadyUsed=O nome de usuário que você forneceu já existe.Por favor, escolha outro. -error.name.exists=O nome e o sobrenome que você forneceu já existems. Por favor, logue com o seu email. -error.email.exists=Este email já existe. Por favor, use outro endereço de email. -error.customer.id=Somente valores numéricos são permitidos no número de ID do cliente. -error.email=Email não foi enviado -error.duplicate.vin=Você selecionou veículos com o mesmo número VIN. Por favor, verifique que todos os veículos são designados para diferentes números VIN. -error.warehouse.alreadyexists = Armazém já existe. Por favor, escolha outro nome. -error.targetQuantity.invalid = Por favor, entre com uma quantidade válida. - -error.cannot.delete.order=Ordem não pode ser apagado pois já foi criada uma fatura. -error.bp.alreadyexist=Este cliente já existe em seu banco de dados. Por favor, selecione o link "Cliente já existente" e escolha o cliente correto. -error.model.alreadyGrouped = Modelo já agrupado -error.bank.already.exist=Banco já existe -error.attributevalue.alreadyexist = Valor já existe -error.year.attributevalue.invalid = Por favor, entre com um ano válido -error.product.alreadyexist = Produto já existe. Por favor, entre com um novo. -error.year.attributevalue.formatting.exception = Por favor, entre com valores númericos para o ano. -error.year.length.invalid = Ano inválido. Tamano deve ser 4 caracteres. -error.product.not.selected = Por favor, selecione um produto. -error.bp.notselected=Por favor, selecione um cliente. -error.no.vin.number=Por favor, especifique um número VIN completo. -error.invalid.period=Data inicial não pode ser maior do que a data final. -error.required.fromDate = Por favor, selecione a data inicial. -error.required.toDate = Por favor, selecione a data final. -error.already.released= O veículo já foi liberado. Não pode ser realizada a troca de veículo. -error.product.selected.not.same.warehouse=Armazéns dos produtos selecionados são diferentes. Por favor, selecione produtos do mesmo armazém. -error.cannot.create.inventory.line=Não é possível criar uma linha de inventário para produtos que são serviços.
Por favor, transforme o ítem em produto e realize a compra. - -error.vehicle.vinAlreadyPresent = O número VIN que você entrou já existe no sistema. -error.vehicle.unitNumberPresent = The unit number entered is already present in the system. -error.numberformatexception.enginePower = Please enter a numeric value for Engine Power. -error.numberformatexception.natisModelNo = Please enter a numeric value for NaTIS Model Number. -error.numberformatexception.noOfWheels = Please enter a numeric value for No. of wheels. -error.numberformatexception.tare = Please enter a numeric value for Tare. -error.numberformatexception.engineCapacity = Please enter a numeric value for Engine Capacity. - - -error.modelmatching.notfound = Model Matching not found. -error.modelmatching.alreadyexist = Model Matching already exist -error.deactivatingproductinstock = Cannot deactivate product(s) as there are still some in HSAF or Dealers' stock. -error.orderId.null = Please enter an Order Id. -error.order.notExist = The Order does not exist. Please enter a valid Order Id. -error.order.noOrderline.selected = Please select at least one orderline to delete. - -error.product.keywords.required=Keywords are mandatory. Please set them before making a product featured in Webstore. - -error.colourmatching.alreadyexist=Colour Code Matching Already Exist -error.colourmatching.invalid=Colour Code Matching is invalid -error.colourmatching.errorsave=Could not save Colour Code Matching details - -error.import.nolineselected=You should choose at least one import line for processing -error.invalid.inputQty=Please enter a quantity greater than 0 -error.invalid.totalQty=Please enter a quantity per Size! -error.quantity.notAvailable=Entered quantity not available for {0} -error.updating.product=Could not update the status of the selected products -error.product.not.found=Product Not Found! -error.check.inserted.value=Please check the value inserted qty and the barcode should be separated by + sign -error.product.attributes.different=Cannot update Products with different attributes -error.updating.attribute=Could not change the specified Attribute Value -error.product.price.not.found=Product is Not On PriceList {0} -error.product.already.exists=Product already exists -error.barcode.already.exists=Barcode already exists -error.barcode.required = Barcode is required -error.reason.required = Please type in the reason -error.qty.required = Quantity is required -error.total.zero = Please check total amount. Cannot be zero -error.product.cannot.inactivate=product cannot be inactivated /Make it Services {0} -error.invalid.content= The Content of the uploaded file are wrong, should be an image -error.pos.no.orderline=There are no orderline in the order, please create a new order -error.no.transfer.amount=Please enter some amount -error.transferAmt.exceeds.endingBalance=Amount exceeding the ending balance, can not create transaction -error.cannot.close.till=The Till is already closed, can not transfer any amount until a new cash order is created
To transfer only card and cheque amount insert transfer amount as 0 and press submit -error.invalid.number=Please insert a valid number -tax.rate.not.defined=The Tax rate is not defined,Please define it {0} -error.required.revenue.recognition=Please enter Revenue Recognition -error.duplicate.product=Duplicate product name in the file Or the product already exists in the system {0} -error.duplicate.barcode=Duplicate barcode in the file Or the barcode already exists in the system {0} -error.cannot.adjust.till=The till is closed,cannot adjust the amount now -error.till.already.close=The Till is closed, can not close it again
To transfer only card and cheque amount just press submit -error.duplicate.userpin=The User Pin Already exists. -error.paymentTermName.duplicate=The Payment Term Name already Exists. -error.net.days.cannot.be.negative=Net Days cannot be negative or null. -error.name.mandatory = Please type the name -error.bpartner.over.credit.limit=Customer exceeds Credit Limit
{0} -error.bpartner.no.payment.term=Customer does not has a Payment Term,Please create one -error.insufficient.qty={0} -error.limit.price.violated={0} - -error.taxname.duplicate=Tax name already exists -error.taxrate.duplicate=Tax rate already exists -error.name.required=Please Insert the Name -error.required.field=field required {0} -error.tax.rate.nagative=tax rate cannot be negative -error.discount.nagative=Discount(s) cannot be negative -cannot.inactivate.tax=Cannot deactivate tax, some products have this tax - - -error.pos.payment.invalidCashAmount=Please enter a numeric value for Cash Amt. -error.pos.payment.invalidCardAmount=Please enter a numeric value for Card Amt. -error.pos.payment.invalidChequeAmount=Please enter a numeric value for Cheque Amt. -error.pos.incorrect.tendered.amount=Please enter the exact tender amount. -error.paymentamount.mandatory=Please enter Payment Amount. -error.allocate.amt.exceeds=Allocated Amt. exceeds the open amt of Invoice {0} -error.allocate.amt.payamt.notequal=Allocated Amt is not equal to the Payment Amt {0} - -error.collection.dir=Image Collection directory does not exist: {0} -error.inactive.collection.dir=Inactive Image Collection directory does not exist: {0} -error.errors.dir=Error image directory does not exist: {0} -error.synchronize.products.collection=Could not synchronize product collections: {0} - -error.related.product=No product found related with this attribute value -error.invalid.datetime=The date and time provided is invalid - -error.order.delete=Could not delete this order - -error.sessions.exceeded=You cannot log into the system.
Number of Licensed Sessions, ({0}), will be exceeded.
Please contact your administrator for further details. -error.requests.exceeded=The number of operations that you have performed has exceeded the limit that has been set for your license of Tamak ICT POS.
Please contact your administrator for further details. -error.license.invalid=Your license is invalid. Please change your licensing details as appropriate. -error.license.unexpected=An unexpected error has occurred. Please try to perform again all the operations that caused this error.
In case this error occurs again, please contact your administrator.
Details: {0} -error.licensinginfo.update=Licensing information could not be updated. Cause\: {0} -login.passwordError= Password is invalid -error.invalid.pin=Invalid User PIN -error.duplicate.pin=More than one user has the same PIN -error.customer.not.exists=The customer is either not present or is not active -error.vendor.not.exists=The vendor is either not present or is not active -# -- other -- -errors.cancel=Operation cancelled. -errors.detail={0} -errors.general=The process did not complete. Details should follow. -errors.token=Request could not be completed. Operation is not in sequence. - -error.required.vin.number=Please enter a VIN number -error.invalid.orderId=Order does not exist! -error.invoke.status=Cannot invoke order with status: {0} -# -- welcome -- - - -address = Address: -postaladdress = Postal Address: -city = City: -region = Region: - -welcome.title=Struts Blank Application -welcome.heading=Welcome! -welcome.message=To get started on your own application, copy the struts-blank.war to a new WAR file using the name for your application. Place it in your container's "webapp" folder (or equivalent), and let your container auto-deploy the application. Edit the skeleton configuration files as needed, restart your container, and you are on your way! (You can find the application.properties file with this message in the /WEB-INF/src/java/resources folder.) -login.emailNotFound=There is no email set for you please check with your administrator -login.userNotFound=Your Username can not be found on the system. -login.alreadyLogin=You are already logged in! Please logout before you attempt to login again. - -admin.changeEmail.title=Change My Email Address -admin.changeEmail.oldEmail=Old Email Address: -admin.changeEmail.newEmail=New Email Address: -admin.changeEmail.confirmEmail=Retype New Email Address: -admin.viewRoles.title=View All Roles - -admin.changePassword.title=Change My Password -admin.changePassword.old=Old Password: -admin.changePassword.new=New Password\: -admin.changePassword.confirm=Retype New Password\: - -admin.home.title=Dealer Admin - Document Storage -admin.home.link.stocks=My Stock -admin.home.link.certificates=My Certificates -admin.home.link.invoices=Invoices -admin.home.link.creditNotes=Credit Notes -admin.home.link.statements=Statements -admin.home.link.rebates=Rebates -admin.home.link.other=Other -admin.home.link.changePassword=Change Password -admin.home.link.changeEmail=Change Email Address -admin.home.link.viewMyDetails=View My Details -admin.invalidEmailError=You entered an invalid email address. -admin.wrongPasswordError=You wrongly entered your old password. - -admin.emailChanged.title=Email Address changed -admin.emailChanged.message=Your email has been changed. -admin.myCertificates.title=My Certificates -admin.myStocks.title=Available Stock - Not Yet Released -admin.passwordChanged.title=Password changed -admin.passwordChanged.message=Your password has been changed. -admin.userDeleted.title=User deleted -admin.userDeleted.message=You have successfully deleted the User. -admin.userDetails.title=User Details -admin.userForm.title=Create User -admin.userForm.select=Select User Role: -admin.viewMyDetails.title=My Details -admin.viewMyDetails.email=Email Address\: -admin.viewMyDetails.dealerName=Dealer Name: -admin.viewMyDetails.dealerCode=Dealer Code: -admin.viewMyDetails.phone=Phone Number: -admin.viewMyDetails.fax=Fax Number: -admin.viewMyDetails.deliveryAddress=Delivery Address: -admin.viewUsers.title=View All Users -admin.viewUsers.username=Username -admin.viewUsers.userRole=User Role -admin.viewUsers.editDelete=Edit/Delete User - -allocation.home.title=Allocations -allocation.home.link.result=Allocations -allocation.home.link.request=Allocation Requests -allocation.home.link.swap=Swap -allocation.request.confirm=Please confirm your allocation request -allocation.results.title=Allocations -allocation.results.vehicle.allocation=Your vehicle allocations for March 2005 are as follows: -allocation.results.eta=ETA -allocation.results.action=Action -allocation.results.accept=Accept -allocation.results.reject=Reject - -mmovement.title=Material Movement\t\t\t\t\t\t\t -mmovement.warehouse=Warehouse -mmovement.documentNo=Document No: -mmovement.description=Description: -mmovement.locator=Locator: -mmovement.destinationLocator=Destination Locator: -mmovement.header=Material Movement -mmovement.product.name=Name -mmovement.product.details=Details -mmovement.product.quantity=Quantity -mmovement.product.move=Move -mmovement.region=Region -mmovement.move=Move -mmovement.track=Track -mmovement.allWarehouses=All -mmovement.selectWarehouse=Move to Warehouse: -mmovement.button.confirm=Confirm -mmovement.button.complete=Complete -mmovement.button.delete=Delete -mmovement.button.cancel=Cancel -mmovement.documentStatus=Document Status: - - -mmovement.track.title=Track Material Movement -mmovement.track.header=Track Material Movement - -allocation.results.time.remaining=Time Remaining for this allocation: -allocation.results.time.numDays=22 days -allocation.results.swap.allocation=*NB: Should you choose to swap an allocated vehicle, the system will automatically accept that allocation. -allocation.resultsConfirm.title=Allocation - Allocation submitted -allocation.resultsConfirm.message=Thank You. Your allocations have been submitted. -allocation.status=Allocation Status -allocation.swap.title=Vehicle Allocation Request -allocation.swap.heading=Vehicle Allocation Request -allocation.swap.vehicles=Vehicles available for swap -allocation.swapConfirm.submit=Your request for swap has been submitted. -allocation.swapProcess.title=Swap Process -allocation.swap=Swap - -asset.status= Asset Status - -days.old=Days Old - -button.add=Add -button.cancel=Cancel -button.confirm=Confirm -button.create=Create Order -button.delete=Delete -button.edit=Edit User -button.process=Process Order -button.search=Search -button.submit=Submit -button.save=Save -button.reply = Reply -button.complete=Complete -button.createwarehouse=Create Warehouse -button.invoice = Create Invoice - - -dealer.order=Order -dealerOrder.cancelOrder.title=Dealer Order - Order cancelled -dealerOrder.cancelOrder.message=This order has been cancelled. -dealerOrder.createOrder.title=Dealer Order -dealerOrder.home.title=Orders -dealerOrder.home.link.result=Dealer Orders -dealerOrder.home.link.specialColour=Special Colour Orders -dealerOrder.home.printOrder=Dealer Order - Print Order -dealerOrder.input.all=Please input all values. -dealerOrder.process.title=Dealer Order - Order processed -dealerOrder.process.message=Thank You, Your orders have been processed -dealerOrder.results.title=Dealer Order - Results -dealerOrder.specialColour.title=Special Colour Orders -dealerOrder.specialColour.submission=*NB: Must be submitted four months in advance for Accord, All other models - 3 months in advance. -dealerOrder.createSpecialColour.title=Create Special Colour Order - -dealerOrder.terms.title=Dealer Order - Terms and Conditions -dealerOrder.terms.heading=Terms and Conditions -dealerOrder.terms.term1=All orders placed by the dealer (whose name and details appear on this order form) ("the Dealer") shall be final and binding on the Dealer once the Dealer has signed this order form and delivered the original signed order form or a copy thereof to Honda South Africa (Pty) Ltd (registration number 2000/010675/07) ("HSAF"). The Dealer shall not be entitled to cancel its order, return any of the Honda Products reflected on this order form or obtain a credit for Honda Products without HSAF's prior written consent. - -dealerOrder.terms.term2=The Dealer's order shall not be binding on HSAF until acceptance thereof by HSAF (whether in whole or in part) by the duly authorized HSAF divisional manager signing this order form in the space provided therefor. - -dealerOrder.terms.term3=Ownership in and to Honda Products forming the subject matter of this order form shall remain vested with HSAF until those Honda Products have been delivered to or collected by the Dealer, as the case may be, and HSAF has received payment in full of the total amounts reflected on this order form. The risk of loss and damage to the Honda Products reflected on this order form shall pass to the Dealer upon the collection or the delivery of those Honda Products to the Dealer, notwithstanding the fact that the Dealer has not paid HSAF in full for those Honda Products and that the Dealer is not the owner of those Honda Products. - -dealerOrder.terms.term4=Any purported variation on this order form of the provisions of any written agreement(s) concluded between HSAF and the Dealer in respect of the Honda Products shall not take precedence over the terms of those written agreements, notwithstanding HSAF's signature on this order form. - -dealerOrder.terms.term5=By the Dealer's signature of this order form, the Dealer acknowledges and agrees that it has read and understood the terms and conditions set out on this order form and agrees to be bound to those terms and conditions. - -dealerOrder.terms.term6=HSAF reserves the right at any time and from time to time to change or modify, without notice, the terms and conditions set out in this order form. - -dealerOrder.terms.term7=Notwithstanding the signature hereof by HSAF, HSAF will have obligation, under any circumstances, to accept orders for any Honda Products which are not in this current inventory. - -dealerOrder.terms.term8=For the purposes of this order form, Honda products means: -dealerOrder.terms.term8a=such new motorcycles and automobiles as are from time to time offered for sale by HSAF to Dealer for resale as part of HSAF's motorcycle or automobile line as determined by HSAF in its sole discretion; and/or - -dealerOrder.terms.term8b=all industrial and domestic engines manufactured by HSAF which form part of HSAF's engine line as determined by HSAF in its sole discretion; and/or\t\t\t - -dealerOrder.terms.term8c=all power products which form part of HSAF's power product line as determined by HSAF in its sole discretion, including without limitation, all HSAF generators, lawn mowers, brushcutters and water pumps; and/or - -dealerOrder.terms.term8d=all parts, accessories and optional equipment marketed by HSAF for use of with motorcycles, engines, automobiles and power products referred to above. - - -dealerOrder.qty.greaterThanZero=The quantity specified must be greater than zero. -dealerOrder.noOrders=Please add at least an order. - -dealerOrder.must.agree=You must agree to the terms and conditions before confirmation. - - -include.footer.poweredBy=Powered by UDI Technology -include.footer.allContent=All Content © 2005 Honda South Africa -include.header.link.loginSuccess=  Home -include.header.link.stockAction=  Stock Inquiries -include.header.link.dealerOrderHome=  Dealer Orders -include.header.link.natisReleaseHome=  NaTIS Release -include.header.link.allocationHome=  Allocations -include.header.link.interDealerHome=  Inter Dealer Transfers -include.header.link.adminHome=  Dealer Admin -include.header.link.loginActionNoInput=  Logout -include.header.link.myorders=My Orders - -interdealer.transfer=Transfer -interDealer.cancelTransfer.message=You have cancelled this request. -interDealer.dealerTransferOrder.title = Inter Dealer Transfer -interDealer.dealerTransferOrder.heading = Dealer Transfer: Request -interDealer.home.title=Dealer Transfers -interDealer.home.link.request=Request -interDealer.home.link.receiving=Receiving -interDealer.process.title=Dealer Transfer - Request sent -interDealer.process.message=Your request has been transmitted. -interDealer.request.title=Dealer Transfer - Requests -interDealer.receiving.title=Dealer Transfer - Receiving -interDealer.receiving.from=From: -interDealer.receiving.accept=Accept -interDealer.receiving.reject=Reject -interDealer.receiving.reason=Reason for rejection - -login.choose.title=Please choose a User from any of these Dealers -login.forgot.forgotPassword=Perdeu sua senha?
Entre com seu nome de usuário e nós lhe enviaremos sua senha para seu endereço de email. -login.forgot.username=Username\: -login.forgot.sendPassword=Send Password -login.home.title=Welcome to Posterita POS -login.home.title.part1=Welcome to -login.home.title.part2=Posterita POS -login.home.login=Please Login -login.home.username=Username\: -login.home.password=Password: -login.home.loginButton=Login -login.home.loginForgot=Forgot password? -login.loginForm.message=Please enter your username and password.Remember your email is your username
NB: Case sensitive. -login.logout.logoutSuccess=You have successfully logged out. -login.logout.backToLogin=  Click Here to go back to the Login Screen -login.password.passwordSent=Your password has been sent you should receive it in a few minutes -login.password.backToLogin=  Click Here to go back to the Login Screen -login.password.emailTitle= Your password reminder. -login.password.emailSubject=The password to log in into the POS System is: -login.success.welcome=Welcome to Posterita
POS System -login.userInactive=Your user has been set inactive. - -menu.title = Menu -menu.close = Close Menu -menu.closed = Menu Closed -menu.isActive = Is Active -menu.list = List of Menu -menu.description = Description - -#============Email Errors============ -email.subject.error = Please enter a subject for the email -email.message.error = Please enter your message -email.send.error = Email cannot be sent. Please Check if you have properly configured your smtp host. - -#==================================== - -message.title = Create Message -message.from = From: -message.to = To: -message.recto = To -message.subject = Subject: -message.recsubject = Subject -message.writemessage = Message: -message.senttitle = Message Sent -message.sent = Your Message has been sent -message.sentmessages = Sent Messages -message.mymessages = My Messages -message.received = Received Messages -message.sender = Sender -message.date = Date -message.viewdate = Date: -message.view = View Message -message.markas = Mark as -message.delete = Delete -message.reply = Reply Message -message.viewreceivedmessage = View Received Message -message.viewsentmessage = View Sent Message -message.sendbutton = Send -message.goback = Go Back - -myorders.home.title=My Orders - Home -myorders.home.heading=My Orders - -myorders.orders.dealerorders.link=Dealer Orders -myorders.orders.scoorders.link=Special Colour Orders -myorders.orders.requesttransferorders.link=Dealer Transfer Orders - -myorders.purchaseorders.home.link=Purchase Orders -upload.file = Please attach the file for creating orders -download.file=Download file - -myorders.result.title=My Orders Result -myorders.result.heading=My Orders - Result -myorders.result.dateOrdered=Date Ordered -myorders.result.bpartnerName=Dealer -myorders.result.docStatus=Doc Status -myorders.result.hsafRef=HSAF Ref ID -myorders.result.poreference=PO Reference -myorders.result.grandTotal=Grand Total -myorders.result.viewOrder=View Order -myorders.result.orderfrom=Ordered From - - - -myorders.salesorders.home.link=Sales Orders -myorders.purchase.order= Purchase Order - -mycertificate.title = My Certificates -mycertificate.viewCertificate = View Certificate - - -natisRelease.home.title=NaTIS Release -natisRelease.process.title=NaTIS Release - Vehicle released -natisRelease.process.message=Thank you, the Vehicle has been released -natisRelease.release.name=Name -natisRelease.release.surname=Surname -natisRelease.release.idNumber=ID Number\: -natisRelease.release.physicalAddress=Physical Address -natisRelease.release.postalAddress=Postal Address -natisRelease.release.homeTelephone=Home Telephone -natisRelease.release.workTelephone=Work Telephone -natisRelease.release.cell=Cell -natisRelease.release.fax=Fax -natisRelease.viewCertificate.title=View Certificate -natisRelease.viewCertificate.message=Your NaTIS Certificate for this vehicle has been released. -natisRelease.viewCertificate.download=Click here for your certificate. -natis.order.history = NaTIS Release Sales History - -order.dealerPONo=Dealer Purchase Order No:  -order.HSAFRefNo=HSAF Ref No:  -order.terms=Terms and Conditions compulsory -order.specialColour=Special Colour Order -order.print=Printer Friendly Version - -orderView.orderFooter.use=FOR OFFICE USE -orderView.orderFooter.roNo=R/O NUMBER -orderView.orderFooter.invoiceNo=INVOICE NUMBER -orderView.orderFooter.dealerAuthor=DEALER AUTHORISATION: -orderView.orderFooter.signature=SIGNATURE: -orderView.orderFooter.recvBy=HSAF RECEIVED BY: -orderView.orderFooter.divMgr=AUTHORISED DIV MANAGER:  (Name & Sign.) - -orderView.orderHeader.honda=HONDA S.A AUTOMOBILE
DEALER ORDER -orderView.orderHeader.att=ATT: -orderView.orderHeader.fax=FAX: -orderView.orderHeader.tel=TEL: -orderView.orderHeader.date=DATE: -orderView.orderHeader.orderNo=DEALER ORDER NO: -orderView.orderHeader.dealerCode=DEALER CODE: -orderView.orderHeader.dealerName=DEALER NAME: -orderView.orderHeader.delAddress=DELIVERY ADDRESS: - -orderView.orderPriceDetails.subTotal=SUB TOTAL -orderView.orderPriceDetails.vat=VAT -orderView.orderPriceDetails.orderTotal=ORDER TOTAL - -product.create.car = Create New Car -product.create.bike = Create New Bike -product.create.usedcar = Create Used Car -product.create.usedbike = Create Used Bike -product.create.usedcar.attributevalue = Create Used Car Attribute Value -product.create.usedbike.attributevalue = Create Used Bike Attribute Value -product.create.car.attributevalue = Create New Car Attribute Value -product.create.bike.attributevalue = Create New Bike Attribute Value - -product.create = Create Product -product.details = Product Details -product.make=Make -product.model=Model -product.colour=Colour -product.transmission=Transmission -product.year =Year -product.purchase.price = Purchase Price -product.sales.price = Sales Price -product.wholesale.price= Wholesale Price -product.retail.price= Retail Price -product.quantity=Quantity -product.price=Price -product.vinNo=VIN No. -product.order=Order -product.salesRegion=Sales Region -product.request=Request -product.sendRequest=Send Request -product.release=Release -product.reserved=Reserved -product.status=Status -product.all=All -product.umodel=MODEL -product.ucolour=COLOUR -product.utransmission=TRANS -product.frameNo=FRAME NUMBER -product.uquantity=QTY -product.uprice=PRICE Ex VAT -product.uVAT=VAT -product.dealer=DEALER -product.uTotal=TOTAL -product.colourType=Colour Type -product.colour.group=Colour Group -product.wholesaleDate=Wholesale Date -product.natisApplicationDate=NaTIS Application Date -product.hide=Hide -product.refNo=Reference No -product.ordId=Order ID -product.ordBy=Order By -product.ordDate=Date Ordered -product.doctype=Doc Type -product.type = Product Type -product.home.title = Select Products For Order -product.isNatisReleased = Is NaTIS Released -product.description = Description -product.restriction = Product Restriction -product.name = Product Name -product.restrict = Restrict -product.pricelist = Pricelist -product.newprice = New Price -product.oldprice = Old Price -product.price.edit = Edit Product Price - -reprice.orders=Reprice Orders - - -customer.details=Customer's Details -customer.licensing.desc=Licensing Option Description -customer.finance.option=Finance Option Description -trade.in.make=Trade In Make -trade.in.makeModel=Trade In Make Model -trade.in.year=Trade In Year -customer.idBookNo=ID Book Number -engine.no=Engine Number -maintenance.contract=Maintenance Contract -registration.status=Registration Status - -sc.dealerOrder.home.quantity=Quantity - -target.sales.title = Target Sales -target.sales.month = Month -target.sales.year = Year -target.sales.ModelGroup = Model Group -target.sales.Quantity = Quantity -target.sales.organisation = Organisation - -stock.home.title=Stock Inquiry -stock.inquiry.show=Show ONLY stock from HSAF -stock.not.reserved.show=Show ONLY available stock -stock.process.title=Stock Inquiry - Request sent -stock.process.message=Thank You, your request has been sent -stock.filter.by=Filter by: - -error.workflow.violation=You can only progress in this application using the buttons and the menu that are offered. Hitting the browser's reload button or using the back button is not allowed. - -user.create = Create User -user.created = User Created -user.username=Username: -user.role=User Role: -user.password=Password: -user.address = Address: -user.city = City: -user.postaladdress = Postal Address: -user.region = Region -user.email=Email Address: -user.phone = Phone No: -user.cellphone=Cell Phone: -user.confirmPassword=Confirm Password: -user.isActive = Is Active -user.isSalesRep = Is Sales Representative -user.details = User Details -user.pin=User PIN -user.docBasisType=Document Basis for Commission -user.comm.per=% Commission for the sales rep -user.comm.fre=Calculation Frequency -user.substract.amt=Substract Amt** -user.substract.exp=**The Subtract Amount indicates the amount to subtract from the total amount prior to calculation of commission - -choose.VIN=Choose VIN Number - -select.month=Month -select.year=Year -select.status=Status -view.all=All - -calendar.day.default=Day -calendar.month.default=Month -calendar.year.default=Year -calendar.month1=Jan -calendar.month2=Feb -calendar.month3=Mar -calendar.month4=Apr -calendar.month5=May -calendar.month6=Jun -calendar.month7=Jul -calendar.month8=Aug -calendar.month9=Sep -calendar.month10=Oct -calendar.month11=Nov -calendar.month12=Dec -asset.owner=Owned By -queryVinNo.title=Query VIN No. -vinNo.search=Search VIN No. -vinNo.query=Query on the Status of VIN Number -vinNoDetails.title=VIN Number Details -searchOrderByRef.title=Query Order Reference Number -search.orderID=Search Order Ref No. -text.yes=Yes -text.no=No -query.dealers.stock.title=Query Dealers Stock - -bPartner.title = Business Partner -bPartner.create = Create Business Partner -bpartner.details = Business Partner Details -bpartner.name = Name -bpartner.name2 = Name2 -bPartner.address = Address -bPartner.address1 = Address1 -bPartner.address2 = Address2 -bPartner.postal.address = Postal Address -bPartner.city = City -bPartner.phone=Phone Number -bPartner.fax=Fax Number -bpartner.edit = Edit -bpartner.view = View -bPartner.isActive = Is Active: -bPartner.isCustomer = Is Customer: -bPartner.isVendor = Is Vendor: -bPartner.isEmployee = Is Employee: -bPartner.isSalesRep = Is Sales Rep: -bPartner.region = Region -bPartner.edit = Edit Business Partner Details -bPartner.credit.limit = Credit Limit -bPartner.credit.status = Credit Status -bPartner.dunning = Dunning - -bank.create = Create Bank -bank.name = Bank Name -bank.address = Address -bank.postaladdress = Postal Address -postal.address = Postal Address -bank.city = City -bank.routingnumber = Routing Number -bank.details = Bank Details - -locator.details = Locator Details -locator.create = Create Locator -locator.warehouse = Warehouse -locator.aisle = Aisle -locator.bin = Bin -locator.level = Level -locator.default = Is Default - -bAccount.create = Create Bank Account -bAccount.bank.name = Bank Name -bAccount.no = Account Number -bAccount.type = Account Type -bAccount.current.balance = Current Balance -bAccount.type.checking = Checking -bAccount.type.saving = Saving -bAccount.details=Bank Account Details - -order.history = Order History -invoice.history = Invoice History -payment.history = Payment History -inout.shipment.history = Shipment History -inout.receipt.history = Receipt History - - -history.receiptNumber = Receipt Number -history.shipmentNumber = Shipment Number -history.orderNumber = Order Number -history.invoiceNumber = Invoice Number -history.documentNumber = Document Number -history.documentStatus = Document Status -history.dealerName = Dealer Name -history.date = Date -history.dateInvoiced = Date Invoiced -history.dateOrdered = Date Ordered -history.grandTotal = Grand Total -history.isDelivered = Is Delivered -history.isInvoiced = Is Invoiced -history.isPaid = Is Paid -history.isReceipt = Is Receipt -history.paymentId = Payment Id -history.paymentAmt = Payment Amt \t -history.transactionDate = Transaction Date -history.orderReference = Order Reference -history.isSotrx = Is Sales Order - -warehouse.create = Create Warehouse -warehouse.created = Warehouse Created -warehouse.details = Warehouse Details -warehouse.wname = Warehouse Name -warehouse.name = Warehouse -warehouse.address = Address: -warehouse.postaladdress = Postal Address: -warehouse.city = City: -warehouse.region = Region -warehouse.isPublic = Is Accesible to Dealers -warehouse.isActive= Is Active -is.warehouse.allocation= Is Allocation Warehouse -warehouse.type=Warehouse Type -warehouse.all = All Warehouses -product.attribute.create = Create Product Attribute Value -product.attribute.set = Vehicle -product.attribute.name = Attribute -product.attribute.value = Value -product.attribute.value.created = Product Attribute Value Created -product.attribute.existingValues = Existing values -product.selected = Selected Products -quantity = Quantity - -engine.number= Engine Number -natis.application.date=NaTIS Application Date -natis.release.date=NaTIS Release Date -natis.control.number=NaTIS Control Number -natis.model.number=NaTIS Model Number -natis.unit.number=NaTIS Unit Number -natis.release.id=NaTIS Release Id -org.name=Dealer Name\: -register.number= Register Number - -customer.create.new=Create new customer -customer.information =NaTIS Release-Customer Information -customer.name = Customer Name: -customer.surname=Surname: -customer.id.number=ID Number: -customer.phy.add = Physical Address: -customer.street1 = Street 1: -customer.street2 = Street 2: -customer.city = city: -customer.postal.address = Postal Address: -postal.street1=Postal Street -postal.city=Postal city -postal.code = Postal Code: -customer.home.telephone =Home Telephone No: -customer.work.telephone =Work Telephone No: -customer.cell= Customer Cell\: \t -customer.aa.car.number=AA Card No\: \t -customer.maintenance.contract.number=Maintenance Contract No: -invoice.it = Invoice -unreserve.stock = Unreserve Stock -shipment.material.receipt=Shipment/Material Receipt - -#vehicle.createVehicle=Create Vehicle -#vehicle.unitNumber=Unit Number -#vehicle.vinNumber=Vin Number -#vehicle.engineNumber=Engine Number -#vehicle.natisModelDesc=Natis Model Desc -#vehicle.enginePower=Engine Power -#vehicle.engineCapacity=Engine Capacity -#vehicle.tare=Tare -#vehicle.noOfWheels=No. of Wheels -#vehicle.cntryOfImport=Country Of Import -#vehicle.colourCdHES=Colour Code HES -#vehicle.mainColourCd=Main Colour Code -#vehicle.natisModelNum=Natis Model Number - - -#========= DMS Messages - -error.required.attributeValue = Value is required -error.required.orgType = Choose a dealer type -error.required.vehicleType = Choose a product type -error.required.locator = Destination Locator required -error.required.warehouse = Destination Warehouse required -error.no.order.exists=The Order is already completed, Please make a new one - -org.create=Create Dealer -org.details = Dealer Details -reserved.for=Reserved For the Dealer: -org.type=Dealer Type: -org.product.type=Product Type: -click.order.id=Click this OrderId to get the Order: -org.retailer= Is Retailer: -org.wholesaler=Is Wholesaler: -org.automobile= Is Automobile: -org.motocycle=Is Motocycle: -org.address=Address: -org.address1=Address1: -org.address2=Address2: -org.city=City: -org.postalAddress=Postal Address: -org.region=Region: -org.isActive= Is Active -org.isVisible= Is Visible - -dealer.details = Dealer Details -dealer.name = Dealer Name -dealer.location = Location -dealer.phone = Phone -dealer.fax = Fax - -role.create = Create Role -role.name = Name -role.superuser = Access to all Dealers -role.accessibleToAll = Access to all Dealers -role.isActive = Is Active - -pos.name= POS Name -pos.begining.balance=Beginning Balance -pos.net.transaction=Net Cash Transaction -pos.cash.total=Cash Amount -pos.card.total=Card Amount -pos.cheque.total=Cheque Amount -pos.grandtotal=Grand Total -pos.current.till.balance= Current Till Balance - - -groupModel.title = Group Models -groupModel.group = Model Group -groupModel.model = Model - -licensing.district = Licensing District -licensing.district.code = Licensing District Code -licensing.district.description = Description -licensing.district.area = Licensing Area -licensing.district.area.domestic = Domestic -licensing.district.area.export = Export - -price.listing = Price Listing -pricelist.Version = PriceList Version -pricelist.name = PriceList Name -pricelist.listPrice = List Price - -error.required.currentBalance = Current Balance is required -error.required.accountNo = Account Number is required -error.required.accountType = Account Type is required -error.required.partnerName = Business Partner Name is required -error.required.supplierName = Vendor Name is required -error.required.sizes = Please select some sizes or enter a custom size - - -error.required.stdPurchasePrice = Purchase Price is required -error.required.stdSalesPrice = Sales Price is required - -error.numberformatexception.currentBalance=Only numeric values are supported for Current Balance -error.numberformatexception=Please Enter a Numeric Value -error.numberformatexception.stdSalesPrice= Sales prices should be numeric -error.numberformatexception.stdPurchasePrice=Purchase prices should be numeric -error.numberformatexception.price=Please enter a numeric value for the prices -error.modelgroup.notExist=Please specify a Model Group -error.deactivatingattributeproductinstock = Unable to perform action. There are some products that use the attribute value. - -invoice.customer.print=Customer Invoice - Print -invoice.customer=Customer Invoice -invoice.no=Invoice No - -search.order = Search Order -search.order.title = Query Order ID -search.order.label = Order ID - -search.order.vin = Search Order For a VIN No. -search.order.vin.title = Search Order For a VIN No. -search.order.vin.label = Enter VIN No. -swap.vin.success=The vehicle has been swapped successfully -reprice.order.success=The Orders have been Repriced successfully - -error.orderId.not.found=Order Id not found -material.movement.success=The products have been moved successfully. -sequence.update.success= The sequences have been updated successfully -data.integrity.success=The data intregriy has been checked and mails have been send for the failed tests -naamsa.dealercode.create=Create NAAMSA Dealer Code -naamsa.dealercode.title=NAAMSA Dealer Code -naamsa.dealercode.edit.title=Edit NAAMSA Dealer Code -naamsa.dealer=Dealer -naamsa.dealercode=Dealer Code - -naamsa.modelcode=Model Code -naamsa.modelcode.create=Create NAAMSA Model Code -naamsa.modelcode.title=NAAMSA Model Code -naamsa.modelcode.edit.title=Edit NAAMSA Model Code - -wholesaleorder.ftp.title=Upload FTP File -wholesaleorder.csv.title=Create Wholesale Order -wholesaleorder.information=Please go to the following site and select the ftp file which consist of the vehicles which you want to insert in the system. -wholesaleorder.site=ftp://ftp.honda-eu.com -wholesaleorder.upload.button=Upload File -error.ftp.notvalid=The ftp file uploaded is not valid -wholesaleorder.csv.invalid=CSV File is invalid -wholesaleorder.csv.unknownerror=An Error has occurred, please contact your system administrator -error.ftp.novehicle=The FTP does not contain vehicles for your Organisation Type -wholesaleorder.csv.download=Download the CSV generated from the FTP file that you have input.
Check whether all the records are good. Take appropriate action for those that have error descriptions.
-wholesaleorder.csv.download1=Download the CSV generated from the FTP file that you have input.
Modify this file by inputing genuine information concerning the vehices.
-wholesaleorder.csv.information=Upload the CSV that you have modified in order to generate the wholesale order. -wholesaleorder.csv.uploadFile=CSV File to upload\: - -error.natis.release=Your request to release this vehicle is in progress.\n The system will automatically complete this order and release the vehicle on NaTIS after some time. -error.natis.release_old=Could not release vehicle on NaTIS. Please try again. \nIf the problem persists please contact the administrator. -vin.number.not.found=VIN number not found -error.vin.number.duplicate=Duplicate VIN number found. -natis.info.not.found=Natis info not found -natis.info.duplicate=Natis info duplicate -released.by=Released by - - - -modelmatch.title=Model Matching -modelmatch.natisModelDesc=Natis Model Desc -modelmatch.modelDesc=Model Desc -modelmatch.transmission=Transmission -modelmatch.year=Year -wesbank.status=Wesbank Status - - -colourmatch.title=Colour Code Matching -colourmatch.colourCode=Colour Code -colourmatch.colourDesc=Colour Description - -wesbank.ping.title=Ping WesBank -wesbank.response.action=Action -wesbank.response.recordtype=Record Type -wesbank.response.reason=Reason -wesbank.response.reasonDescription=Reason Description -wesbank.response.date=Date -wesbank.response.time=Time -wesbank.response.transId=Transaction Id -wesbank.response.status=Status -import.vehicleImported.title=Vehicle imported -import.vehicleUnimported.title=Vehicle Not Imported -import.vehicle.model=Model -import.vehicle.vinNumber=Vin Number -import.vehicle.engineNumber=Engine Number -import.vehicle.natisModelNo=Natis Model No -import.vehicle.colour=Colour -import.vehicle.transmission=Transmission -import.vehicle.year=Year -import.vehicle.natisModelDesc=Natis Model Desc -import.vehicle.modelMatchingDesc=Model Matching -import.vehicle.colourCode=Colour Code -import.vehicle.errorDesc=Error Description -import.vehicle.selProcess=Process -import.vehicle.selectAll=Select All -import.vehicle.reperformMatching=Reperform Matching -import.vehicle.importVehicle=Import Vehicles -error.attachment.empty = Please select a file -error.attachment.invalid.image = Please select an image -error.required.cvv=CVV is required. -error.creditCardExpMonth=Credit card expiry date cannot be prior to this month. Please enter a valid date. -error.required.creditCardExpMonth=Credit card expiry month required. -error.pos.shoppingcart.empty = Your shopping cart is empty. -error.required.accountName=Credit Card Owner name required. -error.required.paymentMethod=Please select the preferred payment method. -error.minlength.creditCardNumber=Please enter a valid credit card number (Length from 13 to 16) -error.minlength.cvv=Please enter a CVV number greater than 2 digits -error.sending.email=Error sending email -error.creditcard.number=Credit Card number is not valid -error.creditcard.type=Credit Card type is not supported -error.creditcard.expiry=Credit Card expiry is not valid -error.creditcard.cvv=Credit Card VV is not valid -error.required.startDate = Please select from date. -error.required.endDate = Please select to date. -error.pos.invoke.no.orderline=Cannot invoke order that has no orderlines. -error.access.not.allowed=you do not have the role to access the window, please contact your administrator -error.shipment.condition.required=Please specity whether the shipment should be generated along with the order and invoice - - -document.status.drafted=Drafted -document.status.inprogress=In Progress -document.status.completed=Completed -document.status.closed=Closed -document.status.invalid=Invalid -payment.rule.cash=Cash -payment.rule.card=Card -payment.rule.cheque=Cheque -payment.rule.mixed=Mixed - -error.store.default=Default Application could not be set. Cause: {0}.
If the problem persists please clear your browser cookies. - -########### CRM MESSAGES ########### - -## ERROR MESSAGES -error.request.view=Cannot view the desired request -error.request.assign=Could not assign request to the specified user -error.request.create=Could not create request -error.request.init.resolve=Could not initialise request for resolving -error.request.resolve=Could not resolve request -error.request.close=Could not close request -error.request.view.summary=Could not retrieve your requests, please contact you administrator - - -vendor.create=Create Vendor -vendor.details = Vendor Details -user.discount = %Discount Allowed - - -error.file.save=Error occurred when saving file. -error.source.file.notpresent=Source file not present. -error.create.bank.account=Error occurred while creating bank account -error.bank.not.found=Bank not found. -error.edit.bank=Editing bank information failed -error.get.partner.detail=Retrieval of partner details failed -error.getall.partners=Retrieval of all partner details failed -error.activate.customer=Could not activate customer -error.deactivate.customer=Could not deactivate customer -error.editing.user=Error occurred while editing user -error.activate.vendor=Could not activate vendor -error.deactivate.vendor=Could not deactivate vendor -error.orderid.notpresent=OrderId not present -error.creating.invoice=Could not create invoice -error.only.pos.order.supported=Only POS Orders are Supported, Please check the number -error.only.credit.order.supported=Only Credit Orders are Supported, Please check the number -error.credit.order.not.completed=The Credit Order is not completed, cannot create Credit Memo -error.pos.order.not.completed=The POS Order is not completed, cannot create Customer Return Order -error.pos.invalid.customerID = The Customer ID entered is not valid! -error.discountLimit.exceeded = Discount allowed limit has been exceeded! -error.print.fidelity.card = Cannot print fidelity card! Please select some active customers. - -error.bpartner.nolocation = Business Partner does not have a location, you should set it first to be able to complete the current operation. -error.userRegistration.failed = Registration failed. Problem with mail server. Please try later. -error.round.off.cannot.be.negative = Round Off Factor cannot be negative. -error.no.product.found.on.pricelist = No product found on price list. - -############Fidelity Card ##################### -fidelitycard.address= TAMAK GROUP,3 DRAPER AVE,Q.BORNES,MAURITIUS.EMAIL:tamak@tamak.com -fidelitycard.telephone=Office Tel: (230)4549555 -Fax: (230)454 1542 -Shop Tel: (230)427 0276 -fidelitycard.note1=THIS TAMAK FIDELITY CARD IS THE PROPERTY OF TAMAK -fidelitycard.note2=THIS CARD ENTITLES YOU TO SPECIAL DISCOUNTS OF 10% -fidelitycard.note3=APPLICABLE IN TAMAK WORLD & TAMAK SHOP. -fidelitycard.note4=NOT APPLICABLE ON DISCOUNTED ITEMS. -fidelitycard.customer.name=Nom: - -################### Messages for Receipt ###################### -receipt.VATRegNo=VAT 20176097 -receipt.company.name1=Tamak World -receipt.company.address=Rte St-Jean, Q.Bornes -receipt.company.phone=Tel:427-0276 -receipt.company.name2=(Tamak Retail LTD) - -################### Messages for POS ###################### -pos.description=Description -pos.qty=Qty -pos.price=Price -pos.VAT=VAT -pos.totalprice=Total Price -pos.discountpercentage=Discount % -pos.actualprice=Actual price -pos.tendertype=Tender Type -pos.cashamt=Cash Amt -pos.chequeamt=Cheque Amt -pos.chequeno=Cheque No -pos.cardamt=Card Amt -pos.cardno=Card No -pos.mixed=Mixed -pos.cash=Cash -pos.card=Card -pos.cheque=Cheque -pos.continue=Continue - -################### Messages for POS ###################### -message.product.saved = Product updated successfully - -################## User Registration ###################### -success.userRegistration.successful = Registration Successful -success.product.prices.on.pricelist.deleted.successfully = Product prices on price list deleted successfully -success.currency.updated.successfully = Currency updated successfully - - -error.process=Fail to process your request. Cause : {0} -error.precision=Precision entered is not valid. {0} -error.import.uom.not.present={0} -error.import.uom.precision.not.valid={0} -error.role.org.access.edit=Error occurred while trying to update Role Organisation Access. Please contact the Administrator. -error.no.edit.access=You do not have the right organisational access for editing -error.import.file.data={0} -error.import.uom.duplicate={0} -error.no.materialmovement.exists=The Material Movement is already completed, Please make a new one -error.terminal.locked=Terminal is locked -error.no.cashjournal.present=There is no Cash Journal present in the system. Please check whether you have done a transaction yet -current.terminal.updated=The current terminal has been updated.
Log out and Log in to be able to create transactions on the terminal. -current.terminal.reset=The current terminal has been reset.
Log out and Log in to chose again the current terminal from the list of available terminals. -error.operation=An error has occured while executing the operation you requested.
Please make sure that all data are correctly entered and try again. -error.terminal.cashbook=The cash book assigned on this terminal is already assigned to another terminal -error.deactivate.cashbook=Cash book cannot be deactivated as it is being used on a terminal -error.deactivate.terminal=Terminal cannot be deactivated as no active terminal will be available for login diff --git a/posterita/posterita/src/main/MessageResources_SPA.properties b/posterita/posterita/src/main/MessageResources_SPA.properties deleted file mode 100644 index ebba136d14..0000000000 --- a/posterita/posterita/src/main/MessageResources_SPA.properties +++ /dev/null @@ -1,1263 +0,0 @@ -asset.natisrelease.no=NaTIS Liberación No -asset.natiscontrol.no=NaTIS Control No -asset.register.no=Registro No - -assetstatus.hsaf.stock=En Stock -assetstatus.onwater.stock=En espera -assetstatus.retailed=Venta detallista -assetStatus.wholesaled=Venta Mayorista - -#Tamak specific -#footer.copyright=All Contents ©2006 Tamak ICT -#title.welcome=Welcome to Tamak POS -#title.POS=Tamak POS - -footer.copyright=Todos los contenidos ©2006 Tamak ICT -title.welcome=Bienvenidos a Tamak POS -title.POS=Tamak POS - - - -scostatus.update =Update SCO Status - -# -- standard errors -- -errors.header=
    -errors.prefix=
  • -errors.suffix=
  • -errors.footer=
-# -- validator -- - -error.minlength.customerID=La identidad del cliente debe ser de 13 dígitos -error.natiscustomer.alreadyexist=Este cliente ya existe.Por favor seleccione el vínculo "Busqueda de cliente?" y seleccionelo. -error.dataAccessException=Su solicitud no puede ser procesada debido a que faltan algunos datos importantes. Contate al administrador del sistema para ver detalles. -error.operationException=Por favor especifique una acción a seguir. -error.systemException=Se detectó un error. Por favor contacte al administrador del sistema para más información. -error.runtimeException=Ocurrió una demora exagerada en el procesamiento. Por favor contacte al administrador del sistema para más información. -errorpage.title=Página de error -errorpage.heading=Ha efectuado una acción inválida. -errors.invalid={0} es inválido. -error.required={0} es necesario. -error.match={0} No coincide. -error.date.prior.today=La fecha de ingreso no puede ser anterior a hoy. -error.dateRangeNotValidException=Rango de fechas inválido. Intente con uno nuevo -error.match.password=Su clave no coincide. Por favor reescriba su nueva clave. -error.match.newPassword=Sus claves no coinciden. Por favor reescriba su nueva clave. -error.match.newEmail=Su correo electrónico no corresponde. Escriba nuevamente su correo. -errors.maxlength={0} no puede ser mayor de {1} caracteres. -errors.minlength={0} no puede ser menor de {1} caracteres. -errors.range={0} no es un rango {1} entre {2}. -errors.required={0} Es necesario. -errors.byte={0} debe ser un byte. -errors.date={0} no es una fecha. -errors.double={0} debe ser un par. -errors.float={0} debe ser variable. -errors.integer={0} debe ser un entero. -errors.long={0} debe ser largo. -errors.short={0} debe ser corto. -errors.creditcard={0} no es válido el número de tarjeta de crédito. -errors.email={0} la dirección de correo es inválida. -error.numberformatexception.quantity=Por favor ingrese un valor numérico para cantidad. -error.numberformatexception.customerIdBookNumber=Ingrese un valor numérico para la identificación del cliente. -error.numberformatexception.customerID=Por favor ingrese un valor numérico sólo para la identificación del cliente. -error.role.Invalid=No se encontró el rol. Intente ingresar con otro rol. Si persiste el problema, contacte al administrador del sistema. -error.illegal.access=No se le permite ver esta orden porque no está autorizado. -error.noStock.Available=La cantidad disponible es menor que la ingresada para {0} {1} {2} {3} -error.webstore.noStock.Available=Cantidad disponible para {0} es {1}. No puede ingresar una cantidad mayor que {1} -error.orderedQuantity.invalid=La cantidad ordenada debe ser mayor que 0 -error.productquantity.invalid=La cantidad ordenada debe ser mayor que 0. -error.invoice.nolineselected=Seleccione por lo menos una línea para generar una factura. -error.csvfile.invalid=El archivo tiene errores. Borre el archivo viejo y descarguelo nuevamente para ver los errores. -error.file.not.found=Por favor adjunte el archivo -error.stock.not.available=La cantidad solicitada no está disponible. {0} -error.inventory=No hay inventario disponible. {0} -error.inventory.not.available=El inventario disponible es insuficiente. {0} -error.vehicle.alreadyReleased=El producto ya se codificó. -error.shipper.alreadyExists=El transportador ya existe. Por favor escoja otro nombre. -error.allocationname.alreadyused=El nombre de proveedor ya está en uso. Por favor ingrese uno distinto. -error.notallvins.available=No todos los números VIN están disponbles . -error.poReference.invalid=Por favor ingrese un número de referencia válido . -error.ftp.file=Los archivos contienen un número VIN que ya existe en el sistema. Ese archivo debe haber sido procesado. -error.naamsaModelCode.exist=El código que ingresó la existe. Por favor ingrese uno distinto. -error.naamsaDealerCode.exist=El código que ingresó la existe. Por favor ingrese uno diferente. -error.salesrep.required = Seleccione un representante de ventas. -error.date.notselected = Seleccione una fecha. -error.emptycart = Su carro de compras está vacío! -error.trackingNo.not.found=Especifique el número de guía del correo expreso. -error.in.file=Hay un error en el archivo, verifique el signo ";" en el archivo y reemplácelo por ","
No deben haber campos vacíos
Si no hay descuento ni precio límite, coloque el mismo precio de lista.
También cersiórese si existe el tipo de impuesto definido en el archivo. -error.invalid.address=El cliente no tiene dirección, Por favor verifique y editelo. -error.invalid.orderType=La orden no es una orden POS formal, revise el documento No -error.no.checkbox.selected=Por favor seleccione una casilla -error.client.alreadyexist=Ya existe un cliente con ese nombre -error.client.create=No puede crear un cliente con los detalles suministrados.
Por favor contacte a POSterita (support@posterita.org) para soporte.
Cause:{0} - - -error.allocation.notclosable=No puede cerrar la asignación porque aún están pendientes una o más líneas. -error.allocation.report.notselected=Por favor seleccione una asignación para reportar. -error.allocation.notselected=Seleccione una asignación para generar la orden. -error.vin.already.exists=El número VIN ya ha sido usado. -error.role.already.exists = El nombra ya está en uso. Por favor seleccione uno diferente. -error.role.edit=No es posible editar el rol. -error.attributevalue.description.exception = Por favor ingrese una descripción -error.too.many.invoice=Solo se puede asignar una factura al pago y a la nota crédito. -error.allocation.amt.exceeds.openamt=La suma asignada es mayor que la suma abierta en la factura; no puede asignarse. -error.no.invoice.to.allocate=Por favor seleccione una factura para hacer la asignación. -error.securityException=Usted está intentando ver una orden no permitida para su organización o su rol. -error.required.agreement=Usted debe acordar los términos y condiciones antes de confirmar. -error.required.checkbox=Por favor seleccione algo. -error.required.sernoAttributeSetInstanceIds=Seleccione un producto. - -error.notfound={0} No se encontró. -error.required.productChange={0} -error.required.model=modelo. -error.required.colour=color o característica. -error.required.transmission=Talla o característica 2. -error.required.year=año. -error.required.bpartnerId=Ingrese el cliente -error.required.amount.given=Ingrese la cantidad entregada -error.required.paymentTermId=Seleccione un término de pago -error.product.name.required=Ingrese un producto -error.cannot.deactivate.paymentTermName=No desactive un término de pago, algunos clientes pueden estar asociados a él; - -error.required.username=El nombre es imprescindible. -error.required.userSurname=El nombre de usuario es indispensable. -error.required.password=Se necesita la clave. -error.required.oldPassword=Ingrese su clave anterior. -error.required.newPassword=Ingrese su clave nueva. -error.required.confirmPassword = Confirme su clave nueva. -error.required.creditCardNumber=Se necesita el número de la tarjeta de crédito. -error.required.address1=Se requiere la dirección -error.required.city = La ciudad es indispensable -error.required.postalAddress = Se requiere el código postal -error.required.email = Ingrese la dirección de correo electrónico. -error.required.newEmail=Ingrese su nueva dirección de correo. -error.required.confirmEmail=Confirme su nueva dirección de correo. -error.wrong.old.password=La clave anterior es incorrecta. -error.wrong.password.matching=La clave no coincide. -error.wrong.password.length=La clave debe contener por lo menos 6 caracteres. - -error.required.warehouseName = Se necesita el nombre de la bodega. -error.required.orgName = Se requiere el nombre de la organización -error.required.poReference = Ingrese el número de referencia. -error.required.orderId=Ingrese una identificación de la orden válida -error.update.sequence=Ha ocurrido un error mientras se actualizaba la secuencia, Por favor verifique la conexión a la base de datos. - -error.required.poreference=Ingrese el número de orden de compra. -error.required.assetID=Seleccione un número VIN. -error.required.description= Ingrese la descripción. -error.required.priceEntered=Ingrese el precio de compra. -error.required.vinNumber=Ingrese un número VIN. -error.numberformatexception.priceEntered=Ingrese un valor numérico para el precio de compra. -error.invalid.barcode=Código de barras inválido! está vacío o nulo. - -error.required.name=Ingrese el nombre. -error.required.Surname=Ingrese el nombre de usuario. -error.required.custIdNumber=Ingrese identidad del cliente. -error.required.physicalCity=Ingrese una ciudad real. -error.required.physicalPostalCode=Ingrese un código postal real. -error.required.physicalStreet1=Ingrese una dirección real. -error.required.postalCity=Ingrese el código postal de la ciudad. -error.required.postalPostalCode=Ingrese el código postal. -error.required.phone1=Ingrese el número telefónico fijo de la casa. -error.required.phoneNo=Ingrese el número telefónico del trabajo. -error.required.cell=Ingrese el número celular. -error.required.aaCardnumber=Ingrese tarjeta AA No. -error.natisRelease.firebird=Su asunto ha sido transmitido a NaTIS y queda en cola para resolución. -error.duplicate.reference=Ya usó esta referencia. Por favor use una diferente. -error.usernameAlreadyUsed=Ese nombre de usuario ya existe. Por favor use otro. -error.name.exists=El nombre y el nombre de usuario ya existen. Por favor ingrese con su cuenta de correo. -error.email.exists=La dirección de correo ya existe. Por favor use otra cuenta de correo. -error.customer.id=El número de identidad de cliente debe ser un valor numérico. -error.email=El correo no ha sido enviado. -error.duplicate.vin=Ha seleccionado un tema con el mismo número VIN. Asegúrese que todos los asuntos tienen un número VIN diferente. -error.warehouse.alreadyexists = Esa bodega ya existe. Por favor elija otro nombre. -error.targetQuantity.invalid = Ingrese una cantidad válida. - -error.cannot.delete.order=No puede borrar una orden ya facturada. -error.bp.alreadyexist=Ese cliente ya está en la base de datos. Ubique el vínculo /"Cliente existente" y escoja el cliente adecuado. -error.model.alreadyGrouped = Modelo agrupado. -error.bank.already.exist=Este banco ya existe. -error.attributevalue.alreadyexist = Ese valor de atributo ya existe. -error.year.attributevalue.invalid = Ingrese un año válido -error.product.alreadyexist = El producto ya existe, Por favor ingrese uno nuevo. -error.year.attributevalue.formatting.exception = Ingrese un valor numérico para el año. -error.year.length.invalid = Año inválido. Debe ser de 4 dígitos. -error.product.not.selected = Seleccione un producto -error.bp.notselected=Elija un cliente -error.no.vin.number=Indique un número VIN completo. -error.invalid.period=La fecha inicial no debe ser posterior a la final. -error.required.fromDate = Elija fecha de inicio. -error.required.toDate = Elija la fecha final. -error.already.released= El tema ya está liberado, no se puede cambiar -error.product.selected.not.same.warehouse=Seleccionó productos de bodegas diferentes, por favor seleccione productos de una misma bodega. -error.cannot.create.inventory.line==No puede crear líneas de inventario para productos cuando estos son servicios,
Primero cree los artículos para luego comprar. -error.ftp.novehicles = No hay productos para esta organización en el archivo FTP que subió. - -error.vehicle.vinAlreadyPresent = El número vin ingresado ya está en el sistema. -error.vehicle.unitNumberPresent = El número ingresado ya está en el sistema. -error.numberformatexception.enginePower = Ingrese un valor numérico para el arranque. -error.numberformatexception.natisModelNo = Ingrese un valor numérico para el modelo NaTIS. -error.numberformatexception.noOfWheels = Ingrese un valor numérico para No. veces. -error.numberformatexception.tare = Ingrese un valor numérico para destare. -error.numberformatexception.engineCapacity = Ingrese un valor numérico para capacidad de arranque. - - -error.modelmatching.notfound = No se encontró coincidencia de modelo. -error.modelmatching.alreadyexist = Ya hay un modelo que coincide. -error.deactivatingproductinstock = No desactive producto(s) pueden haber algunos aún en HSAF o en existencia de los distribuidores. -error.orderId.null = Ingrese otra identidad de orden. -error.order.notExist = La orden no existe. Ingrese una identidad de orden válida. -error.order.noOrderline.selected = Seleccione al menos una línea de orden para borrar. - -error.product.keywords.required=Es obligatoria la palabra clave. Por favor ingrésela antes de configurar un producto en la tienda web. - -error.colourmatching.alreadyexist=El código de característica o color ya existe -error.colourmatching.invalid=El código de característica o color es inválido -error.colourmatching.errorsave=No puede guardar el código de característica o color. - -error.import.nolineselected=Debe escoger al menos una línea para procesar. -error.invalid.inputQty=Ingrese una cantidad mayor que 0 -error.invalid.totalQty=Ingrese una cantidad por tamaño! -error.quantity.notAvailable=No hay disponibilidad para la cantidad {0} -error.updating.product=No se puede actualizar el producto seleccionado -error.product.not.found=Producto no encontrado! -error.check.inserted.value=Por favor verifique el valor de la cantidad insertada y el código de barra debe separarse con el signo + -error.product.attributes.different=No puede actualizar productos con atributos diferentes -error.updating.attribute=No puede cambiar los valores de atributo especificados -error.product.price.not.found=El producto no está en la lista de precios {0} -error.product.already.exists=Ese producto ya existe -error.barcode.already.exists=Ese código de barras ya existe -error.barcode.required = se requiere código de barras -error.reason.required = Por favor escriba la razón. -error.qty.required = La cantidad se requiere. -error.total.zero = Verifique la cantidad. No puede ser cero. -error.product.cannot.inactivate=El producto no se puede desactivar /hacerlo servicio {0} -error.invalid.content= El archivo es incorrecto. Debe ser una imagen. -error.pos.no.orderline=No hay líneas en la orden. Por favor cree una nueva orden. -error.no.transfer.amount=Por favor ingrese alguna cantidad. -error.transferAmt.exceeds.endingBalance=La cantidad excede el saldo. No se puede realizar la transacción. -error.cannot.close.till=La registradora está cerrada, nada se puede transferir hasta que se cree una nueva orden en efectivo
Para transferir sumas sólo de tarjetas o cheques, ingrese cantidad a transferir 0 y presione Enter. -error.invalid.number=Ingrese un número válido -tax.rate.not.defined=La tasa de impuesto no se ha definido. Por favor hágalo {0} -error.required.revenue.recognition=Ingrese el reconocimiento de ingreso -error.duplicate.product=Nombre de producto duplicado o ya existe en el sistema {0} -error.duplicate.barcode=Código de barras duplicado o ya existe en el sistema {0} -error.cannot.adjust.till=La registradora está cerrada. No puede ajustar ahora la cantidad. -error.till.already.close=La registradora está cerrada, no puede cerrarla otra vez
Para transferir sólo tarjeta o cheque, presione Enter -error.duplicate.userpin=El PIN de usuario ya existe. -error.paymentTermName.duplicate=El nombre del término de pago ya existe. -error.net.days.cannot.be.negative=En días neto no puede ser negativo o cero. -error.name.mandatory = Ingrese el nombre. -error.bpartner.over.credit.limit=El cliente excede el límite de crédito
{0} -error.bpartner.no.payment.term=El cliente no tiene asociado un término de pago. Por favor hágalo. -error.insufficient.qty={0} -error.limit.price.violated={0} - -error.taxname.duplicate=Ese impuesto ya existe. -error.taxrate.duplicate=La tasa de impuesto ya existe. -error.name.required=Ingrese un nombre. -error.required.field=Campo obligatorio {0} -error.tax.rate.nagative=La tasa impositiva no puede ser negativa. -error.discount.nagative=El descuento no puede ser negativo -cannot.inactivate.tax=No puede desativar este impuesto, algunos productos lo tienen asociado. - - -error.pos.payment.invalidCashAmount=Ingrese un valor numérico para Cantidad en efectivo. -error.pos.payment.invalidCardAmount=Ingrese un valor numérico para Cantidad en tarjeta. -error.pos.payment.invalidChequeAmount=Ingrese un valor numérico para Cantidad en cheque. -error.pos.incorrect.tendered.amount=Ingrese exactamente la suma entregada. -error.paymentamount.mandatory=Ingrese la suma de pago. -error.allocate.amt.exceeds=La suma asignada excede la cantidad de la factura {0} -error.allocate.amt.payamt.notequal=La suma asignada es diferente de la cantidad pagada {0} - -error.collection.dir=La imagen no existe en el archivo : {0} -error.inactive.collection.dir=Inactiva la imagen en el archivo / no existe: {0} -error.errors.dir=No existe la imagen en el archivo: {0} -error.synchronize.products.collection=No se puede sincronizar la colección de productos: {0} - -error.related.product=No se encontró un producto asociado con este atributo. -error.invalid.datetime=La fecha y la hora de provisión son inválidas. - -error.order.delete=No se puede borrar esta orden. - -error.sessions.exceeded=Usted no puede ingresar al sistema.
El número de cesiones autorizadas, ({0}), será excedido.
Por favor contacte al administrador del sistema para mayores detalles. -error.requests.exceeded=Ha excedido el número de operaciones autorizado por el administrador del sistema POS.
Por favor contáctelo para mayores detalles. -error.license.invalid=Su autorización es inválida. Cambie su autorización por la que corresponde. -error.license.unexpected=Ha ocurrido un error inesperado. Trate de realizar nuevamente todas las operaciones involucradas.
En caso que vuelva a ocurrir el error, contacte al administrador del sistema.
Detalles: {0} -error.licensinginfo.update=La informacion de autorización no puede actualizarse. Causa\: {0} -login.passwordError= Clave inválida -error.invalid.pin=El PIN de usuario es inválido. -error.duplicate.pin=Más de un usuario tiene el mismo PIN -error.customer.not.exists=El cliente, o no existe o no está activo. -error.vendor.not.exists=El vendedor o no existe o no está activo. -# -- other -- -errors.cancel=Transacción cancelada. -errors.detail={0} -errors.general=El proceso no se completó. Debe averiguar razones. -errors.token=La solicitud no se pudo completar. El funcionamiento no está en orden. - -error.required.vin.number=Ingrese un número VIN -error.invalid.orderId=La orden no existe! -error.invoke.status=No se puede traer una orden condicionada: {0} -# -- welcome -- - - -address = Dirección: -postaladdress = Dirección postal: -city = Ciudad: -region = Región: - -welcome.title=Inicio del programa. -welcome.heading=Bienvenido! -welcome.message=Para comenzar la aplicación en su equipo, copie el archivo struts-blank.war a un nuevo WAR usando el nombre para su aplicación. Colóquelo en su carpeta de "webapp" (o equivalente), y deje que la aplicación se autodejecute. Configure la estructura del programa según su necesidad, reinicie su equipo y listo. (Puede encontrar el archivo application.properties en el folder marcado /WEB-INF/src/java/resources folder.) -login.emailNotFound=No hay una cuenta de correo configurada para usted. Verifique con el administrador del sistema. -login.userNotFound=No se encontró su nombre de usuario en el sistema. -login.alreadyLogin=Usted ya está dentro del sistema! Por favor salga antes de intentar ingresar de nuevo. - -admin.changeEmail.title=Cambiar mi dirección de correo. -admin.changeEmail.oldEmail=Dirección de correo anterior: -admin.changeEmail.newEmail=Dirección de correo nueva: -admin.changeEmail.confirmEmail=Escriba otra vez su nueva dirección: -admin.viewRoles.title=Ver todos los roles - -admin.changePassword.title=Cambiar mi clave -admin.changePassword.old=Clave anterior: -admin.changePassword.new=Nueva clave\: -admin.changePassword.confirm=Reescriba la clave nueva\: - -admin.home.title=Administración general - Archivo de documentos -admin.home.link.stocks=Mi Stock -admin.home.link.certificates=Mis certificados -admin.home.link.invoices=Facturas -admin.home.link.creditNotes=Notas crédito -admin.home.link.statements=Extractos -admin.home.link.rebates=Reembolsos -admin.home.link.other=Otros -admin.home.link.changePassword=Cambiar clave -admin.home.link.changeEmail=Cambiar E-mail -admin.home.link.viewMyDetails=Ver mis detalles -admin.invalidEmailError=Ingresó una dirección de correo no válida. -admin.wrongPasswordError=Ingresó mal la clave. - -admin.emailChanged.title=Dirección de correo cambiada. -admin.emailChanged.message=Su dirección de E-mail ha sido cambiada. -admin.myCertificates.title=Mis certificados -admin.myStocks.title=Disponibilidad de stock no se ha actualizado aún. Stock -  -admin.passwordChanged.title=Clave cambiada. -admin.passwordChanged.message=Su clave ha sido cambiada. -admin.userDeleted.title=Usuario borrado -admin.userDeleted.message=Ha borrado el usuario satisfactoriamente. -admin.userDetails.title=Detalles de usuario -admin.userForm.title=Crear usuario -admin.userForm.select=Seleccione rol de usuario: -admin.viewMyDetails.title=Mis detalles -admin.viewMyDetails.email=Dirección de E-mail \: -admin.viewMyDetails.dealerName=Nombre de distribuidor: -admin.viewMyDetails.dealerCode=Código de distribuidor: -admin.viewMyDetails.phone=Número de teléfono: -admin.viewMyDetails.fax=Número de fax: -admin.viewMyDetails.deliveryAddress=Dirección para entregas: -admin.viewUsers.title=Ver todos los usuarios -admin.viewUsers.username=Nombre de usuario -admin.viewUsers.userRole=Rol de usuario -admin.viewUsers.editDelete=Editar/Borrar usuario - -allocation.home.title=Allocations -allocation.home.link.result=Allocations -allocation.home.link.request=Allocation Requests -allocation.home.link.swap=Cambio -allocation.request.confirm=Por favor, confirme su solicitud de asignación -allocation.results.title=Asignaciones -allocation.results.vehicle.allocation=Sus asignaciones para la fecha son las siguientes: -allocation.results.eta=ETA -allocation.results.action=Acción -allocation.results.accept=Aceptar -allocation.results.reject=Rechazar - -mmovement.title=Movimiento de material \t\t\t\t\t\t\t -mmovement.warehouse=Bodega -mmovement.documentNo=Documento No: -mmovement.description=Descripcion: -mmovement.locator=Ubicación: -mmovement.destinationLocator=Ubicación de destino: -mmovement.header=Movimiento de material -mmovement.product.name=Nombre -mmovement.product.details=Detalles -mmovement.product.quantity=Cantidad -mmovement.product.move=Mover -mmovement.region=Region -mmovement.move=Mover -mmovement.track=Ruta -mmovement.allWarehouses=Todo -mmovement.selectWarehouse=Mover a bodega: -mmovement.button.confirm=Confirmar -mmovement.button.complete=Completo -mmovement.button.delete=Borrar -mmovement.button.cancel=Cancelar -mmovement.documentStatus=Estado del documento: - - -mmovement.track.title=Ruta de movimiento de material -mmovement.track.header=Ruta de movimiento - -allocation.results.time.remaining=Tiempo restante para esta asignación: -allocation.results.time.numDays=22 días -allocation.results.swap.allocation=*NB: Si elije cambiar de asignación, el sistema automáticamente toma ese cambio. -allocation.resultsConfirm.title=Asignación - Asignación enviada -allocation.resultsConfirm.message=Gracias. Sus asignaciones han sido procesadas. -allocation.status=Estado de asignación -allocation.swap.title=Solicitud de asignación -allocation.swap.heading=Solicitud de asignación -allocation.swap.vehicles=Productos disponibles para cambio. -allocation.swapConfirm.submit=Su solicitud de cambio ha sido procesada. -allocation.swapProcess.title=Proceso de cambio -allocation.swap=Cambio - -asset.status= Estado de activos - -days.old=Edad - -button.add=Agregar -button.cancel=Cancelar -button.confirm=Confirmar -button.create=Crear orden -button.delete=Borrar -button.edit=Editar Usuario -button.process=Procesar orden -button.search=Buscar -button.submit=Enviar -button.save=Guardar -button.reply = Responder -button.complete=Completar -button.createwarehouse=Crear bodega -button.invoice = Crear factura - - -dealer.order=Orden o pedido -dealerOrder.cancelOrder.title=Orden o pedido- Orden cancelada -dealerOrder.cancelOrder.message=esta orden ha sido cancelada. -dealerOrder.createOrder.title=Orden o pedido de distribuidor -dealerOrder.home.title=Ordenes o pedidos de distribuidor -dealerOrder.home.link.result=Ordenes -dealerOrder.home.link.specialColour=Ordenes de característica especial -dealerOrder.home.printOrder=Orden - Imprimir orden -dealerOrder.input.all=Ingrese todos los valores. -dealerOrder.process.title=Orden - Orden procesada -dealerOrder.process.message=Gracias, su orden ha sido procesada. -dealerOrder.results.title=Orden - Resultados -dealerOrder.specialColour.title=Ordenes de característica especial -dealerOrder.specialColour.submission=*NB: Debe ser enviada con cuatro meses de antelación. Todos los demás modelos, con 3 meses de antelación. -dealerOrder.createSpecialColour.title=Crear orden de característica especial - -dealerOrder.terms.title=Orden o pedido - Términos y condiciones -dealerOrder.terms.heading=Términos y condiciones -dealerOrder.terms.term1=Toda órden de pedido puesta por el distribuidor (cuyo nombre y detalles aparecen en este formulario) ("El distribuidor") será definitiva y vinculante para él en favor de la empresa, una vez firme el original o una copia del mismo. No podrá ya cancelar la orden y no podrá hacer devolucion de mercancías ordenadas sin previo consentimiento escrito por parte de la empresa. - -dealerOrder.terms.term2=La orden del distribuidor no será obligatoria para la empresa (en todo o en parte) sin la firma de aceptación del representante autorizado para firmarla y en el lugar asignado para el efecto. - -dealerOrder.terms.term3=El distribuidor autoriza a la empresa para retener los productos objeto de esta orden o pedido hasta tanto no sean totalmente pagados. Sinembargo, desde el momento en que estén listos para el despacho por parte de la empresa, todos los riesgos de la mercancía corren por cuenta del distribuidor, aún permaneciendo en las bodegas de la empresa y no siendo aún propiedad del distribuidor. - -dealerOrder.terms.term4=Ningún acuerdo verbal anterior o posterior a la firma de esta orden prevalece sobre lo escrito y firmado en este documento. - -dealerOrder.terms.term5=Por la firma de este formulario de orden o pedido, el distribuidor manifiesta que conoce, y acepta los términos y condiciones de negociación y se obliga para con la empresa según esos términos y condiciones. - -dealerOrder.terms.term6=La empresa se reserva el derecho para en cualquier momento y/o periódicamente hacer cambios a los términos establecidos en sus contratos, sin previo aviso y vinculan a quien suscriba un nuevo acuerdo con la empresa. - -dealerOrder.terms.term7=No obstante la firma del representante autorizado de la empresa en este documento, la empresa no se obliga a suplir ningún producto que no esté en la presente orden y sea de suministro normal. - -dealerOrder.terms.term8=Para los propósitos de esta orden o pedido, productos de la empresa significa: -dealerOrder.terms.term8a=Detallar productos - -dealerOrder.terms.term8b=Detallar productos - -dealerOrder.terms.term8c=Detallar productos - -dealerOrder.terms.term8d=Detallar productos. - - -dealerOrder.qty.greaterThanZero=La cantidad especificada debe ser mayor que cero. -dealerOrder.noOrders=Añada al menos una orden o pedido. - -dealerOrder.must.agree=Usted debe aceptar los términos y condiciones antes de confirmar la orden. - - -include.footer.poweredBy=Producido por la empresa -include.footer.allContent=Todos los contenidos pertenecen a la empresa -include.header.link.loginSuccess=  Inicio -include.header.link.stockAction=  Consulta de existencias -include.header.link.dealerOrderHome=  Ordenes de distribuidor -include.header.link.natisReleaseHome=  Publicación -include.header.link.allocationHome=  Asignaciones -include.header.link.interDealerHome=  Transferencia entre distribuidores -include.header.link.adminHome=  Administración de distribuidor -include.header.link.loginActionNoInput=  Salida -include.header.link.myorders=Mis ordenes - -interdealer.transfer=Transferir -interDealer.cancelTransfer.message=Ha cancelado esta solicitud. -interDealer.dealerTransferOrder.title = Transferencia entre distribuidores -interDealer.dealerTransferOrder.heading = Transferencia distribuidor: Solicitud -interDealer.home.title=Transferencia de distribuidor -interDealer.home.link.request=Solicitud -interDealer.home.link.receiving=Recibo -interDealer.process.title=Transferencia de distribuidor - Envío de solicitud -interDealer.process.message=Su solicitud ha sido procesada. -interDealer.request.title=Trasferencias de distribuidor - Solicitudes -interDealer.receiving.title=Transferencia de distribuidor - Recibos -interDealer.receiving.from=De: -interDealer.receiving.accept=Aceptar -interDealer.receiving.reject=Rechazar -interDealer.receiving.reason=Causa del rechazo - -login.choose.title=Escoja un usuario entre estos distribuidores -login.forgot.forgotPassword=Olvidó su clave?
Por favor ingrese su nombre de usuario y le enviaremos su clave al correo electrónico. -login.forgot.username=Usuario\: -login.forgot.sendPassword=Enviar clave -login.home.title=Bienvenido a Posterita POS -login.home.title.part1=Bienvenido a -login.home.title.part2=Posterita POS -login.home.login=Para entrar -login.home.username=Usuario\: -login.home.password=Clave: -login.home.loginButton=Entrar -login.home.loginForgot=Olvidó su clave? -login.loginForm.message=Ingrese su nombre de usuario.Recuerde que su usuario es su cuenta de correo electrónico
NB: Sensible a las mayúsculas. -login.logout.logoutSuccess=Usted ha cerrado la sesión. -login.logout.backToLogin=  Dé click aquí para regresar a la pantalla de ingreso. -login.password.passwordSent=Se ha enviado su clave. En pocos minutos estará en su cuenta de correo. -login.password.backToLogin=  Dé click aquí para regresar a la pantalla de ingreso. -login.password.emailTitle= Recordatorio de clave. -login.password.emailSubject=La clave para ingresar al sistema POS es: -login.success.welcome=Bienvenido a Posterita
Sistema POS -login.userInactive=Su usuario se ha desactivado. - -menu.title = Menú -menu.close = Cerrar menú -menu.closed = Menú cerrado -menu.isActive = Activo -menu.list = Lista del menú -menu.description = Descripción - -#============Email Errors============ -email.subject.error = Ingrese un destinatario para el correo -email.message.error = Escriba un mensaje -email.send.error = No se pudo enviar el mensaje. Verifique si tiene bien configurado su host smtp. - -#==================================== - -message.title = Mensaje nuevo -message.from = De: -message.to = Para: -message.recto = Para -message.subject = Destinatario: -message.recsubject = Destinatario -message.writemessage = Mensaje: -message.senttitle = Mensaje enviado -message.sent = Su mensaje se ha enviado -message.sentmessages = Mensajes enviados -message.mymessages = Mis mensajes -message.received = Mensajes recibidos -message.sender = Enviar -message.date = Fecha -message.viewdate = Fecha: -message.view = Leer mensaje -message.markas = Marcar como -message.delete = Borrar -message.reply = Responder -message.viewreceivedmessage = Ver mensajes recibidos -message.viewsentmessage = Ver mensajes enviados -message.sendbutton = Enviar -message.goback = Regresar - -myorders.home.title=My Orders - Inicio -myorders.home.heading=Mis ordenes - -myorders.orders.dealerorders.link=Ordenes de distribuidor -myorders.orders.scoorders.link=Ordenes de características especiales -myorders.orders.requesttransferorders.link=Ordenes de transferencia entre distribuidores - -myorders.purchaseorders.home.link=Ordenes de compra -upload.file = Adjunte el archivo para crear ordenes. -download.file=Descargar archivo - -myorders.result.title=Resultado de mis ordenes. -myorders.result.heading=Mis ordenes - Resultado -myorders.result.dateOrdered=Ordenar por fecha -myorders.result.bpartnerName=Distribuidor -myorders.result.docStatus=Estado -myorders.result.hsafRef=Por ID -myorders.result.poreference=Por referencia -myorders.result.grandTotal=Total -myorders.result.viewOrder=Ver orden -myorders.result.orderfrom=Ordenar desde - - - -myorders.salesorders.home.link=Ordenes de venta -myorders.purchase.order= Orden de compra - -mycertificate.title = Mis certificados -mycertificate.viewCertificate = Ver certificado - - -natisRelease.home.title=NaTIS Aprobación -natisRelease.process.title=NaTIS Aprobación - Producto aprobado -natisRelease.process.message=Gracias por su interés, su solicitud ha sido aprobada. -natisRelease.release.name=Nombre -natisRelease.release.surname=Usuario -natisRelease.release.idNumber=Número ID\: -natisRelease.release.physicalAddress=Dirección física -natisRelease.release.postalAddress=Dirección postal -natisRelease.release.homeTelephone=Teléfono de casa -natisRelease.release.workTelephone=Teléfono del trabajo -natisRelease.release.cell=Celular -natisRelease.release.fax=Fax -natisRelease.viewCertificate.title=Ver certificado -natisRelease.viewCertificate.message=Su certificado ha sido enviado. -natisRelease.viewCertificate.download=Click aquí para obtener certificado. -natis.order.history = NaTIS Histórico de ventas. - -order.dealerPONo=Orden de compra de distribuidor No:  -order.HSAFRefNo=Ref. de empresa No:  -order.terms=Términos y condiciones obligatorios. -order.specialColour=Orden de característica especial -order.print=Imprimir versión económica. - -orderView.orderFooter.use=USO OFICIAL -orderView.orderFooter.roNo=R/O NUMERO -orderView.orderFooter.invoiceNo=FACTURA Nro. -orderView.orderFooter.dealerAuthor=AUTORIZACIÓN DE DISTRIBUIDOR: -orderView.orderFooter.signature=FIRMA: -orderView.orderFooter.recvBy=RECIBIDO POR: -orderView.orderFooter.divMgr=AUTORIZA POR LA EMPRESA:  (Nombre & Firma.) - -orderView.orderHeader.honda=EMPRESA
ORDEN DE DISTRIBUIDOR -orderView.orderHeader.att=ATT: -orderView.orderHeader.fax=FAX: -orderView.orderHeader.tel=TEL: -orderView.orderHeader.date=FECHA: -orderView.orderHeader.orderNo=ORDEN DISTRIBUIDOR NO: -orderView.orderHeader.dealerCode=CODIGO DISTRIBUIDOR: -orderView.orderHeader.dealerName=NOMBRE DISTRIBUIDOR: -orderView.orderHeader.delAddress=DIRECCION DE ENTREGA: - -orderView.orderPriceDetails.subTotal=SUB TOTAL -orderView.orderPriceDetails.vat=IMPUESTO -orderView.orderPriceDetails.orderTotal=TOTAL - -product.create.car = Crear nuevo artículo grupo A -product.create.bike = Crear nuevo artículo grupo B -product.create.usedcar = Crear artículo grupo C -product.create.usedbike = Crear artículo grupo D -product.create.usedcar.attributevalue = Crear valor de atributo para grupo C -product.create.usedbike.attributevalue = Crear valor de atributo para grupo D -product.create.car.attributevalue = Crear valor de atributo para grupo A -product.create.bike.attributevalue = Crear valor de atributo para grupo B - -product.create = Crear producto -product.details = Detalles de producto -product.make=Fabricante -product.model=Modelo -product.colour=Color -product.transmission=Talla -product.year =Año -product.purchase.price = Precio de compra -product.sales.price = Precio de venta -product.wholesale.price= Precio para mayorista -product.retail.price= Precio al detal -product.quantity=Cantidad -product.price=Precio -product.vinNo=VIN No. -product.order=Orden -product.salesRegion=Región de ventas -product.request=Requerimiento -product.sendRequest=Enviar requerimiento -product.release=Alistamiento -product.reserved=Reservado -product.status=Estado -product.all=Todo -product.umodel=MODELO -product.ucolour=COLOR -product.utransmission=TALLA -product.frameNo=CODIGO ESTRUCTURA -product.uquantity=CANTIDAD -product.uprice=PRECIO ANTES DE IMPUESTO -product.uVAT=IMPUESTO -product.dealer=DISTRIBUIDOR -product.uTotal=TOTAL -product.colourType=Tipo de color -product.colour.group=Grupo de color -product.wholesaleDate=Fecha de venta mayorista -product.natisApplicationDate=NaTIS Fecha de solicitud -product.hide=Ocultar -product.refNo=Referencia No -product.ordId=ID de orden -product.ordBy=Ordenado por -product.ordDate=Fecha de ordenado -product.doctype=Tipo de documento -product.type = Tipo de producto -product.home.title = Seleccione productos para esta orden -product.isNatisReleased = Está listo -product.description = Descripción -product.restriction = Restricción a este producto -product.name = Nombre de producto -product.restrict = Restricción -product.pricelist = Lista de precio -product.newprice = Precio nuevo -product.oldprice = Precio anterior -product.price.edit = Editar precio de producto - -reprice.orders=Revalorizar ordenes - - -customer.details=Detalles de cliente -customer.licensing.desc=Descripción de autorización -customer.finance.option=Opción de crédito-descripción -trade.in.make=Intercambio/recibo un producto por otro -trade.in.makeModel=Producto de intercambio -trade.in.year=Edad -customer.idBookNo=Identidad en libro Nro. -engine.no=Característica Nro. -maintenance.contract=Contrato de garantía. -registration.status=Estado al recibir. - -sc.dealerOrder.home.quantity=Cantidad - -target.sales.title = A vender en -target.sales.month = Mes -target.sales.year = Año -target.sales.ModelGroup = Grupo -target.sales.Quantity = Cantidad -target.sales.organisation = Organización - -stock.home.title=Consulta de inventario -stock.inquiry.show=Mostrar sólo la existencia en este almacén. -stock.not.reserved.show=Mostrar solo inventario disponible. -stock.process.title=Consulta de inventario - Envío de solicitud -stock.process.message=Gracias, su solicitud ha sido enviada -stock.filter.by=Filtrar por: - -error.workflow.violation=Usted debe seguir el orden de los botones disponibles en este proceso. No debe dar click doble vez ni retroceder. - -user.create = Crear usuario -user.created = Usuario creado -user.username=Nombre de usuario: -user.role=Rol de usuario: -user.password=Clave: -user.address = Dirección: -user.city = Ciudad: -user.postaladdress = Dirección postal: -user.region = Región -user.email=Dirección de correo: -user.phone = Teléfono No: -user.cellphone=Celular: -user.confirmPassword=Confirmar clave: -user.isActive = Activo -user.isSalesRep = Es representante de ventas -user.details = Detalle de usuario -user.pin=PIN de usuario -user.docBasisType=Registro base para comisión -user.comm.per=% Comisión para el representante de ventas -user.comm.fre=Frecuencia de cálculo -user.substract.amt=Restar Amt** -user.substract.exp=**Esta resta indica la cantidad a substraer antes de calcular la comisión de venta. - -choose.VIN=Seleccione el número VIN - -select.month=Mes -select.year=Año -select.status=Estado -view.all=Todo - -calendar.day.default=Dia -calendar.month.default=Mes -calendar.year.default=Año -calendar.month1=Ene -calendar.month2=Feb -calendar.month3=Mar -calendar.month4=Abr -calendar.month5=May -calendar.month6=Jun -calendar.month7=Jul -calendar.month8=Ago -calendar.month9=Sep -calendar.month10=Oct -calendar.month11=Nov -calendar.month12=Dic -asset.owner=Apropiado por -queryVinNo.title=Consulta VIN No. -vinNo.search=Buscar VIN No. -vinNo.query=Consultar estado de VIN Nro. -vinNoDetails.title=Detalles del VIN Nro. -searchOrderByRef.title=Consultar número de referencia - orden -search.orderID=Buscar orden Ref No. -text.yes=Si -text.no=No -query.dealers.stock.title=Consultar exitencia en distribuidores - -bPartner.title = Socios de negocio -bPartner.create = Crear socios de negocio -bpartner.details = Detalles del socio de negocio -bpartner.name = Nombre -bpartner.name2 = Nombre 2 -bPartner.address = Dirección -bPartner.address1 = Dirección1 -bPartner.address2 = Dirección2 -bPartner.postal.address = Apartado postal -bPartner.city = Ciudad -bPartner.phone=Número teléfono -bPartner.fax=Fax -bpartner.edit = Editar -bpartner.view = Ver -bPartner.isActive = Activo: -bPartner.isCustomer = Es cliente: -bPartner.isVendor = Es proveedor: -bPartner.isEmployee = Es empleado: -bPartner.isSalesRep = Representante de ventas: -bPartner.region = Región -bPartner.edit = Editar detalles de cliente -bPartner.credit.limit = Cupo de crédito -bPartner.credit.status = Estado del crédito -bPartner.dunning = Dudoso - -bank.create = Crear banco -bank.name = Nombre del banco -bank.address = Dirección -bank.postaladdress = Apartado postal -postal.address = Dirección postal -bank.city = Ciudad -bank.routingnumber = Número de ruta -bank.details = Detalles de banco. - -locator.details = Detalle de ubicación -locator.create = Crear ubicación -locator.warehouse = Bodega -locator.aisle = Estante -locator.bin = Pasillo -locator.level = Nivel -locator.default = Sin determinar - -bAccount.create = Crear cuenta de banco -bAccount.bank.name = Nombre del banco -bAccount.no = Número de cuenta -bAccount.type = Tipo de cuenta -bAccount.current.balance = Saldo actual -bAccount.type.checking = De cheques -bAccount.type.saving = Ahorros -bAccount.details=Detalles de cuenta bancaria - -order.history = Histórico de ordenes -invoice.history = Histórico de facturas -payment.history = Histórico de pagos -inout.shipment.history = Histórico de envíos -inout.receipt.history = Histórico de recibos - - -history.receiptNumber = Número de recibo -history.shipmentNumber = Número de envío -history.orderNumber = Número de orden -history.invoiceNumber = Número de factura -history.documentNumber = Número de documento -history.documentStatus = Estado del documento -history.dealerName = Nombre del distribuidor -history.date = Fecha -history.dateInvoiced = Fecha factura -history.dateOrdered = Fecha orden -history.grandTotal = Gran total -history.isDelivered = Entregado -history.isInvoiced = Facturado -history.isPaid = Está pago -history.isReceipt = Recibido -history.paymentId = Id. de pago -history.paymentAmt = Cantidad pagada \t -history.transactionDate = Fecha transacción -history.orderReference = Referencia de orden -history.isSotrx = Orden de ventas - -warehouse.create = Crear bodega -warehouse.created = Bodega creada -warehouse.details = Detalles de bodega -warehouse.wname = Nombre de bodega -warehouse.name = Bodega -warehouse.address = Dirección: -warehouse.postaladdress = Apartado postal: -warehouse.city = Ciudad: -warehouse.region = Región -warehouse.isPublic = Accesible a distribuidor -warehouse.isActive= Activo -is.warehouse.allocation= Asignación de bodega -warehouse.type=Tipo de bodega -warehouse.all = Todas las bodegas -product.attribute.create = Crear valor de atributo -product.attribute.set = Producto -product.attribute.name = Atributo -product.attribute.value = Valor -product.attribute.value.created = Valor de atributo de producto creado -product.attribute.existingValues = Valores existentes -product.selected = Productos seleccionados -quantity = Cantidad - -engine.number= Engine Number -natis.application.date=NaTIS Application Date -natis.release.date=NaTIS Release Date -natis.control.number=NaTIS Control Number -natis.model.number=NaTIS Model Number -natis.unit.number=NaTIS Unit Number -natis.release.id=NaTIS Release Id -org.name=Dealer Name\: -register.number= Register Number - -customer.create.new=Crear cliente -customer.information =NaTIS Autorización-Información cliente -customer.name = Nombre cliente: -customer.surname=Usuario: -customer.id.number=Nro. ID: -customer.phy.add = Direccion física: -customer.street1 = Dirección1: -customer.street2 = Dirección2: -customer.city = Ciudad: -customer.postal.address = Apartado postal: -postal.street1=Dirección postal -postal.city=Area metropolitana -postal.code = Código postal: -customer.home.telephone =Teléfono de casa No: -customer.work.telephone =Teléfono del trabajo No: -customer.cell= Customer Cel\: \t -customer.aa.car.number=Tarjeta de fidelización No\: \t -customer.maintenance.contract.number=Contrato de suministro No: -invoice.it = Factura -unreserve.stock = Reservados -shipment.material.receipt=Envío/Recibo de materiales - -#vehicle.createVehicle=Crear producto -#vehicle.unitNumber=Número de producto -#vehicle.vinNumber=Número Vin -#vehicle.engineNumber=Engine Number -#vehicle.natisModelDesc=Natis Model Desc -#vehicle.enginePower=Engine Power -#vehicle.engineCapacity=Engine Capacity -#vehicle.tare=Tare -#vehicle.noOfWheels=No. of Wheels -#vehicle.cntryOfImport=Country Of Import -#vehicle.colourCdHES=Colour Code HES -#vehicle.mainColourCd=Main Colour Code -#vehicle.natisModelNum=Natis Model Number - - -#========= DMS Messages - -error.required.attributeValue = Atributo requerido -error.required.orgType = Escoja un tipo de distribuidor -error.required.vehicleType = Elija un tipo de producto -error.required.locator = Se requiere el lugar de destino -error.required.warehouse = Se requiere bodega de destino -error.no.order.exists=La orden se completó, por favor haga una nueva. - -org.create=Crear distribuidor -org.details = Detalles de distribuidor -reserved.for=Reservado para el distribuidor: -org.type=Tipo de distribuidor: -org.product.type=Tipo de producto: -click.order.id=Click este número de orden para verla: -org.retailer= Detallista: -org.wholesaler=Mayorista: -org.automobile= Artículo grupo A: -org.motocycle=Artículo grupo B: -org.address=Dirección: -org.address1=Dirección1: -org.address2=Dirección2: -org.city=Ciudad: -org.postalAddress=Apartado postal: -org.region=Región: -org.isActive= Activo -org.isVisible= Visible - -dealer.details = Detalles de distribuidor -dealer.name = Nombre distribuidor -dealer.location = Ubicación -dealer.phone = Teléfono -dealer.fax = Fax - -role.create = Crear rol -role.name = Nombre -role.superuser = Acceso a todos los distribuidores -role.accessibleToAll = Acceso a todos los distribuidores -role.isActive = Activo - -pos.name= Nombre POS -pos.begining.balance=Saldo inicial -pos.net.transaction=Transacciones en efectivo -pos.cash.total=Cantidad de efectivo -pos.card.total=Cantidad en tarjeta -pos.cheque.total=Cantidad en cheque -pos.grandtotal= Total -pos.current.till.balance= Saldo actual de registradora - - -groupModel.title = Grupos de modelos -groupModel.group = Grupo de modelos -groupModel.model = Modelo - -licensing.district = Distrito de ventas-licencia -licensing.district.code = Código de distrito de ventas -licensing.district.description = Descripción -licensing.district.area = Area de licencia -licensing.district.area.domestic = Nacional -licensing.district.area.export = Internacional - -price.listing = Lista de precios -pricelist.Version = Versión lista de precios -pricelist.name = Nombre de lista de precios -pricelist.listPrice = Lista de precios - -error.required.currentBalance = Saldo actual-requerido -error.required.accountNo = Número de cuenta-requerido -error.required.accountType = Tipo de cuenta-requerido -error.required.partnerName = Nombre del socio de negocio-requerido -error.required.supplierName = Nombre del proveedor-requerido -error.required.sizes = Seleccione un tamaño o personalice uno - - -error.required.stdPurchasePrice = Precio de compra-requerido -error.required.stdSalesPrice = Precio de venta-requerido - -error.numberformatexception.currentBalance=Saldo actual: sólo soporta valor numérico -error.numberformatexception=Ingrese un valor numérico -error.numberformatexception.stdSalesPrice= Lista de precios debe ser numérica -error.numberformatexception.stdPurchasePrice=Precio de compra debe ser numérico -error.numberformatexception.price=Ingrese valores numéricos para precios -error.modelgroup.notExist=Especifique un grupo de modelos -error.deactivatingattributeproductinstock = Imposible ejecutar al proceso. Algunos productos requieren del atributo. - -invoice.customer.print=Factura de venta-Imprimir -invoice.customer=Factura de venta -invoice.no=Factura Nro. - -search.order = Buscar orden -search.order.title = Consultar orden por ID -search.order.label = ID de la orden - -search.order.vin = Buscar orden por un número VIN. -search.order.vin.title = Buscar orden por número VIN No. -search.order.vin.label = Ingrese VIN No. -swap.vin.success=El producto ha sido cambiado satisfactoriamente -reprice.order.success=Las ordenes han sido revalorizadas satisfactoriamente - -error.orderId.not.found=Esta orden no se encontró. -material.movement.success=Los productos se han movido satisfactoriamente. -sequence.update.success= La secuencia ha sido actualizada adecuadamente. -data.integrity.success=Se ha verificado la integridad de los datos y se ha enviado un correo para probar fallos. -naamsa.dealercode.create=Crear código de distribuidor NAAMSA -naamsa.dealercode.title=Código de distribuidor NAAMSA -naamsa.dealercode.edit.title=Editar código de distribuidor NAAMSA -naamsa.dealer=Distribuidor -naamsa.dealercode=Código distribuidor - -naamsa.modelcode=Código de modelo -naamsa.modelcode.create=Crear código de modelo NAAMSA -naamsa.modelcode.title=Código de modelo NAAMSA -naamsa.modelcode.edit.title=Editar código de modelo NAAMSA - -wholesaleorder.ftp.title=Subir archivo por FTP -wholesaleorder.csv.title=Crear orden de venta mayorista -wholesaleorder.information=Ingrese al siguiente sitio y seleccione el archivo ftp con los productos que quiere incorporar al sistema. -wholesaleorder.site=ftp://ftp.honda-eu.com -wholesaleorder.upload.button=Subir archivo -error.ftp.notvalid=El archivo ftp seleccionado no es válido -wholesaleorder.csv.invalid=El archivo CSV no es válido -wholesaleorder.csv.unknownerror=Ha ocurrido un error, por favor contacte al administrador del sistema -error.ftp.novehicle=El archivo FTP no tiene productos para su tipo de organización -wholesaleorder.csv.download=Descargar el CSV generado desde el FTP que usted introdujo.
Verifique todos los registros para asegurarse que están bien. Tome las medidas apropiadas para cuando haya error.
-wholesaleorder.csv.download1=Descargar el CSV generado desde el FTP que usted ha ingresado.
Modificar este archivo con información verificada.
-wholesaleorder.csv.information=Subir el CSV que usted modificó para generar la orden de venta mayorista. -wholesaleorder.csv.uploadFile=Subir archivo CSV \: - -error.natis.release=Su solicitud de aprobación para el producto está en proceso.\n El sistema completa automáticamente la orden y luego libera el producto en NaTIS. -error.natis.release_old=No puede aprobar producto en NaTIS. Por favor inténtelo nuevamente. \n Si persiste el problema, contacte al adminitrador del sistema. -vin.number.not.found=No se encontrpo el número VIN -error.vin.number.duplicate=Se encontró un número VIN duplicado. -natis.info.not.found=Natis: información no encontrada -natis.info.duplicate=Natis: información duplicada -released.by=Publicado por - - - -modelmatch.title=Modelo de correspondencia -modelmatch.natisModelDesc=Natis Modelo de descuento -modelmatch.modelDesc=Modelo de descuento -modelmatch.transmission=Talla o Característica 2 -modelmatch.year=Año -wesbank.status=Estado - - -colourmatch.title=Código de color de correspondencia -colourmatch.colourCode=Código de color -colourmatch.colourDesc=Descripción del color - -wesbank.ping.title=Ping WesBank -wesbank.response.action=Acción -wesbank.response.recordtype=Tipo de registro -wesbank.response.reason=Razón -wesbank.response.reasonDescription=Ampliación de la razón -wesbank.response.date=Fecha -wesbank.response.time=Hora -wesbank.response.transId=Id de transacción -wesbank.response.status=Estado -import.vehicleImported.title=Producto importado -import.vehicleUnimported.title=Producto no importado -import.vehicle.model=Modelo -import.vehicle.vinNumber=Número Vin -import.vehicle.engineNumber=Característica 1 -import.vehicle.natisModelNo=Natis Modelo Nro. -import.vehicle.colour=Color -import.vehicle.transmission=Talla o característica 2 -import.vehicle.year=Año -import.vehicle.natisModelDesc=Natis Modelo de descuento -import.vehicle.modelMatchingDesc=Modelo de correspondencia -import.vehicle.colourCode=Código de color -import.vehicle.errorDesc=Error Descripción -import.vehicle.selProcess=Proceso -import.vehicle.selectAll=Seleccionar todo -import.vehicle.reperformMatching=Reperform Matching -import.vehicle.importVehicle=Importar productos -error.attachment.empty = Seleccione un archivo -error.attachment.invalid.image = Seleccione una imagen -error.required.cvv= Se requiere CVV. -error.creditCardExpMonth=La fecha de caducidad de la tarjeta no puede ser anterior a este mes. Por favor ingrese una fecha válida. -error.required.creditCardExpMonth=Se requiere el mes de expiración de la tarjeta. -error.pos.shoppingcart.empty = Su carro de compras está vacío. -error.required.accountName=Se necesita el nombre del propietario de la tarjeta. -error.required.paymentMethod=Seleccione el método de pago preferido. -error.minlength.creditCardNumber=Ingrese un número de tarjeta de crédito válido (de entre 13 y 16 dígitos) -error.minlength.cvv=Ingrese un número CVV mayor de dos dígitos -error.sending.email=Error al enviar el correo -error.creditcard.number=El número de tarjeta de crédito no es válido -error.creditcard.type=El tipo de tarjeta de crédito no es aceptado -error.creditcard.expiry=La caducidad de la tarjeta de crédito no es válida. -error.creditcard.cvv=No es válido el CVV -error.required.startDate = Se requiere la fecha de inicio. -error.required.endDate = Seleccione la fecha final. -error.pos.invoke.no.orderline=No pueden traerse ordenes que no tienen líneas de orden. -error.access.not.allowed=Usted no tiene permisos para acceder a esta ventana. Consulte con el administrador del sistema -error.shipment.condition.required=Especifique si el envío debe ser generado junto con la orden o la factura. - - -document.status.drafted=Borrado -document.status.inprogress=En progreso -document.status.completed=Completo -document.status.closed=Cerrado -document.status.invalid=Inválido -payment.rule.cash=Efectivo -payment.rule.card=Tarjeta -payment.rule.cheque=Cheque -payment.rule.mixed=Mixto - -error.store.default=No se puedo ejecutar la aplicación. Causa: {0}.
Si el problema persiste, borre las cookies de su navegador. - -########### MENSAJES CRM ########### - -## MENSAJES DE ERROR -error.request.view=Disculpe, no se puede ver la petición deseada -error.request.assign=Disculpe, no se ha podido asignar un usuario a la solicitud -error.request.create=Disculpe, no se pudo crear la solicitud -error.request.init.resolve=Disculpe, no se ha podido iniciar la solución de la solicitud -error.request.resolve=Disculpe, no se pudo resolver la solicitud -error.request.close=Disculpe, no se pudo cerrar la solicitud -error.request.view.summary=Disculpe, no se pudieron recuperar las solicitudes. Por favor contacte el administrador del sistema - - -vendor.create=Crear vendedor -vendor.details = Detalles de vendedor -user.discount = % descuento permitido - - -error.file.save=Ocurrió un error cuando se intentaba guardar el archivo. -error.source.file.notpresent=El archivo de origen no existe. -error.create.bank.account=Ocurrió un error mientras se creaba la cuenta bancaria. -error.bank.not.found=No se encontró el banco. -error.edit.bank=Falló la información al editar banco -error.get.partner.detail=Falló la recuperación de detalles del socio de negocio -error.getall.partners=Falló la recuperación de los socios de negocio -error.activate.customer=No se pudo activar el cliente -error.deactivate.customer=No se pudo desactivar el cliente -error.editing.user=Ocurrió un error mientras se editaba el usuario -error.activate.vendor=No se pudo activar el vendedor -error.deactivate.vendor=No se pudo desactivar el vendedor -error.orderid.notpresent=No está ese número de identidad de orden -error.creating.invoice=No se pudo crear la factura -error.only.pos.order.supported=Solo se admiten ordenes de compra, por favor verifique el número -error.only.credit.order.supported=Solo se adminten ordenes de crédito, por favor verifique el número -error.credit.order.not.completed=La orden de crédito no está completa. No se puede crear la nota crédito -error.pos.order.not.completed=La orden de venta no está completa. No se puede crear orden de devolución del cliente. -error.pos.invalid.customerID = La ID del cliente no es válida! -error.discountLimit.exceeded = Ha excedido el límite de descuento permitido! -error.print.fidelity.card = No se puede imprimir tarjeta de fidelización! Por favor seleccione un cliente activo. - -error.bpartner.nolocation = El socio de negocio no tiene ubicación. Primero debe llenar ese vacío para ejecutar esta operación. -error.userRegistration.failed = Falló el registro. Problemas con el servidor de correos. Por favor intente más tarde. -error.round.off.cannot.be.negative = No se puede redondear un factor negativo. -error.no.product.found.on.pricelist = No se encontró el producto en la lista de precios. - -############Tarjeta de fidelización ##################### -fidelitycard.address= DIRECCION COMPLETA DE LA EMPRESA. EMAIL:tamak@tamak.com -fidelitycard.telephone= Tel OFICINA: (230)4549555 -Fax: (230)454 1542 - Tel tienda : (230)427 0276 -fidelitycard.note1=ESTA TARJETA DE FIDELIZACION ES DE PROPIEDAD DE LA EMPRESA. -fidelitycard.note2=ESTA TARJETA LE DA DERECHO A USTED A DESCUENTOS ESPECIALES DEL 10% -fidelitycard.note3=APLICABLE EN LAS TIENDAS DE LA EMPRESA. -fidelitycard.note4=NO SE APLICA A PRODUCTOS CON OTROS DESCUENTOS. -fidelitycard.customer.name=Nombre: - -################### Mensajes en el recibo ###################### -receipt.VATRegNo=Registro de impuesto 12345667 -receipt.company.name1=LA EMPRESA -receipt.company.address=Dirección de la empresa -receipt.company.phone=Tel:427-0276 -receipt.company.name2=(Otro nombre de la empresa) - -################### Mensajes para la pantalla del POS ###################### -pos.description=Descripción -pos.qty=Cantidad -pos.price=Precio -pos.VAT=Impuesto -pos.totalprice=Precio -pos.discountpercentage=Descuento % -pos.actualprice=Precio nuevo -pos.tendertype=Cancela con -pos.cashamt=En efectivo -pos.chequeamt=En cheque -pos.chequeno=Cheque No -pos.cardamt=En tarjeta -pos.cardno=Tarjeta No -pos.mixed=Mixto -pos.cash=Efectivo -pos.card=Tarjeta -pos.cheque=Cheque -pos.continue=Continuar - -################### Mensajes para el POS ###################### -message.product.saved = Producto procesado satisfactoriamente - -################## Registro de usuario ###################### - -success.userRegistration.successful = Registro exitoso -success.product.prices.on.pricelist.deleted.successfully = Precio del producto borrado con éxito en lista de precios -success.currency.updated.successfully = Moneda procesada con éxito. - - -error.process=Falló el proceso de su petición. Causa : {0} -error.precision=La precisión no es válida. {0} -error.import.uom.not.present={0} -error.import.uom.precision.not.valid={0} -error.role.org.access.edit=Ocurrió un error mientras intentaba procesar el rol en la organización. Por favor contacte al administrador del sistema. -error.no.edit.access=Su acceso a la organización no le da derecho a modificar el sistema -error.import.file.data={0} -error.import.uom.duplicate={0} -error.no.materialmovement.exists=El movimiento de material ya se completó. Por favor haga uno nuevo. -error.terminal.locked=La terminal está bloqueada -error.no.cashjournal.present=No hay un libro diario en el sistema. Verifique si usted aún no ha hecho transacciones. -current.terminal.updated=Esta terminal ha sido habilitada.
Salga y entre de nuevo para iniciar transacciones en esta terminal. -current.terminal.reset=Esta terminal ha sido reiniciada.
Salga y escoja nuevamente esta terminal entre la lista de terminales para hacer transacciones. -error.operation=Ocurrió un error mientras se procesaba su requerimiento.
Por favor asegúrese que todos los datos están correctos e intente de nuevo. -error.terminal.cashbook=El libro de caja asignado a esta terminal ya se había asignado a otra terminal. -error.deactivate.cashbook=El libro de caja no puede ser desativado porque se está usando en otra terminal. -error.deactivate.terminal=Este terminal no se puede desactivar. Porque debe permanecer disponible para acceder al sistema. - diff --git a/posterita/posterita/src/main/ShipmentDispatchedEmailTemplate.properties b/posterita/posterita/src/main/ShipmentDispatchedEmailTemplate.properties deleted file mode 100644 index f2fc39fcfc..0000000000 --- a/posterita/posterita/src/main/ShipmentDispatchedEmailTemplate.properties +++ /dev/null @@ -1,6 +0,0 @@ -subject=Tamak Webstore - Shipment In Transit -action=action -content=,
Your order has been shipped. -signin.info=Order Information -link=Your will receive the product(s) shortly. -emailRegards=Regards,
Tamak Webmaster \ No newline at end of file diff --git a/posterita/posterita/src/main/displaytag.properties b/posterita/posterita/src/main/displaytag.properties deleted file mode 100644 index 5b1eeee4b1..0000000000 --- a/posterita/posterita/src/main/displaytag.properties +++ /dev/null @@ -1,20 +0,0 @@ -#sort.behavior=list -#sort.amount=list -#basic.empty.showtable=true -#basic.msg.empty_list=No results matched your criteria. -#paging.banner.placement=top -#paging.banner.onepage= -export.types=csv pdf rtf -export.excel=false -export.csv=true -export.xml=false -export.pdf=true -export.rtf=true -export.excel.class=org.displaytag.export.excel.ExcelView -export.pdf.class=org.displaytag.export.PdfView -export.rtf.class=org.displaytag.export.DefaultRtfExportView -decorator.media.html=org.posterita.decorator.HistoryWrapper -decorator.media.csv=org.posterita.decorator.HistoryCsvExportWrapper -decorator.media.pdf=org.posterita.decorator.HistoryPdfExportWrapper -decorator.media.rtf=org.posterita.decorator.HistoryRtfExportWrapper -locale.provider=org.posterita.core.I18nAdapter \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/Constants.java b/posterita/posterita/src/main/org/posterita/Constants.java deleted file mode 100644 index 9a58bbab99..0000000000 --- a/posterita/posterita/src/main/org/posterita/Constants.java +++ /dev/null @@ -1,825 +0,0 @@ -/* - * - * Copyright (c) 2005 UDI Ltd. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * UDI Ltd. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with UDI. - * - * UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * Created on Jul 6, 2005 by vishee - */ - -package org.posterita; - -import org.compiere.model.MPayment; - -public class Constants -{ - public static final String ACCESSIBLE_ORGS = "accessibleOrgs"; - public static final String ACTION = "action"; - public static final String ADD_ORDERLINE_ID = "addOrderLineId"; - public static final String ADMIN = "admin"; - public static final String ADMIN_USER_ID = "adminUserId"; - public static final String ALL_BANKS = "allBanks"; - public static final String ALL_CUSTOMERS = "allCustomers"; - public static final String ALL_ORDERS = "allOrders"; - public static final String ALL_ORGS = "allOrgs"; - public static final String ALL_ROLES = "allRoles"; - public static final String ALL_STOCK_REPORT = "allStockReport"; - public static final String ALL_USERS = "allUsers"; - public static final String ALL_WAREHOUSES="allwarehouses"; - public static final String ALL_WEEKS = "allWeeks"; - public static final String ALLBUSINESSPARTNERS = "allBp"; - public static final String ALLOCATION = "allocation"; - public static final String ALLOCATION_DATE = "allocationDate"; - public static final String ALLOCATION_ID = "allocationId"; - public static final String ALLOCATION_LINES="allocationsLines"; - public static final String ALLOCATION_LIST = "allocationList"; - public static final String ALLOCATION_ORDERS = "allocationOrders"; - - - public static final String ALLOCATION_REPORT = "allocationReport"; - public static final String ALLOCATION_STOCK = "Allocation Stock"; - public static final String ALLWAREHOUSES="allwarehouses"; - - public static final String APP_CRM = "crm"; - public static final String APP_DCS = "dcs"; - public static final String APP_IMMOBILIER_WEBSTORE = "ImmobilierWebstore"; - public static final String APP_NAME = "appName"; - //APPLICATION NAME - public static final String APP_POS = "pos"; - public static final String APP_WEBSTORE = "webstore"; - public static final String APP_WEBSTORE_ADMIN = "webstoreadmin"; - public static final String APPROVE = "APPROVE"; - public static final String ASSIGNED_ROLES = "assignedRoles"; - public static final String ATTRIBUTE_LIST = "attributeList"; - public static final String ATTRIBUTE_NAME = "atttributeName"; - public static final String ATTRIBUTE_SET = "attributeSet"; - public static final String ATTRIBUTE_SET_ID = "attributeSetId"; - public static final String ATTRIBUTE_VALUES = "attributeValues"; - public static final String ATTRIBUTE_VALUES_LIST = "attributeValuesList"; - - - public static final int ATTRIBUTE_YEAR_MIN_VALUE = 2000; - public static final String ATTRIBUTESET = "AttributeSet"; - public static final String ATTRIBUTESETINSTANCE_ID = "attributeSetInstanceId"; - public static final String AUCTION_MODULE="Auction Module"; - public static final String AVAILABLE_COLOURS = "availableColours"; - public static final String AVAILABLE_COLOURS_SIZES = "availableColoursSizes"; - public static final String AVAILABLE_SIZES = "availableSizes"; - - - public static final String AVAILABLE_VIN = "availableVin"; - public static final String B_PARTNER_ID = "bPartnerId"; - public static final String BACK_ORDER = "backOrder"; - public static final String BANK = "bank"; - public static final String BANKS = "banks"; - public static final String BANK_ACCOUNTS = "bankAccounts"; - public static final String BASIC_DETAILS = "basicDetails"; - public static final String BARCODE_CART = "barcodeCart"; - public static final String BARCODE_CART_ITEMS = "barcodeCartItems"; - public static final String MMOVEMENT_CART = "mmovementCart"; - public static final String MMOVEMENT_CART_ITEMS = "mmovementCartItems"; - public static final String BP_LIST = "bpList"; - public static final String BPARTNER = "bPartner"; - public static final String BRAND_ATTRIBUTE_VALUES="brandAttributeValues"; - public static final String BREADCRUMB = "breadcrumb"; - public static final String BUSINESSPARTNER = "businessPartner"; - public static final String BUSINESSPARTNER_ORDER_DETAILS ="bPartnerOrderDetails"; - public static final String BUSINESSPARTNER_TRX_DETAILS = "businessPartnerTrxdetails"; - public static final String BUSINESSPARTNERSDETAILS = "bPartnerDetails"; - public static final String CAN_TRADE_IN = "canTradeIn"; - public static final String CANCEL_DO = "cancelDO"; - public static final String CANCEL_DT = "cancelDT"; - public static final String CANCEL_INVOICE = "cancelInvoice"; - public static final String CANCEL_SCO = "cancelSCO"; - public static final String CARD = "card"; - public static final String CASH = "cash"; - public static final String CASH_BOOK = "cashBook"; - public static final String CASH_DETAILS = "cashDetails"; - - public static final String CASH_LINE_DETAILS = "cashLineDetails"; - public static final String CASH_SUMMARY = "cashSummary"; - public static final String CERTIFICATE = "certificate"; - public static final String CHANGE = "change"; - public static final String CHECKED_PRODUCTS = "checkedProducts"; - public static final String CHECKING_ACCOUNT_TYPE = "C"; - public static final String CHECKOUT_ACTION = "/CheckoutAction"; - public static final String CHOOSE = "Choose"; - public static final String CHOOSE_SHIPPING_ADDRESS = "chooseShippingAddress"; - - public static final String CHOOSE_USER = "chooseUser"; - public static final String CHOOSE_VIN = "chooseVin"; - public static final String CLIENT_ID="client"; - public static final String CLIENT_NAME="clientName"; - public static final Integer COGS = Integer.valueOf(51100); - public static final String COLOUR_ATTRIBUTE_VALUE_ID = "colourAttributeValueId"; - public static final String COLOUR_ATTRIBUTE_VALUES = "colourAttributeValues"; - public static final String COLOURCODE_MATCHING = "colourCodeMatching"; - public static final String COMPLETED_INVOICE = "completedInvoice"; - public static final String COMPLETED_POS_ORDER = "completedPOSOrder"; - public static final String COMPLEX_COMMAND = "complexCommand"; - public static final String CONTENT = "content"; - public static final String SUBCLASSIFICATION = "subClassification"; - public static final String COUNTRY_CLASSIFICATION = "countryClassification"; - public static final String BRAND_CLASSIFICATION = "brandClassification"; - public static final String COUNTRIES = "countries"; - public static final String CREATE = "create"; - public static final String CREATE_BANKACCOUNT = "createBankAccount"; - public static final String CREATE_DRAFTED_ORDER = "createDraftedOrder"; - public static final String CREATE_NEW_CAR = "createNewCar"; - public static final String CREATE_PRODUCT_ATTRIBUTE_VALUE_ACTION = "/CreateProductAttributeValueAction"; - public static final String CREATE_PRODUCT_ATTRIBUTE_VALUE_FORM = "CreateProductAttributeValueForm"; - public static final String CREATE_USED_CAR = "createUsedCar"; - public static final String CREATE_WEBSTORE_CUSTOMER_ACTION = "/CreateWebstoreCustomerAction"; - public static final String CREATEPRODUCTS = "createProducts"; - public static final String CREATING_FROM_ORDER = "creatingFromOrder"; - public static final String CREDITCARDTYPE_AMEX = "Amex"; - public static final String CREDITCARDTYPE_DISCOVER = "Discover"; - public static final String CREDITCARDTYPE_MASTERCARD = "MasterCard"; - public static final String CREDITCARDTYPE_VISA = "Visa"; - public static final String CRM_REQUEST_USERS = "crmUsers"; - public static final String CSV = "csv"; - public static final String CSV_FILE = "csvFile"; - public static final String CSV_FILE2 = "csvFile2"; - public static final String PDF_FILE = "pdfFile"; - - public static final String CURRENCIES = "currencies"; - public static final String CURRENCY_SYMBOLE = "currencySymbole"; - public static final String CURRENT_PARTIAL_POS_ORDER_ID = "currentPartialPOSOrderId"; - public static final String CURRENT_POS_ORDER="currentPOSOrder"; - public static final String CURRENT_POS_ORDER_ID = "currentPOSOrderId"; - public static final String CURRENT_PRODUCT = "currentProduct"; - public static final String CURRENT_REQUEST = "currentRequest"; - public static final String CURRENT_TILL_AMOUNT = "currentTillAmount"; - public static final String CURRENT_TILL_AMOUNT_POS = "currentTillAmountPOS"; - public static final String CURRENT_YEAR = "currentYear"; - public static final String CUSTOM_DATE_RANGE = "customDateRange"; - public static final String CUSTOMER = "customer"; - public static final String CUSTOMER_CREATED="CustomerCreated"; - public static final String CUSTOMER_DETAILS = "customerDetails"; - - public static final String CUSTOMER_ID = "customerId"; - public static final String CUSTOMER_RETURN_ORDER = "customerReturnOrder"; - public static final String CUSTOMER_RETURN_ORDER_ID = "customerReturnOrderId"; - - public static final String CUSTOMER_RETURN_ORDER_LINES = "customerReturnOrderLine"; - public static final String CUSTOMER_RETURN_ORDER_SHOPPING_CART = "customerReturnOrderShoppingCart"; - public static final String CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS = "customerReturnOrderShoppingCartItems"; - public static final String DEALER_COUNTER_REF = "dealerCounterRef"; - public static final String DEALER_DETAILS = "dealerDetails"; - public static final String DEALER_REF = "dealerRef"; - - public static final String DEALERCODE_LIST = "dealerCodeList"; - public static final String DEALERS = "dealers"; - public static final String DEALERS_DETAIL = "dealersDetail"; - - - public static final String DELETE_ORDER_TYPE = "deleteOrderType"; - public static final String DELIVERY = "Delivery"; - public static final String DESCRIPTION ="description"; - public static final String DESIGN_ATTRIBUTE_VALUES="designAttributeValues"; - public static final String DISPLAY_REPORT = "displayReport"; - public static final String DMS = "DMS"; - public static final String DOC_STATUS = "docStatus"; - public static final String DOC_NO = "docNo"; - - public static final String DOCUMENT_HISTORY = "documentHistory"; - public static final String DOCUMENT_PDF = "documentPDF"; - public static final String DRAFT_INVOICE = "draftInvoice"; - - public static final String EDITWAREHOUSE="editWarehouse"; - public static final String EMAIL = "email"; - - //Email specific - public static final String EMAIL_FOOTER= "email.footer"; - public static final String EMAIL_REGARDS = "emailRegards"; - public static final String EMAIL_SIGNIN_INFO = "signin.info"; - public static final String END_OF_THE_DAY_DETAILS = "endOfTheDayDetails"; - public static final String ERROR_TITLE = "errorTitle"; - public static final String ERRORS = "errors"; - public static final String ETA_LIST = "ETAList"; - //public static final String EURO_SIGN = "€"; - public static final String EXISTING_BAR_CODE = "existingBarCode"; - public static final String FILE_FOR_UPDATE = "fileForUpdate"; - public static final String FINISHED_AL ="finishedAL"; - public static final String FINISHED_DO = "finishedDO"; - public static final String FINISHED_DT ="finishedDT"; - - public static final String FINISHED_MRO = "finishedMRO"; - - public static final String FINISHED_NR = "finishedNR"; - public static final String FINISHED_SCO = "finishedSCO"; - public static final String FIXED_DATE_RANGE = "fixedDateRange"; - public static final String FREE_STOCK = "Free Stock"; - public static final String FROM_DATE = "fromDate"; - public static final String FULL_DETAILS = "fullDetails"; - public static final String FULL_IMAGE = "fullImage"; - public static final String FULLIMAGE = "fullImage"; - public static final String GENERATE_INVOICE = "generateInvoice"; - public static final String GENERATE_INVOICE_ACTION = "Invoice"; - public static final String GENERATE_INVOICE_PAYMENT_ACTION = "InvoicePayment"; - public static final String GENERATE_WEBSTORE_INVOICE = "generateWebstoreInvoice"; - public static final String GET_CREDIT_CARD_DETAILS = "getCreditCardDetails"; - public static final String GET_LOGO="getLogo"; - - public static final String GET_PRODUCT_CATEGORY_ACTION = "/GetProductCategory"; - public static final String GOING_RATE_REPORT = "goingRateReport"; - public static final String GOODS_RECEIVE_NOTE = "goodsReceiveNote"; - public static final String GOODS_RECEIVE_NOTE_ID = "goodsReceiveNoteId"; - public static final String GOODS_RECEIVE_NOTE_LINES = "goodsReceiveNoteLines"; - public static final String GOODS_RECEIVE_NOTE_SHOPPING_CART = "goodsReceiveNoteShoppingCart"; - public static final String GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS = "goodsReceiveNoteShoppingCartItems"; - public static final String GOODS_RETURN_NOTE = "goodsReturnNote"; - public static final String GOODS_RETURN_NOTE_ID = "goodsReturnNoteId"; - - public static final String GOODS_RETURN_NOTE_LINES = "goodsReturnNoteLines"; - public static final String GOODS_RETURN_NOTE_SHOPPING_CART = "goodsReturnNoteShoppingCart"; - public static final String GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS = "goodsReturnNoteShoppingCartItems"; - public static final String GRAND_TOTAL = "grandTotal"; - public static final String HIDDEN_STOCK = "Hidden Stock"; - public static final String HOMEPAGE_PRODUCTS = "homePageProducts"; - public static final String HTML = "html"; - public static final String IMAGE_NAME = "ImageName"; - public static final String IMAGES_DIRECTORY = "images/"; - public static final String IMPORTED_VEHICLES = "importedVehicles"; - public static final String InitPriceListAction = "/InitPriceListAction"; - public static final String INSERT_VIN = "insertVin"; - public static final String INVOICE_ACTION_CANCEL = "Cancel"; - public static final String INVOICE_ACTION_COMPLETE = "Complete"; - public static final String INVOICE_ACTION_DELETE = "Delete"; - public static final String INVOICE_ACTION_PAID = "Paid"; - public static final String INVOICE_ACTION_PAID_AND_SHIP = "Paid and Ship"; - public static final String INVOICE_HISTORY = "invoiceHistory"; - public static final String INVOICE_ID = "invoiceId"; - public static final String INVENTORY_CART = "inventoryCart"; - public static final String INVENTORY_CART_ITEMS = "inventoryCartItems"; - - public static final String INVOICE_PAID = "Invoice & Pay"; - public static final String INVOICE_PAID_SHIP = "Inv/Paid/Ship"; - public static final String INVOICE_TAX = "invoiceTax"; - public static final String IS_PAID = "isPaid"; - public static final String KEYWORD1_LINK_LIST = "keyword1LinkList"; - public static final String KEYWORD2_LINK_LIST = "keyword2LinkList"; - - public static final String KIA = "kia"; - public static final String LEFT_MENUS = "leftMenus"; - public static final String LICENSING_AREA="licensingAreas"; - public static final String LICENSING_INFORMATION = "licensingInformation"; - public static final String APP_LICENSING_INFORMATION = "appLicensingInformation"; - public static final String LOCATORS = "locators"; - public static final String LOGIN = "login"; - - public static final String LOGIN_LINK = "link"; - public static final String MAKE_ATTRIBUTE_VALUES = "makeAttributeValues"; - public static final String MAX_SOLD_ITEMS = "maxSoldItems"; - public static final String ME = "me"; - public static final String ME_LOCATION = "meLocation"; - public static final String MENU = "menu"; - public static final String MENU_ITEMS = "menuItems"; - - public static final String MENU_LIST = "menuList"; - public static final String MENUS = "menus"; - public static final String MESSAGE = "message"; - public static final String MESSAGE_LOG_BEAN = "messageLogBean"; - public static final String MESSAGE_LOGS = "messageLogs"; - public static final String MIN_SOLD_ITEMS = "minSoldItems"; - public static final String MINOUT = "minout"; - public static final String MINOUT_ACTION_CANCEL = "Cancel"; - public static final String MINOUT_ACTION_COMPLETE = "Complete"; - public static final String MINOUT_ACTION_DELETE = "Delete"; - - public static final String MINOUT_ACTION_RECEIVE = "Receive"; - public static final String MINOUT_ACTION_SHIP = "Ship"; - public static final String MINOUT_LINES_COLLECTION = "minOutLinesCollection"; - public static final String MINVOICE = "minvoice"; - public static final String MINVOICE_LINES_COLLECTION = "invoiceLinesCollection"; - public static final String MMOVEMENT_LOCATOR = "toLocator"; - public static final String MMOVEMENT_LOCATORS = "organisationLocators"; - - public static final String MMOVEMENT_PRODUCT = "materialMovementProduct"; - public static final String MMOVEMENT_PRODUCTS = "organisationProducts"; - public static final String MMOVEMENT_WAREHOUSES = "organisationWarehouses"; - - public static final String MODEL_ATTRIBUTE_VALUE_ID = "modelAttributeValueId"; - public static final String MODEL_ATTRIBUTE_VALUES="modelAttributeValues"; - public static final String MODEL_MATCHING_MODELS = "modelMatchingModels"; - public static final String MODEL_MATCHING_YEARS = "modelMatchingYears"; - public static final String MODELCODE_LIST = "modelCodeList"; - public static final String MODELGROUP_ATTRIBUTE_VALUES = "modelGroupAttributeValues"; - public static final String MODELMATCH = "modelmatch"; - public static final String MONTH_SALES = "monthSales"; - public static final String MORDER = "morder"; - public static final String MORDER_LINES_COLLECTION = "orderLinesCollection"; - public static final String MPAYMENT = "payment"; - public static final String MY_RECEIVED_MESSAGE = "myReceivedMessage"; - public static final String MY_RECEIVED_MESSAGES = "myReceivedMessages"; - public static final String MY_SENT_MESSAGES = "mySentMessages"; - public static final String MY_STOCKS = "myStocks"; - public static final String NAAMSA_REPORT = "Naamsa Report"; - public static final String NAAMSAINFO = "naamsaInfo"; - public static final String NATIS_RELEASE_INFO = "natisReleaseInfo"; - public static final String NATIS_XML_ENCODING = "ISO-8859-1"; - public static final String NEW_PRODUCT = "newProduct"; - public static final String NO_CHAR = "N"; - public static final String NO_OF_VEHICLES_SOLD = "noOfVehicleSold"; - public static final String OLD_MODELMATCH = "oldmodelmatch"; - public static final String OPEN_CASH_BOOK = "openCashBook"; - public static final String OPENED_CASH_BOOK = "openedCashBook"; - public static final String ORDER_ACTION_ACCEPT = "Accept"; - public static final String ORDER_ACTION_ACCEPT_WO="Create"; - public static final String ORDER_ACTION_CANCEL = "Cancel"; - public static final String ORDER_ACTION_CLOSE = "Close"; - public static final String ORDER_ACTION_COMPLETE = "Complete"; - public static final String ORDER_ACTION_CONFIRM = "Confirm"; - public static final String ORDER_ACTION_DELETE = "Delete"; - public static final String ORDER_ACTION_GENERATE_ORDER = "Generate Order"; - public static final String ORDER_ACTION_PREPARE = "Reserve Stock"; - - public static final String ORDER_ACTION_PREPARE_SCO = "Prepare"; - public static final String ORDER_ACTION_PREPARE_SCO_ORDER="Prepare Order"; - public static final String ORDER_ACTION_REJECT = "Reject"; - public static final String ORDER_ACTION_SAVE = "Save"; - public static final String ORDER_ACTION_SPLIT = "Split"; - - public static final String ORDER_ACTION_SUBMIT = "Submit"; - public static final String ORDER_BEAN = "orderBean"; - public static final String ORDER_COLLECTION = "orderCollection"; - public static final String ORDER_DETAILS = "orderDetails"; - public static final String ORDER_HISTORY = "orderHistory"; - public static final String ORDER_ID = "orderId"; - public static final String ORDER_INFO = "orderInfo"; - public static final String ORDER_LINE_BEAN = "orderLineBean"; - public static final String ORDER_LINE_ID = "orderLineId"; - public static final String ORDER_LINES = "orderLines"; - public static final String ORDER_LINES_FOR_ORDER = "orderLinesForOrder"; - public static final String ORDER_TAX = "orderTax"; - public static final String ORDER_TYPE = "orderType"; - public static final String ORDER_TYPE_BULK = "bulk"; - - public static final String ORDER_TYPE_SIMPLE = "simple"; - - public static final String ORDER_TYPES = "orderTypes"; - public static final String ORG_FOR_RESERVED_PRODUCTS="orgForReservedProducts"; - public static final String ORG_ID = "orgId"; - public static final String ORG_USERS = "orgUsers"; - public static final String ORGANISATION = "organisation"; - public static final String ORGANISATION_VALUES="organisationValues"; - public static final String ORGS = "orgs"; - public static final String ORGTYPE = "orgType"; - - public static final String PAID_INVOICE = "paidInvoice"; - public static final String PAIR_VIN_NUMBERS = "pairVinNos"; - - public static final String PARTIAL_ORDER_SHOPPING_CART = "partialOrderShoppingCart"; - public static final String PARTIAL_ORDER_SHOPPING_CART_ITEMS = "partialOrderShoppingCartItems"; - public static final String PARTIAL_POS_ORDER = "partialPosOrder"; - - public static final String PARTIAL_POS_ORDER_LINES = "partialPOSOrderlines"; - public static final String PASSWORD = "password"; - public static final String PATH_CREATE_TAMAK_ORDER_ACTION = "/CreateTamakOrderAction"; - public static final String PATH_VIEW_ORDER_ACTION = "/ViewOrderAction"; - public static final String PAYMENT_ACTION_CANCEL = "Cancel"; - public static final String PAYMENT_ACTION_COMPLETE = "Complete"; - public static final String PAYMENT_BY_CARD = "paymentByCard"; - - public static final String PAYMENT_BY_CASH = "paymentByCash"; - public static final String PAYMENT_BY_CHEQUE = "paymentByCheque"; - - public static final String PAYMENT_HISTORY = "paymentHistory"; - public static final String PAYMENT_RULE_CARD="Card"; - public static final String PAYMENT_RULE_CASH="Cash"; - public static final String PAYMENT_RULE_CHEQUE="Cheque"; - public static final String PAYMENT_RULE_CREDIT="Credit"; - public static final String PAYMENT_RULE_MIXED="Mixed"; - public static final String PAYMENT_RULES = "paymentRules"; - public static final String PAYMENT_TYPE = "paymentType"; - public static final String PDF = "pdf"; - public static final String POOL_ORDERLINES = "poolOrderLines"; - public static final String POS_GENERAL_STOCK = "posGeneralStock"; - public static final String CARD_AMT_TENDERED = "cardAmtTendered"; - public static final String CHEQUE_AMT_TENDERED = "chequeAmtTendered"; - - public static final String POS_HISTORY = "posHistory"; - - public static final String POS_INFO = "posInfo"; - - public static final String POS_ORDER = "posOrder"; - public static final String POS_ORDER_CUSTOMER_COMPULSORY = "posOrderCustomerCompulsory"; - public static final String POS_ORDER_DOC_NUMBER = "POSOrderDocumentNumber"; - public static final String POS_ORDER_ID = "posOrderId"; - public static final String POS_ORDER_LINES = "posOrderLines"; - public static final String POS_ORDER_WITHOUT_ADVANCED = "posOrderWithoutAdvanced"; - public static final String POS_PRODUCTS_FOR_UPDATE = "posProductsForUpdate"; - public static final String POS_SALES_PRICE_LIST = "posSalesPriceList"; - - public static final String POS_STOCK = "posStock"; - public static final String POSTERMINAL = "POSTerminal"; - public static final String POSTERMINALS = "POSTerminals"; - public static final String PRICE = "price"; - - public static final String PRICE_LIST = "priceList"; - public static final String PRICE_LIST_VERSION = "priceListVersion"; - public static final String PRICE_LIST_VERSION_ID = "priceListVersionId"; - public static final String PriceListForm = "PriceListForm"; - - public static final String PRICEQTY_FILTER = "priceQtyFilter"; - public static final String PROCESS_CLASS = "process.class"; - public static final String PROCESS_NAME = "process.name"; - - public static final String PRODUCT = "product"; - public static final String PRODUCT_ATTRIBUTE_LIST = "productAttributeList"; - public static final String PRODUCT_ATTRIBUTE_SET = "productAttributeSet"; - public static final String PRODUCT_BRANDS = "productBrands"; - public static final String PRODUCT_CART = "productCart"; - public static final String PRODUCT_CART_ITEMS = "productCartItems"; - public static final String PRODUCT_CATEGORY_ID = "productCategoryId"; - //public static final String WEBSTORE_SHIPPING_ADDR = "webstoreShippingAddr"; - //public static final String WEBSTORE_BILLING_ADDR = "webstoreBillingAddr"; - public static final String PRODUCT_CLASSIFICATION ="productClassification"; - public static final String PRODUCT_CREATED = "productsCreated"; - public static final String PRODUCT_DETAIL_INFO = "productDetailInfo"; - public static final String PRODUCT_DETAILS = "productDetails"; - - public static final String PRODUCT_FILTER_BEAN = "productFilterBean"; - - public static final String PRODUCT_ID = "productId"; - - public static final String PRODUCT_IDS = "productIds"; - public static final String PRODUCT_IMAGE = "productImage"; - public static final String PRODUCT_IMAGE_BEAN = "productImageBean"; - public static final String PRODUCT_INFO = "productInfo"; - public static final String PRODUCT_KEYWORDS = "productKeywords"; - - public static final String PRODUCT_LINES = "productLines"; - public static final String PRODUCT_LIST = "productList"; - public static final String PRODUCT_SALES_DETAILS = "productSalesDetails"; - public static final String PRODUCT_SALES_SUMMARY = "productSalesSummary"; - public static final String PRODUCTS = "products"; - public static final String PRODUCTS_IN_STOCK = "productsInStock"; - public static final Integer PROFIT_MARGIN = Integer.valueOf(99999); - public static final String PROGRESS_DO = "progressDO"; - public static final String PROGRESS_DT = "progressDT"; - public static final String PROGRESS_NR = "progressNR"; - public static final String PROGRESS_SCO = "progressSCO"; - public static final String PROGRESS_TI = "progressTI"; - public static final String PROJECT_NAME = "project.name"; - public static final String PURCHASE_PRICELISTS = "purchase.pricelists"; - public static final String QUANTITY = "quantity"; - public static final String QUICK_POS_ORDER = "quickPosOrder"; - public static final String RECEIPT_HISTORY = "receiptHistory"; - public static final String RECEIVED_MESSAGE = "receivedMessage"; - public static final String REGION_VALUES = "regionValues"; - public static final String REGIONS = "regions"; - - public static final String RELATED_PRODUCT_IMAGES = "relatedProductImages"; - public static final String REPORT_URL = "reportURL"; - public static final String REPRICE_ORDER_TYPE ="repriceOrderType"; - - public static final String REQUEST_PRIORITIES = "requestPriorities"; - public static final String REQUEST_STATUS = "requestStatus"; - // --> CRM - public static final String REQUESTS_SUMMARY = "requestsSummary"; - public static final String RESERVE_STATUS_VALUES = "reserveStatusValues"; - public static final String RETAIL_REPORT = "retailReport"; - public static final String REVENUE_RECOGNITION = "Revenue Recognition"; - public static final String ROLE = "role"; - public static final String ROLE_MENUS = "roleMenus"; - public static final String ROLES = "roles"; - - public static final String SALES_ANALYSIS = "salesAnalysis"; - public static final String SALES_REP = "salesRep"; - public static final String SALES_REPORT = "salesReport"; - public static final String SALESGROUP_LIST = "salesGroupList"; - public static final String SALES_PRICELISTS = "sales.pricelists"; - public static final String SAVING_ACCOUNT_TYPE = "S"; - public static final String SCO_FILTER_BEAN = "SCOFilterBean"; - public static final String SCO_PRODUCT_LIST = "SCO Product List"; - public static final String SEARCH_VIN_NUMBERS="searchVinNumbers"; - public static final String SEARCH_VIN_NUMBERS_INQUIRY="searchVinNumberForInquiry"; - public static final String SELECTED_PRODUCTS_FOR_BULK_ORDER = "selectedProductsForBulkOrder"; - public static final String SELECTED_PRODUCTS_FOR_SIMPLE_ORDER = "selectedProductsForSimpleOrder"; - public static final String SENT_MESSAGE = "sentMessage"; - public static final String SHIPMENT_HISTORY = "shipmentHistory"; - public static final String SHIPPER_LIST = "shipperList"; - public static final String SHOPPING_CART = "shoppingCart"; - public static final String SHOPPING_CART_ITEMS = "shoppingCartItems"; - public static final String CHECKOUT_BEAN = "checkoutBean"; - public static final String SHOPPING_GRN_CART = "shoppingGRNCart"; - public static final String SHOPPING_GRN_CART_ITEMS = "shoppingGRNCartItems"; - public static final String SHOPPING_ORDER_CART = "shoppingOrderCart"; - public static final String SHOPPING_ORDER_CART_ITEMS = "shoppingOrderCartItems"; - public static final String SIMPLE_COMMAND = "simpleCommand"; - - public static final String SIMPLE_PRODUCT_CART = "simpleProductCart"; - public static final String SIZE_ATTRIBUTE_VALUES="sizeAttributeValues"; - public static final String SPLIT_ORDER_PROCESS = "splitOrderProcess"; - public static final String STATUS = "status"; - public static final String STATUS_OFF = "OFF"; - - public static final String STATUS_ON = "ON"; - public static final String STATUS_VALUES = "statusValues"; - public static final String STOCK_HISTORY_REPORT = "stockHistoryReport"; - - public static final String STOCK_MOVEMENT = "stockMovement"; - public static final String SUB_MENU_ITEMS = "subMenuItems"; - public static final String SUB_MENU_NAME = "subMenuName"; - public static final String SUBJECT = "subject"; - public static final String SUB_TOTAL = "subTotal"; - public static final String SUCCESS = "success"; - public static final String SUCCESS_CREATE_CUSTOMER = "successCreateCustomer"; - public static final String SUPERUSER = "superUser"; - public static final String SWAP_PRODUCT_ID = "swapProductId"; - public static final String SWAP_VIN = "swapVin"; - public static final String SWAP_VIN_NOS_ACTION = "Save"; - public static final String SWAP_VIN_NUMBER_BEAN = "swapVinNumberBean"; - public static final String TABULAR_REPORT_DATA = "tabularReportData"; - - public static final String TABULAR_REPORT_DATA2 = "tabularReport2"; - public static final String TABULAR_REPORT_SUBTITLE = "tabularReportSubtitle"; - public static final String TABULAR_REPORT_TITLE = "tabularReportTitle"; - public static final String TARGET_SALES = "targetSales"; - public static final String TAX_CATEGORY_ID = "taxCategoryId"; - - public static final Integer TAX_CREDIT = Integer.valueOf(12610); - public static final Integer TAX_DUE = Integer.valueOf(21610); - public static final String THUMBNAIL = "thumbnail"; - public static final String TIME_REMAINING = "timeRemaining"; - public static final String TO_DATE = "toDate"; - public static final String TOP_MENUS = "topMenus"; - public static final String MAIN_MENUS = "mainMenus"; - public static final String TOTAL_LINES = "totalLines"; - public static final String TRADE_IN_LIST = "tradeInList"; - public static final String TRADE_IN_PRODUCT_ID = "tradeInProductId"; - public static final Integer TRADE_REVENUE = Integer.valueOf(41000); - public static final String TRAFFIC_LIST = "trafficList"; - public static final String TRX_ATTRIBUTE_VALUE_ID = "trxAttributeValueId"; - public static final String TRX_ATTRIBUTE_VALUES="trxAttributeValues"; - public static final String [] TSHIRT_SIZE={"S","M","XL"}; - public static final String UDIADMIN = "udiadmin"; - public static final String UDIADMINAUTO = "udiadminauto"; - public static final String UDIADMINBIKE = "udiadminbike"; - public static final String UNFINISHED_AL = "unfinishedAL"; - - public static final String UNFINISHED_DO = "unfinishedDO"; - public static final String UNFINISHED_DT = "unfinishedDT"; - public static final String UNFINISHED_INV = "unfinishedInvoice"; - public static final String UNFINISHED_NR = "unfinishedNR"; - public static final String UNFINISHED_SCO = "unfinishedSCO"; - public static final String UNFINISHED_WO = "unfinishedWO"; - public static final String UNIMPORTED_VEHICLES = "unimportedVehicles"; - public static final String UNPAID_INVOICE = "unPaidInvoice"; - public static final String UPDATE_PRODUCT_DETAILS = "updateProductDetails"; - public static final String USED_CAR_PURCHASE_ORDER = "usedCarPurchaseOrder"; - public static final String USER_DETAILS = "userDetails"; - public static final String VEHICLE_DETAILS = "vehicleDetails"; - public static final String VEHICLES = "vehicles"; - public static final String VENDOR_DETAILS = "vendorDetails"; - public static final String BLACKLISTED_DETAILS = "blackListedDetails"; - public static final String BLACKLISTED_LISTS="blackListedList"; - - - public static final String VENDOR_LIST = "vendorList"; - public static final String VIEW_ALL_ALLOCATIONS = "viewAllAllocations"; - public static final String VIEW_INVOICE_DETAILS="view.invoice.detail"; - public static final String VIEW_MINOUT = "viewMinOut"; - public static final String VIEW_MY_SENT_MESSAGES="viewMySentMessages"; - public static final String VIEW_PAYMENT = "viewPayment"; - public static final String VIEW_POS_ORDER_ACTION = "/ViewPOSOrderAction"; - - public static final String VIEW_POS_PRODUCTS = "viewPOSProducts"; - - public static final String VIEW_SHOPPING_CART = "viewShoppingCart"; - public static final String VIEW_VIN_NUMBER_DETAILS = "viewVinNumberDetails"; - public static final String VIN_NOS = "vinNos"; - - public static final String VIN_NUMBER_FROM = "vinNumberFrom"; - public static final String WAREHOUSE="warehouse"; - public static final String WAREHOUSE_NAMES = "warehouseNames"; - public static final String WAREHOUSE_TYPES = "warehouseTypes"; - public static final String WAREHOUSEDETAILS="warehouseDetails"; - - public static final String WAREHOUSES = "warehouses"; - public static final String WEB_APPLICATIONS = "WebApplications"; - public static final String WEB_DOCUMENT_HEADER_BEAN = "webDocumentHeaderBean"; - public static final String WEB_INVOICE_BEAN = "webInvoiceBean"; - - - - public static final String WEB_MINOUT_BEAN = "webMinOutBean"; - public static final String WEB_ORDER_BEAN = "webOrderBean"; - public static final String WEB_ORDER_LINE_BEAN = "webOrderLineBean"; - public static final String WEB_PAYMENT_BEAN = "webPaymentBean"; - - - public static final String WEBSTORE_CREATE_CUSTOMER = "webstoreCreateCustomer"; - public static final String WEBSTORE_CREDITCARD_BEAN = "creditCardBean"; - public static final String WEBSTORE_CUSTOMER = "Webstore Customer"; - public static final String WEBSTORE_INVOICE = "webstoreInvoice"; - /*public static final String WEBSTORE_LINK = UDIFilePropertiesManager.getProperty().get(new Properties(), "webstore.url");*/ - public static final String WEBSTORE_LOGIN_ACTION = "/WebstoreLoginAction"; - public static final String WEBSTORE_PROGRESS_DO = "webstoreProgressDO"; - /*public static final String WEBSTORE_SHIPPING_PROMOTION_PRICE = UDIFilePropertiesManager.getProperty().get(new Properties(), "webstore.shipping.promotion.price"); - public static final String WEBSTORE_SHIPPING_PROMOTION_STATUS = UDIFilePropertiesManager.getProperty().get(new Properties(), "webstore.shipping.promotion.status"); -*/ - public static final String WEBSTORE_USER_BEAN = "webstoreUserBean"; - public static final String WEBSTORE_USER_DETAILS = "webstoreUserDetails"; - public static final String WESBANK = "wesbank"; - public static final String WESBANK_RESPONSE = "WesbankResponse"; - public static final String WESBANK_STATUS = "wesbank.status"; - public static final String WHOLESALE_REPORT = "wholesaleReport"; - public static final String YEAR_ATTRIBUTE_VALUE_ID = "yearAttributeValueId"; - public static final String YEAR_ATTRIBUTE_VALUES="yearAttribueValues"; - - - public static final String YES_CHAR = "Y"; - public static final String YOU = "you"; - public static final String YOU_BP_LOCATION = "youbpLocation"; - public static final String YOU_LOCATION = "youLocation"; - public static final String CURRENCY_SYMBOLE_PURCHASE = "currencySymbolePurchase"; - public static final String CREDIT_ORDER = "creditOrder"; - public static final String CREDIT_ORDER_SHOPPING_CART = "creditOrderShoppingCart"; - public static final String CREDIT_ORDER_SHOPPING_CART_ITEMS = "creditOrderShoppingCartItems"; - public static final String OPEN_ITEMS = "openItems"; - public static final String AGING_ITEMS = "agingItems"; - public static final String CREDIT_INVOICE_INFO = "creditInvoiceInfo"; - public static final String DISCOUNT_ALLOWED = "discountAllowed"; - public static final String PRODUCT_SALES_BUCKET = "productSalesBucket"; - public static final String BPARTNERS = "bPartners"; - public static final String CASH_PAYMENT_MADE = "cashPaymentMade"; - public static final String CASH_PAYMENT_LIST = "cashPaymentList"; - public static final String CARD_CHQ_PAYMENT_LIST = "cardChqPaymentList"; - public static final String INVOICE_GRAND_TOTAL = "invoiceGrandTotal"; - public static final String NO_IMAGE_CSV_REPORT = "noImageCSVReport"; - public static final String MCASHLINE = "cashLine"; - public static final String DEBTORS = "debtors"; - public static final String PAYMENT_ALLOCATIONS = "paymentAllocations"; - public static final String PAYMENT_TERM = "paymentTerm"; - public static final String PAYMENT_TERM_ID = "paymentTermId"; - public static final String ALL_PAYMENT_TERMS = "allPaymentsTerms"; - public static final String EDIT_PAYMENT_TERM = "editPaymentTerm"; - public static final String NO_CREDIT_CHECK="No Credit Check"; - public static final String CREDIT_OK="Credit OK"; - public static final String CREDIT_STOP="Credit Stop"; - public static final String BUSINESSPARTNERINFO = "bPartnerInfo"; - public static final String ORDER_NAME = "orderName"; - public static final String COMMISSION_AMT = "commissionAmt"; - public static final String COMMISSION_AMT_DETAILS = "commissionAmtDetails"; - public static final String CREDIT_HOLD = "creditHold"; - public static final String CREDIT_WATCH = "creditWatch"; - public static final String CREDIT_PAYMENT_TERM_ID = "creditPaymentTermId"; - public static final String PRESENT_POS_ORDER = "presentPOSOrder"; - public static final String PRESENT_CREDIT_ORDER = "presentCreditOrder"; - public static final String PRESENT_POS_ORDER_ID = "presentPOSOrderId"; - public static final String PRESENT_GRN_ORDER_ID = "presentGRNOrderId"; - public static final String PRESENT_GRN_ORDER = "presentGRNOrder"; - public static final String PRESENT_GOODS_RET_ORDER = "presentGoodsReturnOrder"; - public static final String PRESENT_GOODS_RET_ORDER_ID = "presentGoodsReturnOrderId"; - public static final String PRESENT_CREDIT_ORDER_ID ="presentCreditOrderId"; - public static final String PRESENT_CUSTOMER_RET_ORDER = "presentCustomerReturnOrder"; - public static final String PRESENT_CUSTOMER_RET_ORDER_ID = "presentCustomerReturnOrderId"; - public static final String CUSTOMER_CART = "customerCart"; - public static final String ALL_CART_CUSTOMERS = "allCartCustomers"; - public static final String ALL_TAX_RATE ="allTaxRates"; - public static final String EDIT_TAX = "editTax"; - public static final String INVENTORY_LINE_LIST = "inventoryLineList"; - public static final String CREDITORDER_BPARTNER = "creditOrderBPartner"; - public static final String ORDER_TITLE = "orderTitle"; - public static final String UNALLOCATED_PAYMENTS = "unallocatedPayments"; - public static final String COMPLETED_INVENTORY_LINE_LIST = "completedInventoryLineList"; - public static final String INVENTORY_HISTORY_LIST = "inventoryHistoryList"; - public static final String WHOLE_INVENTORY_LINE_LIST = "wholeInventoryLineList"; - public static final String SHIPMENT_REQUIRED = "shipmentRequired"; - public static final String INVOICE_FOR_ALLOCATION = "invoiceForAllocation"; - public static final String TO_BE_SHIPPED = "toBeShipped"; - public static final String POS_HISTORY_ORDER_TYPE = "posHistoryOrderType"; - public static final String GROUP1 = "group1"; - public static final String GROUP2 = "group2"; - public static final Object CREATE_PAYMENT = "createPayment"; - public static final String INVENTORY_ID = "inventoryId"; - public static final String PAID="Paid"; - public static final String UNPAID="UnPaid"; - public static final String PARTIALLY_PAID="Partially Paid"; - public static final String OVER_PAID = "overPaid"; - public static final String INVENTORY_DESCRIPTION ="inventoryDescription"; - public static final String PARTIAL_POS_OREDR = "partialPOSOrder"; - public static final String ALL_ORDER_HISTORY = "allOrderHistory"; - - public static final String CLOSE_TILL_PRINT_DATA="closeTillPrintData"; - public static final String SHOPPING_CART_NAME = "shoppingCartName"; - - public static final String PREFERENCE_PRINTER_TYPE = "preference.printerType"; - public static final String UOM_LIST = "uomList"; - public static final String USER_ORGS = "userOrgs"; - public static final String ALL_ORGANISATIONS = "*"; - public static final String ROLE_ORG_ACCESS_LIST = "roleOrgAccessList"; - public static final String DETAILED_SALES_REPORT = "detailedSalesReport"; - // Constants related to Material Movement - public static final String ORG_FROM_ID = "orgFromId"; - public static final String ORG_TO_ID = "orgToId"; - public static final String USER_ORGS_STOCK = "userOrgsStockMovement"; - - public static final String STOCK_LIST = "stockList"; - public static final String MOVE_CONFIRM = "moveConfirm"; - public static final String MATERIAL_MOVEMENT_ITEMS = "materialMovementItems"; - public static final String MATERIAL_MOVEMENT = "materialMovement"; - public static final String MATERIAL_MOVEMENT_LIST = "materialMovementList"; - public static final String MATERIAL_MOVEMENT_LINES = "materialMovementLines"; - public static final String MATERIAL_MOVEMENT_DETAILS = "materialMovementDetails"; - public static final String MATERIAL_MOVEMENT_ID = "materialMovementId"; - public static final String MOVE_CONFIRM_LINES = "moveConfirmLines"; - public static final String MMOVEMENT = "movement"; - public static final String MMOVEMENT_ID = "movementId"; - - public static final String PAYMENT_RULE_CASH_MSG = "payment.rule.cash"; - public static final String PAYMENT_RULE_CARD_MSG = "payment.rule.card"; - public static final String PAYMENT_RULE_CHEQUE_MSG = "payment.rule.cheque"; - public static final String PAYMENT_RULE_MIXED_MSG = "payment.rule.mixed"; - public static final String PAYMENT_RULE_CREDIT_MSG = "payment.rule.credit"; - - - public static final String DOC_STATUS_DRAFTED = "document.status.drafted"; - public static final String DOC_STATUS_INPROGRESS = "document.status.inprogress"; - public static final String DOC_STATUS_COMPLETED = "document.status.completed"; - public static final String DOC_STATUS_INVALID = "document.status.invalid"; - public static final String DOC_STATUS_VOID = "document.status.void"; - public static final String DOC_STATUS_CLOSED = "document.status.closed"; - public static final String STOCK_SALES_REPORT_LIST = "stock.sales.report.list"; - public static final String STOCK_SALES_REPORT_DATA = "stockSalesReportData"; - public static final String SALES_REPORT_LIST = "salesReportList"; - public static final String STOCK_REPORT_LIST = "stockReportList"; - public static final String SALES_REPORT_LIST_COMPLETE = "salesReportListComplete"; - public static final String STOCK_REPORT_LIST_COMPLETE = "stockReportListComplete"; - public static final String PRODUCT_SALES_COMPLETE_SET = "productSalesCompleteSet"; - public static final String PRODUCT_STOCK_COMPLETE_SET = "productStockCompleteSet"; - public static final String PRODUCT_ORG_STOCK_MAP = "productOrgStockMap"; - public static final String PRODUCT_ORG_SALES_MAP = "productOrgSalesMap"; - public static final String STOCK_PRODUCT_LIST = "stockProductList"; - public static final String MMOVEMENT_LINES = "movementLines"; - public static final String STOCKMOVEMENT_MAP = "stockMovementMap"; - public static final String PRE_ORG_FROM_ID = "preOrgFromId"; - public static final int SALES_TYPE = 1; - public static final int STOCK_TYPE = 2; - public static final String STOCK_SALES_REPORT_ORGS = "stockSalesReportOrgs"; - public static final String MONTHLY_SALES_REPORT_DATA = "monthlySalesReportData"; - public static final String DETAILED_SALES_REPORT_PER_PRODUCT = "detailedSalesReportPerProduct"; - public static final String DETAILED_GRN_REPORT_PER_PRODUCT = "detailedGRNReportPerProduct"; - public static final String STOCK_ADJUSTMENTS_REPORT_DATA = "stockAdjustmentsReportData"; - public static final String INVENTORY_MOVE_HISTORY = "viewInventoryMoveHistory"; - public static final String LIST_PRICE_LISTS = "list.price.lists"; - public static final String CREATE_PRICE_LIST = "create.price.list"; - public static final String PRODUCT_PRICE_LISTS = "product.price.lists"; - public static final String PRICE_LIST_HEADERS = "price.list.headers"; - public static final String USER_PRICE_LISTS = "user.price.lists"; - public static final String REGISTER_USERS = "RegisterUser"; - public static final String USER_BEAN = "userBean"; - public static final String USER_PURCHASE_PRICE_LISTS = "user.purchase.price.lists"; - public static final String USER_SALES_PRICE_LISTS = "user.sales.price.lists"; - public static final String CONFIGURATION = "configuration"; - public static final String WEB_COMPONENTS = "web.components"; - public static final String REPORT_DESCRIPTION = "report.description"; - public static final String PROCESS_ID = "process.id"; - public static final String IMPORT_FAIL_CSV_FILE = "import.fail.csv.file"; - - public static final String CURRENCY_LIST = "currencyList"; - public static final String CURRENCY = "currency"; - public static final String IS_FROM_DELETE_PRODUCT_PRICE = "is.from.delete.product.price"; - public static final String REPORT_COMMENT = "report.comment"; - public static final String SHOPPING_CART_TOTAL = "shoppingcartTotal"; - public static final String SHOPPING_CART_DISCOUNTED_TOTAL = "shoppingcartDiscountedTotal"; - public static final String SHOPPING_CART_DISCOUNT_PERCENTAGE = "shoppingcartDiscountPercentage"; - public static final String BPARTNER_ID = "bpartner.id"; - public static final String BPARTNER_NAME = "bpartner.name"; - public static final String BPARTNER_CREDIT = "bpartner.credit"; - public static final String ORDER_PRICE_LIST = "order.price.list"; - public static final String IS_SOTRX = "isSOTrx"; - - public static final String ACCESSIBLE_BANKACCOUNTS = "accessible.bankaccounts"; - public static final String ACCESSIBLE_CASHBOOKS = "accessible.cashbooks"; - public static final String CASHBOOKS = "cashbooks"; - public static final String TERMINALS = "terminals"; - public static final String TERMINAL_TRANSFER_TYPE = "terminalTransferType"; - public static final String DISPLAYTAG_TABLE_ID = "displayTagTableId"; - public static final String ORDER_PAYMENT = "orderPayment"; - public static final String ORDER_WRITE_OFF = "orderWriteOff"; - public static final String ORDER_DICOUNT = "orderDiscount"; - public static final String ORDER_CARD_AMOUNT = MPayment.TENDERTYPE_CreditCard; - public static final String ORDER_CHECK_AMOUNT = MPayment.TENDERTYPE_Check; - public static final String ORDER_CASH_AMOUNT = "cashAmount"; - public static final String DISCOUNT_ON_ORDER_TOTAL = "discountOnOrderTotal"; - public static final String DISCOUNT_ON_ORDER_TOTAL_PERCENT = "discountOnOrderTotalPercent"; - - public static final String CREDITORS = "creditors"; - //public static final String DEBTORS = ""; - public static final String CREDITOR_HISTORY = "creditorHistory"; - public static final String DEBTOR_HISTORY = "debtorHistory"; -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/TangoColors.java b/posterita/posterita/src/main/org/posterita/TangoColors.java deleted file mode 100644 index fbf1dbc018..0000000000 --- a/posterita/posterita/src/main/org/posterita/TangoColors.java +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita; - -/** - * @author servansingh - * May 29, 2008 - */ -public class TangoColors -{ - public static final String ALUMINIUM_1 = "#EEEEEC"; - public static final String ALUMINIUM_2 = "#D3D7CF"; - public static final String BLUE_1 = "#D1E0EF"; - public static final String BLUE_2 = "#98B9DC"; - public static final String GREEN_1 = "#DAF5BC"; - public static final String GREEN_2 = "#ABEA6C"; - public static final String PLUM_1 = "#E9DDE8"; - public static final String PLUM_2 = "#CBAEC9"; - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/AddressBean.java b/posterita/posterita/src/main/org/posterita/beans/AddressBean.java deleted file mode 100644 index d552782ef7..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/AddressBean.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.beans; - -import org.posterita.beans.UDIBean; - -public class AddressBean extends UDIBean -{ - - public Integer getBpartnerId() - { - return bpartnerId; - } - - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - - public String getAddress1() - { - return address1; - } - - public void setAddress1(String address1) - { - this.address1 = address1; - } - - public String getAddress2() - { - return address2; - } - public void setAddress2(String address2) - { - this.address2 = address2; - } - - public Boolean getBillTo() - { - return billTo; - } - - public void setBillTo(Boolean billTo) - { - this.billTo = billTo; - } - public String getCity() - { - return city; - } - - public void setCity(String city) - { - this.city = city; - } - - public Integer getCountryId() - { - return countryId; - } - public void setCountryId(Integer countryId) - { - this.countryId = countryId; - } - - public String getPostalAddress() - { - return postalAddress; - } - - public void setPostalAddress(String postalAddress) - { - this.postalAddress = postalAddress; - } - - public Boolean getShipTo() - { - return shipTo; - } - - public void setShipTo(Boolean shipTo) - { - this.shipTo = shipTo; - } - - public String getCountryName() - { - return countryName; - } - - public void setCountryName(String countryName) - { - this.countryName = countryName; - } - - public String getUserSurname() - { - return userSurname; - } - - public void setUserSurname(String userSurname) - { - this.userSurname = userSurname; - } - - public String getUsername() - { - return username; - } - - public void setUsername(String username) - { - this.username = username; - } - - - public String getCountryCode() - { - return countryCode; - } - - public void setCountryCode(String countryCode) - { - this.countryCode = countryCode; - } - - public Integer getRegionId() - { - return regionId; - } - - public void setRegionId(Integer regionId) - { - this.regionId = regionId; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/AgingBean.java b/posterita/posterita/src/main/org/posterita/beans/AgingBean.java deleted file mode 100644 index 637a2e95ea..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/AgingBean.java +++ /dev/null @@ -1,232 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 17, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; - - -public class AgingBean extends UDIBean -{ - - public Integer getCurrencyId() - { - return currencyId; - } - - public void setCurrencyId(Integer currencyId) - { - this.currencyId = currencyId; - } - - public BigDecimal getDue0() - { - return due0; - } - - public void setDue0(BigDecimal due0) - { - this.due0 = due0; - } - - public BigDecimal getDue0_30() - { - return due0_30; - } - - public void setDue0_30(BigDecimal due0_30) - { - this.due0_30 = due0_30; - } - - public BigDecimal getDue1_7() - { - return due1_7; - } - - public void setDue1_7(BigDecimal due1_7) - { - this.due1_7 = due1_7; - } - - public BigDecimal getDue31_60() - { - return due31_60; - } - - public void setDue31_60(BigDecimal due31_60) - { - this.due31_60 = due31_60; - } - - public BigDecimal getDue61_90() - { - return due61_90; - } - - public void setDue61_90(BigDecimal due61_90) - { - this.due61_90 = due61_90; - } - - public BigDecimal getDue8_30() - { - return due8_30; - } - - public void setDue8_30(BigDecimal due8_30) - { - this.due8_30 = due8_30; - } - - public BigDecimal getDue91_PLUS() - { - return due91_PLUS; - } - - public void setDue91_PLUS(BigDecimal due91_PLUS) - { - this.due91_PLUS = due91_PLUS; - } - - public BigDecimal getDueAmt() - { - return dueAmt; - } - - public void setDueAmt(BigDecimal dueAmt) - { - this.dueAmt = dueAmt; - } - - public Timestamp getDueDate() - { - return dueDate; - } - - public void setDueDate(Timestamp dueDate) - { - this.dueDate = dueDate; - } - - public BigDecimal getInvoicedAmt() - { - return invoicedAmt; - } - - public void setInvoicedAmt(BigDecimal invoicedAmt) - { - this.invoicedAmt = invoicedAmt; - } - - public Integer getInvoiceId() - { - return invoiceId; - } - - public void setInvoiceId(Integer invoiceId) - { - this.invoiceId = invoiceId; - } - - public BigDecimal getOpenAmt() - { - return openAmt; - } - - public void setOpenAmt(BigDecimal openAmt) - { - this.openAmt = openAmt; - } - - public BigDecimal getPastDue1_30() - { - return pastDue1_30; - } - - public void setPastDue1_30(BigDecimal pastDue1_30) - { - this.pastDue1_30 = pastDue1_30; - } - - public BigDecimal getPastDue1_7() - { - return pastDue1_7; - } - - public void setPastDue1_7(BigDecimal pastDue1_7) - { - this.pastDue1_7 = pastDue1_7; - } - - public BigDecimal getPastDue31_60() - { - return pastDue31_60; - } - - public void setPastDue31_60(BigDecimal pastDue31_60) - { - this.pastDue31_60 = pastDue31_60; - } - - public BigDecimal getPastDue61_90() - { - return pastDue61_90; - } - - public void setPastDue61_90(BigDecimal pastDue61_90) - { - this.pastDue61_90 = pastDue61_90; - } - - public BigDecimal getPastDue8_30() - { - return pastDue8_30; - } - - public void setPastDue8_30(BigDecimal pastDue8_30) - { - this.pastDue8_30 = pastDue8_30; - } - - public BigDecimal getPastDue91_plus() - { - return pastDue91_plus; - } - - public void setPastDue91_plus(BigDecimal pastDue91_plus) - { - this.pastDue91_plus = pastDue91_plus; - } - - public BigDecimal getPastDueAmt() - { - return pastDueAmt; - } - - public void setPastDueAmt(BigDecimal pastDueAmt) - { - this.pastDueAmt = pastDueAmt; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ApplicationParametersBean.java b/posterita/posterita/src/main/org/posterita/beans/ApplicationParametersBean.java deleted file mode 100644 index 5951222de0..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ApplicationParametersBean.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * */ -package org.posterita.beans; - - -public class ApplicationParametersBean extends UDIBean -{ - public String getApplicationName() - { - return applicationName; - } - - public void setApplicationName(String applicationName) - { - this.applicationName = applicationName; - } - - public String getApplicationWebContext() - { - return applicationWebContext; - } - - public void setApplicationWebContext(String applicationWebContext) - { - this.applicationWebContext = applicationWebContext; - } - - public Integer getStoreId() - { - return storeId; - } - - public void setStoreId(Integer storeId) - { - this.storeId = storeId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttachmentBean.java b/posterita/posterita/src/main/org/posterita/beans/AttachmentBean.java deleted file mode 100644 index e888a7b19e..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/AttachmentBean.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Aug-2005 by alok - * - */ -package org.posterita.beans; - - -public class AttachmentBean extends UDIBean -{ - public String getLogoName() - { - return logoName; - } - public void setLogoName(String logoName) - { - this.logoName = logoName; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttributeBean.java b/posterita/posterita/src/main/org/posterita/beans/AttributeBean.java deleted file mode 100644 index ee17bc3ac9..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/AttributeBean.java +++ /dev/null @@ -1,227 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jun 15, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.ArrayList; - - -public class AttributeBean extends UDIBean -{ - public BigDecimal getUnitPrice() - { - return unitPrice; - } - - public void setUnitPrice(BigDecimal unitPrice) - { - this.unitPrice = unitPrice; - } - - public BigDecimal getPrice() - { - return price; - } - - public void setPrice(BigDecimal price) - { - this.price = price; - } - - public String getBarCode() - { - return barCode; - } - - public void setBarCode(String barCode) - { - this.barCode = barCode; - } - - public Integer[] getProductIds() - { - return productIds; - } - - public void setProductIds(Integer[] productIds) - { - this.productIds = productIds; - } - - public String getQtyNumberFilter() - { - return qtyNumberFilter; - } - - public void setQtyNumberFilter(String qtyNumberFilter) - { - this.qtyNumberFilter = qtyNumberFilter; - } - - public String getQtyFilter() - { - return qtyFilter; - } - - public void setQtyFilter(String qtyFilter) - { - this.qtyFilter = qtyFilter; - } - - public Integer getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - - public void setAttributeSetInstanceId(Integer attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - - public Integer getProductId() - { - return productId; - } - public void setProductId(Integer productId) { - this.productId = productId; - } - - public String getProductName() - { - return productName; - } - - public void setProductName(String productName) - { - this.productName = productName; - } - - public BigDecimal getQuantity() - { - return quantity; - } - - public void setQuantity(BigDecimal quantity) - { - this.quantity = quantity; - } - - public Integer getAttributeValueId() - { - return attributeValueId; - } - - public void setAttributeValueId(Integer attributeValueId) - { - this.attributeValueId = attributeValueId; - } - - public String getAttributeValue() - { - return attributeValue; - } - - public void setAttributeValue(String attributeValue) - { - this.attributeValue = attributeValue; - } - - public String getAttributeName() - { - return attributeName; - } - - public void setAttributeName(String attributeName) - { - this.attributeName = attributeName; - } - - public Integer getAttributeId() - { - return attributeId; - } - - public void setAttributeId(Integer attributeId) - { - this.attributeId = attributeId; - } - - public Integer getAttributeSetId() - { - return attributeSetId; - } - - public void setAttributeSetId(Integer attributeSetId) - { - this.attributeSetId = attributeSetId; - } - - public String getAttributeSetName() - { - return attributeSetName; - } - - public void setAttributeSetName(String attributeSetName) - { - this.attributeSetName = attributeSetName; - } - - public ArrayList getAttributeValueList() - { - return attributeValueList; - } - - public void setAttributeValueList(ArrayList attributeValueList) - { - this.attributeValueList = attributeValueList; - } - - public String[] getAttributeValueIds() - { - return attributeValueIds; - } - - public void setAttributeValueIds(String[] attributeValueIds) - { - this.attributeValueIds = attributeValueIds; - } - public void setUom(String uom) - { - this.uom = uom; - } - public String getUom() - { - return this.uom; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttributeInstanceBean.java b/posterita/posterita/src/main/org/posterita/beans/AttributeInstanceBean.java deleted file mode 100644 index 5e435055a3..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/AttributeInstanceBean.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - - -public class AttributeInstanceBean -{ - private int attributeSetInstanceId; - private int attributeId; - private String attributeValue; - private String attribute; - private int attributeValueId; - - - public int getAttributeId() - { - - return attributeId; - } - - public void setAttributeId(int attributeId) - { - this.attributeId = attributeId; - } - - public int getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - - public void setAttributeSetInstanceId(int attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - - public String getAttribute() - { - return attribute; - } - - public void setAttribute(String attribute) - { - this.attribute = attribute; - } - - public String getAttributeValue() - { - return attributeValue; - } - public void setAttributeValue(String attributeValue) - { - this.attributeValue = attributeValue; - } - public int getAttributeValueId() - { - return attributeValueId; - } - - public void setAttributeValueId(int attributeValueId) - { - this.attributeValueId = attributeValueId; - } - - public boolean equals(Object o) - { - if (o == null) - return false; - - AttributeInstanceBean bean = (AttributeInstanceBean) o; - - if (bean.getAttributeSetInstanceId() == this.getAttributeSetInstanceId()) - return true; - - return false; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttributeValueDetailBean.java b/posterita/posterita/src/main/org/posterita/beans/AttributeValueDetailBean.java deleted file mode 100644 index b3286e7663..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/AttributeValueDetailBean.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Feb 3, 2006 by praveen - * - */ -package org.posterita.beans; - -public class AttributeValueDetailBean extends UDIBean -{ - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public Integer getId() - { - return id; - } - - public void setId(Integer id) - { - this.id = id; - } - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - public Boolean getIsActive() - { - return isActive; - } - - public void setActive(Boolean isActive) - { - this.isActive = isActive; - } - - public Integer getAttributeId() - { - return attributeId; - } - - public void setAttributeId(Integer attributeId) - { - this.attributeId = attributeId; - } - - public Integer getAttributeValueId() - { - return attributeValueId; - } - - public void setAttributeValueId(Integer attributeValueId) - { - this.attributeValueId = attributeValueId; - } - - public String getNewName() - { - return newName; - } - - public void setNewName(String newName) - { - this.newName = newName; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttributeValuesBean.java b/posterita/posterita/src/main/org/posterita/beans/AttributeValuesBean.java deleted file mode 100644 index 82293a4373..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/AttributeValuesBean.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - - -import java.util.ArrayList; - -import org.compiere.util.KeyNamePair; - -public class AttributeValuesBean extends UDIBean -{ - private ArrayList brand = new ArrayList(); - private ArrayList model = new ArrayList(); - private ArrayList design = new ArrayList(); - private ArrayList colour = new ArrayList(); - private ArrayList size = new ArrayList(); - private ArrayList trx = new ArrayList(); - private ArrayList years = new ArrayList(); - private ArrayList ETAList = new ArrayList(); - private ArrayList make = new ArrayList(); - private ArrayList modelGroup = new ArrayList(); - - public void setAttributeId(Integer attributeId) - { - this.attributeId = attributeId; - } - - public Integer getAttributeSetId() - { - return attributeSetId; - } - - public ArrayList getAttributeSet() - { - return attributeSet; - } - public void setAttributeSet(ArrayList attributeSet) - { - this.attributeSet = attributeSet; - } - private ArrayList attributeSet; - - public ArrayList getColour() - { - return colour; - } - - public void setColour(ArrayList colour) - { - this.colour = colour; - } - - public ArrayList getModel() - { - return model; - } - - public void setModel(ArrayList model) - { - this.model = model; - } - - public ArrayList getTrx() - { - return trx; - } - - public void setTrx(ArrayList trx) - { - this.trx = trx; - } - - public ArrayList getYears() - { - return years; - } - - public void setYears(ArrayList years) - { - this.years = years; - } - - public ArrayList getMake() - { - return make; - } - - public void setMake(ArrayList make) - { - this.make = make; - } - - public ArrayList getModelGroup() - { - return modelGroup; - } - - public void setModelGroup(ArrayList modelGroup) - { - this.modelGroup = modelGroup; - } - - public ArrayList getETAList() - { - return ETAList; - } - - public void setETAList(ArrayList list) - { - ETAList = list; - } - - public ArrayList getBrand() { - return brand; - } - - public void setBrand(ArrayList brand) { - this.brand = brand; - } - - public ArrayList getDesign() { - return design; - } - - public void setDesign(ArrayList design) { - this.design = design; - } - - public ArrayList getSize() { - return size; - } - - public void setSize(ArrayList size) { - this.size = size; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/AttributeValuesPair.java b/posterita/posterita/src/main/org/posterita/beans/AttributeValuesPair.java deleted file mode 100644 index 5af78d5c87..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/AttributeValuesPair.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - -import org.compiere.util.KeyNamePair; - - -public class AttributeValuesPair -{ - private KeyNamePair makeAttributeValue; - private KeyNamePair modelAttributeValue; - private KeyNamePair modelGroupAttributeValue; - private KeyNamePair colourAttributeValue; - private KeyNamePair transmissionAttributeValue; - private KeyNamePair yearAttributeValue; - private KeyNamePair styleAttributeValue; - private KeyNamePair sizeAttributeValue; - private KeyNamePair designAttributeValue; - private KeyNamePair brandAttributeValue; - - - public KeyNamePair getBrandAttributeValue() - { - return brandAttributeValue; - } - - public void setBrandAttributeValue(KeyNamePair brandAttributeValue) - { - this.brandAttributeValue = brandAttributeValue; - } - - public KeyNamePair getColourAttributeValue() - { - return colourAttributeValue; - } - - public void setColourAttributeValue(KeyNamePair colourAttributeValue) - { - this.colourAttributeValue = colourAttributeValue; - } - - public KeyNamePair getModelAttributeValue() - { - return modelAttributeValue; - } - - public void setModelAttributeValue(KeyNamePair modelAttributeValue) - { - this.modelAttributeValue = modelAttributeValue; - } - - - public KeyNamePair getTransmissionAttributeValue() - { - return transmissionAttributeValue; - } - - public void setTransmissionAttributeValue(KeyNamePair transmissionAttributeValue) - { - this.transmissionAttributeValue = transmissionAttributeValue; - } - - public KeyNamePair getYearAttributeValue() - { - return yearAttributeValue; - } - - public void setYearAttributeValue(KeyNamePair yearAttributeValue) - { - this.yearAttributeValue = yearAttributeValue; - } - - public KeyNamePair getMakeAttributeValue() - { - return makeAttributeValue; - } - - public void setMakeAttributeValue(KeyNamePair makeAttributeValue) - { - this.makeAttributeValue = makeAttributeValue; - } - - public KeyNamePair getModelGroupAttributeValue() - { - return modelGroupAttributeValue; - } - - public void setModelGroupAttributeValue(KeyNamePair modelGroupAttributeValue) - { - this.modelGroupAttributeValue = modelGroupAttributeValue; - } - - public KeyNamePair getDesignAttributeValue() - { - return designAttributeValue; - } - - public void setDesignAttributeValue(KeyNamePair designAttributeValue) - { - this.designAttributeValue = designAttributeValue; - } - - public KeyNamePair getSizeAttributeValue() - { - return sizeAttributeValue; - } - - public void setSizeAttributeValue(KeyNamePair sizeAttributeValue) - { - this.sizeAttributeValue = sizeAttributeValue; - } - - public KeyNamePair getStyleAttributeValue() - { - return styleAttributeValue; - } - - public void setStyleAttributeValue(KeyNamePair styleAttributeValue) - { - this.styleAttributeValue = styleAttributeValue; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/AvailableProductSizeBean.java b/posterita/posterita/src/main/org/posterita/beans/AvailableProductSizeBean.java deleted file mode 100644 index 812291f8bd..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/AvailableProductSizeBean.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - **/ -package org.posterita.beans; - - -public class AvailableProductSizeBean extends UDIBean -{ - private Boolean existsInSmall = Boolean.valueOf(false); - private Boolean existsInMedium = Boolean.valueOf(false); - private Boolean existsInLarge = Boolean.valueOf(false); - private Boolean existsInXLarge = Boolean.valueOf(false); - - public Boolean getExistsInLarge() - { - return existsInLarge; - } - - public void setExistsInLarge(Boolean existsInLarge) - { - this.existsInLarge = existsInLarge; - } - - public Boolean getExistsInMedium() - { - return existsInMedium; - } - - public void setExistsInMedium(Boolean existsInMedium) - { - this.existsInMedium = existsInMedium; - } - - public Boolean getExistsInSmall() - { - return existsInSmall; - } - - public void setExistsInSmall(Boolean existsInSmall) - { - this.existsInSmall = existsInSmall; - } - - public Boolean getExistsInXLarge() - { - return existsInXLarge; - } - - public void setExistsInXLarge(Boolean existsInXLarge) - { - this.existsInXLarge = existsInXLarge; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/BPartnerBean.java b/posterita/posterita/src/main/org/posterita/beans/BPartnerBean.java deleted file mode 100644 index 5a9fcc9542..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/BPartnerBean.java +++ /dev/null @@ -1,256 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ -package org.posterita.beans; - -import java.math.BigDecimal; - -public class BPartnerBean -{ - protected String postalCode; - protected Integer orgId; - protected String countryName; - protected Integer countryId; - protected String name2; - protected Integer bpartnerId; - protected String partnerName; - protected Boolean isCustomer; - protected Boolean isEmployee; - protected Boolean isSalesRep; - protected Boolean isVendor; - protected String phone; - protected String address1; - protected String city; - protected String postalAddress; - protected Integer regionId; - protected Boolean isActive; - protected Integer locationId; - protected String address2; - protected String fax; - protected BigDecimal openBalance; - protected BigDecimal actualLifetimeValue; - protected BigDecimal creditLimit; - protected BigDecimal creditUsed; - - public String getPostalCode() - { - return postalCode; - } - - public void setPostalCode(String postalCode) - { - this.postalCode = postalCode; - } - - public Integer getOrgId() { - return orgId; - } - - public void setOrgId(Integer orgId) { - this.orgId = orgId; - } - - public String getCountryName() - { - return countryName; - } - - public void setCountryName(String countryName) - { - this.countryName = countryName; - } - - public Integer getCountryId() - { - return countryId; - } - - public void setCountryId(Integer countryId) - { - this.countryId = countryId; - } - - public String getName2() - { - return name2; - } - public void setName2(String name2) - { - this.name2 = name2; - } - public Integer getBpartnerId() - { - return bpartnerId; - } - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - - public String getPartnerName() - { - return partnerName; - } - public void setPartnerName(String partnerName) - { - this.partnerName = partnerName; - } - public Boolean getIsCustomer() - { - return isCustomer; - } - public void setIsCustomer(Boolean isCustomer) - { - this.isCustomer = isCustomer; - } - public Boolean getIsEmployee() - { - return isEmployee; - } - public void setIsEmployee(Boolean isEmployee) - { - this.isEmployee = isEmployee; - } - public Boolean getIsSalesRep() - { - return isSalesRep; - } - public void setIsSalesRep(Boolean isSalesRep) - { - this.isSalesRep = isSalesRep; - } - public Boolean getIsVendor() - { - return isVendor; - } - public void setIsVendor(Boolean isVendor) - { - this.isVendor = isVendor; - } - public String getPhone() - { - return phone; - } - public void setPhone(String phone) - { - this.phone = phone; - } - - public String getAddress1() - { - return address1; - } - public void setAddress1(String address1) - { - this.address1 = address1; - } - public String getCity() - { - return city; - } - public void setCity(String city) - { - this.city = city; - } - - public String getPostalAddress() - { - return postalAddress; - } - public void setPostalAddress(String postalAddress) - { - this.postalAddress = postalAddress; - } - - public Integer getRegionId() - { - return regionId; - } - public void setRegionId(Integer regionId) - { - this.regionId = regionId; - } - - public Boolean getIsActive() - { - return isActive; - } - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - public Integer getLocationId() - { - return locationId; - } - public void setLocationId(Integer locationId) - { - this.locationId = locationId; - } - public String getAddress2() - { - return address2; - } - public void setAddress2(String address2) - { - this.address2 = address2; - } - public String getFax() - { - return fax; - } - public void setFax(String fax) - { - this.fax = fax; - } - - public BigDecimal getOpenBalance() { - return openBalance; - } - - public void setOpenBalance(BigDecimal openBalance) { - this.openBalance = openBalance; - } - - public BigDecimal getActualLifetimeValue() { - return actualLifetimeValue; - } - - public void setActualLifetimeValue(BigDecimal actualLifetimeValue) { - this.actualLifetimeValue = actualLifetimeValue; - } - - public BigDecimal getCreditLimit() { - return creditLimit; - } - - public void setCreditLimit(BigDecimal creditLimit) { - this.creditLimit = creditLimit; - } - - public BigDecimal getCreditUsed() { - return creditUsed; - } - - public void setCreditUsed(BigDecimal creditUsed) { - this.creditUsed = creditUsed; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/BPartnerInfoBean.java b/posterita/posterita/src/main/org/posterita/beans/BPartnerInfoBean.java deleted file mode 100644 index 3cdc47da78..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/BPartnerInfoBean.java +++ /dev/null @@ -1,264 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 26, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; - - -public class BPartnerInfoBean extends UDIBean -{ - - protected String soCreditStatus; - protected String forward; - - public String getForward() - { - return forward; - } - - public void setForward(String forward) - { - this.forward = forward; - } - - public String getBpfirstSale() - { - return bpfirstSale; - } - - public void setBpfirstSale(String bpfirstSale) - { - this.bpfirstSale = bpfirstSale; - } - - public String getSoCreditStatus() - { - return soCreditStatus; - } - - public void setSoCreditStatus(String soCreditStatus) - { - this.soCreditStatus = soCreditStatus; - } - - public Integer getDunningId() - { - return dunningId; - } - - public void setDunningId(Integer dunningId) - { - this.dunningId = dunningId; - } - - public Integer[] getBpartnerIds() - { - return bpartnerIds; - } - - public void setBpartnerIds(Integer[] bpartnerIds) - { - this.bpartnerIds = bpartnerIds; - } - - public BigDecimal getCreditLimit() - { - return creditLimit; - } - - public void setCreditLimit(BigDecimal creditLimit) - { - this.creditLimit = creditLimit; - } - - public BigDecimal getCreditUsed() - { - return creditUsed; - } - - public void setCreditUsed(BigDecimal creditUsed) - { - this.creditUsed = creditUsed; - } - - public BigDecimal getOpenAmt() - { - return openAmt; - } - - public void setOpenAmt(BigDecimal openAmt) - { - this.openAmt = openAmt; - } - - public BigDecimal getRevenue() - { - return revenue; - } - - public void setRevenue(BigDecimal revenue) - { - this.revenue = revenue; - } - - public BigDecimal getAmount() - { - return amount; - } - - public void setAmount(BigDecimal amount) - { - this.amount = amount; - } - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - public String getProductName() - { - return productName; - } - - public void setProductName(String productName) - { - this.productName = productName; - } - - public String getAddress1() - { - return address1; - } - - public void setAddress1(String address1) - { - this.address1 = address1; - } - - public String getAddress2() - { - return address2; - } - - public void setAddress2(String address2) - { - this.address2 = address2; - } - - public String getCity() - { - return city; - } - - public void setCity(String city) - { - this.city = city; - } - - public Boolean getIsCustomer() - { - return isCustomer; - } - - public void setIsCustomer(Boolean isCustomer) - { - this.isCustomer = isCustomer; - } - - public Integer getBpartnerId() - { - return bpartnerId; - } - - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - - public String getEmail() - { - return email; - } - - public void setEmail(String email) - { - this.email = email; - } - - public String getFax() - { - return fax; - } - - public void setFax(String fax) - { - this.fax = fax; - } - - public String getPartnerName() - { - return partnerName; - } - - public void setPartnerName(String partnerName) - { - this.partnerName = partnerName; - } - - public String getPhone2() - { - return phone2; - } - - public void setPhone2(String phone2) - { - this.phone2 = phone2; - } - - public String getPhone() - { - return phone; - } - - public void setPhone(String phone) - { - this.phone = phone; - } - - public BigDecimal getQuantity() - { - return quantity; - } - - public void setQuantity(BigDecimal quantity) - { - this.quantity = quantity; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/BankAccountBean.java b/posterita/posterita/src/main/org/posterita/beans/BankAccountBean.java deleted file mode 100644 index 30d004557e..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/BankAccountBean.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 26, 2005 by praveen - * - */ -package org.posterita.beans; - -public class BankAccountBean extends UDIBean -{ - public String getAccountNo() - { - return accountNo; - } - - public void setAccountNo(String accountNo) - { - this.accountNo = accountNo; - } - - public String getAccountType() - { - return accountType; - } - - public void setAccountType(String accountType) - { - this.accountType = accountType; - } - - public Integer getBankId() - { - return bankId; - } - - public void setBankId(Integer bankId) - { - this.bankId = bankId; - } - - public Double getCurrentBalance() - { - return currentBalance; - } - - public void setCurrentBalance(Double currentBalance) - { - this.currentBalance = currentBalance; - } - - public String getBankName() - { - return bankName; - } - - public void setBankName(String bankName) - { - this.bankName = bankName; - } - - public String getSummary() - { - return bankName + " - " + accountNo; - } - - /** - * @return the bankAccountId - */ - public Integer getBankAccountId() - { - return bankAccountId; - } - - /** - * @param bankAccountId the bankAccountId to set - */ - public void setBankAccountId(Integer bankAccountId) - { - this.bankAccountId = bankAccountId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/BankBean.java b/posterita/posterita/src/main/org/posterita/beans/BankBean.java deleted file mode 100644 index 127791ac04..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/BankBean.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Jul-2005 by alok - * - */ -package org.posterita.beans; - - -public class BankBean extends UDIBean -{ - public String getAddress1() - { - return address1; - } - public void setAddress1(String address1) - { - this.address1 = address1; - } - - public Integer getBankId() - { - return bankId; - } - public void setBankId(Integer bankId) - { - this.bankId = bankId; - } - public String getBankName() - { - return bankName; - } - public void setBankName(String bankName) - { - this.bankName = bankName; - } - public String getCity() - { - return city; - } - public void setCity(String city) - { - this.city = city; - } - public String getPostalAddress() - { - return postalAddress; - } - public void setPostalAddress(String postalAddress) - { - this.postalAddress = postalAddress; - } - public String getRoutingNumber() - { - return routingNumber; - } - public void setRoutingNumber(String routingNumber) - { - this.routingNumber = routingNumber; - } - public Integer getLocationId() - { - return locationId; - } - public void setLocationId(Integer locationId) - { - this.locationId = locationId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/BankStatementLineBean.java b/posterita/posterita/src/main/org/posterita/beans/BankStatementLineBean.java deleted file mode 100644 index 11b0769599..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/BankStatementLineBean.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; - - -public class BankStatementLineBean -{ - private Timestamp dateTrx; - private String documentNo; - private int paymentId; - private int currencyId; - private String isoCode; - private BigDecimal payAmt; - private BigDecimal currencyConvert; - private String bpName; - - - public String getBpName() - { - return bpName; - } - - public void setBpName(String bpName) - { - this.bpName = bpName; - } - - public BigDecimal getCurrencyConvert() - { - return currencyConvert; - } - - public void setCurrencyConvert(BigDecimal currencyConvert) - { - this.currencyConvert = currencyConvert; - } - - public int getCurrencyId() - { - return currencyId; - } - - public void setCurrencyId(int currencyId) - { - this.currencyId = currencyId; - } - public Timestamp getDateTrx() - { - return dateTrx; - } - - public void setDateTrx(Timestamp dateTrx) - { - this.dateTrx = dateTrx; - } - - public String getDocumentNo() - { - return documentNo; - } - - public void setDocumentNo(String documentNo) { - this.documentNo = documentNo; - } - - public String getIsoCode() - { - return isoCode; - } - - - public void setIsoCode(String isoCode) - { - this.isoCode = isoCode; - } - public BigDecimal getPayAmt() { - return payAmt; - } - - public void setPayAmt(BigDecimal payAmt) - { - this.payAmt = payAmt; - } - - public int getPaymentId() - { - return paymentId; - } - - public void setPaymentId(int paymentId) - { - this.paymentId = paymentId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/BlackListedBean.java b/posterita/posterita/src/main/org/posterita/beans/BlackListedBean.java deleted file mode 100644 index 71a2b0c169..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/BlackListedBean.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - **/ -package org.posterita.beans; - -public class BlackListedBean extends UDIBean -{ - - public String getBlackListedBankName() - { - return blackListedBankName; - } - public void setBlackListedBankName(String blackListedBankName) - { - this.blackListedBankName = blackListedBankName; - } - public String getBlackListedChequeNo() - { - return blackListedChequeNo; - } - public void setBlackListedChequeNo(String blackListedChequeNo) - { - this.blackListedChequeNo = blackListedChequeNo; - } - public Integer getBlackListedId() - { - return blackListedId; - } - public void setBlackListedId(Integer blackListedId) - { - this.blackListedId = blackListedId; - } - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CashBean.java b/posterita/posterita/src/main/org/posterita/beans/CashBean.java deleted file mode 100644 index f1cd43f794..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CashBean.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 3, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; - - -public class CashBean extends UDIBean -{ - - public Integer getCashId() - { - return cashId; - } - public void setCashId(Integer cashId) - { - this.cashId = cashId; - } - public Timestamp getDateAcct() - { - return dateAcct; - } - public void setDateAcct(Timestamp dateAcct) - { - this.dateAcct = dateAcct; - } - public Timestamp getDateCreated() - { - return dateCreated; - } - public void setDateCreated(Timestamp dateCreated) - { - this.dateCreated = dateCreated; - } - public Timestamp getDateUpdated() - { - return dateUpdated; - } - public void setDateUpdated(Timestamp dateUpdated) - { - this.dateUpdated = dateUpdated; - } - public String getName() - { - return name; - } - public void setName(String name) - { - this.name = name; - } - public String getStatmentDate() - { - return statmentDate; - } - public void setStatmentDate(String statmentDate) - { - this.statmentDate = statmentDate; - } - public String getCashJournalDisc() - { - return cashJournalDisc; - } - public void setCashJournalDisc(String cashJournalDisc) - { - this.cashJournalDisc = cashJournalDisc; - } - public Integer getCashJournalId() - { - return cashJournalId; - } - public void setCashJournalId(Integer cashJournalId) - { - this.cashJournalId = cashJournalId; - } - public String getCashJournalName() - { - return cashJournalName; - } - public void setCashJournalName(String cashJournalName) - { - this.cashJournalName = cashJournalName; - } - public BigDecimal getBeginingBalance() - { - return beginingBalance; - } - - public void setBeginingBalance(BigDecimal beginingBalance) - { - this.beginingBalance = beginingBalance; - } - - public BigDecimal getEndingBalance() - { - return endingBalance; - } - - public void setEndingBalance(BigDecimal endingBalance) - { - this.endingBalance = endingBalance; - } - public String getDocStatus() - { - return docStatus; - } - public void setDocStatus(String docStatus) - { - this.docStatus = docStatus; - } - public String toString() - { - StringBuffer buffer = new StringBuffer(); - buffer.append("\n The Begining Balance = "+getBeginingBalance()); - buffer.append("\n The Ending Balance = "+getEndingBalance()); - - return buffer.toString(); - } -} - diff --git a/posterita/posterita/src/main/org/posterita/beans/CashBookBean.java b/posterita/posterita/src/main/org/posterita/beans/CashBookBean.java deleted file mode 100644 index 09034c35fe..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CashBookBean.java +++ /dev/null @@ -1,155 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.beans; - -/** - * @author Ashley G Ramdass - * May 2, 2008 - */ -public class CashBookBean extends UDIBean -{ - /** - * @return the cashBookId - */ - public Integer getCashBookId() - { - return (cashBookId == null ? 0 : cashBookId); - } - - /** - * @param cashBookId the cashBookId to set - */ - public void setCashBookId(Integer cashBookId) - { - this.cashBookId = cashBookId; - } - - /** - * @return the cashBookName - */ - public String getCashBookName() - { - return cashBookName; - } - - /** - * @param cashBookName the cashBookName to set - */ - public void setCashBookName(String cashBookName) - { - this.cashBookName = cashBookName; - } - - /** - * @return the description - */ - public String getDescription() - { - return description; - } - - /** - * @param description the description to set - */ - public void setDescription(String description) - { - this.description = description; - } - - /** - * @return the isActive - */ - public Boolean getIsActive() - { - return isActive; - } - - /** - * @param isActive the isActive to set - */ - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - - /** - * @return the isDefault - */ - public Boolean getIsDefault() - { - return isDefault; - } - - /** - * @param isDefault the isDefault to set - */ - public void setIsDefault(Boolean isDefault) - { - this.isDefault = isDefault; - } - - /** - * @return the orgId - */ - public Integer getOrgId() - { - return orgId; - } - - /** - * @param orgId the orgId to set - */ - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - /** - * @return The currencyId - */ - public Integer getCurrencyId() - { - return (currencyId == null ? 0 : currencyId); - } - - /** - * @param currencyId The currencyId to set - */ - public void setCurrencyId(Integer currencyId) - { - this.currencyId = currencyId; - } - - /** - * @return The currency - */ - public String getCurrency() - { - return currency; - } - - /** - * @param currency The currency to set - */ - public void setCurrency(String currency) - { - this.currency = currency; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CashBookDetailBean.java b/posterita/posterita/src/main/org/posterita/beans/CashBookDetailBean.java deleted file mode 100644 index cf4b10ccce..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CashBookDetailBean.java +++ /dev/null @@ -1,247 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 3, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; - - -public class CashBookDetailBean extends UDIBean -{ - public String getTransferType() - { - return transferType; - } - - public void setTransferType(String transferType) - { - this.transferType = transferType; - } - - public BigDecimal getDifferenceAmt() - { - return differenceAmt; - } - - public void setDifferenceAmt(BigDecimal differenceAmt) - { - this.differenceAmt = differenceAmt; - } - - public BigDecimal getAdjustmentAmount() - { - return adjustmentAmount; - } - - public void setAdjustmentAmount(BigDecimal adjustmentAmount) - { - this.adjustmentAmount = adjustmentAmount; - } - - public Boolean getTransferAllAmount() - { - return transferAllAmount; - } - public void setTransferAllAmount(Boolean transferAllAmount) - { - this.transferAllAmount = transferAllAmount; - } - public String getBeginingBalanceAsString() - { - return beginingBalanceAsString; - } - public void setBeginingBalanceAsString(String beginingBalanceAsString) - { - this.beginingBalanceAsString = beginingBalanceAsString; - } - public String getEndingBalanceAsString() - { - return endingBalanceAsString; - } - public void setEndingBalanceAsString(String endingBalanceAsString) - { - this.endingBalanceAsString = endingBalanceAsString; - } - public BigDecimal getTransferAmount() - { - return transferAmount; - } - public void setTransferAmount(BigDecimal transferAmount) - { - this.transferAmount = transferAmount; - } - public Integer getCashJournalId() - { - return cashJournalId; - } - public void setCashJournalId(Integer cashJournalId) - { - this.cashJournalId = cashJournalId; - } - public Integer getCashBookId() - { - return cashBookId; - } - - public void setCashBookId(Integer cashBookId) - { - this.cashBookId = cashBookId; - } - public String getCashJournalName() - { - return cashJournalName; - } - public void setCashJournalName(String cashJournalName) - { - this.cashJournalName = cashJournalName; - } - public String getCashJournalDisc() - { - return cashJournalDisc; - } - public void setCashJournalDisc(String cashJournalDisc) - { - this.cashJournalDisc = cashJournalDisc; - } - public void setDateAcct(Timestamp dateAcct) - { - this.dateAcct = dateAcct; - } - public BigDecimal getBeginingBalance() - { - return beginingBalance; - } - - public void setBeginingBalance(BigDecimal beginingBalance) - { - this.beginingBalance = beginingBalance; - } - public BigDecimal getEndingBalance() - { - return endingBalance; - } - - public void setEndingBalance(BigDecimal endingBalance) - { - this.endingBalance = endingBalance; - } - public BigDecimal getStatementDifference() - { - return statementDifference; - } - - public void setStatementDifference(BigDecimal statementDifference) - { - this.statementDifference = statementDifference; - } - public String getDocStatus() { - return docStatus; - } - public void setDocStatus(String docStatus) { - this.docStatus = docStatus; - } - public String getCashBookName() - { - return cashBookName; - } - - public void setCashBookName(String cashBookName) - { - this.cashBookName = cashBookName; - } - - public BigDecimal getCardTotal() - { - return cardTotal; - } - - public void setCardTotal(BigDecimal cardTotal) - { - this.cardTotal=cardTotal; - } - - public BigDecimal getChequeTotal() - { - return chequeTotal; - } - - public void setChequeTotal(BigDecimal chequeTotal) - { - this.chequeTotal=chequeTotal; - } - - public BigDecimal getCardDifference() - { - return cardDifference; - } - public void setCardDifference(BigDecimal cardDifference) - { - this.cardDifference = cardDifference; - } - public BigDecimal getChequeDifference() - { - return chequeDifference; - } - public void setChequeDifference(BigDecimal chequeDifference) - { - this.chequeDifference = chequeDifference; - } - public String toString() - { - StringBuffer buffer = new StringBuffer(); - buffer.append("\n The Begining Balance = "+getBeginingBalance()); - buffer.append("\n The Ending Balance = "+getEndingBalance()); - - return buffer.toString(); - - } - - /** - * @return The description - */ - public String getDescription() - { - return description; - } - - /** - * @param description - * The description to set - */ - public void setDescription(String description) - { - this.description = description; - } - - private int cash_id; - - public int getCash_id() { - return cash_id; - } - - public void setCash_id(int cash_id) { - this.cash_id = cash_id; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CashLineBean.java b/posterita/posterita/src/main/org/posterita/beans/CashLineBean.java deleted file mode 100644 index 21c41d9ced..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CashLineBean.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Sep 11, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; - -public class CashLineBean extends UDIBean -{ - public Integer getCashId() - { - return cashId; - } - - public void setCashId(Integer cashId) - { - this.cashId = cashId; - } - - public BigDecimal getAmount() - { - return amount; - } - - public void setAmount(BigDecimal amount) - { - this.amount = amount; - } - - public Integer getCashLineId() - { - return cashLineId; - } - - public void setCashLineId(Integer cashLineId) - { - this.cashLineId = cashLineId; - } - - public String getCashType() - { - return cashType; - } - - public void setCashType(String cashType) - { - this.cashType = cashType; - } - - public String getCurrency() - { - return currency; - } - - public void setCurrency(String currency) - { - this.currency = currency; - } - - public Timestamp getDateCreated() - { - return dateCreated; - } - - public void setDateCreated(Timestamp dateCreated) - { - this.dateCreated = dateCreated; - } - - public Integer getInvoiceId() - { - return invoiceId; - } - - public void setInvoiceId(Integer invoiceId) - { - this.invoiceId = invoiceId; - } - - public String getCashTypeName() - { - return cashTypeName; - } - - public void setCashTypeName(String cashTypeName) - { - this.cashTypeName = cashTypeName; - } - - /** - * @return The description - */ - public String getDescription() - { - return description; - } - - /** - * @param description The description to set - */ - public void setDescription(String description) - { - this.description = description; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CashSummaryBean.java b/posterita/posterita/src/main/org/posterita/beans/CashSummaryBean.java deleted file mode 100644 index 1384866487..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CashSummaryBean.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Sep 11, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.beans; - -import java.math.BigDecimal; - -import org.compiere.util.Env; - -public class CashSummaryBean extends UDIBean -{ - public CashSummaryBean() - { - this.setBankAcctTransferAmount(Env.ZERO); - this.setChargeAmount(Env.ZERO); - this.setDifferenceAmount(Env.ZERO); - this.setGeneralExpenseAmount(Env.ZERO); - this.setGeneralReceiptsAmount(Env.ZERO); - this.setInvoiceAmount(Env.ZERO); - } - - public Integer getCashId() - { - return cashId; - } - - public void setCashId(Integer cashId) - { - this.cashId = cashId; - } - - public BigDecimal getBankAcctTransferAmount() - { - return bankAcctTransferAmount; - } - - public void setBankAcctTransferAmount(BigDecimal bankAcctTransferAmount) - { - this.bankAcctTransferAmount = bankAcctTransferAmount; - } - - public BigDecimal getChargeAmount() - { - return chargeAmount; - } - - public void setChargeAmount(BigDecimal chargeAmount) - { - this.chargeAmount = chargeAmount; - } - - public BigDecimal getDifferenceAmount() - { - return differenceAmount; - } - - public void setDifferenceAmount(BigDecimal differenceAmount) - { - this.differenceAmount = differenceAmount; - } - - public BigDecimal getGeneralExpenseAmount() - { - return generalExpenseAmount; - } - - public void setGeneralExpenseAmount(BigDecimal generalExpenseAmount) - { - this.generalExpenseAmount = generalExpenseAmount; - } - - public BigDecimal getGeneralReceiptsAmount() - { - return generalReceiptsAmount; - } - - public void setGeneralReceiptsAmount(BigDecimal generalReceiptsAmount) - { - this.generalReceiptsAmount = generalReceiptsAmount; - } - - public BigDecimal getInvoiceAmount() - { - return invoiceAmount; - } - - public void setInvoiceAmount(BigDecimal invoiceAmount) - { - this.invoiceAmount = invoiceAmount; - } - - /** - * @return The beginingBalance - */ - public BigDecimal getBeginingBalance() - { - return beginingBalance; - } - - /** - * @param beginingBalance The beginingBalance to set - */ - public void setBeginingBalance(BigDecimal beginingBalance) - { - this.beginingBalance = beginingBalance; - } - - /** - * @return The endingBalance - */ - public BigDecimal getEndingBalance() - { - return endingBalance; - } - - /** - * @param endingBalance The endingBalance to set - */ - public void setEndingBalance(BigDecimal endingBalance) - { - this.endingBalance = endingBalance; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ChangeDocumentStatusBean.java b/posterita/posterita/src/main/org/posterita/beans/ChangeDocumentStatusBean.java deleted file mode 100644 index 1d049fbf32..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ChangeDocumentStatusBean.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - - -public class ChangeDocumentStatusBean extends DocumentBean -{ - - public String getTrackingNo() - { - return trackingNo; - } - public void setTrackingNo(String trackingNo) - { - this.trackingNo = trackingNo; - } - public Integer getAllocationId() - { - return allocationId; - } - public void setAllocationId(Integer allocationId) - { - this.allocationId = allocationId; - } - public String getPoReference() - { - return poReference; - } - - public void setPoReference(String poReference) - { - this.poReference = poReference; - } - - public void setAgreement(Boolean agreement) - { - this.agreement = agreement; - } - - public Boolean getAgreement() - { - return agreement; - } - - public String getSubmit() - { - return submit; - } - - public void setSubmit(String submit) - { - this.submit = submit; - } - - public Integer getTradeInOrderlineId() - { - return tradeInOrderlineId; - } - - public void setTradeInOrderlineId(Integer tradeInOrderlineId) - { - this.tradeInOrderlineId = tradeInOrderlineId; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ChangePasswordBean.java b/posterita/posterita/src/main/org/posterita/beans/ChangePasswordBean.java deleted file mode 100644 index 747ae4b146..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ChangePasswordBean.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 29, 2005 by din - */ - -package org.posterita.beans; - -public class ChangePasswordBean extends UDIBean -{ - - public String getPassword() - { - return password; - } - public void setPassword(String password) - { - this.password = password; - } - - public String getNewPassword() - { - return newPassword; - } - public void setNewPassword(String newPassword) - { - this.newPassword = newPassword; - } - - public String getConfirmPassword() - { - return confirmPassword; - } - - public void setConfirmPassword(String confirmPassword) - { - this.confirmPassword = confirmPassword; - } - - public String getOldPassword() - { - return oldPassword; - } - public void setOldPassword(String oldPassword) - { - this.oldPassword = oldPassword; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CheckoutBean.java b/posterita/posterita/src/main/org/posterita/beans/CheckoutBean.java deleted file mode 100644 index 4c27dbb4ed..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CheckoutBean.java +++ /dev/null @@ -1,375 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * Mar 21, 2008 10:31:54 AM by praveen - * - */ - -package org.posterita.beans; - -import java.math.BigDecimal; - -import org.compiere.model.MOrder; -import org.posterita.Constants; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; - -public class CheckoutBean -{ - private BigDecimal amountTendered; - private BigDecimal amountRefunded; - private String cardType; - private String cardNo; - private String chequeNo; - private BigDecimal cashAmt; - private BigDecimal chequeAmt; - private BigDecimal cardAmt; - private Integer bpartnerId; - private String tenderType; - private String paymentRule; - private BigDecimal discount[]; - private BigDecimal discountedPrice[]; - private Boolean[] isDiscOnInclUnitPrice; - private BigDecimal[] discInclUnitPrice; - private String orderType; - private BigDecimal discountLimit; - private Integer priceListId; - private Integer m_productId; - private Boolean toBeShipped; - private BigDecimal discountedTotal; - private Boolean discountOnTotal; - private Boolean discountOnTotalPercent; - private Boolean overridePriceLimit; - private Boolean isDiscountUptoLimitPrice; - private BigDecimal totalDiscount; - private BigDecimal writeOffAmt; - private BigDecimal discountAmt; - private BigDecimal totalAmount; - private Boolean isOverridePinOk; - private Boolean[] isDiscOnPerc; - private Boolean[] isDiscOnTotal; - private BigDecimal[] qtyPerLine; - private BigDecimal grandTotal; - protected Integer roleId; - - public BigDecimal[] getQtyPerLine() - { - return qtyPerLine; - } - public void setQtyPerLine(BigDecimal[] qtyPerLine) - { - this.qtyPerLine = qtyPerLine; - } - public Boolean[] getIsDiscOnPerc() - { - return isDiscOnPerc; - } - public void setIsDiscOnPerc(Boolean[] isDiscOnPerc) - { - this.isDiscOnPerc = isDiscOnPerc; - } - public Boolean[] getIsDiscOnTotal() - { - return isDiscOnTotal; - } - public void setIsDiscOnTotal(Boolean[] isDiscOnTotal) - { - this.isDiscOnTotal = isDiscOnTotal; - } - public Boolean getIsOverridePinOk() { - return isOverridePinOk; - } - public void setIsOverridePinOk(Boolean isOverridePinOk) { - this.isOverridePinOk = isOverridePinOk; - } - public BigDecimal getAmountTendered() { - return amountTendered; - } - public void setAmountTendered(BigDecimal amountTendered) { - this.amountTendered = amountTendered; - } - public String getCardNo() { - return cardNo; - } - public void setCardNo(String cardNo) { - this.cardNo = cardNo; - } - public String getChequeNo() { - return chequeNo; - } - public void setChequeNo(String chequeNo) { - this.chequeNo = chequeNo; - } - public BigDecimal getCashAmt() { - return cashAmt; - } - public void setCashAmt(BigDecimal cashAmt) { - this.cashAmt = cashAmt; - } - public BigDecimal getChequeAmt() { - return chequeAmt; - } - public void setChequeAmt(BigDecimal chequeAmt) { - this.chequeAmt = chequeAmt; - } - public Integer getBpartnerId() { - return bpartnerId; - } - public void setBpartnerId(Integer bpartnerId) { - this.bpartnerId = bpartnerId; - } - public String getTenderType() { - return tenderType; - } - public void setTenderType(String tenderType) throws OperationException { - this.tenderType = tenderType; - - //set payment rule - if(tenderType == null) return; - - if (Constants.PAYMENT_RULE_CASH.equalsIgnoreCase(tenderType)) - { - paymentRule=MOrder.PAYMENTRULE_Cash; - } - else if(Constants.PAYMENT_RULE_CARD.equalsIgnoreCase(tenderType)) - { - paymentRule=MOrder.PAYMENTRULE_CreditCard; - } - else if(Constants.PAYMENT_RULE_CHEQUE.equalsIgnoreCase(tenderType)) - { - paymentRule=MOrder.PAYMENTRULE_Check; - } - else if(Constants.PAYMENT_RULE_MIXED.equalsIgnoreCase(tenderType)) - { - paymentRule=UdiConstants.PAYMENTRULE_MIXED; - } - else if(Constants.PAYMENT_RULE_CREDIT.equalsIgnoreCase(tenderType)) - { - paymentRule=MOrder.PAYMENTRULE_OnCredit; - } - else - { - throw new OperationException("Invalid Payment Rule :" + tenderType); - } - } - public BigDecimal[] getDiscount() { - return discount; - } - public void setDiscount(BigDecimal[] discount) { - this.discount = discount; - } - public String getOrderType() { - return orderType; - } - public void setOrderType(String orderType) { - this.orderType = orderType; - } - public BigDecimal getDiscountLimit() { - return discountLimit; - } - public void setDiscountLimit(BigDecimal discountLimit) { - this.discountLimit = discountLimit; - } - public BigDecimal getAmountRefunded() { - return amountRefunded; - } - public void setAmountRefunded(BigDecimal amountRefunded) { - this.amountRefunded = amountRefunded; - } - public BigDecimal getCardAmt() { - return cardAmt; - } - public void setCardAmt(BigDecimal cardAmt) { - this.cardAmt = cardAmt; - } - public BigDecimal[] getDiscountedPrice() { - return discountedPrice; - } - public void setDiscountedPrice(BigDecimal[] discountedPrice) { - this.discountedPrice = discountedPrice; - } - public Integer getPriceListId() { - return priceListId; - } - public void setPriceListId(Integer priceListId) { - this.priceListId = priceListId; - } - public Boolean getToBeShipped() { - return toBeShipped; - } - public void setToBeShipped(Boolean toBeShipped) { - this.toBeShipped = toBeShipped; - } - public BigDecimal getDiscountedTotal() { - return discountedTotal; - } - public void setDiscountedTotal(BigDecimal discountedTotal) { - this.discountedTotal = discountedTotal; - } - public Boolean getDiscountOnTotal() { - return discountOnTotal; - } - public void setDiscountOnTotal(Boolean discountOnTotal) { - this.discountOnTotal = discountOnTotal; - } - public Boolean getOverridePriceLimit() { - return overridePriceLimit; - } - public void setOverridePriceLimit(Boolean overridePriceLimit) { - this.overridePriceLimit = overridePriceLimit; - } - public BigDecimal getTotalDiscount() { - return totalDiscount; - } - public void setTotalDiscount(BigDecimal totalDiscount) { - this.totalDiscount = totalDiscount; - } - /** - * @return the cardType - */ - public String getCardType() - { - return cardType; - } - /** - * @param cardType the cardType to set - */ - public void setCardType(String cardType) - { - this.cardType = cardType; - } - /** - * @return the writeOffAmt - */ - public BigDecimal getWriteOffAmt() - { - return writeOffAmt; - } - /** - * @param writeOffAmt the writeOffAmt to set - */ - public void setWriteOffAmt(BigDecimal writeOffAmt) - { - this.writeOffAmt = writeOffAmt; - } - /** - * @return the discountAmt - */ - public BigDecimal getDiscountAmt() - { - return discountAmt; - } - /** - * @param discountAmt the discountAmt to set - */ - public void setDiscountAmt(BigDecimal discountAmt) - { - this.discountAmt = discountAmt; - } - public Boolean[] getIsDiscOnInclUnitPrice() { - return isDiscOnInclUnitPrice; - } - public void setIsDiscOnInclUnitPrice(Boolean[] isDiscOnInclUnitPrice) { - this.isDiscOnInclUnitPrice = isDiscOnInclUnitPrice; - } - public BigDecimal[] getDiscInclUnitPrice() { - return discInclUnitPrice; - } - public void setDiscInclUnitPrice(BigDecimal[] discInclUnitPrice) { - this.discInclUnitPrice = discInclUnitPrice; - } - public Boolean getDiscountOnTotalPercent() { - return discountOnTotalPercent; - } - public void setDiscountOnTotalPercent(Boolean discountOnTotalPercent) { - this.discountOnTotalPercent = discountOnTotalPercent; - } - public String getPaymentRule() { - return paymentRule; - } - public void setPaymentRule(String paymentRule) { - this.paymentRule = paymentRule; - } - - public String getPaymentRuleFromTenderType() - { - if (Constants.PAYMENT_RULE_CASH.equalsIgnoreCase(tenderType)) - { - paymentRule=MOrder.PAYMENTRULE_Cash; - } - else if(Constants.PAYMENT_RULE_CARD.equalsIgnoreCase(tenderType)) - { - paymentRule=MOrder.PAYMENTRULE_CreditCard; - } - else if(Constants.PAYMENT_RULE_CHEQUE.equalsIgnoreCase(tenderType)) - { - paymentRule=MOrder.PAYMENTRULE_Check; - } - else if(Constants.PAYMENT_RULE_MIXED.equalsIgnoreCase(tenderType)) - { - paymentRule=UdiConstants.PAYMENTRULE_MIXED; - } - else if(Constants.PAYMENT_RULE_CREDIT.equalsIgnoreCase(tenderType)) - { - paymentRule=MOrder.PAYMENTRULE_OnCredit; - } - - return paymentRule; - - } - public BigDecimal getTotalAmount() - { - return totalAmount; - } - public void setTotalAmount(BigDecimal totalAmount) - { - this.totalAmount = totalAmount; - } - public Integer getM_productId() - { - return m_productId; - } - public void setM_productId(Integer id) - { - m_productId = id; - } - public Boolean getIsDiscountUptoLimitPrice() - { - return isDiscountUptoLimitPrice; - } - public void setIsDiscountUptoLimitPrice(Boolean isDiscountUptoLimitPrice) - { - this.isDiscountUptoLimitPrice = isDiscountUptoLimitPrice; - } - public BigDecimal getGrandTotal() - { - return grandTotal; - } - public void setGrandTotal(BigDecimal grandTotal) - { - this.grandTotal = grandTotal; - } - public Integer getRoleId() - { - return roleId; - } - public void setRoleId(Integer roleId) - { - this.roleId = roleId; - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/beans/CloseTillBean.java b/posterita/posterita/src/main/org/posterita/beans/CloseTillBean.java deleted file mode 100644 index 881aef21e2..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CloseTillBean.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * Aug 4, 2008 3:02:32 AM by praveen - * - */ - -package org.posterita.beans; - -import java.io.Serializable; -import java.math.BigDecimal; - -public class CloseTillBean implements Serializable -{ - /** - * - */ - private static final long serialVersionUID = -7556804983067360454L; - private String currency; - private String tillNo; - private String tillName; - private BigDecimal beginningBalance; - private BigDecimal netCashTrx; - private BigDecimal balanceEntered; - private BigDecimal difference; - private BigDecimal endingBalance; - private BigDecimal cashTotal; - private BigDecimal cardTotal; - private BigDecimal chequeTotal; - private BigDecimal grandTotal; - private BigDecimal cardAmtEntered; - private BigDecimal cardDifference; - private BigDecimal chequeAmtEntered; - private BigDecimal chequeDifference; - - public String getTillNo() { - return tillNo; - } - public void setTillNo(String tillNo) { - this.tillNo = tillNo; - } - public String getTillName() { - return tillName; - } - public void setTillName(String tillName) { - this.tillName = tillName; - } - public BigDecimal getBeginningBalance() { - return beginningBalance; - } - public void setBeginningBalance(BigDecimal beginningBalance) { - this.beginningBalance = beginningBalance; - } - public BigDecimal getNetCashTrx() { - return netCashTrx; - } - public void setNetCashTrx(BigDecimal netCashTrx) { - this.netCashTrx = netCashTrx; - } - public BigDecimal getBalanceEntered() { - return balanceEntered; - } - public void setBalanceEntered(BigDecimal balanceEntered) { - this.balanceEntered = balanceEntered; - } - public BigDecimal getDifference() { - return difference; - } - public void setDifference(BigDecimal difference) { - this.difference = difference; - } - public BigDecimal getEndingBalance() { - return endingBalance; - } - public void setEndingBalance(BigDecimal endingBalance) { - this.endingBalance = endingBalance; - } - public BigDecimal getCashTotal() { - return cashTotal; - } - public void setCashTotal(BigDecimal cashTotal) { - this.cashTotal = cashTotal; - } - public BigDecimal getCardTotal() { - return cardTotal; - } - public void setCardTotal(BigDecimal cardTotal) { - this.cardTotal = cardTotal; - } - public BigDecimal getChequeTotal() { - return chequeTotal; - } - public void setChequeTotal(BigDecimal chequeTotal) { - this.chequeTotal = chequeTotal; - } - public BigDecimal getGrandTotal() { - return grandTotal; - } - public void setGrandTotal(BigDecimal grandTotal) { - this.grandTotal = grandTotal; - } - public BigDecimal getCardAmtEntered() { - return cardAmtEntered; - } - public void setCardAmtEntered(BigDecimal cardAmtEntered) { - this.cardAmtEntered = cardAmtEntered; - } - public BigDecimal getCardDifference() { - return cardDifference; - } - public void setCardDifference(BigDecimal cardDifference) { - this.cardDifference = cardDifference; - } - public BigDecimal getChequeAmtEntered() { - return chequeAmtEntered; - } - public void setChequeAmtEntered(BigDecimal chequeAmtEntered) { - this.chequeAmtEntered = chequeAmtEntered; - } - public BigDecimal getChequeDifference() { - return chequeDifference; - } - public void setChequeDifference(BigDecimal chequeDifference) { - this.chequeDifference = chequeDifference; - } - public String getCurrency() { - return currency; - } - public void setCurrency(String currency) { - this.currency = currency; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CommandBean.java b/posterita/posterita/src/main/org/posterita/beans/CommandBean.java deleted file mode 100644 index c2c6826385..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CommandBean.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Jul-2005 by alok - * - */ -package org.posterita.beans; - - -public class CommandBean extends UDIBean -{ - - private String[] simpleCommand; - private String[] complexCommand; - - - public void setSimpleCommand(String[] simpleCommand) - { - this.simpleCommand = simpleCommand; - } - - public String[] getSimpleCommand() - { - return simpleCommand; - } - - - public void setComplexCommand(String[] complexCommand) - { - this.complexCommand = complexCommand; - } - - public String[] getComplexCommand() - { - return complexCommand; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CommissionBean.java b/posterita/posterita/src/main/org/posterita/beans/CommissionBean.java deleted file mode 100644 index b40d206c83..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CommissionBean.java +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 6, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; - - - -public class CommissionBean extends UDIBean -{ - - public BigDecimal getSubtractAmt() { - return subtractAmt; - } - public void setSubtractAmt(BigDecimal subtractAmt) { - this.subtractAmt = subtractAmt; - } - public Integer getInvoiceId() { - return invoiceId; - } - public void setInvoiceId(Integer invoiceId) { - this.invoiceId = invoiceId; - } - public Integer getOrderId() { - return orderId; - } - public void setOrderId(Integer orderId) { - this.orderId = orderId; - } - public String getPeriodAndCurrencyDesc() { - return periodAndCurrencyDesc; - } - public void setPeriodAndCurrencyDesc(String periodAndCurrencyDesc) { - this.periodAndCurrencyDesc = periodAndCurrencyDesc; - } - public BigDecimal getAmtMultiplier() { - return amtMultiplier; - } - public void setAmtMultiplier(BigDecimal amtMultiplier) { - this.amtMultiplier = amtMultiplier; - } - public String getDocBasisType() { - return docBasisType; - } - public void setDocBasisType(String docBasisType) { - this.docBasisType = docBasisType; - } - public String getFrequencyType() { - return frequencyType; - } - public void setFrequencyType(String frequencyType) { - this.frequencyType = frequencyType; - } - public BigDecimal getActualAmt() { - return actualAmt; - } - public void setActualAmt(BigDecimal actualAmt) { - this.actualAmt = actualAmt; - } - public BigDecimal getActualQty() { - return actualQty; - } - public void setActualQty(BigDecimal actualQty) { - this.actualQty = actualQty; - } - public BigDecimal getCommissionAmt() { - return commissionAmt; - } - public void setCommissionAmt(BigDecimal commissionAmt) { - this.commissionAmt = commissionAmt; - } - public Integer getCommissionAmtId() { - return commissionAmtId; - } - public void setCommissionAmtId(Integer commissionAmtId) { - this.commissionAmtId = commissionAmtId; - } - public Integer getCommissionDetailId() { - return commissionDetailId; - } - public void setCommissionDetailId(Integer commissionDetailId) { - this.commissionDetailId = commissionDetailId; - } - public Integer getCommissionLineId() { - return commissionLineId; - } - public void setCommissionLineId(Integer commissionLineId) { - this.commissionLineId = commissionLineId; - } - public String getCommissionLineName() { - return commissionLineName; - } - public void setCommissionLineName(String commissionLineName) { - this.commissionLineName = commissionLineName; - } - public Integer getCommissionRunId() { - return commissionRunId; - } - public void setCommissionRunId(Integer commissionRunId) { - this.commissionRunId = commissionRunId; - } - public BigDecimal getConvertedAmt() { - return convertedAmt; - } - public void setConvertedAmt(BigDecimal convertedAmt) { - this.convertedAmt = convertedAmt; - } - public Integer getCurrencyId() { - return currencyId; - } - public void setCurrencyId(Integer currencyId) { - this.currencyId = currencyId; - } - public String getInfo() { - return info; - } - public void setInfo(String info) { - this.info = info; - } - public Integer getInvoiceLineId() { - return invoiceLineId; - } - public void setInvoiceLineId(Integer invoiceLineId) { - this.invoiceLineId = invoiceLineId; - } - public Integer getOrderLineId() { - return orderLineId; - } - public void setOrderLineId(Integer orderLineId) { - this.orderLineId = orderLineId; - } - public String getReference() { - return reference; - } - public void setReference(String reference) { - this.reference = reference; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CreditCardBean.java b/posterita/posterita/src/main/org/posterita/beans/CreditCardBean.java deleted file mode 100644 index 7a4a2fe9a3..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CreditCardBean.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.beans; - -public class CreditCardBean extends UDIBean -{ - - - public String getPaymentMethod() - { - return paymentMethod; - } - public void setPaymentMethod(String paymentMethod) - { - this.paymentMethod = paymentMethod; - } - public String getCreditCardNumberEncrypted() - { - return creditCardNumberEncrypted; - } - public void setCreditCardNumberEncrypted(String creditCardNumberEncrypted) - { - this.creditCardNumberEncrypted = creditCardNumberEncrypted; - } - public String getCreditCardExpMonthName() - { - return creditCardExpMonthName; - } - public void setCreditCardExpMonthName(String creditCardExpMonthName) - { - this.creditCardExpMonthName = creditCardExpMonthName; - } - public String getAccountName() - { - return accountName; - } - public void setAccountName(String accountName) - { - this.accountName = accountName; - } - public String getCreditCardNumber() - { - return creditCardNumber; - } - - public void setCreditCardNumber(String creditCardNumber) - { - this.creditCardNumber = creditCardNumber; - } - - public String getCvv() - { - return cvv; - } - - public void setCvv(String cvv) - { - this.cvv = cvv; - } - - public Integer getCreditCardExpMonth() - { - return creditCardExpMonth; - } - - public void setCreditCardExpMonth(Integer creditCardExpMonth) - { - this.creditCardExpMonth = creditCardExpMonth; - } - - public Integer getCreditCardExpYear() - { - return creditCardExpYear; - } - - public void setCreditCardExpYear(Integer creditCardExpYear) - { - this.creditCardExpYear = creditCardExpYear; - } - public String getCreditCardType() - { - return creditCardType; - } - public void setCreditCardType(String creditCardType) - { - this.creditCardType = creditCardType; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CreditCheckBean.java b/posterita/posterita/src/main/org/posterita/beans/CreditCheckBean.java deleted file mode 100644 index 5ae045eaf2..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CreditCheckBean.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 1, 2006 - */ - - -package org.posterita.beans; - - - - -public class CreditCheckBean -{ - protected String msg; - protected Boolean valid; - - public String getMsg() { - return msg; - } - public void setMsg(String msg) { - this.msg = msg; - } - public Boolean getValid() { - return valid; - } - public void setValid(Boolean valid) { - this.valid = valid; - } - - - - - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CreditPaymentDetailsBean.java b/posterita/posterita/src/main/org/posterita/beans/CreditPaymentDetailsBean.java deleted file mode 100644 index d48ead320c..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CreditPaymentDetailsBean.java +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 25, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; - - -public class CreditPaymentDetailsBean extends UDIBean -{ - - - public Integer getCurrencyId() { - return currencyId; - } - public void setCurrencyId(Integer currencyId) { - this.currencyId = currencyId; - } - public String getCashBookName() { - return cashBookName; - } - public void setCashBookName(String cashBookName) { - this.cashBookName = cashBookName; - } - public Integer getCashId() { - return cashId; - } - public void setCashId(Integer cashId) { - this.cashId = cashId; - } - public Integer getCashLineId() { - return cashLineId; - } - public void setCashLineId(Integer cashLineId) { - this.cashLineId = cashLineId; - } - public String getCashType() { - return cashType; - } - public void setCashType(String cashType) { - this.cashType = cashType; - } - public String getCashTypeName() { - return cashTypeName; - } - public void setCashTypeName(String cashTypeName) { - this.cashTypeName = cashTypeName; - } - public String getChequeNo() { - return chequeNo; - } - public void setChequeNo(String chequeNo) { - this.chequeNo = chequeNo; - } - public String getCreditCardNumber() { - return creditCardNumber; - } - public void setCreditCardNumber(String creditCardNumber) { - this.creditCardNumber = creditCardNumber; - } - public Timestamp getDateCreated() { - return dateCreated; - } - public void setDateCreated(Timestamp dateCreated) { - this.dateCreated = dateCreated; - } - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public BigDecimal getDiscountAmt() { - return discountAmt; - } - public void setDiscountAmt(BigDecimal discountAmt) { - this.discountAmt = discountAmt; - } - public String getDocumentNo() { - return documentNo; - } - public void setDocumentNo(String documentNo) { - this.documentNo = documentNo; - } - public BigDecimal getInvoiceGrandTotal() { - return invoiceGrandTotal; - } - public void setInvoiceGrandTotal(BigDecimal invoiceGrandTotal) { - this.invoiceGrandTotal = invoiceGrandTotal; - } - public Integer getInvoiceId() { - return invoiceId; - } - public void setInvoiceId(Integer invoiceId) { - this.invoiceId = invoiceId; - } - public BigDecimal getPaidAmt() { - return paidAmt; - } - public void setPaidAmt(BigDecimal paidAmt) { - this.paidAmt = paidAmt; - } - public Integer getPaymentId() { - return paymentId; - } - public void setPaymentId(Integer paymentId) { - this.paymentId = paymentId; - } - public String getTenderType() { - return tenderType; - } - public void setTenderType(String tenderType) { - this.tenderType = tenderType; - } - public Integer getUserID() { - return userID; - } - public void setUserID(Integer userID) { - this.userID = userID; - } - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - public BigDecimal getWriteOffAmt() { - return writeOffAmt; - } - public void setWriteOffAmt(BigDecimal writeOffAmt) { - this.writeOffAmt = writeOffAmt; - } - - - - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CurrencyBean.java b/posterita/posterita/src/main/org/posterita/beans/CurrencyBean.java deleted file mode 100644 index c12ab4aa36..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CurrencyBean.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.posterita.beans; - -import java.math.BigDecimal; - -public class CurrencyBean extends UDIBean -{ - private Integer currencyId; - private BigDecimal roundOffFactor; - private Integer stdPrecision; - private String isoCode; - private String curSymbol; - private String description; - private boolean isActive; - - - public String getDescription() - { - return description; - } - public void setDescription(String description) - { - this.description = description; - } - public String getIsoCode() - { - return isoCode; - } - public void setIsoCode(String isoCode) - { - this.isoCode = isoCode; - } - public Integer getStdPrecision() - { - return stdPrecision; - } - public void setStdPrecision(Integer stdPrecision) - { - this.stdPrecision = stdPrecision; - } - public Integer getCurrencyId() - { - return currencyId; - } - public void setCurrencyId(Integer currencyId) - { - this.currencyId = currencyId; - } - - public BigDecimal getRoundOffFactor() - { - return roundOffFactor; - } - - public void setRoundOffFactor(BigDecimal roundOffFactor) - { - this.roundOffFactor = roundOffFactor; - } - public String getCurSymbol() - { - return curSymbol; - } - public void setCurSymbol(String curSymbol) - { - this.curSymbol = curSymbol; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CurrentTillAmountBean.java b/posterita/posterita/src/main/org/posterita/beans/CurrentTillAmountBean.java deleted file mode 100644 index 46c8fe3087..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CurrentTillAmountBean.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 5, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; - - -public class CurrentTillAmountBean extends UDIBean -{ - - - - public BigDecimal getBeginingBalance() { - return beginingBalance; - } - public void setBeginingBalance(BigDecimal beginingBalance) { - this.beginingBalance = beginingBalance; - } - public BigDecimal getStatementDifference() { - return statementDifference; - } - public void setStatementDifference(BigDecimal statementDifference) { - this.statementDifference = statementDifference; - } - public BigDecimal getTillGrandTotal() - { - return tillGrandTotal; - } - public void setTillGrandTotal(BigDecimal tillGrandTotal) - { - this.tillGrandTotal = tillGrandTotal; - } - public BigDecimal getCashTotal() - { - return cashTotal; - } - - public void setCashTotal(BigDecimal cashTotal) - { - this.cashTotal = cashTotal; - } - - public BigDecimal getCardTotal() - { - return cardTotal; - } - public void setCardTotal(BigDecimal cardTotal) - { - this.cardTotal = cardTotal; - } - public BigDecimal getChequeTotal() - { - return chequeTotal; - } - public void setChequeTotal(BigDecimal chequeTotal) - { - this.chequeTotal = chequeTotal; - } - - - public String getPosName() { - return posName; - } - public void setPosName(String posName) { - this.posName = posName; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/CustomerBean.java b/posterita/posterita/src/main/org/posterita/beans/CustomerBean.java deleted file mode 100644 index 0e5f885f61..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/CustomerBean.java +++ /dev/null @@ -1,584 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 02-Sep-2005 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; - -public class CustomerBean extends DocumentBean -{ - public Boolean isEditable; - - - - public Boolean getIsEditable() { - return isEditable; - } - - public void setIsEditable(Boolean isEditable) { - this.isEditable = isEditable; - } - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public String getPaymentTermName() { - return paymentTermName; - } - public void setPaymentTermName(String paymentTermName) { - this.paymentTermName = paymentTermName; - } - public Integer getPaymentTermId() { - return paymentTermId; - } - public void setPaymentTermId(Integer paymentTermId) { - this.paymentTermId = paymentTermId; - } - public String getCreditStatus() { - return creditStatus; - } - public void setCreditStatus(String creditStatus) { - this.creditStatus = creditStatus; - } - public BigDecimal getCreditLimit() { - return creditLimit; - } - public void setCreditLimit(BigDecimal creditLimit) { - this.creditLimit = creditLimit; - } - public Integer getDunningId() { - return dunningId; - } - public void setDunningId(Integer dunningId) { - this.dunningId = dunningId; - } - public Boolean getCreatingFromOrder() { - return creatingFromOrder; - } - public void setCreatingFromOrder(Boolean creatingFromOrder) { - this.creatingFromOrder = creatingFromOrder; - } - public Integer getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - public void setAttributeSetInstanceId(Integer attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - public Integer getProductId() - { - return productId; - } - public void setProductId(Integer productId) - { - this.productId = productId; - } - public Integer getLicensingDistrictId() { - return licensingDistrictId; - } - public void setLicensingDistrictId(Integer licensingDistrictId) { - this.licensingDistrictId = licensingDistrictId; - } - public String getSurname() { - return surname; - } - public void setSurname(String surname) { - this.surname = surname; - } - public String getAaCardnumber() { - return aaCardnumber; - } - public String getAddress1() { - return address1; - } - public String getAddress2() { - return address2; - } - public String getCity() { - return city; - } - - public String getCustIdNumber() { - return custIdNumber; - } - - public String getMaintenanceContractNumber() { - return maintenanceContractNumber; - } - public String getMobile() { - return mobile; - } - public String getPartnerName() { - return partnerName; - } - - public String getPhone2() { - return phone2; - } - public String getPhone() { - return phone; - } - public String getPostalAddress1() { - return postalAddress1; - } - public String getPostalCity() { - return postalCity; - } - public String getPostalCode() { - return postalCode; - } - public String getPostalPostalCode() { - return postalPostalCode; - } - - - public Integer getRegionId() { - return regionId; - } - - public void setAaCardnumber(String aaCardnumber) { - this.aaCardnumber = aaCardnumber; - } - public void setAddress1(String address1) { - this.address1 = address1; - } - public void setAddress2(String address2) { - this.address2 = address2; - } - public void setCity(String city) { - this.city = city; - } - public void setCustIdNumber(String custIdNumber) { - this.custIdNumber = custIdNumber; - } - public void setMaintenanceContractNumber(String maintenanceContractNumber) { - this.maintenanceContractNumber = maintenanceContractNumber; - } - public void setMobile(String mobile) { - this.mobile = mobile; - } - public void setPartnerName(String partnerName) { - this.partnerName = partnerName; - } - public void setPhone2(String phone2) { - this.phone2 = phone2; - } - public void setPhone(String phone) { - this.phone = phone; - } - public void setPostalAddress1(String postalAddress1) { - this.postalAddress1 = postalAddress1; - } - public void setPostalCity(String postalCity) { - this.postalCity = postalCity; - } - public void setPostalCode(String postalCode) { - this.postalCode = postalCode; - } - public void setPostalPostalCode(String postalPostalCode) { - this.postalPostalCode = postalPostalCode; - } - public void setRegionId(Integer regionId) { - this.regionId = regionId; - } - - public Integer getBpartnerId() - { - return bpartnerId; - } - - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - - public String getLicensingDistrict() - { - return licensingDistrict; - } - - public void setLicensingDistrict(String licensingDistrict) - { - this.licensingDistrict = licensingDistrict; - } - - public String getRegion() - { - return region; - } - - public void setRegion(String region) - { - this.region = region; - } - - public String getCompanyRegNo() - { - return companyRegNo; - } - - public void setCompanyRegNo(String companyRegNo) - { - this.companyRegNo = companyRegNo; - } - - public String getPassportNo() - { - return passportNo; - } - - public void setPassportNo(String passportNo) - { - this.passportNo = passportNo; - } - - public String getEmail() - { - return email; - } - - public void setEmail(String email) - { - this.email = email; - } - - public Integer getSalesRepId() - { - return salesRepId; - } - - public void setSalesRepId(Integer salesRepId) - { - this.salesRepId = salesRepId; - } - - public String getMakeName() - { - return makeName; - } - - public void setMakeName(String makeName) - { - this.makeName = makeName; - } - - public String getModelName() - { - return modelName; - } - - public void setModelName(String modelName) - { - this.modelName = modelName; - } - - public String getYearName() - { - return yearName; - } - - public void setYearName(String yearName) - { - this.yearName = yearName; - } - - public Integer getCreditCardExpMonth() - { - return creditCardExpMonth; - } - - public void setCreditCardExpMonth(Integer creditCardExpMonth) - { - this.creditCardExpMonth = creditCardExpMonth; - } - - public Integer getCreditCardExpYear() - { - return creditCardExpYear; - } - - public void setCreditCardExpYear(Integer creditCardExpYear) - { - this.creditCardExpYear = creditCardExpYear; - } - - public String getCreditCardNumber() - { - return creditCardNumber; - } - - public void setCreditCardNumber(String creditCardNumber) - { - this.creditCardNumber = creditCardNumber; - } - - public String getPassword() - { - return password; - } - - public void setPassword(String password) - { - this.password = password; - } - - public String getConfirmPassword() - { - return confirmPassword; - } - - public void setConfirmPassword(String confirmPassword) - { - this.confirmPassword = confirmPassword; - } - - public String getCountryName() - { - return countryName; - } - - public void setCountryName(String countryName) - { - this.countryName = countryName; - } - - public String getPostalAddress() - { - return postalAddress; - } - - public void setPostalAddress(String postalAddress) - { - this.postalAddress = postalAddress; - } - - public String getUsername() - { - return username; - } - public void setUsername(String username) - { - this.username = username; - } - - public String getUserSurname() - { - return userSurname; - } - - public void setUserSurname(String userSurname) - { - this.userSurname = userSurname; - } - - public String getFax() - { - return fax; - } - - public void setFax(String fax) - { - this.fax = fax; - } - - public Integer getCountryId() - { - return countryId; - } - - public void setCountryId(Integer countryId) - { - this.countryId = countryId; - } - -/* public Integer getCvv() - { - return cvv; - } - - public void setCvv(Integer cvv) - { - this.cvv = cvv; - } -*/ - public String getCreditCardPayment() - { - return creditCardPayment; - } - - public void setCreditCardPayment(String creditCardPayment) - { - this.creditCardPayment = creditCardPayment; - } - - public String getShipmentMethod() - { - return shipmentMethod; - } - - public void setShipmentMethod(String shipmentMethod) - { - this.shipmentMethod = shipmentMethod; - } - - public String getBirthdate() - { - return birthdate; - } - public void setBirthdate(String birthdate) - { - this.birthdate = birthdate; - } - public String getStartDay() { - return startDay; - } - public void setStartDay(String startDay) { - this.startDay = startDay; - } - public String getStartMonth() { - return startMonth; - } - public void setStartMonth(String startMonth) { - this.startMonth = startMonth; - } - public String getStartYear() { - return startYear; - } - public void setStartYear(String startYear) { - this.startYear = startYear; - } - public Integer getUserId() { - return userId; - } - public void setUserId(Integer userId) { - this.userId = userId; - } - public Integer getPriceListId() - { - return priceListId; - } - - public void setPriceListId(Integer priceListId) - { - this.priceListId = priceListId; - } - - //---------------------------------------------- - private BigDecimal totalOpenBalance; - private BigDecimal creditLimit; - private BigDecimal creditUsed; - private BigDecimal creditAvailable; - - public BigDecimal getTotalOpenBalance() { - return totalOpenBalance; - } - - public void setTotalOpenBalance(BigDecimal totalOpenBalance) { - this.totalOpenBalance = totalOpenBalance; - } - - public BigDecimal getCreditUsed() { - return creditUsed; - } - - public void setCreditUsed(BigDecimal creditUsed) { - this.creditUsed = creditUsed; - } - - public BigDecimal getCreditAvailable() { - return creditAvailable; - } - - public void setCreditAvailable(BigDecimal creditAvailable) { - this.creditAvailable = creditAvailable; - } - - public String getBankName() - { - return bankName; - } - - public void setBankName(String bankName) - { - this.bankName = bankName; - } - - public String getAccountNo() - { - return accountNo; - } - - public void setAccountNo(String accountNo) - { - this.accountNo = accountNo; - } - - public String getBranch() - { - return branch; - } - - public void setBranch(String branch) - { - this.branch = branch; - } - - public String getPriceListName() - { - return priceListName; - } - - public void setPriceListName(String priceListName) - { - this.priceListName = priceListName; - } - - public String getSaleRepName() - { - return saleRepName; - } - - public void setSaleRepName(String saleRepName) - { - this.saleRepName = saleRepName; - } - - public String getTaxNo() - { - return taxNo; - } - - public void setTaxNo(String taxNo) - { - this.taxNo = taxNo; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/DateFilterBean.java b/posterita/posterita/src/main/org/posterita/beans/DateFilterBean.java deleted file mode 100644 index 94ab651d80..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/DateFilterBean.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Sep 11, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.beans; - -public class DateFilterBean extends UDIBean -{ - public String getFromDate() - { - return fromDate; - } - - public void setFromDate(String fromDate) - { - this.fromDate = fromDate; - } - - public String getToDate() - { - return toDate; - } - - public void setToDate(String toDate) - { - this.toDate = toDate; - } - - public String getStartDay() - { - return startDay; - } - - public void setStartDay(String startDay) - { - this.startDay = startDay; - } - - public String getStartMonth() - { - return startMonth; - } - - public void setStartMonth(String startMonth) - { - this.startMonth = startMonth; - } - - public String getStartYear() - { - return startYear; - } - - public void setStartYear(String startYear) - { - this.startYear = startYear; - } - - public String getEndDay() - { - return endDay; - } - - public void setEndDay(String endDay) - { - this.endDay = endDay; - } - - public String getEndMonth() - { - return endMonth; - } - - public void setEndMonth(String endMonth) - { - this.endMonth = endMonth; - } - - public String getEndYear() - { - return endYear; - } - - public void setEndYear(String endYear) - { - this.endYear = endYear; - } - - public String getStartHour() - { - return startHour; - } - - public void setStartHour(String startHour) - { - this.startHour = startHour; - } - - public String getStartMinute() - { - return startMinute; - } - - public void setStartMinute(String startMinute) - { - this.startMinute = startMinute; - } - - public String getEndHour() - { - return endHour; - } - - public void setEndHour(String endHour) - { - this.endHour = endHour; - } - - public String getEndMinute() - { - return endMinute; - } - - public void setEndMinute(String endMinute) - { - this.endMinute = endMinute; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/DisplayMessageLogBean.java b/posterita/posterita/src/main/org/posterita/beans/DisplayMessageLogBean.java deleted file mode 100644 index ce4c6afc89..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/DisplayMessageLogBean.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - -import java.sql.Timestamp; - - -public class DisplayMessageLogBean -{ - private String input; - private String output; - private String status; - private String type; - private String documentType; - private Timestamp date; - private Integer documentId; - private String reasonDescription; - - public Timestamp getDate() - { - return date; - } - - public void setDate(Timestamp date) - { - this.date = date; - } - - public String getDocumentType() - { - return documentType; - } - - public void setDocumentType(String documentType) - { - this.documentType = documentType; - } - - public String getInput() - { - return input; - } - - public void setInput(String input) - { - this.input = input; - } - - public String getOutput() - { - return output; - } - - public void setOutput(String output) - { - this.output = output; - } - - public String getStatus() - { - return status; - } - - public void setStatus(String status) - { - this.status = status; - } - - public String getType() - { - return type; - } - - public void setType(String type) - { - this.type = type; - } - - public Integer getDocumentId() - { - return documentId; - } - - public void setDocumentId(Integer documentId) - { - this.documentId = documentId; - } - - public String getReasonDescription() - { - return reasonDescription; - } - - public void setReasonDescription(String reasonDescription) - { - this.reasonDescription = reasonDescription; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/DocumentBean.java b/posterita/posterita/src/main/org/posterita/beans/DocumentBean.java deleted file mode 100644 index ff146ccc8c..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/DocumentBean.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - - - -public class DocumentBean extends UDIBean -{ - public Integer getDocumentId() - { - return documentId; - } - - public void setDocumentId(Integer documentId) - { - this.documentId = documentId; - } - - - public String getDocumentType() - { - return documentType; - } - - public void setDocumentType(String documentType) - { - this.documentType = documentType; - } - - public Integer[] getCheckBox() - { - return checkBox; - } - - public void setCheckBox(Integer[] checkBox) - { - this.checkBox = checkBox; - } - - public Integer getBpartnerId() - { - return bpartnerId; - } - - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - - public String getSubmit() - { - return submit; - } - - public void setSubmit(String submit) - { - this.submit = submit; - } - - public String getOrderType() { - return orderType; - } - - public void setOrderType(String orderType) { - this.orderType = orderType; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/DocumentHistortFilterBean.java b/posterita/posterita/src/main/org/posterita/beans/DocumentHistortFilterBean.java deleted file mode 100644 index b870d5e162..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/DocumentHistortFilterBean.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -package org.posterita.beans; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.TreeSet; - - - -/** - * @author alok - */ - -public class DocumentHistortFilterBean -{ - - private TreeSet bPartnerList = new TreeSet(); - private TreeSet docStatusList = new TreeSet(); - - public DocumentHistortFilterBean(ArrayList beans) - { - - if(beans!=null) - { - Iterator iter = beans.iterator(); - - while(iter.hasNext()) - { - DocumentHistoryBean bean = (DocumentHistoryBean) iter.next(); - - if(bean.getBpartnerId()!=null) - { - UDIPair pair = new UDIPair(bean.getBpartnerId(),bean.getPartnerName()); - bPartnerList.add(pair); - } - - if(bean.getDocStatus()!= null) - { - UDIPair docStatusPair = new UDIPair(bean.getDocStatusCode(), bean.getDocStatus()); - docStatusList.add(docStatusPair); - } - } - } - - } - - - public TreeSet getBPartnerList() - { - return bPartnerList; - } - - public TreeSet getDocStatusList() - { - return docStatusList; - } - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/DocumentHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/DocumentHistoryBean.java deleted file mode 100644 index 84af7801b2..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/DocumentHistoryBean.java +++ /dev/null @@ -1,248 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.beans; - -import java.sql.Timestamp; -import java.util.ArrayList; - -import org.posterita.beans.UDIBean; - -public class DocumentHistoryBean extends UDIBean -{ -/* - protected Integer orderId; - protected Integer paymentId; - protected Integer invoiceId; - protected Integer minOutId; - protected String docStatus; //Shipment DocStatus - protected Integer month; - protected Integer year; - protected Integer bpartnerId; - protected String partnerName; - protected Timestamp dateOrdered; - protected String docStatusCode; -*/ - protected String paymentStatus; - protected String shipmentStatus; - - protected String invoiceNo; - protected String paymentNo; - protected String shipmentNo; - protected ArrayList documentHistoryList; - - - - - - - - - public ArrayList getDocumentHistoryList() { - return documentHistoryList; - } - - public void setDocumentHistoryList(ArrayList documentHistoryList) { - this.documentHistoryList = documentHistoryList; - } - - public Integer getCashLineId() { - return cashLineId; - } - - public void setCashLineId(Integer cashLineId) { - this.cashLineId = cashLineId; - } - - public String getDocumentNo() - { - return documentNo; - } - - public void setDocumentNo(String documentNo) - { - this.documentNo=documentNo; - } - public String getOrderType() - { - return orderType; - } - - public void setOrderType(String orderType) - { - this.orderType=orderType; - } - - - public String getDocStatus() - { - return docStatus; - } - public void setDocStatus(String docStatus) - { - this.docStatus = docStatus; - } - public Integer getInvoiceId() - { - return invoiceId; - } - public void setInvoiceId(Integer invoiceId) - { - this.invoiceId = invoiceId; - } - public Integer getMinOutId() - { - return minOutId; - } - public void setMinOutId(Integer minOutId) - { - this.minOutId = minOutId; - } - public Integer getMonth() - { - return month; - } - public void setMonth(Integer month) - { - this.month = month; - } - public Integer getOrderId() - { - return orderId; - } - public void setOrderId(Integer orderId) - { - this.orderId = orderId; - } - public Integer getPaymentId() - { - return paymentId; - } - public void setPaymentId(Integer paymentId) - { - this.paymentId = paymentId; - } - public Integer getYear() - { - return year; - } - public void setYear(Integer year) - { - this.year = year; - } - public Integer getBpartnerId() - { - return bpartnerId; - } - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - public String getPartnerName() - { - return partnerName; - } - public void setPartnerName(String partnerName) - { - this.partnerName = partnerName; - } - public Timestamp getDateOrdered() - { - return dateOrdered; - } - public void setDateOrdered(Timestamp dateOrdered) - { - this.dateOrdered = dateOrdered; - } - public String getDocStatusCode() - { - return docStatusCode; - } - public void setDocStatusCode(String docStatusCode) - { - this.docStatusCode = docStatusCode; - } - public String getPaymentStatus() - { - return paymentStatus; - } - public void setPaymentStatus(String paymentStatus) - { - this.paymentStatus = paymentStatus; - } - public String getShipmentStatus() - { - return shipmentStatus; - } - public void setShipmentStatus(String shipmentStatus) - { - this.shipmentStatus = shipmentStatus; - } - - public String getInvoiceNo() - { - return invoiceNo; - } - - public void setInvoiceNo(String invoiceNo) - { - this.invoiceNo = invoiceNo; - } - - public String getPaymentNo() - { - return paymentNo; - } - - public void setPaymentNo(String paymentNo) - { - this.paymentNo = paymentNo; - } - - public String getShipmentNo() - { - return shipmentNo; - } - - public void setShipmentNo(String shipmentNo) - { - this.shipmentNo = shipmentNo; - } - - public Boolean getIsCustomer() { - return isCustomer; - } - - public void setIsCustomer(Boolean isCustomer) { - this.isCustomer = isCustomer; - } - - public Boolean getIsVendor() { - return isVendor; - } - - public void setIsVendor(Boolean isVendor) { - this.isVendor = isVendor; - } - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/DunningBean.java b/posterita/posterita/src/main/org/posterita/beans/DunningBean.java deleted file mode 100644 index c3f0660196..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/DunningBean.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 27, 2006 - */ - - -package org.posterita.beans; - - -public class DunningBean extends UDIBean -{ - - - - - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public Integer getDunningId() { - return dunningId; - } - public void setDunningId(Integer dunningId) { - this.dunningId = dunningId; - } - public String getDunningLevelName() { - return dunningLevelName; - } - public void setDunningLevelName(String dunningLevelName) { - this.dunningLevelName = dunningLevelName; - } - public String getDunningName() { - return dunningName; - } - public void setDunningName(String dunningName) { - this.dunningName = dunningName; - } - public Integer getDunningLevelId() { - return dunningLevelId; - } - public void setDunningLevelId(Integer dunningLevelId) { - this.dunningLevelId = dunningLevelId; - } - public String getDunningPrintNote() { - return dunningPrintNote; - } - public void setDunningPrintNote(String dunningPrintNote) { - this.dunningPrintNote = dunningPrintNote; - } - public String getDunningPrintText() { - return dunningPrintText; - } - public void setDunningPrintText(String dunningPrintText) { - this.dunningPrintText = dunningPrintText; - } - public Integer getBP_Group_ID() { - return BP_Group_ID; - } - public void setBP_Group_ID(Integer group_ID) { - BP_Group_ID = group_ID; - } - public Integer getBpartnerId() { - return bpartnerId; - } - public void setBpartnerId(Integer bpartnerId) { - this.bpartnerId = bpartnerId; - } - public Integer getCurrencyId() { - return currencyId; - } - public void setCurrencyId(Integer currencyId) { - this.currencyId = currencyId; - } - - - - - public Integer[] getBpartnerIds() { - return bpartnerIds; - } - public void setBpartnerIds(Integer[] bpartnerIds) { - this.bpartnerIds = bpartnerIds; - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/EditPriceBean.java b/posterita/posterita/src/main/org/posterita/beans/EditPriceBean.java deleted file mode 100644 index 5d76d0d0db..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/EditPriceBean.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 20, 2005 by praveen - * - */ -package org.posterita.beans; - -import java.math.BigDecimal; - - -public class EditPriceBean extends UDIBean -{ - public BigDecimal getPrice() - { - return price; - } - - public void setPrice(BigDecimal price) - { - this.price = price; - } - - public Integer getPriceListVersionId() - { - return priceListVersionId; - } - - public void setPriceListVersionId(Integer priceListVersionId) - { - this.priceListVersionId = priceListVersionId; - } - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/FilterBean.java b/posterita/posterita/src/main/org/posterita/beans/FilterBean.java deleted file mode 100644 index e9bab97232..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/FilterBean.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 19, 2005 by praveen - * - */ -package org.posterita.beans; - -import java.util.ArrayList; - -public class FilterBean extends UDIBean -{ - private ArrayList bpList; - private ArrayList docStatusList; - public Integer getRefToQuote() - { - return refToQuote; - } - public void setRefToQuote(Integer refToQuote) - { - this.refToQuote = refToQuote; - } - - public String getOrderType() - { - return orderType; - } - public void setOrderType(String orderType) - { - this.orderType = orderType; - } - - public String getDocStatus() - { - return docStatus; - } - - public String getDocStatusCode() - { - return docStatusCode; - } - - public String getDocumentNo() - { - return documentNo; - } - - public Integer getMonth() - { - return month; - } - - - public Integer getPartnerId() - { - return this.partnerId; - } - - public String getPartnerName() - { - return partnerName; - } - - public Integer getYear() - { - return year; - } - public void setDocStatus(String docStatus) - { - this.docStatus = docStatus; - } - - public void setDocStatusCode(String docStatusCode) - { - this.docStatusCode = docStatusCode; - } - - public void setDocumentNo(String documentNo) - { - this.documentNo = documentNo; - } - - public void setMonth(Integer month) - { - this.month = month; - } - - public void setPartnerId(Integer partnerId) - { - this.partnerId = partnerId; - } - public void setPartnerName(String partnerName) - { - this.partnerName = partnerName; - } - - public void setYear(Integer year) - { - this.year = year; - } - - public ArrayList getBpList() - { - return bpList; - } - - public void setBpList(ArrayList bpList) - { - this.bpList = bpList; - } - - public ArrayList getDocStatusList() - { - return docStatusList; - } - - public void setDocStatusList(ArrayList docStatusList) - { - this.docStatusList = docStatusList; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/GenericProductBean.java b/posterita/posterita/src/main/org/posterita/beans/GenericProductBean.java deleted file mode 100644 index af28427bb5..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/GenericProductBean.java +++ /dev/null @@ -1,167 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - - -public class GenericProductBean -{ - private String name; - private Integer qtyOnHand; - private Integer productId; - private String description; - private ProductImageInfo imageInfo; - private Boolean isSmall; - private Boolean isMedium; - private Boolean isLarge; - private Boolean isXLarge; - private Integer qtySmall; - private Integer qtyMedium; - private Integer qtyLarge; - private Integer qtyXLarge; - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - public Integer getQtyOnHand() - { - return qtyOnHand; - } - - public void setQtyOnHand(Integer qtyOnHand) - { - this.qtyOnHand = qtyOnHand; - } - - - public Integer getProductId() - { - return productId; - } - public void setProductId(Integer productId) - { - this.productId = productId; - } - - - public String getDescription() - { - return description; - } - public void setDescription(String description) - { - this.description = description; - } - - public ProductImageInfo getImageInfo() - { - return imageInfo; - } - public void setImageInfo(ProductImageInfo imageInfo) - { - this.imageInfo = imageInfo; - } - - public Boolean getIsLarge() - { - return isLarge; - } - - public void setIsLarge(Boolean isLarge) - { - this.isLarge = isLarge; - } - - public Boolean getIsMedium() - { - return isMedium; - } - - public void setIsMedium(Boolean isMedium) - { - this.isMedium = isMedium; - } - - public Boolean getIsSmall() - { - return isSmall; - } - - public void setIsSmall(Boolean isSmall) - { - this.isSmall = isSmall; - } - - public Boolean getIsXLarge() - { - return isXLarge; - } - - public void setIsXLarge(Boolean isXLarge) - { - this.isXLarge = isXLarge; - } - - public Integer getQtyLarge() - { - return qtyLarge; - } - - public void setQtyLarge(Integer qtyLarge) - { - this.qtyLarge = qtyLarge; - } - - public Integer getQtyMedium() - { - return qtyMedium; - } - - public void setQtyMedium(Integer qtyMedium) - { - this.qtyMedium = qtyMedium; - } - - public Integer getQtySmall() - { - return qtySmall; - } - - public void setQtySmall(Integer qtySmall) - { - this.qtySmall = qtySmall; - } - - public Integer getQtyXLarge() - { - return qtyXLarge; - } - - public void setQtyXLarge(Integer qtyXLarge) - { - this.qtyXLarge = qtyXLarge; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/InOutHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/InOutHistoryBean.java deleted file mode 100644 index 84b1f1da54..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/InOutHistoryBean.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 08-Aug-2005 by alok - * - */ -package org.posterita.beans; - -import java.sql.Timestamp; - - -public class InOutHistoryBean extends FilterBean -{ - - public String getPartnerName() - { - return partnerName; - } - public void setPartnerName(String partnerName) - { - this.partnerName = partnerName; - } - - public Integer getInOutId() - { - return inOutId; - } - - public void setInOutId(Integer inOutId) - { - this.inOutId = inOutId; - } - - public Timestamp getDateMovement() - { - return dateMovement; - } - public void setDateMovement(Timestamp dateMovement) - { - this.dateMovement = dateMovement; - } - public Timestamp getDateOrdered() - { - return dateOrdered; - } - public void setDateOrdered(Timestamp dateOrdered) - { - this.dateOrdered = dateOrdered; - } - public Integer getInvoiceId() - { - return invoiceId; - } - public void setInvoiceId(Integer invoiceId) - { - this.invoiceId = invoiceId; - } - public Boolean getIsSotrx() - { - return isSoTrx; - } - public void setIsSotrx(Boolean isSotrx) - { - this.isSoTrx = isSotrx; - } - public Integer getOrderId() - { - return orderId; - } - public void setOrderId(Integer orderId) - { - this.orderId = orderId; - } - public String getPoReference() - { - return poReference; - } - public void setPoReference(String poReference) - { - this.poReference = poReference; - } - public Integer getRefInOutId() - { - return refInOutId; - } - public void setRefInOutId(Integer refInOutId) - { - this.refInOutId = refInOutId; - } - public Integer getWarehouseId() - { - return warehouseId; - } - public void setWarehouseId(Integer warehouseId) - { - this.warehouseId = warehouseId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/InventoryBean.java b/posterita/posterita/src/main/org/posterita/beans/InventoryBean.java deleted file mode 100644 index 5be1d7280c..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/InventoryBean.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 4, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; - - -public class InventoryBean extends UDIBean -{ - - public Integer[] getInventoryIds() - { - return inventoryIds; - } - public void setInventoryIds(Integer[] inventoryIds) - { - this.inventoryIds = inventoryIds; - } - public BigDecimal getBookQtyValue() { - return bookQtyValue; - } - public void setBookQtyValue(BigDecimal bookQtyValue) { - this.bookQtyValue = bookQtyValue; - } - public BigDecimal getCountQtyValue() { - return countQtyValue; - } - public void setCountQtyValue(BigDecimal countQtyValue) { - this.countQtyValue = countQtyValue; - } - public String getBarCode() { - return barCode; - } - public void setBarCode(String barCode) { - this.barCode = barCode; - } - public String getDocStatus() { - return docStatus; - } - public void setDocStatus(String docStatus) { - this.docStatus = docStatus; - } - public String getInventoryNo() { - return inventoryNo; - } - public void setInventoryNo(String inventoryNo) { - this.inventoryNo = inventoryNo; - } - public String getMovementDate() { - return movementDate; - } - public void setMovementDate(String movementDate) { - this.movementDate = movementDate; - } - public String getProductName() { - return productName; - } - public void setProductName(String productName) { - this.productName = productName; - } - public Integer getProductId() { - return productId; - } - public void setProductId(Integer productId) { - this.productId = productId; - } - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public Integer getInventoryId() { - return inventoryId; - } - public void setInventoryId(Integer inventoryId) { - this.inventoryId = inventoryId; - } - public Integer getInventoryLineId() { - return inventoryLineId; - } - public void setInventoryLineId(Integer inventoryLineId) { - this.inventoryLineId = inventoryLineId; - } - public BigDecimal getQtyBook() { - return qtyBook; - } - public void setQtyBook(BigDecimal qtyBook) { - this.qtyBook = qtyBook; - } - public BigDecimal getQtyCount() { - return qtyCount; - } - public void setQtyCount(BigDecimal qtyCount) { - this.qtyCount = qtyCount; - } - public void setUom(String uom) - { - this.uom = uom; - } - public String getUom() - { - return this.uom; - } - - public String getIfAdd() { - return ifAdd; - } - public void setIfAdd(String ifAdd) { - this.ifAdd = ifAdd; - } - - public Integer getPriceListId() { - return priceListId; - } - public void setPriceListId(Integer priceListId) { - this.priceListId = priceListId; - } - - public BigDecimal getQtyCsv() - { - return qtyCsv; - } - public void setQtyCsv(BigDecimal qtyCsv) - { - this.qtyCsv = qtyCsv; - } - - public Integer getMonth() - { - return month; - } - public void setMonth(Integer month) - { - this.month = month; - } - public Integer getYear() - { - return year; - } - public void setYear(Integer year) - { - this.year = year; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/InventoryCartBean.java b/posterita/posterita/src/main/org/posterita/beans/InventoryCartBean.java deleted file mode 100644 index c2aba600c2..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/InventoryCartBean.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * 27 May 2008 12:27:14 by shameem - * - */ - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.ArrayList; - -public class InventoryCartBean extends UDIBean -{ - private ArrayList items; - private String currency; - private BigDecimal totalPrice; - private int pricelistId; - - public String getCurrency() - { - return currency; - } - - public void setCurrency(String currency) - { - this.currency = currency; - } - - public ArrayList getItems() - { - return items; - } - - public void setItems(ArrayList items) - { - this.items = items; - } - - public BigDecimal getTotalPrice() - { - return totalPrice; - } - - public void setTotalPrice(BigDecimal totalPrice) - { - this.totalPrice = totalPrice; - } - - public int getPricelistId() { - return pricelistId; - } - - public void setPricelistId(int pricelistId) { - this.pricelistId = pricelistId; - } - - public BigDecimal getQtyCount() { - return qtyCount; - } - public void setQtyCount(BigDecimal qtyCount) { - this.qtyCount = qtyCount; - } - - public String getBarCode() { - return barCode; - } - - public void setBarCode(String barCode) { - this.barCode = barCode; - } - - public Integer getPriceListId() { - return priceListId; - } - - public void setPriceListId(Integer priceListId) { - this.priceListId = priceListId; - } - - public BigDecimal getQtyBook() { - return qtyBook; - } - public void setQtyBook(BigDecimal qtyBook) { - this.qtyBook = qtyBook; - } - - public BigDecimal getQtyCsv() - { - return qtyCsv; - } - - public void setQtyCsv(BigDecimal qtyCsv) - { - this.qtyCsv = qtyCsv; - } - - public void setInventoryId(Integer inventoryId) - { - this.inventoryId = inventoryId; - } - - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public Integer getInventoryId() - { - return inventoryId; - } - public String getUom() - { - return uom; - } - public void setUom(String uom) - { - this.uom = uom; - } - public Integer getInventoryLineId() - { - return inventoryLineId; - } - public void setInventoryLineId(Integer inventoryLineId) - { - this.inventoryLineId = inventoryLineId; - } - - public BigDecimal getCountQtyValue() - { - return countQtyValue; - } - public void setCountQtyValue(BigDecimal countQtyValue) - { - this.countQtyValue = countQtyValue; - } - - public Integer getProductId() - { - return productId; - } - public void setProductId(Integer productId) - { - this.productId = productId; - } - public String getProductName() - { - return productName; - } - public void setProductName(String productName) - { - this.productName = productName; - } - public BigDecimal getBookQtyValue() { - return bookQtyValue; - } - public void setBookQtyValue(BigDecimal bookQtyValue) { - this.bookQtyValue = bookQtyValue; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/InventoryLineBean.java b/posterita/posterita/src/main/org/posterita/beans/InventoryLineBean.java deleted file mode 100644 index 4825ceedf6..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/InventoryLineBean.java +++ /dev/null @@ -1,475 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.ArrayList; - - -public class InventoryLineBean extends DocumentBean implements Comparable -{ - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public Double getTotalActualPrice() { - return totalActualPrice; - } - public void setTotalActualPrice(Double totalActualPrice) { - this.totalActualPrice = totalActualPrice; - } - public Double getPaymentByCard() { - return paymentByCard; - } - public void setPaymentByCard(Double paymentByCard) { - this.paymentByCard = paymentByCard; - } - public Double getPaymentByCash() { - return paymentByCash; - } - public void setPaymentByCash(Double paymentByCash) { - this.paymentByCash = paymentByCash; - } - public Double getPaymentByChq() { - return paymentByChq; - } - public void setPaymentByChq(Double paymentByChq) { - this.paymentByChq = paymentByChq; - } - public String[] getActualPrice() { - return actualPrice; - } - public void setActualPrice(String[] actualPrice) { - this.actualPrice = actualPrice; - } - - public String[] getDiscountPercent() { - return discountPercent; - } - public void setDiscountPercent(String[] discountPercent) { - this.discountPercent = discountPercent; - } - public String getQtyAndItem() { - return qtyAndItem; - } - public void setQtyAndItem(String qtyAndItem) { - this.qtyAndItem = qtyAndItem; - } - public String getBarCode() { - return barCode; - } - public void setBarCode(String barCode) { - this.barCode = barCode; - } - - public String getPartnerName() { - return partnerName; - } - public void setPartnerName(String partnerName) { - this.partnerName = partnerName; - } - public Integer[] getInventoryLineIds() - { - return inventoryLineIds; - } - public void setInventoryLineIds(Integer[] inventoryLineIds) - { - this.inventoryLineIds = inventoryLineIds; - } - public String getChequeNo() - { - return chequeNo; - } - - public void setChequeNo(String chequeNo) - { - this.chequeNo = chequeNo; - } - - public Integer getCreditCardExpMonth() - { - return creditCardExpMonth; - } - - public void setCreditCardExpMonth(Integer creditCardExpMonth) - { - this.creditCardExpMonth = creditCardExpMonth; - } - - public Integer getCreditCardExpYear() - { - return creditCardExpYear; - } - - public void setCreditCardExpYear(Integer creditCardExpYear) - { - this.creditCardExpYear = creditCardExpYear; - } - - public String getCreditCardNumber() - { - return creditCardNumber; - } - - public void setCreditCardNumber(String creditCardNumber) - { - this.creditCardNumber = creditCardNumber; - } - - public String getCreditCardType() - { - return creditCardType; - } - - public void setCreditCardType(String creditCardType) - { - this.creditCardType = creditCardType; - } - public Integer getInventoryId() - { - return inventoryId; - } - public void setInventoryId(Integer inventoryId) - { - this.inventoryId = inventoryId; - } - public String getSurname() { - return surname; - } - public void setSurname(String surname) { - this.surname = surname; - } - - public Integer getBpartnerId() - { - return bpartnerId; - } - - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - public Boolean getIsQtyReserved() - { - return isQtyReserved; - } - - public void setIsQtyReserved(Boolean isQtyReserved) - { - this.isQtyReserved = isQtyReserved; - } - public String getEngineNo() { - return engineNo; - } - public void setEngineNo(String engineNo) { - this.engineNo = engineNo; - } - public BigDecimal getQuantity() - { - return quantity; - } - - public void setQuantity(BigDecimal quantity) - { - this.quantity = quantity; - } - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - - public Integer[] getCheckBox() - { - return checkBox; - } - public void setCheckBox(Integer [] checkBox) - { - this.checkBox = checkBox; - } - - public Integer getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - - public void setAttributeSetInstanceId(Integer attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - - public ArrayList getInventoryLineList() - { - return InventoryLineList; - } - public void setInventoryLineList(ArrayList inventoryLineList) - { - InventoryLineList = inventoryLineList; - } - - public Integer getInventoryLineId() - { - return inventoryLineId; - } - public void setInventoryLineId(Integer inventoryLineId) - { - this.inventoryLineId = inventoryLineId; - } - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public Integer getAllocationId() - { - return allocationId; - } - - public void setAllocationId(Integer allocationId) - { - this.allocationId = allocationId; - } - - public boolean equals(Object obj) - { - OrderLineBean target = (OrderLineBean) obj; - - if ( obj == null) - return false; - - if (this.getAttributeSetInstanceId().equals(target.getAttributeSetInstanceId())) - return true; - - return false; - } - - public String getSubmit() - { - return submit; - } - - public void setSubmit(String submit) - { - this.submit = submit; - } - - - public int compareTo(Object o) - { - InventoryLineBean src = (InventoryLineBean) o; - - if (src.getAttributeSetInstanceId().intValue() == this.getAttributeSetInstanceId().intValue()) - return 0; - - - return -1; - } - - - - - - - public BigDecimal getAmountGiven() - { - return amountGiven; - } - - public void setAmountGiven(BigDecimal amountGiven) - { - this.amountGiven = amountGiven; - } - - public BigDecimal getAmountRefunded() - { - return amountRefunded; - } - - public void setAmountRefunded(BigDecimal amountRefunded) - { - this.amountRefunded = amountRefunded; - } - public String getTrxType() - { - return trxType; - } - - public void setTrxType(String trxType) - { - this.trxType = trxType; - } - - public BigDecimal getTransferAmount() { - return transferAmount; - } - public void setTransferAmount(BigDecimal transferAmount) { - this.transferAmount = transferAmount; - } - - public Integer getCashBookIds() { - return cashBookIds; - } - public void setCashBookIds(Integer cashBookIds) { - this.cashBookIds = cashBookIds; - } - public String getIsSales() { - return isSales; - } - public void setIsSales(String isSales) { - this.isSales = isSales; - } - public String getIfAdd() { - return ifAdd; - } - public void setIfAdd(String ifAdd) { - this.ifAdd = ifAdd; - } - - public String getVendorName() { - return vendorName; - } - public void setVendorName(String vendorName) { - this.vendorName = vendorName; - } - - public String getDocumentNo() { - return documentNo; - } - public void setDocumentNo(String documentNo) { - this.documentNo = documentNo; - } - - public BigDecimal getUserDiscount() { - return userDiscount; - } - public void setUserDiscount(BigDecimal userDiscount) { - this.userDiscount = userDiscount; - } - - public Integer getPaymentTermId() { - return paymentTermId; - } - public void setPaymentTermId(Integer paymentTermId) { - this.paymentTermId = paymentTermId; - } - - public String getPaymentTermName() { - return paymentTermName; - } - public void setPaymentTermName(String paymentTermName) { - this.paymentTermName = paymentTermName; - } - public String getToBeShipped() { - return toBeShipped; - } - public void setToBeShipped(String toBeShipped) { - this.toBeShipped = toBeShipped; - } - - public Boolean getOpenDrawer() { - return openDrawer; - } - public void setOpenDrawer(Boolean openDrawer) { - this.openDrawer = openDrawer; - } - - public void setUom(String uom) - { - this.uom = uom; - } - - public String getUom() - { - return this.uom; - } - public Integer getPriceListId() { - return priceListId; - } - public void setPriceListId(Integer priceListId) { - this.priceListId = priceListId; - } - - public BigDecimal getQtyBook() - { - return qtyBook; - } - public void setQtyBook(BigDecimal qtyBook) - { - this.qtyBook = qtyBook; - } - public BigDecimal getQtyCount() - { - return qtyCount; - } - public void setQtyCount(BigDecimal qtyCount) - { - this.qtyCount = qtyCount; - } - public BigDecimal getQtyCsv() - { - return qtyCsv; - } - public void setQtyCsv(BigDecimal qtyCsv) - { - this.qtyCsv = qtyCsv; - } - public String getProductName() - { - return productName; - } - public void setProductName(String productName) - { - this.productName = productName; - } - public BigDecimal getBookQtyValue() { - return bookQtyValue; - } - public void setBookQtyValue(BigDecimal bookQtyValue) { - this.bookQtyValue = bookQtyValue; - } - public BigDecimal getCountQtyValue() - { - return countQtyValue; - } - public void setCountQtyValue(BigDecimal countQtyValue) - { - this.countQtyValue = countQtyValue; - } - public String getDocStatus() { - return docStatus; - } - public void setDocStatus(String docStatus) { - this.docStatus = docStatus; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/InvoiceHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/InvoiceHistoryBean.java deleted file mode 100644 index 4114b182d1..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/InvoiceHistoryBean.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 04-Aug-2005 by alok - * - */ -package org.posterita.beans; - -import java.sql.Timestamp; - - -public class InvoiceHistoryBean extends FilterBean -{ - private PaymentHistoryBean paymentHistoryBean; - - public PaymentHistoryBean getPaymentHistoryBean() - { - return paymentHistoryBean; - } - - public void setPaymentHistoryBean(PaymentHistoryBean paymentHistoryBean) - { - this.paymentHistoryBean = paymentHistoryBean; - } - - public Integer getInvoiceId() - { - return invoiceId; - } - public void setInvoiceId(Integer invoiceId) - { - this.invoiceId = invoiceId; - } - public Timestamp getDateInvoiced() - { - return dateInvoiced; - } - public void setDateInvoiced(Timestamp dateInvoiced) - { - this.dateInvoiced = dateInvoiced; - } - - public Integer getGrandTotal() - { - return grandTotal; - } - public void setGrandTotal(Integer grandTotal) - { - this.grandTotal = grandTotal; - } - public String getIsPaid() - { - return isPaid; - } - public void setIsPaid(String isPaid) - { - this.isPaid = isPaid; - } - public Boolean getIsSotrx() - { - return isSoTrx; - } - public void setIsSotrx(Boolean isSotrx) - { - this.isSoTrx = isSotrx; - } - public Integer getOrderId() - { - return orderId; - } - public void setOrderId(Integer orderId) - { - this.orderId = orderId; - } - - public Integer[] getCheckBox() - { - return checkBox; - } - - public void setCheckBox(Integer[] checkBox) - { - this.checkBox = checkBox; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ItemBean.java b/posterita/posterita/src/main/org/posterita/beans/ItemBean.java deleted file mode 100644 index 7ad2e2cb7d..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ItemBean.java +++ /dev/null @@ -1,531 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - -import java.math.BigDecimal; - -import org.compiere.util.Env; - - -public class ItemBean -{ - - private Integer productId; - private Integer priceListId; - private Integer inventoryId; - private Integer inventoryLineId; - private String description; - private String barCode; - private BigDecimal price; - private BigDecimal qty = Env.ONE; - private BigDecimal grandTotal = Env.ZERO; - private BigDecimal discountPercent = Env.ZERO; - private BigDecimal actualPrice; - private BigDecimal taxAmt; - private BigDecimal standardPrice; - private BigDecimal priceLimit; - private BigDecimal priceLimitTotal; - private BigDecimal priceTotal; - private BigDecimal taxTotal; - private BigDecimal qtyTotal = Env.ZERO; - private BigDecimal unitPrice; - private String productName; - private BigDecimal inclPrice; - private BigDecimal taxRate; - private String uom; - private String backOrder; - private BigDecimal discountedLinePrice; - private BigDecimal discountedInclUnitPrice; - private Boolean isDiscountOnInclUnitPrice; - private BigDecimal qtyCsv; - private BigDecimal qtyBook; - private BigDecimal qtyCount; - private BigDecimal bookQtyValue; - private BigDecimal countQtyValue; - private BigDecimal listPrice; - - private Boolean isDiscountOnPercentage; - private Boolean isDiscountOnTotal; - private Boolean isTaxIncluded; - - private BigDecimal stockValue; - private BigDecimal qtyToMove; - private BigDecimal qtyOnHand; - private Integer unitsPerPack; - private Integer noOfPack; - - public Boolean getIsTaxIncluded() { - return isTaxIncluded; - } - - public void setIsTaxIncluded(Boolean isTaxIncluded) { - this.isTaxIncluded = isTaxIncluded; - } - - public Boolean getIsDiscountOnInclUnitPrice() { - return isDiscountOnInclUnitPrice; - } - - public void setIsDiscountOnInclUnitPrice(Boolean isDiscountOnInclUnitPrice) { - this.isDiscountOnInclUnitPrice = isDiscountOnInclUnitPrice; - } - - public BigDecimal getDiscountedLinePrice() { - return discountedLinePrice; - } - - public void setDiscountedLinePrice(BigDecimal discountedLinePrice) { - this.discountedLinePrice = discountedLinePrice; - } - - public BigDecimal getTaxRate() { - return taxRate; - } - - public void setTaxRate(BigDecimal taxRate) { - this.taxRate = taxRate; - } - - public BigDecimal getInclPrice() { - return inclPrice; - } - - public void setInclPrice(BigDecimal inclPrice) { - this.inclPrice = inclPrice; - } - - public String getProductName() - { - return productName; - } - - public void setProductName(String productName) - { - this.productName = productName; - } - - public String getUom() { - return uom; - } - - public void setUom(String uom) { - this.uom = uom; - } - - public BigDecimal getUnitPrice() { - return unitPrice; - } - - public void setUnitPrice(BigDecimal unitPrice) { - this.unitPrice = unitPrice; - } - - public BigDecimal getQtyTotal() { - return qtyTotal; - } - - public void setQtyTotal(BigDecimal qtyTotal) { - this.qtyTotal = qtyTotal; - } - - public BigDecimal getPriceTotal() { - return priceTotal; - } - - public void setPriceTotal(BigDecimal priceTotal) { - this.priceTotal = priceTotal; - } - - public BigDecimal getTaxTotal() { - return taxTotal; - } - - public void setTaxTotal(BigDecimal taxTotal) { - this.taxTotal = taxTotal; - } - - public BigDecimal getStandardPrice() { - return standardPrice; - } - - public void setStandardPrice(BigDecimal standardPrice) { - this.standardPrice = standardPrice; - } - - public BigDecimal getTaxAmt() { - return taxAmt; - } - - public void setTaxAmt(BigDecimal taxAmt) { - this.taxAmt = taxAmt; - } - - public void setGrandTotal(BigDecimal grandTotal) { - this.grandTotal = grandTotal; - } - - public String getBackOrder() - { - return backOrder; - } - - public void setBackOrder(String backOrder) - { - this.backOrder = backOrder; - } - - public BigDecimal getActualPrice() { - return actualPrice; - } - - public void setActualPrice(BigDecimal actualPrice) { - this.actualPrice = actualPrice; - } - public BigDecimal getDiscountPercent() { - return discountPercent; - } - public void setDiscountPercent(BigDecimal discountPercent) { - this.discountPercent = discountPercent; - } - public void setgrandTotal(BigDecimal grandTotal) - { - this.grandTotal=grandTotal; - } - - public BigDecimal getGrandTotal() - { - return grandTotal; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public BigDecimal getPrice() - { - return price; - } - - public void setPrice(BigDecimal price) - { - this.price = price; - } - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - public BigDecimal getQty() - { - return qty; - } - - public void setQty(BigDecimal qty) - { - this.qty = qty; - } - - /** - * Update Quantity in order - * @param original - * @param itemToAdd - * @param add - */ - public void updateQuantity(ItemBean original, ItemBean itemToAdd,boolean add) - { - BigDecimal originalQuantity = original.getQty(); - - BigDecimal quantityToAdd = itemToAdd.getQty(); - - BigDecimal finalQuantity = null; - - if(!add) - finalQuantity= originalQuantity.subtract(quantityToAdd); - else - finalQuantity= originalQuantity.add(quantityToAdd); - - - original.setQty(finalQuantity); - } - - /** - * Update Quantity count in inventory - * @param original - * @param itemToAdd - * @param add - */ - public void updateQuantityCount(ItemBean original, ItemBean itemToAdd,boolean add) - { - BigDecimal originalQuantity = original.getQtyCount(); - - BigDecimal quantityToAdd = itemToAdd.getQtyCount(); - - BigDecimal finalQuantity = null; - - if(!add) - finalQuantity= originalQuantity.subtract(quantityToAdd); - else - finalQuantity= originalQuantity.add(quantityToAdd); - - - original.setQtyCount(finalQuantity); - } - - /** - * Update Quantity CSV in inventory - * @param original - * @param itemToAdd - * @param add - */ - public void updateQuantityCsv(ItemBean original, ItemBean itemToAdd,boolean add) - { - BigDecimal originalQuantity = original.getQtyCsv(); - - BigDecimal quantityToAdd = itemToAdd.getQtyCsv(); - - BigDecimal finalQuantity = null; - - if(!add) - finalQuantity= originalQuantity.subtract(quantityToAdd); - else - finalQuantity= originalQuantity.add(quantityToAdd); - - - original.setQtyCsv(finalQuantity); - } - - /** - * Update Quantity to move in Stock Transfer - * @param original - * @param itemToAdd - * @param add - */ - public void updateQuantityToMove(ItemBean original, ItemBean itemToAdd,boolean add) - { - BigDecimal originalQuantity = original.getQtyToMove(); - - BigDecimal quantityToAdd = itemToAdd.getQtyToMove(); - - BigDecimal finalQuantity = null; - - if(!add) - finalQuantity= originalQuantity.subtract(quantityToAdd); - else - finalQuantity= originalQuantity.add(quantityToAdd); - - original.setQtyToMove(finalQuantity); - } - - public boolean equals(Object o) - { - if (o == null) - return false; - - ItemBean bean1 = (ItemBean) o; - if (bean1.getProductId().intValue() == this.getProductId().intValue()) - return true; - - return false; - - } - public String getBarCode() { - return barCode; - } - public void setBarCode(String barCode) { - this.barCode = barCode; - } - - public Integer getPriceListId() { - return priceListId; - } - - public void setPriceListId(Integer priceListId) { - this.priceListId = priceListId; - } - - public BigDecimal getPriceLimit() { - return priceLimit; - } - - public void setPriceLimit(BigDecimal priceLimit) { - this.priceLimit = priceLimit; - } - - public BigDecimal getPriceLimitTotal() { - return priceLimitTotal; - } - - public void setPriceLimitTotal(BigDecimal priceLimitTotal) { - this.priceLimitTotal = priceLimitTotal; - } - - public BigDecimal getDiscountedInclUnitPrice() { - return discountedInclUnitPrice; - } - - public void setDiscountedInclUnitPrice(BigDecimal discountedInclUnitPrice) { - this.discountedInclUnitPrice = discountedInclUnitPrice; - } - - public Boolean getIsDiscountOnPercentage() - { - return isDiscountOnPercentage; - } - - public void setIsDiscountOnPercentage(Boolean isDiscountOnPercentage) - { - this.isDiscountOnPercentage = isDiscountOnPercentage; - } - - public BigDecimal getQtyBook() - { - return qtyBook; - } - public void setQtyBook(BigDecimal qtyBook) - { - this.qtyBook = qtyBook; - } - public BigDecimal getQtyCount() - { - return qtyCount; - } - public void setQtyCount(BigDecimal qtyCount) - { - this.qtyCount = qtyCount; - } - public BigDecimal getQtyCsv() - { - return qtyCsv; - } - public void setQtyCsv(BigDecimal qtyCsv) - { - this.qtyCsv = qtyCsv; - } - public BigDecimal getBookQtyValue() { - return bookQtyValue; - } - public void setBookQtyValue(BigDecimal bookQtyValue) { - this.bookQtyValue = bookQtyValue; - } - public Integer getInventoryLineId() - { - return inventoryLineId; - } - public void setInventoryLineId(Integer inventoryLineId) - { - this.inventoryLineId = inventoryLineId; - } - public Boolean getIsDiscountOnTotal() - { - return isDiscountOnTotal; - } - - public BigDecimal getCountQtyValue() - { - return countQtyValue; - } - public void setCountQtyValue(BigDecimal countQtyValue) - { - this.countQtyValue = countQtyValue; - } - public Integer getInventoryId() - { - return inventoryId; - } - public void setInventoryId(Integer inventoryId) - { - this.inventoryId = inventoryId; - } - - public void setIsDiscountOnTotal(Boolean isDiscountOnTotal) - { - this.isDiscountOnTotal = isDiscountOnTotal; - } - - public BigDecimal getListPrice() { - return listPrice; - } - - public void setListPrice(BigDecimal listPrice) { - this.listPrice = listPrice; - } - - public BigDecimal getStockValue() - { - return stockValue; - } - - public void setStockValue(BigDecimal stockValue) - { - this.stockValue = stockValue; - } - - public BigDecimal getQtyToMove() - { - return qtyToMove; - } - - public void setQtyToMove(BigDecimal qtyToMove) - { - this.qtyToMove = qtyToMove; - } - - public BigDecimal getQtyOnHand() - { - return qtyOnHand; - } - - public void setQtyOnHand(BigDecimal qtyOnHand) - { - this.qtyOnHand = qtyOnHand; - } - - public Integer getUnitsPerPack() - { - return unitsPerPack; - } - - public void setUnitsPerPack(Integer unitsPerPack) - { - this.unitsPerPack = unitsPerPack; - } - - public Integer getNoOfPack() - { - return noOfPack; - } - - public void setNoOfPack(Integer noOfPack) - { - this.noOfPack = noOfPack; - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/beans/LocatorBean.java b/posterita/posterita/src/main/org/posterita/beans/LocatorBean.java deleted file mode 100644 index bf65c7f46e..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/LocatorBean.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Jul-2005 by alok - * - */ -package org.posterita.beans; - - -public class LocatorBean extends UDIBean -{ - - public String getAisle() - { - return aisle; - } - public void setAisle(String aisle) - { - this.aisle = aisle; - } - public String getBin() - { - return bin; - } - public void setBin(String bin) - { - this.bin = bin; - } - public Boolean getIsDefault() - { - return isDefault; - } - public void setIsDefault(Boolean isDefault) - { - this.isDefault = isDefault; - } - public String getLevel() - { - return level; - } - public void setLevel(String level) - { - this.level = level; - } - public Integer getWarehouseId() - { - return warehouseId; - } - public void setWarehouseId(Integer warehouseId) - { - this.warehouseId = warehouseId; - } - - public String getWarehouseName() - { - return warehouseName; - } - - public void setWarehouseName(String warehouseName) - { - this.warehouseName = warehouseName; - } - - - - public Integer getAttributeSetInstance() - { - return attributeSetInstance; - } - public void setAttributeSetInstance(Integer attributeSetInstance) - { - this.attributeSetInstance = attributeSetInstance; - } - public String getSernoAttributeSetInstance() - { - return sernoAttributeSetInstance; - } - public void setSernoAttributeSetInstance(String sernoAttributeSetInstance) - { - this.sernoAttributeSetInstance = sernoAttributeSetInstance; - } - - - public Integer getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - public void setAttributeSetInstanceId(Integer attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - - public Integer getLocatorId() - { - return locatorId; - } - public void setLocatorId(Integer locatorId) - { - this.locatorId = locatorId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/LoginBean.java b/posterita/posterita/src/main/org/posterita/beans/LoginBean.java deleted file mode 100644 index d010de9612..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/LoginBean.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ -package org.posterita.beans; - - -public class LoginBean extends UDIBean -{ - - public Integer getRoleId() { - return roleId; - } - public void setRoleId(Integer roleId) { - this.roleId = roleId; - } - public String getUserPIN() - { - return userPIN; - } - public void setUserPIN(String userPIN) - { - this.userPIN = userPIN; - } - public String getPassword() - { - return password; - } - public void setPassword(String password) - { - this.password = password; - } - public String getUsername() - { - return username; - } - public void setUsername(String username) - { - this.username = username; - } - - public Integer getId() - { - return id; - } - public void setId(Integer id) - { - this.id = id; - } - - public Integer getUserId() - { - return userId; - } - public void setUserId(Integer userId) - { - this.userId = userId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/MMovementCartBean.java b/posterita/posterita/src/main/org/posterita/beans/MMovementCartBean.java deleted file mode 100644 index 2c4b9b2240..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/MMovementCartBean.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.ArrayList; - -public class MMovementCartBean extends UDIBean -{ - private ArrayList items; - private String currency; - private BigDecimal totalPrice; - private int pricelistId; - private BigDecimal stockValue; - private BigDecimal qtyToMove; - private BigDecimal qtyOnHand; - - public String getCurrency() - { - return currency; - } - - public void setCurrency(String currency) - { - this.currency = currency; - } - - public ArrayList getItems() - { - return items; - } - - public void setItems(ArrayList items) - { - this.items = items; - } - - public BigDecimal getTotalPrice() - { - return totalPrice; - } - - public void setTotalPrice(BigDecimal totalPrice) - { - this.totalPrice = totalPrice; - } - - public int getPricelistId() { - return pricelistId; - } - - public void setPricelistId(int pricelistId) { - this.pricelistId = pricelistId; - } - - public BigDecimal getStockValue() - { - return stockValue; - } - - public void setStockValue(BigDecimal stockValue) - { - this.stockValue = stockValue; - } - - public BigDecimal getQtyToMove() - { - return qtyToMove; - } - - public void setQtyToMove(BigDecimal qtyToMove) - { - this.qtyToMove = qtyToMove; - } - - public BigDecimal getQtyOnHand() - { - return qtyOnHand; - } - - public void setQtyOnHand(BigDecimal qtyOnHand) - { - this.qtyOnHand = qtyOnHand; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/MenuItemBean.java b/posterita/posterita/src/main/org/posterita/beans/MenuItemBean.java deleted file mode 100644 index 19a8c57bd5..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/MenuItemBean.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - - -public class MenuItemBean extends UDIBean -{ - - - public Integer getMenuId() - { - return menuId; - } - public void setMenuId(Integer menuId) - { - this.menuId = menuId; - } - public String getMenuItemName() - { - return menuItemName; - } - public void setMenuItemName(String menuItemName) - { - this.menuItemName = menuItemName; - } - public String getMenuLink() - { - return menuLink; - } - public void setMenuLink(String menuLink) - { - this.menuLink = menuLink; - } - public Integer getParentMenuId() - { - return parentMenuId; - } - public void setParentMenuId(Integer parentMenuId) - { - this.parentMenuId = parentMenuId; - } - - public Integer getId() - { - return id; - } - public void setId(Integer id) - { - this.id = id; - } - - public Boolean getIsActive() - { - return isActive; - } - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - public String getName() - { - return name; - } - public void setName(String name) - { - this.name = name; - } - public Boolean getIsClosable() - { - return isClosable; - } - public void setIsClosable(Boolean isClosable) - { - this.isClosable = isClosable; - } - - public String getDescription() - { - return description; - } - public void setDescription(String description) - { - this.description = description; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/MessageBean.java b/posterita/posterita/src/main/org/posterita/beans/MessageBean.java deleted file mode 100644 index 4850a2d410..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/MessageBean.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 1, 2005 by din - */ - -package org.posterita.beans; - -import java.sql.Timestamp; - -public class MessageBean extends UDIBean -{ - public String getMessage() - { - return message; - } - public void setMessage(String message) - { - this.message = message; - } - public Integer getMessageID() - { - return messageID; - } - public void setMessageID(Integer messageID) - { - this.messageID = messageID; - } - public String getSubject() - { - return subject; - } - public void setSubject(String subject) - { - this.subject = subject; - } - public Integer getCounterOrgID() - { - return counterOrgID; - } - public void setCounterOrgID(Integer counterOrgID) - { - this.counterOrgID = counterOrgID; - } - public String getCounterOrgName() - { - return counterOrgName; - } - public void setCounterOrgName(String counterOrgName) - { - this.counterOrgName = counterOrgName; - } - public Integer getOrgId() - { - return orgId; - } - public void setOrgID(Integer orgId) - { - this.orgId = orgId; - } - public String getRead() - { - return read; - } - public void setRead(String read) - { - this.read = read; - } - public Timestamp getDateCreated() - { - return dateCreated; - } - public void setDateCreated(Timestamp dateCreated) - { - this.dateCreated = dateCreated; - } - public String getCounterOrderStatusInfo() - { - return counterOrderStatusInfo; - } - public void setCounterOrderStatusInfo(String counterOrderStatusInfo) - { - this.counterOrderStatusInfo = counterOrderStatusInfo; - } - public String getOrderStatusInfo() - { - return orderStatusInfo; - } - public void setOrderStatusInfo(String orderStatusInfo) - { - this.orderStatusInfo = orderStatusInfo; - } - public Boolean getIsActive() - { - return isActive; - } - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - - public Integer[] getCheckBox() - { - return checkBox; - } - - public void setCheckBox(Integer[] checkBox) - { - this.checkBox = checkBox; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/MessageLoggerBean.java b/posterita/posterita/src/main/org/posterita/beans/MessageLoggerBean.java deleted file mode 100644 index fa0eebe47c..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/MessageLoggerBean.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * */ -package org.posterita.beans; - - -public class MessageLoggerBean -{ - private String cause; - private String error; - private String description; - - public String getCause() - { - return cause; - } - - public void setCause(String cause) - { - this.cause = cause; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public String getError() - { - return error; - } - - public void setError(String error) - { - this.error = error; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/MinOutHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/MinOutHistoryBean.java deleted file mode 100644 index 7790d84f93..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/MinOutHistoryBean.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - - -public class MinOutHistoryBean extends UDIBean -{ - public Integer getMinOutId() - { - return minOutId; - } - - public void setMinOutId(Integer minOutId) - { - this.minOutId = minOutId; - } - - public Integer getInvoiceId() - { - return invoiceId; - } - - public void setInvoiceId(Integer invoiceId) - { - this.invoiceId = invoiceId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/OpenItemBean.java b/posterita/posterita/src/main/org/posterita/beans/OpenItemBean.java deleted file mode 100644 index db1f697866..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/OpenItemBean.java +++ /dev/null @@ -1,284 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 17, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; - - -public class OpenItemBean extends UDIBean -{ - - - public BigDecimal getAvailableAmt() - { - return AvailableAmt; - } - public void setAvailableAmt(BigDecimal availableAmt) - { - AvailableAmt = availableAmt; - } - public BigDecimal getPaymentAllocatedAmt() - { - return paymentAllocatedAmt; - } - public void setPaymentAllocatedAmt(BigDecimal paymentAllocatedAmt) - { - this.paymentAllocatedAmt = paymentAllocatedAmt; - } - public String getAllocationStatus() - { - return allocationStatus; - } - public void setAllocationStatus(String allocationStatus) - { - this.allocationStatus = allocationStatus; - } - public BigDecimal getAllocatedAmount() { - return allocatedAmount; - } - public void setAllocatedAmount(BigDecimal allocatedAmount) { - this.allocatedAmount = allocatedAmount; - } - - public Integer[] getPaymentIds() { - return paymentIds; - } - public void setPaymentIds(Integer[] paymentIds) { - this.paymentIds = paymentIds; - } - public String getTrxDate() { - return trxDate; - } - public void setTrxDate(String trxDate) { - this.trxDate = trxDate; - } - public BigDecimal getTaxedAmt() { - return taxedAmt; - } - public void setTaxedAmt(BigDecimal taxedAmt) { - this.taxedAmt = taxedAmt; - } - public Integer getPaymentId() { - return paymentId; - } - public void setPaymentId(Integer paymentId) { - this.paymentId = paymentId; - } - public String getPaymentNo() { - return paymentNo; - } - public void setPaymentNo(String paymentNo) { - this.paymentNo = paymentNo; - } - - - public String getTenderType() { - return tenderType; - } - public void setTenderType(String tenderType) { - this.tenderType = tenderType; - } - public String getForward() { - return forward; - } - public void setForward(String forward) { - this.forward = forward; - } - public String getPartnerName() { - return partnerName; - } - public void setPartnerName(String partnerName) { - this.partnerName = partnerName; - } - public String getPaymentTermName() { - return paymentTermName; - } - public void setPaymentTermName(String paymentTermName) { - this.paymentTermName = paymentTermName; - } - public String getInvoiceNo() { - return invoiceNo; - } - public void setInvoiceNo(String invoiceNo) { - this.invoiceNo = invoiceNo; - } - public String getChequeNo() { - return chequeNo; - } - public void setChequeNo(String chequeNo) { - this.chequeNo = chequeNo; - } - public String getCreditCardNumber() { - return creditCardNumber; - } - public void setCreditCardNumber(String creditCardNumber) { - this.creditCardNumber = creditCardNumber; - } - public String getInvoiceDate() { - return invoiceDate; - } - public void setInvoiceDate(String invoiceDate) { - this.invoiceDate = invoiceDate; - } - public Integer getBpartnerId() { - return bpartnerId; - } - public void setBpartnerId(Integer bpartnerId) { - this.bpartnerId = bpartnerId; - } - public Integer getPaymentTermId() { - return paymentTermId; - } - public Integer getCurrencyId() { - return currencyId; - } - public void setCurrencyId(Integer currencyId) { - this.currencyId = currencyId; - } - - public Integer getDaysDue() { - return daysDue; - } - public void setDaysDue(Integer daysDue) { - this.daysDue = daysDue; - } - public BigDecimal getDiscountAmt() { - return discountAmt; - } - public void setDiscountAmt(BigDecimal discountAmt) { - this.discountAmt = discountAmt; - } - public String getDiscountDate() { - return discountDate; - } - public void setDiscountDate(String discountDate) { - this.discountDate = discountDate; - } - public String getDocumentNo() { - return documentNo; - } - public void setDocumentNo(String documentNo) { - this.documentNo = documentNo; - } - public Timestamp getDueDate() { - return dueDate; - } - public void setDueDate(Timestamp dueDate) { - this.dueDate = dueDate; - } - - public Integer getInvoiceId() { - return invoiceId; - } - public void setInvoiceId(Integer invoiceId) { - this.invoiceId = invoiceId; - } - public Integer getInvoiceScheduleId() { - return invoiceScheduleId; - } - public void setInvoiceScheduleId(Integer invoiceScheduleId) { - this.invoiceScheduleId = invoiceScheduleId; - } - public Boolean getIsSoTrx() { - return isSoTrx; - } - public void setIsSoTrx(Boolean isSoTrx) { - this.isSoTrx = isSoTrx; - } - public Integer getNetDays() { - return netDays; - } - public void setNetDays(Integer netDays) { - this.netDays = netDays; - } - public BigDecimal getOpenAmt() { - return openAmt; - } - public void setOpenAmt(BigDecimal openAmt) { - this.openAmt = openAmt; - } - public Integer getOrderId() { - return orderId; - } - public void setOrderId(Integer orderId) { - this.orderId = orderId; - } - public BigDecimal getPaidAmt() { - return paidAmt; - } - public void setPaidAmt(BigDecimal paidAmt) { - this.paidAmt = paidAmt; - } - public Integer getPaumentTermId() { - return paymentTermId; - } - public void setPaymentTermId(Integer paymentTermId) { - this.paymentTermId = paymentTermId; - } - public BigDecimal getInvoiceGrandTotal() { - return invoiceGrandTotal; - } - public void setInvoiceGrandTotal(BigDecimal invoiceGrandTotal) { - this.invoiceGrandTotal = invoiceGrandTotal; - } - - public BigDecimal getOverUnderPayment() { - return overUnderPayment; - } - public void setOverUnderPayment(BigDecimal overUnderPayment) { - this.overUnderPayment = overUnderPayment; - } - - public BigDecimal getPaymentAmt() { - return paymentAmt; - } - public void setPaymentAmt(BigDecimal paymentAmt) { - this.paymentAmt = paymentAmt; - } - public String getTrxType() { - return trxType; - } - public void setTrxType(String trxType) { - this.trxType = trxType; - } - public BigDecimal getWriteOffAmt() { - return writeOffAmt; - } - public void setWriteOffAmt(BigDecimal writeOffAmt) { - this.writeOffAmt = writeOffAmt; - } - public String getCurrencySymbole() { - return currencySymbole; - } - public void setCurrencySymbole(String currencySymbole) { - this.currencySymbole = currencySymbole; - } - public Integer[] getInvoiceIds() { - return invoiceIds; - } - public void setInvoiceIds(Integer[] invoiceIds) { - this.invoiceIds = invoiceIds; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderBean.java deleted file mode 100644 index 3ea7d69e09..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/OrderBean.java +++ /dev/null @@ -1,172 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.beans; - -import java.math.BigDecimal; - -public class OrderBean -{ - private String orderType; - private String docStatus; - private String paymentRule; - private Integer orderId; - private Integer paymentTermId; - private Integer bpartnerId; - private Integer salesRepId; - private Integer priceListId; - private Integer warehouseId; - - //payment details - private BigDecimal amountTendered; - private BigDecimal amountRefunded; - private String cardType; - private String cardNo; - private String chequeNo; - private BigDecimal cashAmt; - private BigDecimal chequeAmt; - private BigDecimal cardAmt; - - private BigDecimal writeOffAmt; - private BigDecimal discountAmt; - - //getters and setters - - public String getOrderType() { - return orderType; - } - public void setOrderType(String orderType) { - this.orderType = orderType; - } - public String getDocStatus() { - return docStatus; - } - public void setDocStatus(String docStatus) { - this.docStatus = docStatus; - } - public String getPaymentRule() { - return paymentRule; - } - public void setPaymentRule(String paymentRule) { - this.paymentRule = paymentRule; - } - public Integer getOrderId() { - return orderId; - } - public void setOrderId(Integer orderId) { - this.orderId = orderId; - } - public Integer getPaymentTermId() { - return paymentTermId; - } - public void setPaymentTermId(Integer paymentTermId) { - this.paymentTermId = paymentTermId; - } - public Integer getBpartnerId() { - return bpartnerId; - } - public void setBpartnerId(Integer bpartnerId) { - this.bpartnerId = bpartnerId; - } - public Integer getSalesRepId() { - return salesRepId; - } - public void setSalesRepId(Integer salesRepId) { - this.salesRepId = salesRepId; - } - public Integer getPriceListId() { - return priceListId; - } - public void setPriceListId(Integer priceListId) { - this.priceListId = priceListId; - } - public Integer getWarehouseId() { - return warehouseId; - } - public void setWarehouseId(Integer warehouseId) { - this.warehouseId = warehouseId; - } - public BigDecimal getAmountTendered() { - return amountTendered; - } - public void setAmountTendered(BigDecimal amountTendered) { - this.amountTendered = amountTendered; - } - public BigDecimal getAmountRefunded() { - return amountRefunded; - } - public void setAmountRefunded(BigDecimal amountRefunded) { - this.amountRefunded = amountRefunded; - } - public String getCardType() { - return cardType; - } - public void setCardType(String cardType) { - this.cardType = cardType; - } - public String getCardNo() { - return cardNo; - } - public void setCardNo(String cardNo) { - this.cardNo = cardNo; - } - public String getChequeNo() { - return chequeNo; - } - public void setChequeNo(String chequeNo) { - this.chequeNo = chequeNo; - } - public BigDecimal getCashAmt() { - return cashAmt; - } - public void setCashAmt(BigDecimal cashAmt) { - this.cashAmt = cashAmt; - } - public BigDecimal getChequeAmt() { - return chequeAmt; - } - public void setChequeAmt(BigDecimal chequeAmt) { - this.chequeAmt = chequeAmt; - } - public BigDecimal getCardAmt() { - return cardAmt; - } - public void setCardAmt(BigDecimal cardAmt) { - this.cardAmt = cardAmt; - } - public BigDecimal getWriteOffAmt() { - return writeOffAmt; - } - public void setWriteOffAmt(BigDecimal writeOffAmt) { - this.writeOffAmt = writeOffAmt; - } - public BigDecimal getDiscountAmt() { - return discountAmt; - } - public void setDiscountAmt(BigDecimal discountAmt) { - this.discountAmt = discountAmt; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderHistoryBean.java deleted file mode 100644 index e67ff4799d..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/OrderHistoryBean.java +++ /dev/null @@ -1,339 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 04-Aug-2005 by alok - * - */ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.ArrayList; - - -public class OrderHistoryBean extends FilterBean -{ - public ArrayList orderHistoryBean; - private ArrayList invoiceHistoryList; - private ArrayList orderHistoryList; - - protected Integer refOrderId; - private FilterBean filterBean; - private String serno; - - - - - - public Integer getDocumentId() { - return documentId; - } - public void setDocumentId(Integer documentId) { - this.documentId = documentId; - } - public Integer[] getOrderIds() { - return orderIds; - } - public void setOrderIds(Integer[] orderIds) { - this.orderIds = orderIds; - } - public String getSerno() { - return serno; - } - - public void setSerno(String serno) { - this.serno = serno; - } - - public Integer getRefOrderId() - { - return refOrderId; - } - - public void setRefOrderId(Integer refOrderId) - { - this.refOrderId = refOrderId; - } - - public Integer getRefToQuote() - { - return refToQuote; - } - public void setRefToQuote(Integer refToQuote) - { - this.refToQuote = refToQuote; - } - public String getOrderType() - { - return orderType; - } - public void setOrderType(String orderType) - { - this.orderType = orderType; - } - public ArrayList getOrderHistoryBean() - { - return orderHistoryBean; - } - - public void setOrderHistoryBean(ArrayList orderHistoryBean) - { - this.orderHistoryBean = orderHistoryBean; - } - - public Integer getInOutId() - { - return inOutId; - } - - public void setInOutId(Integer inOutId) - { - this.inOutId = inOutId; - } - - public Integer getInvoiceId() - { - return invoiceId; - } - - public void setInvoiceId(Integer invoiceId) - { - this.invoiceId = invoiceId; - } - - public Integer getPaymentId() - { - return paymentId; - } - - public void setPaymentId(Integer paymentId) - { - this.paymentId = paymentId; - } - - public String getPartnerName() - { - return partnerName; - } - - public void setPartnerName(String partnerName) - { - this.partnerName = partnerName; - } - public Integer getBpartnerId() - { - return bpartnerId; - } - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - - public Timestamp getDateOrdered() - { - return dateOrdered; - } - public void setDateOrdered(Timestamp dateOrdered) - { - this.dateOrdered = dateOrdered; - } - public String getDatePromised() - { - return datePromised; - } - public void setDatePromised(String datePromised) - { - this.datePromised = datePromised; - } - public BigDecimal getOrderGrandTotal() - { - return orderGrandTotal; - } - public void setOrderGrandTotal(BigDecimal orderGrandTotal) - { - this.orderGrandTotal = orderGrandTotal; - } - public String getIsApproved() - { - return isApproved; - } - public void setIsApproved(String isApproved) - { - this.isApproved = isApproved; - } - public String getIsDelivered() - { - return isDelivered; - } - public void setIsDelivered(String isDelivered) - { - this.isDelivered = isDelivered; - } - public String getIsInvoiced() - { - return isInvoiced; - } - public void setIsInvoiced(String isInvoiced) - { - this.isInvoiced = isInvoiced; - } - public Boolean getIsSotrx() - { - return isSoTrx; - } - public void setIsSotrx(Boolean isSotrx) - { - this.isSoTrx = isSotrx; - } - public Integer getOrderId() - { - return orderId; - } - public void setOrderId(Integer orderId) - { - this.orderId = orderId; - } - public String getPoReference() - { - return poReference; - } - public void setPoReference(String poReference) - { - this.poReference = poReference; - } - - public Boolean getIsSoTrx() - { - return isSoTrx; - } - - public void setIsSoTrx(Boolean isSoTrx) - { - this.isSoTrx = isSoTrx; - } - - public ArrayList getInvoiceHistoryList() - { - return invoiceHistoryList; - } - - public void setInvoiceHistoryList(ArrayList list) - { - this.invoiceHistoryList = list; - } - - public String getSotrxFlag() - { - return sotrxFlag; - } - - public void setSotrxFlag(String sotrxFlag) - { - this.sotrxFlag = sotrxFlag; - } - - public FilterBean getFilterBean() - { - return filterBean; - } - - public void setFilterBean(FilterBean filterBean) - { - this.filterBean = filterBean; - } - - public String getBpName() - { - return bpName; - } - - public void setBpName(String bpName) - { - this.bpName = bpName; - } - - public String getDocStatus() - { - return docStatus; - } - - public void setDocStatus(String docStatus) - { - this.docStatus = docStatus; - } - - public ArrayList getOrderHistoryList() - { - return orderHistoryList; - } - - public void setOrderHistoryList(ArrayList orderHistoryList) - { - this.orderHistoryList = orderHistoryList; - } - - public String getCompiereDocStatus() - { - return compiereDocStatus; - } - - public void setCompiereDocStatus(String compiereDocStatus) - { - this.compiereDocStatus = compiereDocStatus; - } - - public Integer getOrderlineCount() - { - return orderlineCount; - } - - public void setOrderlineCount(Integer orderlineCount) - { - this.orderlineCount = orderlineCount; - } - - public Integer getOrderlineInvoicedCount() - { - return orderlineInvoicedCount; - } - - public void setOrderlineInvoicedCount(Integer orderlineInvoicedCount) - { - this.orderlineInvoicedCount = orderlineInvoicedCount; - } - - public Integer getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - - public void setAttributeSetInstanceId(Integer attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - - public Timestamp getDateInvoiced() - { - return dateInvoiced; - } - - public void setDateInvoiced(Timestamp dateInvoiced) - { - this.dateInvoiced = dateInvoiced; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderInfoBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderInfoBean.java deleted file mode 100644 index 14c2ebd399..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/OrderInfoBean.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 8, 2005 by praveen - * - */ -package org.posterita.beans; - -import java.sql.Timestamp; - -public class OrderInfoBean -{ - private Integer orderId; - private Integer poReference; - private Timestamp dateOrdered; - private String docStatus; - private String orderedFrom; - private String vinNumber; - private String reserved; - private String assetStatus; - private String orderBy; - private String docType; - private Integer attributeSetInstanceId; - - public Timestamp getDateOrdered() - { - return dateOrdered; - } - - public void setDateOrdered(Timestamp dateOrdered) - { - this.dateOrdered = dateOrdered; - } - - public String getDocStatus() - { - return docStatus; - } - - public void setDocStatus(String docStatus) - { - this.docStatus = docStatus; - } - - public String getOrderedFrom() - { - return orderedFrom; - } - - public void setOrderedFrom(String orderedFrom) - { - this.orderedFrom = orderedFrom; - } - - public Integer getPoReference() - { - return poReference; - } - - public void setPoReference(Integer poReference) - { - this.poReference = poReference; - } - - public Integer getOrderId() - { - return orderId; - } - - public void setOrderId(Integer orderId) - { - this.orderId = orderId; - } - - public String getAssetStatus() - { - return assetStatus; - } - - public void setAssetStatus(String assetStatus) - { - this.assetStatus = assetStatus; - } - - public String getDocType() - { - return docType; - } - - public void setDocType(String docType) - { - this.docType = docType; - } - - public String getOrderBy() - { - return orderBy; - } - - public void setOrderBy(String orderBy) - { - this.orderBy = orderBy; - } - - public String getReserved() - { - return reserved; - } - - public void setReserved(String reserved) - { - this.reserved = reserved; - } - - public String getVinNumber() - { - return vinNumber; - } - - public void setVinNumber(String vinNumber) - { - this.vinNumber = vinNumber; - } - - public Integer getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - - public void setAttributeSetInstanceId(Integer attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderLineAttributeSetInstanceBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderLineAttributeSetInstanceBean.java deleted file mode 100644 index 0bea792765..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/OrderLineAttributeSetInstanceBean.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - - -public class OrderLineAttributeSetInstanceBean -{ - private int orderLineId; - private int attributeSetInstanceId; - - public int getOrderLineId() - { - return orderLineId; - } - - public void setOrderLineId(int orderLineId) - { - this.orderLineId = orderLineId; - } - - public int getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - - public void setAttributeSetInstanceId(int attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderLineBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderLineBean.java deleted file mode 100644 index d9edbe6f86..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/OrderLineBean.java +++ /dev/null @@ -1,476 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 09-Aug-2005 by alok - * - */ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.ArrayList; - -public class OrderLineBean extends DocumentBean implements Comparable -{ - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public Double getTotalActualPrice() { - return totalActualPrice; - } - public void setTotalActualPrice(Double totalActualPrice) { - this.totalActualPrice = totalActualPrice; - } - public Double getPaymentByCard() { - return paymentByCard; - } - public void setPaymentByCard(Double paymentByCard) { - this.paymentByCard = paymentByCard; - } - public Double getPaymentByCash() { - return paymentByCash; - } - public void setPaymentByCash(Double paymentByCash) { - this.paymentByCash = paymentByCash; - } - public Double getPaymentByChq() { - return paymentByChq; - } - public void setPaymentByChq(Double paymentByChq) { - this.paymentByChq = paymentByChq; - } - public String[] getActualPrice() { - return actualPrice; - } - public void setActualPrice(String[] actualPrice) { - this.actualPrice = actualPrice; - } - - public String[] getDiscountPercent() { - return discountPercent; - } - public void setDiscountPercent(String[] discountPercent) { - this.discountPercent = discountPercent; - } - public String getQtyAndItem() { - return qtyAndItem; - } - public void setQtyAndItem(String qtyAndItem) { - this.qtyAndItem = qtyAndItem; - } - public String getBarCode() { - return barCode; - } - public void setBarCode(String barCode) { - this.barCode = barCode; - } - - public String getPartnerName() { - return partnerName; - } - public void setPartnerName(String partnerName) { - this.partnerName = partnerName; - } - public Integer[] getPosOrderLineIds() - { - return posOrderLineIds; - } - - public void setPosOrderLineIds(Integer[] posOrderLineIds) - { - this.posOrderLineIds = posOrderLineIds; - } - public String getChequeNo() - { - return chequeNo; - } - - public void setChequeNo(String chequeNo) - { - this.chequeNo = chequeNo; - } - - public Integer getCreditCardExpMonth() - { - return creditCardExpMonth; - } - - public void setCreditCardExpMonth(Integer creditCardExpMonth) - { - this.creditCardExpMonth = creditCardExpMonth; - } - - public Integer getCreditCardExpYear() - { - return creditCardExpYear; - } - - public void setCreditCardExpYear(Integer creditCardExpYear) - { - this.creditCardExpYear = creditCardExpYear; - } - - public String getCreditCardNumber() - { - return creditCardNumber; - } - - public void setCreditCardNumber(String creditCardNumber) - { - this.creditCardNumber = creditCardNumber; - } - - public String getCreditCardType() - { - return creditCardType; - } - - public void setCreditCardType(String creditCardType) - { - this.creditCardType = creditCardType; - } - public Integer getOrderId() - { - return orderId; - } - - public void setOrderId(Integer orderId) - { - this.orderId = orderId; - } - public String getSurname() { - return surname; - } - public void setSurname(String surname) { - this.surname = surname; - } - - public Integer getBpartnerId() - { - return bpartnerId; - } - - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - public Boolean getIsQtyReserved() - { - return isQtyReserved; - } - - public void setIsQtyReserved(Boolean isQtyReserved) - { - this.isQtyReserved = isQtyReserved; - } - public String getEngineNo() { - return engineNo; - } - public void setEngineNo(String engineNo) { - this.engineNo = engineNo; - } - public BigDecimal getQuantity() - { - return quantity; - } - - public void setQuantity(BigDecimal quantity) - { - this.quantity = quantity; - } - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - - public Integer[] getCheckBox() - { - return checkBox; - } - public void setCheckBox(Integer [] checkBox) - { - this.checkBox = checkBox; - } - - public Integer getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - - public void setAttributeSetInstanceId(Integer attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - - public ArrayList getOrderLineList() - { - return orderLineList; - } - public void setOrderLineList(ArrayList orderLineList) - { - this.orderLineList = orderLineList; - } - - public Integer getOrderLineId() - { - return orderLineId; - } - - public void setOrderLineId(Integer orderLineId) - { - this.orderLineId = orderLineId; - } - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public Integer getAllocationId() - { - return allocationId; - } - - public void setAllocationId(Integer allocationId) - { - this.allocationId = allocationId; - } - - public boolean equals(Object obj) - { - OrderLineBean target = (OrderLineBean) obj; - - if ( obj == null) - return false; - - if (this.getAttributeSetInstanceId().equals(target.getAttributeSetInstanceId())) - return true; - - return false; - } - - public String getSubmit() - { - return submit; - } - - public void setSubmit(String submit) - { - this.submit = submit; - } - - - public int compareTo(Object o) - { - OrderLineBean src = (OrderLineBean) o; - - if (src.getAttributeSetInstanceId().intValue() == this.getAttributeSetInstanceId().intValue()) - return 0; - - - return -1; - } - - - - - - - public BigDecimal getAmountGiven() - { - return amountGiven; - } - - public void setAmountGiven(BigDecimal amountGiven) - { - this.amountGiven = amountGiven; - } - - public BigDecimal getAmountRefunded() - { - return amountRefunded; - } - - public void setAmountRefunded(BigDecimal amountRefunded) - { - this.amountRefunded = amountRefunded; - } - public String getTrxType() - { - return trxType; - } - - public void setTrxType(String trxType) - { - this.trxType = trxType; - } - - public BigDecimal getTransferAmount() { - return transferAmount; - } - public void setTransferAmount(BigDecimal transferAmount) { - this.transferAmount = transferAmount; - } - - public Integer getCashBookIds() { - return cashBookIds; - } - public void setCashBookIds(Integer cashBookIds) { - this.cashBookIds = cashBookIds; - } - public String getIsSales() { - return isSales; - } - public void setIsSales(String isSales) { - this.isSales = isSales; - } - public String getIfAdd() { - return ifAdd; - } - public void setIfAdd(String ifAdd) { - this.ifAdd = ifAdd; - } - - public String getVendorName() { - return vendorName; - } - public void setVendorName(String vendorName) { - this.vendorName = vendorName; - } - - public String getDocumentNo() { - return documentNo; - } - public void setDocumentNo(String documentNo) { - this.documentNo = documentNo; - } - - public BigDecimal getUserDiscount() { - return userDiscount; - } - public void setUserDiscount(BigDecimal userDiscount) { - this.userDiscount = userDiscount; - } - - public Integer getPaymentTermId() { - return paymentTermId; - } - public void setPaymentTermId(Integer paymentTermId) { - this.paymentTermId = paymentTermId; - } - - public String getPaymentTermName() { - return paymentTermName; - } - public void setPaymentTermName(String paymentTermName) { - this.paymentTermName = paymentTermName; - } - public String getToBeShipped() { - return toBeShipped; - } - public void setToBeShipped(String toBeShipped) { - this.toBeShipped = toBeShipped; - } - - public Boolean getOpenDrawer() { - return openDrawer; - } - public void setOpenDrawer(Boolean openDrawer) { - this.openDrawer = openDrawer; - } - - public void setUom(String uom) - { - this.uom = uom; - } - - public String getUom() - { - return this.uom; - } - public Integer getPriceListId() { - return priceListId; - } - public void setPriceListId(Integer priceListId) { - this.priceListId = priceListId; - } - - public BigDecimal getUnitPurchasePrice() - { - return unitPurchasePrice; - } - - public void setUnitPurchasePrice(BigDecimal unitPurchasePrice) - { - this.unitPurchasePrice = unitPurchasePrice; - } - - public BigDecimal getGrossProfit() - { - return grossProfit; - } - - public void setGrossProfit(BigDecimal grossProfit) - { - this.grossProfit = grossProfit; - } - - public BigDecimal getTotalGrossProfit() - { - return totalGrossProfit; - } - - public void setTotalGrossProfit(BigDecimal totalGrossProfit) - { - this.totalGrossProfit = totalGrossProfit; - } - - protected String paymentRule; - - public String getPaymentRule() { - return paymentRule; - } - - public void setPaymentRule(String paymentRule) { - this.paymentRule = paymentRule; - } - public Integer getRoleId() - { - return roleId; - } - public void setRoleId(Integer roleId) - { - this.roleId = roleId; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrderLineImporterBean.java b/posterita/posterita/src/main/org/posterita/beans/OrderLineImporterBean.java deleted file mode 100644 index c7643bab34..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/OrderLineImporterBean.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Nov 4, 2005 by ashley -* -*/ - -package org.posterita.beans; - -public class OrderLineImporterBean extends UDIBean -{ - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrgBean.java b/posterita/posterita/src/main/org/posterita/beans/OrgBean.java deleted file mode 100644 index 85002ae5f7..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/OrgBean.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - -public class OrgBean extends UDIBean -{ - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public String getAddress2() { - return address2; - } - - public void setAddress2(String address2) { - this.address2 = address2; - } - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - public String getAddress1() - { - return address1; - } - public void setAddress1(String address1) - { - this.address1 = address1; - } - - public String getCity() - { - return city; - } - - public void setCity(String city) - { - this.city = city; - } - - public String getOrgName() - { - return orgName; - } - - public void setOrgName(String orgName) - { - this.orgName = orgName; - } - - public String getPostalAddress() - { - return postalAddress; - } - - public void setPostalAddress(String postalAddress1) - { - this.postalAddress = postalAddress1; - } - - public Integer getRegionId() - { - return regionId; - } - - public void setRegionId(Integer regionId) - { - this.regionId = regionId; - } - - public String getRegion() - { - return region; - } - - public void setRegion(String region) - { - this.region = region; - } - - - public String getFax() - { - return fax; - } - - public void setFax(String fax) - { - this.fax = fax; - } - - public String getPhone() - { - return phone; - } - - public void setPhone(String phone) - { - this.phone = phone; - } - - public Boolean getIsActive() - { - return isActive; - } - - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - - public String getActive() - { - return active; - } - - public void setActive(String active) - { - this.active = active; - } - - public void setCountryId(Integer countryId) - { - this.countryId = countryId; - } - - public Integer getCountryId() - { - return this.countryId; - } - - public String getReceiptFooterMsg() - { - return receiptFooterMsg; - } - - public void setReceiptFooterMsg(String receiptFooterMsg) - { - this.receiptFooterMsg = receiptFooterMsg; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/OrgUsersBean.java b/posterita/posterita/src/main/org/posterita/beans/OrgUsersBean.java deleted file mode 100644 index 073d4e3375..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/OrgUsersBean.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 2, 2005 by din - */ - -package org.posterita.beans; - -import java.util.Vector; - - - - -public class OrgUsersBean extends UDIBean -{ - - - public String getOrgName() - { - return orgName; - } - - public void setOrgName(String orgName) - { - this.orgName = orgName; - } - - public Integer getOrgId() - { - return orgId; - } - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public Vector getOrgUsers() - { - return orgUsers; - } - public void setOrgUsers(Vector orgUsers) - { - this.orgUsers = orgUsers; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSBean.java b/posterita/posterita/src/main/org/posterita/beans/POSBean.java deleted file mode 100644 index 2db5f71783..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/POSBean.java +++ /dev/null @@ -1,234 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 17-Mar-2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; - - -public class POSBean extends OrderLineBean -{ - public Timestamp getDateCreated() { - return dateCreated; - } - public void setDateCreated(Timestamp dateCreated) { - this.dateCreated = dateCreated; - } - public String getCashJournalDisc() { - return cashJournalDisc; - } - public void setCashJournalDisc(String cashJournalDisc) { - this.cashJournalDisc = cashJournalDisc; - } - public Integer getCashJournalId() { - return cashJournalId; - } - public void setCashJournalId(Integer cashJournalId) { - this.cashJournalId = cashJournalId; - } - public String getCashJournalName() { - return cashJournalName; - } - public void setCashJournalName(String cashJournalName) { - this.cashJournalName = cashJournalName; - } - public Timestamp getDateAcct() { - return dateAcct; - } - public void setDateAcct(Timestamp dateAcct) { - this.dateAcct = dateAcct; - } - public String getDocStatus() { - return docStatus; - } - public void setDocStatus(String docStatus) { - this.docStatus = docStatus; - } - public Integer getGrandTotal() { - return grandTotal; - } - public void setGrandTotal(Integer grandTotal) { - this.grandTotal = grandTotal; - } - public String getPaymentRule() { - return paymentRule; - } - public void setPaymentRule(String paymentRule) { - this.paymentRule = paymentRule; - } - public Integer getPriceListId() { - return priceListId; - } - public void setPriceListId(Integer priceListId) { - this.priceListId = priceListId; - } - public String getPriceListName() { - return priceListName; - } - public void setPriceListName(String priceListName) { - this.priceListName = priceListName; - } - public String getWarehouseName() { - return warehouseName; - } - public void setWarehouseName(String warehouseName) { - this.warehouseName = warehouseName; - } - public String getPosDesc() - { - return posDesc; - } - public void setPosDesc(String posDesc) - { - this.posDesc = posDesc; - } - public Integer getPosId() - { - return posId; - } - public void setPosId(Integer posId) - { - this.posId = posId; - } - public String getPosName() - { - return posName; - } - public void setPosName(String posName) - { - this.posName = posName; - } - public String getSaleRepName() - { - return saleRepName; - } - public void setSaleRepName(String saleRepName) - { - this.saleRepName = saleRepName; - } - public Integer getSalesRepId() - { - return salesRepId; - } - public void setSalesRepId(Integer salesRepId) - { - this.salesRepId = salesRepId; - } - public Integer getWarehouseId() - { - return warehouseId; - } - public void setWarehouseId(Integer warehouseId) - { - this.warehouseId = warehouseId; - } - public Integer getCashBookId() - { - return cashBookId; - } - - public void setCashBookId(Integer cashBookId) - { - this.cashBookId = cashBookId; - } - - public String getCashBookName() - { - return cashBookName; - } - - public void setCashBookName(String cashBookName) - { - this.cashBookName = cashBookName; - } - public String getTrxType() - { - return trxType; - } - - - public void setTrxType(String trxType) - { - this.trxType = trxType; - } - public BigDecimal getAmount() - { - return amount; - } - - public void setAmount(BigDecimal amount) { - this.amount = amount; - } - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - public BigDecimal getBeginingBalance() - { - return beginingBalance; - } - - public void setBeginingBalance(BigDecimal beginingBalance) - { - this.beginingBalance = beginingBalance; - } - - public BigDecimal getEndingBalance() - { - return endingBalance; - } - - public void setEndingBalance(BigDecimal endingBalance) - { - this.endingBalance = endingBalance; - } - - public BigDecimal getStatementDifference() - { - return statementDifference; - } - - public void setStatementDifference(BigDecimal statementDifference) - { - this.statementDifference = statementDifference; - } - - public String toString() - { - StringBuffer buffer = new StringBuffer(); - buffer.append("\n POS NAME= "+ getPosName()); - buffer.append("\n PAYMENT RULE = " + getPaymentRule()); - buffer.append("\n TOTAL = "+getGrandTotal()); - buffer.append("\n The Begining Balance = "+getBeginingBalance()); - buffer.append("\n The Ending Balance = "+getEndingBalance()); - - return buffer.toString(); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSDescriptionBean.java b/posterita/posterita/src/main/org/posterita/beans/POSDescriptionBean.java deleted file mode 100644 index adff505990..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/POSDescriptionBean.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 4, 2006 - */ - - -package org.posterita.beans; - - -public class POSDescriptionBean extends UDIBean -{ - - - public String getPosName() { - return posName; - } - public void setPosName(String posName) { - this.posName = posName; - } - public Integer getPosId() { - return posId; - } - public void setPosId(Integer posId) { - this.posId = posId; - } - public Integer getWareHouseId() { - return wareHouseId; - } - public void setWareHouseId(Integer wareHouseId) { - this.wareHouseId = wareHouseId; - } - public String getWarehouseName() { - return warehouseName; - } - public void setWarehouseName(String warehouseName) { - this.warehouseName = warehouseName; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSHelpBean.java b/posterita/posterita/src/main/org/posterita/beans/POSHelpBean.java deleted file mode 100644 index 95f3c7a22d..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/POSHelpBean.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * 6 Feb 2008 18:03:33 by shameem - * - */ - -package org.posterita.beans; - -public class POSHelpBean extends UDIBean -{ - public String getSubject() { - return subject; - } - public void setSubject(String subject) { - this.subject = subject; - } - public String getFromAddress() { - return fromAddress; - } - public void setFromAddress(String fromAddress) { - this.fromAddress = fromAddress; - } - public String getToAddresses() { - return toAddresses; - } - public void setToAddresses(String toAddresses) { - this.toAddresses = toAddresses; - } - public String getTextMessage() { - return textMessage; - } - public void setTextMessage(String textMessage) { - this.textMessage = textMessage; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/POSHistoryBean.java deleted file mode 100644 index 3727a209a5..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/POSHistoryBean.java +++ /dev/null @@ -1,214 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on May 15, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; - - -public class POSHistoryBean extends UDIBean -{ - public Boolean isCustomer; - private Integer invoiceRefNo; - private String invoiceDocumentNo; - private BigDecimal amountPaid; - - public BigDecimal getGrossProfit() - { - return grossProfit; - } - public void setGrossProfit(BigDecimal grossProfit) - { - this.grossProfit = grossProfit; - } - public String getHistoryType() - { - return historyType; - } - public void setHistoryType(String historyType) - { - this.historyType = historyType; - } - public Integer getBpartnerId() - { - return bpartnerId; - } - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - public String getPaymentRule() { - return paymentRule; - } - public void setPaymentRule(String paymentRule) { - this.paymentRule = paymentRule; - } - public String getOrderType() { - return orderType; - } - public void setOrderType(String orderType) { - this.orderType = orderType; - } - public Integer getMonth() { - return month; - } - public void setMonth(Integer month) { - this.month = month; - } - public Integer getYear() { - return year; - } - public void setYear(Integer year) { - this.year = year; - } - public Timestamp getDateAcct() { - return dateAcct; - } - public void setDateAcct(Timestamp dateAcct) { - this.dateAcct = dateAcct; - } - public String getDocumentNo() { - return documentNo; - } - public void setDocumentNo(String documentNo) { - this.documentNo = documentNo; - } - public BigDecimal getOrderGrandTotal() { - return orderGrandTotal; - } - public void setOrderGrandTotal(BigDecimal orderGrandTotal) { - this.orderGrandTotal = orderGrandTotal; - } - public Integer getInvoiceId() { - return invoiceId; - } - public void setInvoiceId(Integer invoiceId) { - this.invoiceId = invoiceId; - } - public Integer getOrderId() { - return orderId; - } - public void setOrderId(Integer orderId) { - this.orderId = orderId; - } - public String getPartnerName() { - return partnerName; - } - public void setPartnerName(String partnerName) { - this.partnerName = partnerName; - } - public String getDocStatus() - { - return docStatus; - } - public void setDocStatus(String docStatus) - { - this.docStatus = docStatus; - } - public Boolean getIsCustomer() - { - return isCustomer; - } - public void setIsCustomer(Boolean isCustomer) - { - this.isCustomer = isCustomer; - } - - public Integer getInvoiceRefNo() - { - return invoiceRefNo; - } - - public void setInvoiceRefNo(Integer invoiceRefNo) - { - this.invoiceRefNo = invoiceRefNo; - } - public Integer getOrgId() { - return orgId; - } - public void setOrgId(Integer orgId) { - this.orgId = orgId; - } - - /** - * @return The cashBookId - */ - public Integer getCashBookId() - { - return cashBookId; - } - - /** - * @param cashBookId The cashBookId to set - */ - public void setCashBookId(Integer cashBookId) - { - this.cashBookId = cashBookId; - } - - /** - * @return The invoiceDocumentNo - */ - public String getInvoiceDocumentNo() - { - return invoiceDocumentNo; - } - - /** - * @param invoiceDocumentNo The invoiceDocumentNo to set - */ - public void setInvoiceDocumentNo(String invoiceDocumentNo) - { - this.invoiceDocumentNo = invoiceDocumentNo; - } - - /** - * @return The amountPaid - */ - public BigDecimal getAmountPaid() - { - return amountPaid; - } - - /** - * @param amountPaid The amountPaid to set - */ - public void setAmountPaid(BigDecimal amountPaid) - { - this.amountPaid = amountPaid; - } - /** - * @return The dateOrdered - */ - public Timestamp getDateOrdered() - { - return dateOrdered; - } - /** - * @param dateOrdered The dateOrdered to set - */ - public void setDateOrdered(Timestamp dateOrdered) - { - this.dateOrdered = dateOrdered; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSInfoBean.java b/posterita/posterita/src/main/org/posterita/beans/POSInfoBean.java deleted file mode 100644 index 04a878b9f2..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/POSInfoBean.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 3, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; - - -public class POSInfoBean extends UDIBean -{ - public String getOrgName() - { - return orgName; - } - public void setOrgName(String orgName) - { - this.orgName = orgName; - } - public String getPosName() - { - return posName; - } - public void setPosName(String posName) - { - this.posName = posName; - } - - public String getPaymentRule() { - return paymentRule; - } - public void setPaymentRule(String paymentRule) { - this.paymentRule = paymentRule; - } - public BigDecimal getOrderGrandTotal() { - return orderGrandTotal; - } - public void setOrderGrandTotal(BigDecimal orderGrandTotal) { - this.orderGrandTotal = orderGrandTotal; - } - - public BigDecimal getTillGrandTotal() - { - return tillGrandTotal; - } - public void setTillGrandTotal(BigDecimal tillGrandTotal) - { - this.tillGrandTotal = tillGrandTotal; - } - public BigDecimal getCashTotal() - { - return cashTotal; - } - - public void setCashTotal(BigDecimal cashTotal) - { - this.cashTotal = cashTotal; - } - - public BigDecimal getCardTotal() - { - return cardTotal; - } - public void setCardTotal(BigDecimal cardTotal) - { - this.cardTotal = cardTotal; - } - public BigDecimal getChequeTotal() - { - return chequeTotal; - } - public void setChequeTotal(BigDecimal chequeTotal) - { - this.chequeTotal = chequeTotal; - } - public String toString() - { - StringBuffer buffer = new StringBuffer(); - buffer.append("\n POS NAME= "+ getPosName()); - buffer.append("\n PAYMENT RULE = " + getPaymentRule()); - buffer.append("\n TOTAL = "+getOrderGrandTotal()); - - - return buffer.toString(); - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSReportBean.java b/posterita/posterita/src/main/org/posterita/beans/POSReportBean.java deleted file mode 100644 index c9f2918795..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/POSReportBean.java +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 11, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; - - -public class POSReportBean extends UDIBean -{ - - - - - - - - public Integer getProductId() { - return productId; - } - public void setProductId(Integer productId) { - this.productId = productId; - } - public BigDecimal getQtyInventoryIn() { - return qtyInventoryIn; - } - public void setQtyInventoryIn(BigDecimal qtyInventoryIn) { - this.qtyInventoryIn = qtyInventoryIn; - } - public BigDecimal getQtyInventoryOut() { - return qtyInventoryOut; - } - public void setQtyInventoryOut(BigDecimal qtyInventoryOut) { - this.qtyInventoryOut = qtyInventoryOut; - } - public String getProductCategory() { - return productCategory; - } - public void setProductCategory(String productCategory) { - this.productCategory = productCategory; - } - public String getBrandName() { - return brandName; - } - public void setBrandName(String brandName) { - this.brandName = brandName; - } - public String getColourName() { - return colourName; - } - public void setColourName(String colourName) { - this.colourName = colourName; - } - public String getDesignName() { - return designName; - } - public void setDesignName(String designName) { - this.designName = designName; - } - public BigDecimal getEndingBalance() - { - return endingBalance; - } - - public void setEndingBalance(BigDecimal endingBalance) - { - this.endingBalance = endingBalance; - } - public String getModelName() { - return modelName; - } - public void setModelName(String modelName) { - this.modelName = modelName; - } - public String getPartnerName() { - return partnerName; - } - public void setPartnerName(String partnerName) { - this.partnerName = partnerName; - } - public BigDecimal getQuantity() { - return quantity; - } - public void setQuantity(BigDecimal quantity) { - this.quantity= quantity; - } - public String getSizeName() { - return sizeName; - } - public void setSizeName(String sizeName) { - this.sizeName = sizeName; - } - public BigDecimal getCloseingBalanceQty() { - return closeingBalanceQty; - } - public void setCloseingBalanceQty(BigDecimal closeingBalanceQty) { - this.closeingBalanceQty = closeingBalanceQty; - } - public String getProductName() { - return productName; - } - public void setProductName(String productName) { - this.productName = productName; - } - public BigDecimal getOpeningBalanceQty() { - return openingBalanceQty; - } - public void setOpeningBalanceQty(BigDecimal openingBalanceQty) { - this.openingBalanceQty = openingBalanceQty; - } - public BigDecimal getQtyOfGoodsReceived() { - return qtyOfGoodsReceived; - } - public void setQtyOfGoodsReceived(BigDecimal qtyOfGoodsReceived) { - this.qtyOfGoodsReceived = qtyOfGoodsReceived; - } - public BigDecimal getQtyOfGoodsReturned() { - return qtyOfGoodsReturned; - } - public void setQtyOfGoodsReturned(BigDecimal qtyOfGoodsReturned) { - this.qtyOfGoodsReturned = qtyOfGoodsReturned; - } - public BigDecimal getQtyOfGoodsSold() { - return qtyOfGoodsSold; - } - public void setQtyOfGoodsSold(BigDecimal qtyOfGoodsSold) { - this.qtyOfGoodsSold = qtyOfGoodsSold; - } - public BigDecimal getQtyReturnedByCustomer() { - return qtyReturnedByCustomer; - } - public void setQtyReturnedByCustomer(BigDecimal qtyReturnedByCustomer) { - this.qtyReturnedByCustomer = qtyReturnedByCustomer; - } - public void setUom(String uom) - { - this.uom = uom; - } - public String getUom() - { - return this.uom; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSStockBean.java b/posterita/posterita/src/main/org/posterita/beans/POSStockBean.java deleted file mode 100644 index de9546a608..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/POSStockBean.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 8, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.HashMap; - - -public class POSStockBean extends UDIBean -{ - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public String getUom() - { - return uom; - } - - public void setUom(String uom) - { - this.uom = uom; - } - - - public String getQtyFilter() { - return qtyFilter; - } - - public void setQtyFilter(String qtyFilter) { - this.qtyFilter = qtyFilter; - } - - public Boolean getIsTextileProduct() { - return isTextileProduct; - } - - public void setIsTextileProduct(Boolean isTextileProduct) { - this.isTextileProduct = isTextileProduct; - } - - public Integer getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - - public void setAttributeSetInstanceId(Integer attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - - public HashMap getAttributeValuesMap() { - return attributeValuesMap; - } - public void setAttributeValuesMap(HashMap attributeValuesMap) { - this.attributeValuesMap = attributeValuesMap; - } - public Integer getProductId() { - return productId; - } - public void setProductId(Integer productId) { - this.productId = productId; - } - public String getProductName() { - return productName; - } - public void setProductName(String productName) { - this.productName = productName; - } - public BigDecimal getQuantity() { - return quantity; - } - public void setQuantity(BigDecimal quantity) { - this.quantity = quantity; - } - public String getBrandName() { - return brandName; - } - public void setBrandName(String brandName) { - this.brandName = brandName; - } - public String getColourName() { - return colourName; - } - public void setColourName(String colourName) { - this.colourName = colourName; - } - public String getDesignName() { - return designName; - } - public void setDesignName(String designName) { - this.designName = designName; - } - public String getModelName() { - return modelName; - } - public void setModelName(String modelName) { - this.modelName = modelName; - } - public String getSizeName() { - return sizeName; - } - public void setSizeName(String sizeName) { - this.sizeName = sizeName; - } - - public AttributeValuesPair getAttributeValuesPair() - { - return attributeValuesPair; - } - - public void setAttributeValuesPair(AttributeValuesPair attributeValuesPair) - { - this.attributeValuesPair = attributeValuesPair; - } - - public void setQtyOnHand(BigDecimal qtyAvailable) - { - // TODO Auto-generated method stub - - } - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/POSSupplierBean.java b/posterita/posterita/src/main/org/posterita/beans/POSSupplierBean.java deleted file mode 100644 index 1e926e7f31..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/POSSupplierBean.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 8, 2006 - */ - - -package org.posterita.beans; - - -public class POSSupplierBean extends UDIBean -{ - - - public Integer getBpartnerId() { - return bpartnerId; - } - public void setBpartnerId(Integer bpartnerId) { - this.bpartnerId = bpartnerId; - } - public String getPartnerName() { - return partnerName; - } - public void setPartnerName(String partnerName) { - this.partnerName = partnerName; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentAllocationBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentAllocationBean.java deleted file mode 100644 index b1741aee47..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/PaymentAllocationBean.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 30, 2006 - */ - -package org.posterita.beans; - -import java.math.BigDecimal; - -public class PaymentAllocationBean extends UDIBean { - - public Integer getCreditMemoId() { - return creditMemoId; - } - - public void setCreditMemoId(Integer creditMemoId) { - this.creditMemoId = creditMemoId; - } - - public String getCreditMemoNumber() { - return creditMemoNumber; - } - - public void setCreditMemoNumber(String creditMemoNumber) { - this.creditMemoNumber = creditMemoNumber; - } - - public BigDecimal getAmount() { - return amount; - } - - public void setAmount(BigDecimal amount) { - this.amount = amount; - } - - public Integer getBpartnerId() { - return bpartnerId; - } - - public void setBpartnerId(Integer bpartnerId) { - this.bpartnerId = bpartnerId; - } - - public Integer getCashLineId() { - return cashLineId; - } - - public void setCashLineId(Integer cashLineId) { - this.cashLineId = cashLineId; - } - - public BigDecimal getDiscountAmt() { - return discountAmt; - } - - public void setDiscountAmt(BigDecimal discountAmt) { - this.discountAmt = discountAmt; - } - - public String getDocumentNo() { - return documentNo; - } - - public void setDocumentNo(String documentNo) { - this.documentNo = documentNo; - } - - public Integer getInvoiceId() { - return invoiceId; - } - - public void setInvoiceId(Integer invoiceId) { - this.invoiceId = invoiceId; - } - - public String getInvoiceNo() { - return invoiceNo; - } - - public void setInvoiceNo(String invoiceNo) { - this.invoiceNo = invoiceNo; - } - - public Integer getOrderId() { - return orderId; - } - - public void setOrderId(Integer orderId) { - this.orderId = orderId; - } - - public BigDecimal getOverUnderPayment() { - return overUnderPayment; - } - - public void setOverUnderPayment(BigDecimal overUnderPayment) { - this.overUnderPayment = overUnderPayment; - } - - public String getPartnerName() { - return partnerName; - } - - public void setPartnerName(String partnerName) { - this.partnerName = partnerName; - } - - public Integer getPaymentId() { - return paymentId; - } - - public void setPaymentId(Integer paymentId) { - this.paymentId = paymentId; - } - - public BigDecimal getWriteOffAmt() { - return writeOffAmt; - } - - public void setWriteOffAmt(BigDecimal writeOffAmt) { - this.writeOffAmt = writeOffAmt; - } - - public Boolean getIsCustomer() { - return isCustomer; - } - - public void setIsCustomer(Boolean isCustomer) { - this.isCustomer = isCustomer; - } - - public Boolean getIsVendor() { - return isVendor; - } - - public void setIsVendor(Boolean isVendor) { - this.isVendor = isVendor; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentBean.java deleted file mode 100644 index aeb94b6e41..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/PaymentBean.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - -import java.math.BigDecimal; - -public class PaymentBean extends PaymentHistoryBean { - private AttributeValuesPair attributeValuesPair; - private String serno; - - public Integer[] getInvoiceIds() { - return invoiceIds; - } - - public void setInvoiceIds(Integer[] invoiceIds) { - this.invoiceIds = invoiceIds; - } - - public BigDecimal[] getAllocateAmount() { - return allocateAmount; - } - - public void setAllocateAmount(BigDecimal[] allocateAmount) { - this.allocateAmount = allocateAmount; - } - - - public BigDecimal getAllocatedAmount() { - return allocatedAmount; - } - - public void setAllocatedAmount(BigDecimal allocatedAmount) { - this.allocatedAmount = allocatedAmount; - } - - public Integer getBpartnerId() { - return bpartnerId; - } - - public void setBpartnerId(Integer bpartnerId) { - this.bpartnerId = bpartnerId; - } - - public AttributeValuesPair getAttributeValuesPair() { - return attributeValuesPair; - } - - public void setAttributeValuesPair(AttributeValuesPair attributeValuesPair) { - this.attributeValuesPair = attributeValuesPair; - } - - public String getSerno() { - return serno; - } - - public void setSerno(String serno) { - this.serno = serno; - } - - public String getTrxType() { - return trxType; - } - - public void setTrxType(String trxType) { - this.trxType = trxType; - } - - public String getChequeNo() { - return chequeNo; - } - - public void setChequeNo(String chequeNo) { - this.chequeNo = chequeNo; - } - - public String getCreditCardNumber() { - return creditCardNumber; - } - - public void setCreditCardNumber(String creditCardNumber) { - this.creditCardNumber = creditCardNumber; - } - - public BigDecimal getAmount() { - return amount; - } - - public void setAmount(BigDecimal amount) { - this.amount = amount; - } - - public Boolean getIsSoTrx() { - return isSoTrx; - } - - public void setIsSoTrx(Boolean isSoTrx) { - this.isSoTrx = isSoTrx; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentDetailsBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentDetailsBean.java deleted file mode 100644 index 6d5df4bf28..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/PaymentDetailsBean.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * May 21, 2008 1:11:53 PM by praveen - * - */ - -package org.posterita.beans; - -import java.math.BigDecimal; - -import org.compiere.util.Env; - -public class PaymentDetailsBean -{ - private BigDecimal cashAmt = Env.ZERO; - private BigDecimal cardAmt = Env.ZERO; - private BigDecimal chequeAmt = Env.ZERO; - private BigDecimal writeOffAmt = Env.ZERO; - private BigDecimal discountAmt = Env.ZERO; - private BigDecimal tenderedAmt = Env.ZERO; - private BigDecimal refundedAmt = Env.ZERO; - private BigDecimal payAmt = Env.ZERO; - - public BigDecimal getCashAmt() { - return cashAmt; - } - public void setCashAmt(BigDecimal cashAmt) { - this.cashAmt = cashAmt; - } - public BigDecimal getCardAmt() { - return cardAmt; - } - public void setCardAmt(BigDecimal cardAmt) { - this.cardAmt = cardAmt; - } - public BigDecimal getChequeAmt() { - return chequeAmt; - } - public void setChequeAmt(BigDecimal chequeAmt) { - this.chequeAmt = chequeAmt; - } - public BigDecimal getWriteOffAmt() { - return writeOffAmt; - } - public void setWriteOffAmt(BigDecimal writeOffAmt) { - this.writeOffAmt = writeOffAmt; - } - public BigDecimal getDiscountAmt() { - return discountAmt; - } - public void setDiscountAmt(BigDecimal discountAmt) { - this.discountAmt = discountAmt; - } - public BigDecimal getTenderedAmt() { - return tenderedAmt; - } - public void setTenderedAmt(BigDecimal tenderedAmt) { - this.tenderedAmt = tenderedAmt; - } - public BigDecimal getRefundedAmt() { - return refundedAmt; - } - public void setRefundedAmt(BigDecimal refundedAmt) { - this.refundedAmt = refundedAmt; - } - public BigDecimal getPayAmt() { - return payAmt; - } - public void setPayAmt(BigDecimal payAmt) { - this.payAmt = payAmt; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentHistoryBean.java deleted file mode 100644 index 46c3e292ad..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/PaymentHistoryBean.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 05-Aug-2005 by alok - * - */ -package org.posterita.beans; - -import java.sql.Timestamp; - - -public class PaymentHistoryBean extends FilterBean -{ - private MinOutHistoryBean minoutHistoryBean; - - public MinOutHistoryBean getMinoutHistoryBean() - { - return minoutHistoryBean; - } - - public void setMinoutHistoryBean(MinOutHistoryBean bean) - { - this.minoutHistoryBean = bean; - } - - public String getCheckNo() - { - return checkNo; - } - public void setCheckNo(String checkNo) - { - this.checkNo = checkNo; - } - public Timestamp getDateTrx() - { - return dateTrx; - } - public void setDateTrx(Timestamp dateTrx) - { - this.dateTrx = dateTrx; - } - - public Integer getInvoiceId() - { - return invoiceId; - } - public void setInvoiceId(Integer invoiceId) - { - this.invoiceId = invoiceId; - } - public String getIsReceipt() - { - return isReceipt; - } - public void setIsReceipt(String isReceipt) - { - this.isReceipt = isReceipt; - } - public Integer getOrderId() - { - return orderId; - } - public void setOrderId(Integer orderId) - { - this.orderId = orderId; - } - - public Integer getPayAmt() - { - return payAmt; - } - public void setPayAmt(Integer payAmt) - { - this.payAmt = payAmt; - } - public Integer getPaymentId() - { - return paymentId; - } - public void setPaymentId(Integer paymentId) - { - this.paymentId = paymentId; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentTermBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentTermBean.java deleted file mode 100644 index 11932bef0f..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/PaymentTermBean.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 31, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; - - -public class PaymentTermBean extends UDIBean -{ - - - - - - - - - public BigDecimal getDiscountAmt1() { - return discountAmt1; - } - public void setDiscountAmt1(BigDecimal discountAmt1) { - this.discountAmt1 = discountAmt1; - } - public BigDecimal getDiscountAmt2() { - return discountAmt2; - } - public void setDiscountAmt2(BigDecimal discountAmt2) { - this.discountAmt2 = discountAmt2; - } - public Integer getDiscountDay1() { - return discountDay1; - } - public void setDiscountDay1(Integer discountDay1) { - this.discountDay1 = discountDay1; - } - public Integer getDiscountDay2() { - return discountDay2; - } - public void setDiscountDay2(Integer discountDay2) { - this.discountDay2 = discountDay2; - } - public Boolean getAfterDelivery() { - return afterDelivery; - } - public void setAfterDelivery(Boolean afterDelivery) { - this.afterDelivery = afterDelivery; - } - public Integer getFiedMonthCutoff() { - return fiedMonthCutoff; - } - public void setFiedMonthCutoff(Integer fiedMonthCutoff) { - this.fiedMonthCutoff = fiedMonthCutoff; - } - public Boolean getFixedDueDate() { - return fixedDueDate; - } - public void setFixedDueDate(Boolean fixedDueDate) { - this.fixedDueDate = fixedDueDate; - } - public Integer getFixedMonthDay() { - return fixedMonthDay; - } - public void setFixedMonthDay(Integer fixedMonthDay) { - this.fixedMonthDay = fixedMonthDay; - } - public Integer getFixedMonthOffset() { - return fixedMonthOffset; - } - public void setFixedMonthOffset(Integer fixedMonthOffset) { - this.fixedMonthOffset = fixedMonthOffset; - } - public Boolean getNextBusinessday() { - return nextBusinessday; - } - public void setNextBusinessday(Boolean nextBusinessday) { - this.nextBusinessday = nextBusinessday; - } - public Integer getPaymentTermId() { - return paymentTermId; - } - public void setPaymentTermId(Integer paymentTermId) { - this.paymentTermId = paymentTermId; - } - - public String getPaymentTermName() { - return paymentTermName; - } - public void setPaymentTermName(String paymentTermName) { - this.paymentTermName = paymentTermName; - } - public Integer getNetDays() { - return netDays; - } - public void setNetDays(Integer netDays) { - this.netDays = netDays; - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/PaymentTypeBean.java b/posterita/posterita/src/main/org/posterita/beans/PaymentTypeBean.java deleted file mode 100644 index 9ed016c96b..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/PaymentTypeBean.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 25, 2006 - */ - - -package org.posterita.beans; - - -public class PaymentTypeBean -{ - protected String paymentType; - - protected Integer id; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getPaymentType() { - return paymentType; - } - - public void setPaymentType(String paymentType) { - this.paymentType = paymentType; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/PopulateHistoryBean.java b/posterita/posterita/src/main/org/posterita/beans/PopulateHistoryBean.java deleted file mode 100644 index 0aec697136..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/PopulateHistoryBean.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 09-Aug-2005 by alok - * - */ -package org.posterita.beans; - - -public class PopulateHistoryBean extends UDIBean -{ - - protected String partnerName; - protected String DocStatus; - protected String isDelivered; - protected String isInvoiced; - protected String isPaid; - protected String isReceipt; - protected String isSotrx; - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/PriceListBean.java b/posterita/posterita/src/main/org/posterita/beans/PriceListBean.java deleted file mode 100644 index 03a7e2506d..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/PriceListBean.java +++ /dev/null @@ -1,280 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 19, 2005 by praveen - * - */ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.ArrayList; - -public class PriceListBean -{ - protected Boolean isDeleteOldRecords; - protected PriceListBean priceListBean; - protected ArrayList priceListBeanList; - protected Integer index; - protected BigDecimal stdPrice; - protected BigDecimal listPrice; - protected BigDecimal limitPrice; - protected Boolean isDefault; - protected Boolean isPresentForProduct; - protected Boolean isMandatory; - protected String orgName; - protected Boolean isSOPriceList; - protected Integer priceListVersionId; - protected Integer productId; - protected BigDecimal priceList; - protected Integer[] productIds; - protected String name; - protected Integer orgId; - protected Integer priceListId; - protected Boolean isActive; - protected Integer basePriceListId; - protected Boolean isCreatePriceList; - protected Boolean isTaxIncluded; - - public Boolean getIsTaxIncluded() - { - return isTaxIncluded; - } - - public void setIsTaxIncluded(Boolean isTaxIncluded) - { - this.isTaxIncluded = isTaxIncluded; - } - - public Boolean getIsCreatePriceList() - { - return isCreatePriceList; - } - - public void setIsCreatePriceList(Boolean isCreatePriceList) - { - this.isCreatePriceList = isCreatePriceList; - } - - public Boolean getIsDeleteOldRecords() - { - return isDeleteOldRecords; - } - - public void setIsDeleteOldRecords(Boolean isDeleteOldRecords) - { - this.isDeleteOldRecords = isDeleteOldRecords; - } - - public PriceListBean getPriceListBean() - { - return priceListBean; - } - - public void setPriceListBean(PriceListBean priceListBean) - { - this.priceListBean = priceListBean; - } - - public ArrayList getPriceListBeanList() - { - return priceListBeanList; - } - - public void setPriceListBeanList(ArrayList priceListBeanList) - { - this.priceListBeanList = priceListBeanList; - } - - public Integer getIndex() - { - return index; - } - - public void setIndex(Integer index) - { - this.index = index; - } - - public BigDecimal getStdPrice() - { - return stdPrice; - } - - public void setStdPrice(BigDecimal stdPrice) - { - this.stdPrice = stdPrice; - } - - public BigDecimal getListPrice() - { - return listPrice; - } - - public void setListPrice(BigDecimal listPrice) - { - this.listPrice = listPrice; - } - - public BigDecimal getLimitPrice() - { - return limitPrice; - } - - public void setLimitPrice(BigDecimal limitPrice) - { - this.limitPrice = limitPrice; - } - - public Boolean getIsDefault() - { - return isDefault; - } - - public void setIsDefault(Boolean isDefault) - { - this.isDefault = isDefault; - } - - public Boolean getIsPresentForProduct() - { - return isPresentForProduct; - } - - public void setIsPresentForProduct(Boolean isPresentForProduct) - { - this.isPresentForProduct = isPresentForProduct; - } - - public Boolean getIsMandatory() - { - return isMandatory; - } - - public void setIsMandatory(Boolean isMandatory) - { - this.isMandatory = isMandatory; - } - - public String getOrgName() - { - return orgName; - } - - public void setOrgName(String orgName) - { - this.orgName = orgName; - } - - public Boolean getIsSOPriceList() - { - return isSOPriceList; - } - - public void setIsSOPriceList(Boolean isSOPriceList) - { - this.isSOPriceList = isSOPriceList; - } - - public Integer getPriceListVersionId() - { - return priceListVersionId; - } - - public void setPriceListVersionId(Integer priceListVersionId) - { - this.priceListVersionId = priceListVersionId; - } - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - public BigDecimal getPriceList() - { - return priceList; - } - - public void setPriceList(BigDecimal priceList) - { - this.priceList = priceList; - } - - public Integer[] getProductIds() - { - return productIds; - } - public void setProductIds(Integer[] productIds) - { - this.productIds = productIds; - } - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public Integer getPriceListId() - { - return priceListId; - } - - public void setPriceListId(Integer priceListId) - { - this.priceListId = priceListId; - } - - public Boolean getIsActive() { - return isActive; - } - - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - - public Integer getBasePriceListId() - { - return basePriceListId; - } - - public void setBasePriceListId(Integer basePriceListId) - { - this.basePriceListId = basePriceListId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/PrintBarcodeBean.java b/posterita/posterita/src/main/org/posterita/beans/PrintBarcodeBean.java deleted file mode 100644 index 0d77237e72..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/PrintBarcodeBean.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 04-Oct-2006 10:41:05 by praveen - * - */ - -package org.posterita.beans; - -public class PrintBarcodeBean -{ - private int qty; - private String title; - private String subtitle; - private String barcode; - private String price; - - public String getBarcode() { - return barcode; - } - public void setBarcode(String barcode) { - this.barcode = barcode; - } - public String getPrice() { - return price; - } - public void setPrice(String price) { - this.price = price; - } - public int getQty() { - return qty; - } - public void setQty(int qty) { - this.qty = qty; - } - public String getSubtitle() { - return subtitle; - } - public void setSubtitle(String subtitle) { - this.subtitle = subtitle; - } - public String getTitle() { - return title; - } - public void setTitle(String title) { - this.title = title; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductAttributeBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductAttributeBean.java deleted file mode 100644 index 66f1ede656..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductAttributeBean.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 28, 2005 by praveen - * - */ -package org.posterita.beans; - -import java.util.ArrayList; - -public class ProductAttributeBean extends UDIBean -{ - private ArrayList attributeSets; - private ArrayList attributes; - private ArrayList attributeValues; - - public String getAttribute() - { - return attribute; - } - - public void setAttribute(String attribute) - { - this.attribute = attribute; - } - - public Integer getAttributeId() - { - return attributeId; - } - - public void setAttributeId(Integer attributeId) - { - this.attributeId = attributeId; - } - - public Integer getAttributeSetId() - { - return attributeSetId; - } - - public void setAttributeSetId(Integer attributeSetId) - { - this.attributeSetId = attributeSetId; - } - - public String getAttributeValue() - { - return attributeValue; - } - - public void setAttributeValue(String attributeValue) - { - this.attributeValue = attributeValue; - } - - public ArrayList getAttributes() - { - return attributes; - } - - public void setAttributes(ArrayList attributes) - { - this.attributes = attributes; - } - - public ArrayList getAttributeSets() - { - return attributeSets; - } - - public void setAttributeSets(ArrayList attributeSets) - { - this.attributeSets = attributeSets; - } - - public ArrayList getAttributeValues() - { - return attributeValues; - } - - public void setAttributeValues(ArrayList attributeValues) - { - this.attributeValues = attributeValues; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public Integer getProductCategoryId() - { - return productCategoryId; - } - - public void setProductCategoryId(Integer productCategoryId) - { - this.productCategoryId = productCategoryId; - } - - - public Integer getAttributeValueId() { - return attributeValueId; - } - public void setAttributeValueId(Integer attributeValueId) { - this.attributeValueId = attributeValueId; - } - public Boolean getShowActiveOnly() { - return showActiveOnly; - } - public void setShowActiveOnly(Boolean showActiveOnly) { - this.showActiveOnly = showActiveOnly; - } - public Integer getUpdateAttrValueId() { - return updateAttrValueId; - } - public void setUpdateAttrValueId(Integer updateAttrValueId) { - this.updateAttrValueId = updateAttrValueId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductAttributeValueBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductAttributeValueBean.java deleted file mode 100644 index 3fb1ea95db..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductAttributeValueBean.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 31, 2005 by praveen - * - */ -package org.posterita.beans; - -public class ProductAttributeValueBean extends UDIBean -{ - - protected String attrColour; - protected String attrModel; - protected String attrTrx; - protected String attrYear; - - public String getAttrColour() { - return attrColour; - } - public void setAttrColour(String attrColour) { - this.attrColour = attrColour; - } - public String getAttrModel() { - return attrModel; - } - public void setAttrModel(String attrModel) { - this.attrModel = attrModel; - } - public String getAttrTrx() { - return attrTrx; - } - public void setAttrTrx(String attrTrx) { - this.attrTrx = attrTrx; - } - public String getAttrYear() { - return attrYear; - } - public void setAttrYear(String attrYear) { - this.attrYear = attrYear; - } - public Integer getProductId() { - return productId; - } - public void setProductId(Integer productId) { - this.productId = productId; - } - public String getProductName() { - return productName; - } - public void setProductName(String productName) { - this.productName = productName; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductBean.java deleted file mode 100644 index f18371ffc7..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductBean.java +++ /dev/null @@ -1,935 +0,0 @@ -/* - * - * Copyright (c) 2005 UDI Ltd. All Rights Reserved. - * - * This software is the confidential and proprietary information of UDI Ltd. - * ("Confidential Information"). You shall not disclose such Confidential - * Information and shall use it only in accordance with the terms of the license - * agreement you entered into with UDI. - * - * UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE - * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR - * NON-INFRINGEMENT. UDI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY - * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS - * DERIVATIVES. - * - */ - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; - -import org.apache.struts.upload.FormFile; -import org.compiere.util.Env; - -public class ProductBean extends UDIBean implements Comparable -{ - - protected Integer attributeSetId; - protected Integer mAttrSetInstanceId; - protected Boolean isEditable; - protected Boolean isTaxIncluded; - private String productName; - private BigDecimal qtyOnHand = Env.ZERO; - private BigDecimal qtyReserved = Env.ZERO; - private BigDecimal qtyOrdered = Env.ZERO; - private BigDecimal qtyToMove; - private Integer productId; - private BigDecimal priceList; - private BigDecimal priceLimit; - private BigDecimal priceStandard; - private Integer orgId; - - //this is the attributeSetInstance corresponding to the serial number - private Integer sernoAttributeSetInstance; - - //attributeSetInstance for model/colour/transmission/year - private Integer attributeSetInstanceId; - - private Integer priceListVersionId; - - private Integer locatorId; - - private String regionName; - - private ArrayList orderLineList; - - private ArrayList productInstances; - - private String priceListName; - - private String orgName; - - private String serno; - - private AttributeValuesPair attributeValuesPair; - - private Integer productCategoryId; - -// Y/N -private String isOwnedByWholesaler; - -private String isNatisReleased; - -private String reserveStatus; - -private String warehouseName; - -private String ETA; - -private ProductImageInfo imageInfo; - -private HashMap attributeValuesMap; - -private String description; - -private String imageLink; -private String textLink; - -private String customSize; - -private String group1; - -private String group2; - -private Integer uomId; - -private String productCategoryName; - -private String taxCategoryName; - - public Integer getTaxCategoryId() { - return taxCategoryId; - } - public void setTaxCategoryId(Integer taxCategoryId) { - this.taxCategoryId = taxCategoryId; - } - public String getTaxCategoryName() { - return taxCategoryName; - } - public void setTaxCategoryName(String taxCategoryName) { - this.taxCategoryName = taxCategoryName; - } - public String getPartnerName() { - return partnerName; - } - public void setPartnerName(String partnerName) { - this.partnerName = partnerName; - } - public Integer getBpartnerId() { - return bpartnerId; - } - public void setBpartnerId(Integer bpartnerId) { - this.bpartnerId = bpartnerId; - } - public String getBarCode() { - return barCode; - } - public void setBarCode(String barCode) { - this.barCode = barCode; - } - //TODO refactor this - private ArrayList availableColours; - - private ArrayList availableSizes; - - - public Integer getLicensingDistrictId() - { - return licensingDistrictId; - } - public void setLicensingDistrictId(Integer licensingDistrictId) { - this.licensingDistrictId = licensingDistrictId; - } - - public String getReserveStatus() - { - return reserveStatus; - } - - public void setReserveStatus(String reserveStatus) - { - this.reserveStatus = reserveStatus; - } - - public String getIsOwnedByWholesaler() - { - return isOwnedByWholesaler; - } - - public void setIsOwnedByWholesaler(String isOwnedByWholesaler) - { - this.isOwnedByWholesaler = isOwnedByWholesaler; - } - - - public BigDecimal getQuantity() - { - return quantity; - } - public void setQuantity(BigDecimal quantity) - { - this.quantity = quantity; - } - public ArrayList getOrderLineList() - { - return orderLineList; - } - - public void setOrderLineList(ArrayList orderLineList) - { - this.orderLineList = orderLineList; - } - - public String getProductName() - { - return productName; - } - - public void setProductName(String productName) - { - this.productName = productName; - } - - public BigDecimal getQtyOnHand() - { - return qtyOnHand; - } - - public void setQtyOnHand(BigDecimal qtyOnHand) - { - this.qtyOnHand = qtyOnHand; - } - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - public BigDecimal getPriceList() - { - return priceList; - } - - public void setPriceList(BigDecimal priceList) - { - this.priceList = priceList; - } - - public BigDecimal getPriceLimit() - { - return priceLimit; - } - - public void setPriceLimit(BigDecimal priceLimit) - { - this.priceLimit = priceLimit; - } - - public BigDecimal getPriceStandard() - { - return priceStandard; - } - - public void setPriceStandard(BigDecimal priceStandard) - { - this.priceStandard = priceStandard; - } - - public ArrayList getProductInstances() - { - return productInstances; - } - - public void setProductInstances(ArrayList productInstances) - { - this.productInstances = productInstances; - } - - public Integer getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - - public void setAttributeSetInstanceId(Integer attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - - public Integer getLocatorId() - { - return locatorId; - } - - public void setLocatorId(Integer locatorId) - { - this.locatorId = locatorId; - } - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public BigDecimal getQtyReserved() - { - return qtyReserved; - } - - public void setQtyReserved(BigDecimal qtyReserved) - { - this.qtyReserved = qtyReserved; - } - - public BigDecimal getQtyOrdered() - { - return qtyOrdered; - } - - public void setQtyOrdered(BigDecimal qtyOrdered) - { - this.qtyOrdered = qtyOrdered; - } - - public String getOrgName() - { - return orgName; - } - - public void setOrgName(String orgName) - { - this.orgName = orgName; - } - - - public int compareTo(Object o) - { - if (o == null && this.getProductId() == null) - return -1; - - ProductBean bean = (ProductBean) o; - - return (bean.getProductId().compareTo(this.getProductId())); - } - - public boolean equals(Object obj) - { - ProductBean bean = (ProductBean) obj; - - if ( obj == null) - return false; - - if (bean.getProductId().intValue() == this.getProductId().intValue()) - return true; - - return false; - } - - public Integer getSernoAttributeSetInstance() - { - return sernoAttributeSetInstance; - } - - public void setSernoAttributeSetInstance(Integer sernoAttributeSetInstance) - { - this.sernoAttributeSetInstance = sernoAttributeSetInstance; - } - - public String getRegionName() - { - return regionName; - } - - public void setRegionName(String regionName) - { - this.regionName = regionName; - } - - public void setSerno(String serno) - { - this.serno = serno; - } - - public String getSerno() - { - return serno; - } - - - public String getIsNatisReleased() - { - return isNatisReleased; - } - - public void setIsNatisReleased(String isNatisReleased) - { - this.isNatisReleased = isNatisReleased; - } - - public String getPriceListName() - { - return priceListName; - } - - public void setPriceListName(String priceListName) - { - this.priceListName = priceListName; - } - - public Integer getPriceListVersionId() - { - return priceListVersionId; - } - - public void setPriceListVersionId(Integer priceListVersionId) - { - this.priceListVersionId = priceListVersionId; - } - - public Integer[] getCheckBox() - { - return checkBox; - } - public void setCheckBox(Integer [] checkBox) - { - this.checkBox = checkBox; - } - - - public AttributeValuesPair getAttributeValuesPair() - { - return attributeValuesPair; - } - - public void setAttributeValuesPair(AttributeValuesPair attributeValuesPair) - { - this.attributeValuesPair = attributeValuesPair; - } - - - public String getEngineNo() { - return engineNo; - } - public void setEngineNo(String engineNo) { - this.engineNo = engineNo; - } - - public Integer getProductCategoryId() - { - return productCategoryId; - } - - public void setProductCategoryId(Integer productCategoryId) - { - this.productCategoryId = productCategoryId; - } - - public String getWarehouseType() - { - return warehouseType; - } - - public void setWarehouseType(String warehouseType) - { - this.warehouseType = warehouseType; - } - - public String toString() - { - return this.getProductName(); - } - - public String getWarehouseName() - { - return warehouseName; - } - - public void setWarehouseName(String warehouseName) - { - this.warehouseName = warehouseName; - } - - public Integer getWarehouseId() - { - return warehouseId; - } - - public void setWarehouseId(Integer warehouseId) - { - this.warehouseId = warehouseId; - } - - public String getETA() - { - return ETA; - } - public void setETA(String eta) - { - ETA = eta; - } - - public Integer[] getProductIds() - { - return productIds; - } - - public void setProductIds(Integer[] productIds) - { - this.productIds = productIds; - } - - public ProductImageInfo getImageInfo() - { - return imageInfo; - } - public void setImageInfo(ProductImageInfo imageInfo) - { - this.imageInfo = imageInfo; - } - - public HashMap getAttributeValuesMap() - { - return attributeValuesMap; - } - - public void setAttributeValuesMap(HashMap attributeValuesMap) - { - this.attributeValuesMap = attributeValuesMap; - } - - - public String getDescription() - { - return description; - } - public void setDescription(String description) - { - this.description = description; - } - - public ArrayList getAvailableColours() - { - return availableColours; - } - public void setAvailableColours(ArrayList availableColours) - { - this.availableColours = availableColours; - } - public ArrayList getAvailableSizes() - { - return availableSizes; - } - public void setAvailableSizes(ArrayList availableSizes) - { - this.availableSizes = availableSizes; - } - - public Integer getAttributeId() - { - return attributeId; - } - - public void setAttributeId(Integer attributeId) - { - this.attributeId = attributeId; - } - - - public String getImageLink() - { - return imageLink; - } - - public void setImageLink(String imageLink) - { - this.imageLink = imageLink; - } - - public String getTextLink() - { - return textLink; - } - - public void setTextLink(String textLink) - { - this.textLink = textLink; - } - public String getCurrency() - { - return currency; - } - public void setCurrency(String currency) - { - this.currency = currency; - } - - public String getSalesPriceLimit() { - return salesPriceLimit; - } - public void setSalesPriceLimit(String salesPriceLimit) { - this.salesPriceLimit = salesPriceLimit; - } - public String getSalesPriceList() { - return salesPriceList; - } - public void setSalesPriceList(String salesPriceList) { - this.salesPriceList = salesPriceList; - } - public String getSalesPriceStandard() { - return salesPriceStandard; - } - public void setSalesPriceStandard(String salesPriceStandard) { - this.salesPriceStandard = salesPriceStandard; - } - - - public String getBrandName() { - return brandName; - } - public void setBrandName(String brandName) { - this.brandName = brandName; - } - public String getColourName() { - return colourName; - } - public void setColourName(String colourName) { - this.colourName = colourName; - } - public String getDesignName() { - return designName; - } - public void setDesignName(String designName) { - this.designName = designName; - } - public String getSizeName() { - return sizeName; - } - public void setSizeName(String sizeName) { - this.sizeName = sizeName; - } - public String[] getSizes() - { - return sizes; - } - public void setSizes(String[] sizes) - { - this.sizes = sizes; - } - - - - public String getPurchasePriceLimit() { - return purchasePriceLimit; - } - public void setPurchasePriceLimit(String purchasePriceLimit) { - this.purchasePriceLimit = purchasePriceLimit; - } - public String getPurchasePriceList() { - return purchasePriceList; - } - public void setPurchasePriceList(String purchasePriceList) { - this.purchasePriceList = purchasePriceList; - } - public String getPurchasePriceStandard() { - return purchasePriceStandard; - } - public void setPurchasePriceStandard(String purchasePriceStandard) { - this.purchasePriceStandard = purchasePriceStandard; - } - public String getModelName() { - return modelName; - } - public void setModelName(String modelName) { - this.modelName = modelName; - } - public String getRevenueRecognition() { - return revenueRecognition; - } - public void setRevenueRecognition(String revenueRecognition) { - this.revenueRecognition = revenueRecognition; - } - public Integer getAttributeSetId() { - return attributeSetId; - } - public void setAttributeSetId(Integer attributeSetId) { - this.attributeSetId = attributeSetId; - } - public Integer getMAttrSetInstanceId() { - return mAttrSetInstanceId; - } - public void setMAttrSetInstanceId(Integer attrSetInstanceId) { - mAttrSetInstanceId = attrSetInstanceId; - } - public Integer getRevenueRecoId() { - return revenueRecoId; - } - public void setRevenueRecoId(Integer revenueRecoId) { - this.revenueRecoId = revenueRecoId; - } - - public String getProductType() { - return productType; - } - public void setProductType(String productType) { - this.productType = productType; - } - - public Boolean getIsActive() { - return isActive; - } - public void setIsActive(Boolean isActive) { - this.isActive = isActive; - } - public BigDecimal getTaxRate() { - return taxRate; - } - public void setTaxRate(BigDecimal taxRate) { - this.taxRate = taxRate; - } - public String getCustomSize() { - return customSize; - } - public void setCustomSize(String customSize) { - this.customSize = customSize; - } - public String getProductClassification() - { - return productClassification; - } - public void setProductClassification(String productClassification) - { - this.productClassification = productClassification; - } - public String getKeyword2() - { - return keyword2; - } - public void setKeyword2(String keyword2) - { - this.keyword2 = keyword2; - } - - public Boolean getIsSelfService() - { - return isSelfService; - } - - public void setIsSelfService(Boolean isSelfService) - { - this.isSelfService = isSelfService; - } - - public FormFile getFile() { - return file; - } - public void setFile(FormFile file) { - this.file = file; - } - public String getGroup1() { - return group1; - } - public void setGroup1(String group1) { - this.group1 = group1; - } - public String getGroup2() { - return group2; - } - public void setGroup2(String group2) { - this.group2 = group2; - } - public Integer getUomId() { - return uomId; - } - public void setUomId(Integer uomId) { - this.uomId = uomId; - - } - public Boolean getIsEditable() { - return isEditable; - } - public void setIsEditable(Boolean isEditable) { - this.isEditable = isEditable; - } - public String getUom() - { - return uom; - } - public void setUom(String uom) - { - this.uom = uom; - } - public BigDecimal getQtyToMove() - { - return qtyToMove; - } - public void setQtyToMove(BigDecimal qtyToMove) - { - this.qtyToMove = qtyToMove; - } - public Integer getOrgFromId() - { - return this.orgFromId; - } - public void setOrgFromId(Integer orgFromId) - { - this.orgFromId = orgFromId; - } - public Integer getOrgToId() - { - return orgToId; - } - public void setOrgToId(Integer orgToId) - { - this.orgToId = orgToId; - } - // - public BigDecimal getStdPrice() - { - return stdPrice; - } - - public void setStdPrice(BigDecimal stdPrice) - { - this.stdPrice = stdPrice; - } - - public BigDecimal getListPrice() - { - return listPrice; - } - - public void setListPrice(BigDecimal listPrice) - { - this.listPrice = listPrice; - } - - public BigDecimal getLimitPrice() - { - return limitPrice; - } - - public void setLimitPrice(BigDecimal limitPrice) - { - this.limitPrice = limitPrice; - } - - public Boolean getIsDefault() - { - return isDefault; - } - - public void setIsDefault(Boolean isDefault) - { - this.isDefault = isDefault; - } - - public Boolean getIsPresentForProduct() - { - return isPresentForProduct; - } - - public void setIsPresentForProduct(Boolean isPresentForProduct) - { - this.isPresentForProduct = isPresentForProduct; - } - - public Boolean getIsMandatory() - { - return isMandatory; - } - - public void setIsMandatory(Boolean isMandatory) - { - this.isMandatory = isMandatory; - } - - public Boolean getIsSOPriceList() - { - return isSOPriceList; - } - - public void setIsSOPriceList(Boolean isSOPriceList) - { - this.isSOPriceList = isSOPriceList; - } - public Integer getPriceListId() - { - return priceListId; - } - - public void setPriceListId(Integer priceListId) - { - this.priceListId = priceListId; - } - public ProductBean getProductBean() - { - return productBean; - } - - public void setProductBean(ProductBean productBean) - { - this.productBean = productBean; - } - - public ArrayList getProductBeanList() - { - return productBeanList; - } - - public void setProductBeanList(ArrayList productBeanList) - { - this.productBeanList = productBeanList; - } - public String getProductCategoryName() { - return productCategoryName; - } - public void setProductCategoryName(String productCategoryName) { - this.productCategoryName = productCategoryName; - } - public BigDecimal getListPriceIncl() { - return listPriceIncl; - } - public void setListPriceIncl(BigDecimal listPriceIncl) { - this.listPriceIncl = listPriceIncl; - } - public BigDecimal getStdPriceIncl() { - return stdPriceIncl; - } - public void setStdPriceIncl(BigDecimal stdPriceIncl) { - this.stdPriceIncl = stdPriceIncl; - } - public BigDecimal getLimitPriceIncl() { - return limitPriceIncl; - } - public void setLimitPriceIncl(BigDecimal limitPriceIncl) { - this.limitPriceIncl = limitPriceIncl; - } - public Boolean getIsTaxIncluded() { - return isTaxIncluded; - } - public void setIsTaxIncluded(Boolean isTaxIncluded) { - this.isTaxIncluded = isTaxIncluded; - } - public Integer getUnitsPerPack() - { - return unitsPerPack; - } - public void setUnitsPerPack(Integer unitsPerPack) - { - this.unitsPerPack = unitsPerPack; - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductCategoryBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductCategoryBean.java deleted file mode 100644 index bd6eed6b3e..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductCategoryBean.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 9, 2006 - */ - - -package org.posterita.beans; - - -public class ProductCategoryBean extends UDIBean -{ - - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public Integer getProductCategoryId() { - return productCategoryId; - } - public void setProductCategoryId(Integer productCategoryId) { - this.productCategoryId = productCategoryId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductDetailsBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductDetailsBean.java deleted file mode 100644 index 608caf241d..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductDetailsBean.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.beans; - -import java.math.BigDecimal; - -public class ProductDetailsBean extends UDIBean -{ - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - public String getBarCode() - { - return barCode; - } - - public void setBarCode(String barCode) - { - this.barCode = barCode; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public Boolean getHasImage() - { - return hasImage; - } - - public void setHasImage(Boolean hasImage) - { - this.hasImage = hasImage; - } - - public String getProductName() - { - return productName; - } - - public void setProductName(String productName) - { - this.productName = productName; - } - - public String getRevenueRecognition() - { - return revenueRecognition; - } - - public void setRevenueRecognition(String revenueRecognition) - { - this.revenueRecognition = revenueRecognition; - } - - public Double getStdPurchasePrice() - { - return stdPurchasePrice; - } - - public void setStdPurchasePrice(Double stdPurchasePrice) - { - this.stdPurchasePrice = stdPurchasePrice; - } - - public Double getStdSalesPrice() - { - return stdSalesPrice; - } - - public void setStdSalesPrice(Double stdSalesPrice) - { - this.stdSalesPrice = stdSalesPrice; - } - - public String getTaxCategoryName() - { - return taxCategoryName; - } - - public void setTaxCategoryName(String taxCategoryName) - { - this.taxCategoryName = taxCategoryName; - } - - public BigDecimal getQuantity() { - return quantity; - } - - public void setQuantity(BigDecimal quantity) { - this.quantity = quantity; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductImageBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductImageBean.java deleted file mode 100644 index ed9c2a1421..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductImageBean.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 14, 2006 by praveen - * - */ -package org.posterita.beans; - -import java.util.ArrayList; - -import org.apache.struts.upload.FormFile; - -import org.posterita.businesslogic.administration.ProductManager; - - -public class ProductImageBean extends UDIBean -{ - public Integer getProductId() { - return productId; - } - public void setProductId(Integer productId) { - this.productId = productId; - } - public FormFile getFile() { - return file; - } - public void setFile(FormFile file) { - this.file = file; - } - public Integer[] getProductIds() { - return productIds; - } - public void setProductIds(Integer[] productIds) { - this.productIds = productIds; - } - public String getBrandName() - { - return brandName; - } - public void setBrandName(String brandName) - { - this.brandName = brandName; - } - public String getColourName() - { - return colourName; - } - public void setColourName(String colourName) - { - this.colourName = colourName; - } - public String getDesignName() - { - return designName; - } - public void setDesignName(String designName) - { - this.designName = designName; - } - public String getModelName() - { - return modelName; - } - public void setModelName(String modelName) - { - this.modelName = modelName; - } - public String getKeyword1() - { - return keyword1; - } - public void setKeyword1(String keyword1) - { - this.keyword1 = keyword1; - } - public String getKeyword2() - { - return keyword2; - } - public void setKeyword2(String keyword2) - { - this.keyword2 = keyword2; - } - public String[] getSizes() - { - return sizes; - } - public void setSizes(String[] sizes) - { - this.sizes = sizes; - } - - public String toString() - { - StringBuffer productName = new StringBuffer(); - productName.append(brandName + ProductManager.PRODUCT_ATTRIBUTES_DELIMETER); - productName.append(designName + ProductManager.PRODUCT_ATTRIBUTES_DELIMETER); - productName.append(modelName + ProductManager.PRODUCT_ATTRIBUTES_DELIMETER); - productName.append(colourName + ProductManager.PRODUCT_ATTRIBUTES_DELIMETER); - - return productName.toString(); - } - public String getKeyword3() - { - return keyword3; - } - public void setKeyword3(String keyword3) - { - this.keyword3 = keyword3; - } - public String getKeyword4() - { - return keyword4; - } - public void setKeyword4(String keyword4) - { - this.keyword4 = keyword4; - } - public String getImageName() - { - return imageName; - } - public void setImageName(String imageName) - { - this.imageName = imageName; - } - public ArrayList getProductsList() - { - return productsList; - } - public void setProductsList(ArrayList productsList) - { - this.productsList = productsList; - } - public String getBarCode() - { - return barCode; - } - public void setBarCode(String barCode) - { - this.barCode = barCode; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductImageInfo.java b/posterita/posterita/src/main/org/posterita/beans/ProductImageInfo.java deleted file mode 100644 index 1069e34348..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductImageInfo.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 15, 2006 by praveen - * - */ -package org.posterita.beans; - -public class ProductImageInfo -{ - private Integer productId; - private Boolean hasAttachment; - private String model; - - public Boolean getHasAttachment() { - return hasAttachment; - } - public void setHasAttachment(Boolean hasAttachment) { - this.hasAttachment = hasAttachment; - } - public String getModel() { - return model; - } - public void setModel(String model) { - this.model = model; - } - public Integer getProductId() { - return productId; - } - public void setProductId(Integer productId) { - this.productId = productId; - } - private String productName; - - - public String getProductName() - { - return productName; - } - public void setProductName(String productName) - { - this.productName = productName; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductInfo.java b/posterita/posterita/src/main/org/posterita/beans/ProductInfo.java deleted file mode 100644 index b393f07e28..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductInfo.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - -import java.sql.Timestamp; -import java.util.ArrayList; - - -public class ProductInfo implements Comparable -{ - private AttributeValuesBean attributeValuesBean = new AttributeValuesBean(); - private ArrayList products = new ArrayList(); - private ArrayList regions = new ArrayList(); - private ArrayList reservedStatusValues = new ArrayList(); - private ArrayList warehouseTypes = new ArrayList(); - private ArrayList organisations = new ArrayList(); - private ArrayList warehouseNames = new ArrayList(); - private Integer productCategoryId; - private Timestamp ETA; - - public ArrayList getOrganisations() - { - return organisations; - } - public void setOrganisations(ArrayList organisations) - { - this.organisations = organisations; - } - - - public AttributeValuesBean getAttributeValuesBean() - { - return attributeValuesBean; - } - - public void setAttributeValuesBean(AttributeValuesBean attributeValuesBean) - { - this.attributeValuesBean = attributeValuesBean; - } - - public ArrayList getProducts() - { - return products; - } - - public void setProducts(ArrayList products) - { - this.products = products; - } - - public void setRegions(ArrayList regions) - { - this.regions = regions; - } - - public ArrayList getRegions() - { - return regions; - } - - public ArrayList getReservedStatusValues() - { - return reservedStatusValues; - } - - public void setReservedStatusValues(ArrayList reservedStatusValues) - { - this.reservedStatusValues = reservedStatusValues; - } - - public Integer getProductCategoryId() - { - return productCategoryId; - } - - public void setProductCategoryId(Integer productCategoryId) - { - this.productCategoryId = productCategoryId; - } - - public ArrayList getWarehouseTypes() - { - return warehouseTypes; - } - - public void setWarehouseTypes(ArrayList warehouseTypes) - { - this.warehouseTypes = warehouseTypes; - } - - public ArrayList getWarehouseNames() - { - return warehouseNames; - } - - public void setWarehouseNames(ArrayList warehouseNames) - { - this.warehouseNames = warehouseNames; - } - - public int compareTo(Object o) - { - return 0; - } - - public Timestamp getETA() - { - return ETA; - } - public void setETA(Timestamp eta) - { - ETA = eta; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductInfoBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductInfoBean.java deleted file mode 100644 index 63652fd231..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductInfoBean.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 31, 2005 by praveen - * - */ -package org.posterita.beans; - -public class ProductInfoBean extends StockBean -{ - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductInstanceBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductInstanceBean.java deleted file mode 100644 index 1e0c564b4d..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductInstanceBean.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - -public class ProductInstanceBean -{ - private int attributeSetInstanceId; - private int attributeId; - private String serNo; - private String description; - private int qtyOnHand; - - public int getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - - public void setAttributeSetInstanceId(int attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - - public int getAttributeId() - { - return attributeId; - } - - public void setAttributeId(int attributeId) - { - this.attributeId = attributeId; - } - - public String getSerno() - { - return serNo; - } - - public void setSerno(String serno) - { - this.serNo = serno; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - //this should return only on because a serial number(vin number) - // must be unique - public int getQtyOnHand() - { - return qtyOnHand; - } - - public void setQtyOnHand(int qtyOnHand) - { - this.qtyOnHand = qtyOnHand; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductKeywordsBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductKeywordsBean.java deleted file mode 100644 index 2a15fbd891..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductKeywordsBean.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 12, 2006 by ashley -* -*/ - -package org.posterita.beans; - -import org.apache.struts.upload.FormFile; - -public class ProductKeywordsBean extends UDIBean -{ - - public String getProductClassification() - { - return productClassification; - } - public void setProductClassification(String productClassification) - { - this.productClassification = productClassification; - } - public String getKeyword1() - { - return keyword1; - } - public void setKeyword1(String keyword1) - { - this.keyword1 = keyword1; - } - public String getKeyword2() - { - return keyword2; - } - public void setKeyword2(String keyword2) - { - this.keyword2 = keyword2; - } - public String getKeyword3() - { - return keyword3; - } - public void setKeyword3(String keyword3) - { - this.keyword3 = keyword3; - } - public String getKeyword4() - { - return keyword4; - } - public void setKeyword4(String keyword4) - { - this.keyword4 = keyword4; - } - public Integer[] getProductIds() - { - return productIds; - } - public void setProductIds(Integer[] productIds) - { - this.productIds = productIds; - } - - public String getImageName() - { - return imageName; - } - public void setImageName(String imageName) - { - this.imageName = imageName; - } - public FormFile getFile() - { - return file; - } - public void setFile(FormFile file) - { - this.file = file; - } - - public Boolean getIsSelfService() - { - return isSelfService; - } - - public void setIsSelfService(Boolean isSelfService) - { - this.isSelfService = isSelfService; - } - - public String getDocumentNote() - { - return documentNote; - } - public void setDocumentNote(String documentNote) - { - this.documentNote = documentNote; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductPriceBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductPriceBean.java deleted file mode 100644 index 2ef43bd140..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductPriceBean.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 30, 2005 by praveen - * - */ -package org.posterita.beans; - -import java.math.BigDecimal; - - -public class ProductPriceBean extends ProductAttributeValueBean -{ - protected BigDecimal priceList; - protected String priceListName; - protected BigDecimal priceStandard; - - public Integer getPriceListVersionId() - { - return priceListVersionId; - } - - public void setPriceListVersionId(Integer priceListVersionId) - { - this.priceListVersionId = priceListVersionId; - } - - - - public String getPriceListName() - { - return priceListName; - } - - public void setPriceListName(String priceListName) - { - this.priceListName = priceListName; - } - - - - public BigDecimal getPriceList() - { - return priceList; - } - - public void setPriceList(BigDecimal priceList) - { - this.priceList = priceList; - } - - public BigDecimal getPriceStandard() - { - return priceStandard; - } - - public void setPriceStandard(BigDecimal priceStandard) - { - this.priceStandard = priceStandard; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductQuery.java b/posterita/posterita/src/main/org/posterita/beans/ProductQuery.java deleted file mode 100644 index eab21ab4d5..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductQuery.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -package org.posterita.beans; - - - -public class ProductQuery -{ - - private int locatorId; - private int attributeSetId; - private int attributeValueIds[]; - private int productId; - private String fromLocatorSQL; - private String regionFilterSQL; - private int hondaOrgId; - private int priceListId; - private int priceListVersionId; - private int warehouseId; - private String reserveStatusFilter; - private String availableForBackOrderFilter; - private int productCategoryId; - private Integer ad_Org_ID; - private String ETAFilter; - private String backOrder; - - - public String getAvailableForBackOrderFilter() { - return availableForBackOrderFilter; - } - public void setAvailableForBackOrderFilter( - String availableForBackOrderFilter) { - this.availableForBackOrderFilter = availableForBackOrderFilter; - } - public String getReserveStatusFilter() - { - return reserveStatusFilter; - } - - public void setReserveStatusFilter(String reserveStatusFilter) - { - this.reserveStatusFilter = reserveStatusFilter; - } - - public int getWarehouseId() - { - return warehouseId; - } - - public void setWarehouseId(int warehouseId) - { - this.warehouseId = warehouseId; - } - - public int getPriceListVersionId() - { - return priceListVersionId; - } - - public void setPriceListVersionId(int priceListVersionId) - { - this.priceListVersionId = priceListVersionId; - } - - public int getPriceListId() - { - return priceListId; - } - - public void setPriceListId(int priceListId) - { - this.priceListId = priceListId; - } - - public int getHondaOrgId() - { - return hondaOrgId; - } - public void setHondaOrgId(int hondaOrgId) - { - this.hondaOrgId = hondaOrgId; - } - - public int getProductId() - { - return productId; - } - - public void setProductId(int productId) - { - this.productId = productId; - } - - - public int getLocatorId() - { - return locatorId; - } - - public void setLocatorId(int locatorId) - { - this.locatorId = locatorId; - } - - - - - public int[] getAttributeValueIds() - { - return attributeValueIds; - } - public void setAttributeValueIds(int[] attributeValueIds) - { - this.attributeValueIds = attributeValueIds; - } - - - public int getAttributeSetId() - { - return attributeSetId; - } - - public void setAttributeSetId(int attributeSetid) - { - this.attributeSetId = attributeSetid; - } - - public String getFromLocatorSQL() - { - return fromLocatorSQL; - } - - public void setFromLocatorSQL(String fromLocatorSQL) - { - this.fromLocatorSQL = fromLocatorSQL; - } - - public String getRegionFilterSQL() - { - return regionFilterSQL; - } - - public void setRegionFilterSQL(String regionFilterSQL) - { - this.regionFilterSQL = regionFilterSQL; - } - - public int getProductCategoryId() - { - return productCategoryId; - } - - public void setProductCategoryId(int productCategoryId) - { - this.productCategoryId = productCategoryId; - } - - public Integer getAd_Org_ID() - { - return ad_Org_ID; - } - - public void setAd_Org_ID(Integer ad_Org_ID) - { - this.ad_Org_ID = ad_Org_ID; - } - - public String getETAFilter() - { - return ETAFilter; - } - public void setETAFilter(String filter) - { - ETAFilter = filter; - } - - public String getBackOrder() - { - return backOrder; - } - - public void setBackOrder(String backOrder) - { - this.backOrder = backOrder; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductRestrictionBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductRestrictionBean.java deleted file mode 100644 index 451de68469..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductRestrictionBean.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 30, 2005 by praveen - * - */ -package org.posterita.beans; - -public class ProductRestrictionBean extends StockBean -{ - public Integer getProductCategoryId() - { - return productCategoryId; - } - - public void setProductCategoryId(Integer productCategoryId) - { - this.productCategoryId = productCategoryId; - } - - public Integer[] getCheckBox() - { - return checkBox; - } - public Integer getColour() - { - return colour; - } - - public Integer getModel() - { - return model; - } - - public Integer getOrgId() - { - return orgId; - } - - public Integer getTransmission() - { - return transmission; - } - - public Integer getYear() - { - return year; - } - - public void setCheckBox(Integer[] checkBox) - { - this.checkBox = checkBox; - } - - public void setColour(Integer colour) - { - this.colour = colour; - } - - public void setModel(Integer model) - { - this.model = model; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public void setTransmission(Integer transmission) - { - this.transmission = transmission; - } - - public void setYear(Integer year) - { - this.year = year; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductSalesInfoBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductSalesInfoBean.java deleted file mode 100644 index 52a9fe7505..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductSalesInfoBean.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 10-Oct-2006 12:34:54 by praveen - * - */ - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.Date; - -public class ProductSalesInfoBean { - private String DocumentNo; - private Date dateOrdered; - private String bpartnerName; - private String orderType; - private BigDecimal qtyOrderded; - private Integer orderId; - private BigDecimal lineAmount; - - public String getBpartnerName() { - return bpartnerName; - } - public void setBpartnerName(String bpartnerName) { - this.bpartnerName = bpartnerName; - } - public Date getDateOrdered() { - return dateOrdered; - } - public void setDateOrdered(Date dateOrdered) { - this.dateOrdered = dateOrdered; - } - public String getDocumentNo() { - return DocumentNo; - } - public void setDocumentNo(String documentNo) { - DocumentNo = documentNo; - } - public String getOrderType() { - return orderType; - } - public void setOrderType(String orderType) { - this.orderType = orderType; - } - public BigDecimal getQtyOrderded() { - return qtyOrderded; - } - public void setQtyOrderded(BigDecimal qtyOrderded) { - this.qtyOrderded = qtyOrderded; - } - public Integer getOrderId() { - return orderId; - } - public void setOrderId(Integer orderId) { - this.orderId = orderId; - } - public BigDecimal getLineAmount() { - return lineAmount; - } - public void setLineAmount(BigDecimal lineAmount) { - this.lineAmount = lineAmount; - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductSalesSummaryBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductSalesSummaryBean.java deleted file mode 100644 index 80b6870660..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductSalesSummaryBean.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 10-Oct-2006 12:25:01 by praveen - * - */ - -package org.posterita.beans; - -import java.math.BigDecimal; - -public class ProductSalesSummaryBean { - private Integer productId; - private String productName; - private BigDecimal qtySold; - private BigDecimal totalAmount; - private BigDecimal qtyOnHand; - - public Integer getProductId() { - return productId; - } - public void setProductId(Integer productId) { - this.productId = productId; - } - public String getProductName() { - return productName; - } - public void setProductName(String productName) { - this.productName = productName; - } - public BigDecimal getQtyOnHand() { - return qtyOnHand; - } - public void setQtyOnHand(BigDecimal qtyOnHand) { - this.qtyOnHand = qtyOnHand; - } - public BigDecimal getQtySold() { - return qtySold; - } - public void setQtySold(BigDecimal qtySold) { - this.qtySold = qtySold; - } - public BigDecimal getTotalAmount() { - return totalAmount; - } - public void setTotalAmount(BigDecimal totalAmount) { - this.totalAmount = totalAmount; - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductSearchBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductSearchBean.java deleted file mode 100644 index 13889256ff..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductSearchBean.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 17, 2006 by ashley -* -*/ - -package org.posterita.beans; - -public class ProductSearchBean extends UDIBean -{ - public Boolean getIsActive() - { - return isActive; - } - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - public Boolean getIsWebstoreFeatured() - { - return isWebstoreFeatured; - } - public void setIsWebstoreFeatured(Boolean isWebstoreFeatured) - { - this.isWebstoreFeatured = isWebstoreFeatured; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductSpecsBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductSpecsBean.java deleted file mode 100644 index ca858f8598..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductSpecsBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - -import java.math.BigDecimal; - - -public class ProductSpecsBean -{ - private String model; - private String colour; - private String year; - private String transmission; - private BigDecimal priceStd; - - - public BigDecimal getPriceStd() { - return priceStd; - } - public void setPriceStd(BigDecimal priceStd) { - this.priceStd = priceStd; - } - public String getColour() { - return colour; - } - public void setColour(String colour) { - this.colour = colour; - } - public String getModel() { - return model; - } - public void setModel(String model) { - this.model = model; - } - public String getTransmission() { - return transmission; - } - public void setTransmission(String transmission) { - this.transmission = transmission; - } - public String getYear() { - return year; - } - public void setYear(String year) { - this.year = year; - } - - public boolean equals(Object obj) - { - ProductSpecsBean bean = (ProductSpecsBean) obj; - - if ( obj == null) - return false; - - if (this.getModel().equalsIgnoreCase(bean.getModel()) == false) - return false; - - if (this.getColour().equalsIgnoreCase(bean.getColour()) == false) - return false; - - if (this.getTransmission().equalsIgnoreCase(bean.getTransmission()) == false) - return false; - - if (this.getYear().equalsIgnoreCase(bean.getYear()) == false) - return false; - - return true; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductStatusBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductStatusBean.java deleted file mode 100644 index 8597bc9592..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductStatusBean.java +++ /dev/null @@ -1,253 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jan 18, 2006 by praveen - * - */ -package org.posterita.beans; - -import java.math.BigDecimal; - -public class ProductStatusBean extends UDIBean -{ - private Boolean availability = Boolean.valueOf(true); - private ProductImageInfo imageInfo; - private Boolean hasAttachment; - - public String getProductClassification() - { - return productClassification; - } - public void setProductClassification(String productClassification) - { - this.productClassification = productClassification; - } - - public Integer[] getCheckBox() - { - return checkBox; - } - - public void setCheckBox(Integer[] checkBox) - { - this.checkBox = checkBox; - } - - public Boolean getAvailability() - { - return availability; - } - - public void setAvailability(Boolean availability) - { - this.availability = availability; - } - - private String colour,model,transmission,year; - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - public String getColour() - { - return colour; - } - - public void setColour(String colour) - { - this.colour = colour; - } - - public String getModel() - { - return model; - } - - public void setModel(String model) - { - this.model = model; - } - - public String getTransmission() - { - return transmission; - } - - public void setTransmission(String transmission) - { - this.transmission = transmission; - } - - public String getYear() - { - return year; - } - - public void setYear(String year) - { - this.year = year; - } - - public Boolean getIsActive() - { - return isActive; - } - - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - - private String productName; - - public String getProductName() - { - return productName; - } - public void setProductName(String productName) - { - this.productName = productName; - } - - public ProductImageInfo getImageInfo() - { - return imageInfo; - } - - public void setImageInfo(ProductImageInfo imageInfo) - { - this.imageInfo = imageInfo; - } - - public Boolean getHasAttachment() - { - return hasAttachment; - } - public void setHasAttachment(Boolean hasAttachment) - { - this.hasAttachment = hasAttachment; - } - public Boolean getIsWebstoreFeatured() - { - return isWebstoreFeatured; - } - - public void setIsWebstoreFeatured(Boolean isWebstoreFeatured) - { - this.isWebstoreFeatured = isWebstoreFeatured; - } - - public String getProductNameComplete() - { - String retVal = ""; - if(productName != null) - retVal = productName.replaceAll("_", " "); - return retVal; - } - - public String getKeyword1() - { - return keyword1; - } - - public void setKeyword1(String keyword1) - { - this.keyword1 = keyword1; - } - - public String getKeyword2() - { - return keyword2; - } - - public void setKeyword2(String keyword2) - { - this.keyword2 = keyword2; - } - - public String getKeyword3() - { - return keyword3; - } - - public void setKeyword3(String keyword3) - { - this.keyword3 = keyword3; - } - - public String getKeyword4() - { - return keyword4; - } - - public void setKeyword4(String keyword4) - { - this.keyword4 = keyword4; - } - - public String getBarCode() - { - return barCode; - } - - public void setBarCode(String barCode) - { - this.barCode = barCode; - } - - public Boolean getIsSelfService() - { - return isSelfService; - } - - public void setIsSelfService(Boolean isSelfService) - { - this.isSelfService = isSelfService; - } - - private String description; - - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public BigDecimal getQtyOnHand() { - return qtyOnHand; - } - public void setQtyOnHand(BigDecimal qtyOnHand) { - this.qtyOnHand = qtyOnHand; - } - public BigDecimal getPriceStandard() { - return priceStandard; - } - public void setPriceStandard(BigDecimal priceStandard) { - this.priceStandard = priceStandard; - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ProductSupplierBean.java b/posterita/posterita/src/main/org/posterita/beans/ProductSupplierBean.java deleted file mode 100644 index 6a3733974a..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ProductSupplierBean.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jun 20, 2006 - */ - - -package org.posterita.beans; - - -public class ProductSupplierBean extends UDIBean -{ - protected Integer bPartnerId; - protected String partnerName; - protected Integer quantity; - - public Integer getBPartnerId() { - return bPartnerId; - } - public void setBPartnerId(Integer partnerId) { - bPartnerId = partnerId; - } - public String getPartnerName() { - return partnerName; - } - public void setPartnerName(String partnerName) { - this.partnerName = partnerName; - } - public Integer getQuantity() { - return quantity; - } - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/RemoveSessionBean.java b/posterita/posterita/src/main/org/posterita/beans/RemoveSessionBean.java deleted file mode 100644 index 3aad81c53a..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/RemoveSessionBean.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jan 26, 2007 - */ - - -package org.posterita.beans; - - -public class RemoveSessionBean extends UDIBean -{ - - - public String getOrderType() - { - return orderType; - } - - public void setOrderType(String orderType) - { - this.orderType = orderType; - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/beans/ReportBean.java b/posterita/posterita/src/main/org/posterita/beans/ReportBean.java deleted file mode 100644 index 6fe738904c..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ReportBean.java +++ /dev/null @@ -1,293 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - -import java.util.ArrayList; - - -public class ReportBean extends UDIBean -{ - - public ReportBean getReport() - { - return report; - } - - public void setReport(ReportBean report) - { - this.report = report; - } - - public ArrayList getReportList() - { - return reportList; - } - - public void setStockList(ArrayList reportList) - { - this.reportList = reportList; - } - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - public String getProductName() - { - return productName; - } - - public void setProductName(String productName) - { - this.productName = productName; - } - - public String getBarCode() - { - return barCode; - } - public void setBarCode(String barCode) - { - this.barCode = barCode; - } - - public String getDescription() - { - return description; - } - public void setDescription(String description) - { - this.description = description; - } - - public Integer getOrgId() - { - return orgId; - } - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public Integer getNoOfProductsRequired() { - return noOfProductsRequired; - } - public void setNoOfProductsRequired(Integer noOfProductsRequired) { - this.noOfProductsRequired = noOfProductsRequired; - } - public String getReportType() { - return reportType; - } - public void setReportType(String reportType) { - this.reportType = reportType; - } - public String getFromDate() - { - return fromDate; - } - - public void setFromDate(String fromDate) - { - this.fromDate = fromDate; - } - - public String getToDate() - { - return toDate; - } - - public void setToDate(String toDate) - { - this.toDate = toDate; - } - - public String getStartDay() - { - return startDay; - } - - public void setStartDay(String startDay) - { - this.startDay = startDay; - } - - public String getStartMonth() - { - return startMonth; - } - - public void setStartMonth(String startMonth) - { - this.startMonth = startMonth; - } - - public String getStartYear() - { - return startYear; - } - - public void setStartYear(String startYear) - { - this.startYear = startYear; - } - - public String getEndDay() - { - return endDay; - } - - public void setEndDay(String endDay) - { - this.endDay = endDay; - } - - public String getEndMonth() - { - return endMonth; - } - - public void setEndMonth(String endMonth) - { - this.endMonth = endMonth; - } - - public String getEndYear() - { - return endYear; - } - - public void setEndYear(String endYear) - { - this.endYear = endYear; - } - - public String getStartHour() - { - return startHour; - } - - public void setStartHour(String startHour) - { - this.startHour = startHour; - } - - public String getStartMinute() - { - return startMinute; - } - - public void setStartMinute(String startMinute) - { - this.startMinute = startMinute; - } - - public String getEndHour() - { - return endHour; - } - - public void setEndHour(String endHour) - { - this.endHour = endHour; - } - - public String getEndMinute() - { - return endMinute; - } - - public void setEndMinute(String endMinute) - { - this.endMinute = endMinute; - } - public String getAttribute() { - return attribute; - } - public void setAttribute(String attribute) { - this.attribute = attribute; - } - - public String getTimePeriod() { - return timePeriod; - } - public void setTimePeriod(String timePeriod) { - this.timePeriod = timePeriod; - } - - public String getChartType() { - return chartType; - } - public void setChartType(String chartType) { - this.chartType = chartType; - } - - public String getSalesGroup() { - return salesGroup; - } - public void setSalesGroup(String salesGroup) { - this.salesGroup = salesGroup; - } - - public Integer getAccountId() { - return accountId; - } - public void setAccountId(Integer accountId) { - this.accountId = accountId; - } - - public String getDateRange() { - return dateRange; - } - public void setDateRange(String dateRange) { - this.dateRange = dateRange; - } - - public String getPriceQtyFilter() { - return priceQtyFilter; - } - public void setPriceQtyFilter(String priceQtyFilter) { - this.priceQtyFilter = priceQtyFilter; - } - - public String getFullDetails() - { - return fullDetails; - } - - public void setFullDetails(String fullDetails) - { - this.fullDetails = fullDetails; - } - public String getIsSalesReport() - { - return isSalesReport; - } - public void setIsSalesReport(String isSalesReport) - { - this.isSalesReport = isSalesReport; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ReportDataBean.java b/posterita/posterita/src/main/org/posterita/beans/ReportDataBean.java deleted file mode 100644 index ac3f3f4350..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ReportDataBean.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 21, 2005 by praveen - * - */ -package org.posterita.beans; - - -public class ReportDataBean -{ - private String model; - private int count; - private int automatic; - private int manual; - private int sale; - private int target; - - public ReportDataBean() - { - model = ""; - count = 0; - automatic = 0; - manual = 0; - sale = 0; - target = 0; - } - - public int getAutomatic() - { - return automatic; - } - - public void setAutomatic(int automatic) - { - this.automatic = automatic; - } - - public int getCount() - { - return count; - } - - public void setCount(int count) - { - this.count = count; - } - - public int getManual() - { - return manual; - } - - public void setManual(int manual) - { - this.manual = manual; - } - - public String getModel() - { - return model; - } - - public void setModel(String model) - { - this.model = model; - } - - public int getSale() - { - return sale; - } - - public void setSale(int sale) { - this.sale = sale; - } - - public int getTarget() - { - return target; - } - - public void setTarget(int target) - { - this.target = target; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ReportImageBean.java b/posterita/posterita/src/main/org/posterita/beans/ReportImageBean.java deleted file mode 100644 index ba84e11b8d..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ReportImageBean.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 17, 2005 by praveen - * - */ -package org.posterita.beans; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.GregorianCalendar; - -import org.posterita.core.TimestampConvertor; - - -public class ReportImageBean -{ - private String imagePath; - private String imageTitle; - private String altText; - private String requestParams; - private String dateFrom; - private String dateTo; - - public ReportImageBean() - { - initDateFrom(); - initDateTo(); - } - - private void initDateFrom() - { - SimpleDateFormat df = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - - Calendar calendar = GregorianCalendar.getInstance(); - - if(calendar.get(Calendar.MONTH) == Calendar.JANUARY) - { - calendar.set(Calendar.DATE,9); - } - else - { - calendar.set(Calendar.DATE,1); - } - - calendar.set(Calendar.HOUR_OF_DAY,9); - calendar.set(Calendar.MINUTE,15); - calendar.set(Calendar.SECOND,0); - dateFrom = df.format(calendar.getTime()); - } - - private void initDateTo() - { - SimpleDateFormat df = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - - Calendar calendar = GregorianCalendar.getInstance(); - //int maxNoOfDays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); - //calendar.set(Calendar.DATE,maxNoOfDays); - dateTo = df.format(calendar.getTime()); - } - - public String getAltText() - { - return altText; - } - - public void setAltText(String altText) - { - this.altText = altText; - } - - public String getImagePath() - { - return imagePath; - } - - public void setImagePath(String imagePath) - { - this.imagePath = imagePath; - } - - public String getImageTitle() - { - return imageTitle; - } - - public void setImageTitle(String imageTitle) - { - this.imageTitle = imageTitle; - } - - public void setRequestParams(String requestParams) - { - this.requestParams = requestParams; - } - - public String getDateFrom() - { - return dateFrom; - } - - public void setDateFrom(String dateFrom) - { - this.dateFrom = dateFrom; - } - - public String getDateTo() - { - return dateTo; - } - - public void setDateTo(String dateTo) - { - this.dateTo = dateTo; - } - - public String getRequestParams() - { - requestParams = null; - - try - { - requestParams = "dateFrom=" + URLEncoder.encode(dateFrom,"UTF-8") + - "&dateTo=" + URLEncoder.encode(dateTo,"UTF-8") + - "&imagePath=" + URLEncoder.encode(imagePath,"UTF-8") + - "&imageTitle=" + URLEncoder.encode(imageTitle,"UTF-8"); - } - catch (UnsupportedEncodingException e) - { - - } - return requestParams; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/RoleBean.java b/posterita/posterita/src/main/org/posterita/beans/RoleBean.java deleted file mode 100644 index 484a1f1166..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/RoleBean.java +++ /dev/null @@ -1,203 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 16, 2005 by praveen - * - */ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.ArrayList; - -public class RoleBean extends UDIBean -{ - protected Boolean isDiscountUptoLimitPrice; - protected Boolean isDiscountAllowedOnTotal; - - - public ArrayList getRoleBeanList() { - return roleBeanList; - } - - public void setRoleBeanList(ArrayList roleBeanList) { - this.roleBeanList = roleBeanList; - } - - public Boolean getIsChecked() { - return isChecked; - } - - public void setIsChecked(Boolean isChecked) { - this.isChecked = isChecked; - } - - public Boolean getIsOverwritePriceLimit() { - return isOverwritePriceLimit; - } - - public void setIsOverwritePriceLimit(Boolean isOverwritePriceLimit) { - this.isOverwritePriceLimit = isOverwritePriceLimit; - } - - public BigDecimal getUserDiscount() { - return userDiscount; - } - - public void setUserDiscount(BigDecimal userDiscount) { - this.userDiscount = userDiscount; - } - - public Integer[] getCheckBox() - { - return checkBox; - } - - public void setCheckBox(Integer[] checkBox) - { - this.checkBox = checkBox; - } - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - public Boolean getIsActive() - { - return isActive; - } - - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - - public Integer getRoleId() - { - return roleId; - } - - public void setRoleId(Integer roleId) - { - this.roleId = roleId; - } - - public Boolean getIsAccessAllOrgs() - { - return isAccessAllOrgs; - - } - - public void setIsAccessAllOrgs(Boolean isAccessAllOrgs) - { - this.isAccessAllOrgs = isAccessAllOrgs; - } - - - - public Boolean getCanAlterOrder() - { - return canAlterOrder; - } - - public void setCanAlterOrder(Boolean canAlterOrder) - { - this.canAlterOrder = canAlterOrder; - } - - protected Boolean canCreateOrder; - protected Boolean canViewOrder; - - - public Boolean getCanCreateOrder() - { - return canCreateOrder; - } - - public void setCanCreateOrder(Boolean canCreateOrder) - { - this.canCreateOrder = canCreateOrder; - } - - public Boolean getCanViewOrder() - { - return canViewOrder; - } - - public void setCanViewOrder(Boolean canViewOrder) - { - this.canViewOrder = canViewOrder; - } - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public String getOrgName() - { - return orgName; - } - - public void setOrgName(String orgName) - { - this.orgName = orgName; - } - - public Boolean getIsDiscountUptoLimitPrice() - { - return isDiscountUptoLimitPrice; - } - - public void setIsDiscountUptoLimitPrice(Boolean isDiscountUptoLimitPrice) - { - this.isDiscountUptoLimitPrice = isDiscountUptoLimitPrice; - } - - public Boolean getIsDiscountAllowedOnTotal() - { - return isDiscountAllowedOnTotal; - } - - public void setIsDiscountAllowedOnTotal(Boolean isDiscountAllowedOnTotal) - { - this.isDiscountAllowedOnTotal = isDiscountAllowedOnTotal; - } - - public Integer getWebMenuId() - { - return webMenuId; - } - - public void setWebMenuId(Integer webMenuId) - { - this.webMenuId = webMenuId; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportBean.java b/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportBean.java deleted file mode 100644 index 8559560809..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 14-Jul-2006 14:00:21 by praveen - * - */ - -package org.posterita.beans; - -public class SalesAnalysisReportBean extends ReportBean -{ - private String supplier,category,brand,model,design,colour,size; - - public String getBrand() { - return brand; - } - - public void setBrand(String brand) { - this.brand = brand; - } - - public String getCategory() { - return category; - } - - public void setCategory(String category) { - this.category = category; - } - - public String getColour() { - return colour; - } - - public void setColour(String colour) { - this.colour = colour; - } - - public String getDesign() { - return design; - } - - public void setDesign(String design) { - this.design = design; - } - - public String getModel() { - return model; - } - - public void setModel(String model) { - this.model = model; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } - - public String getSupplier() { - return supplier; - } - - public void setSupplier(String supplier) { - this.supplier = supplier; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportDataBean.java b/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportDataBean.java deleted file mode 100644 index 573242e971..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/SalesAnalysisReportDataBean.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 05-Jul-2006 12:32:38 by praveen - * - */ - -package org.posterita.beans; - -import java.math.BigDecimal; - -public class SalesAnalysisReportDataBean -{ - private String supplier,category,brand,model,design,colour,size; - private BigDecimal quantity,amount; - - public BigDecimal getAmount() { - return amount; - } - public void setAmount(BigDecimal amount) { - this.amount = amount; - } - public String getBrand() { - return brand; - } - public void setBrand(String brand) { - this.brand = brand; - } - public String getCategory() { - return category; - } - public void setCategory(String category) { - this.category = category; - } - public String getColour() { - return colour; - } - public void setColour(String colour) { - this.colour = colour; - } - public String getDesign() { - return design; - } - public void setDesign(String design) { - this.design = design; - } - public String getModel() { - return model; - } - public void setModel(String model) { - this.model = model; - } - public BigDecimal getQuantity() { - return quantity; - } - public void setQuantity(BigDecimal quantity) { - this.quantity = quantity; - } - public String getSize() { - return size; - } - public void setSize(String size) { - this.size = size; - } - public String getSupplier() { - return supplier; - } - public void setSupplier(String supplier) { - this.supplier = supplier; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/SalesDetailsBean.java b/posterita/posterita/src/main/org/posterita/beans/SalesDetailsBean.java deleted file mode 100644 index 7bce57259f..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/SalesDetailsBean.java +++ /dev/null @@ -1,208 +0,0 @@ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; - -public class SalesDetailsBean -{ - private int orderId; - private int[] orderLineId; - private int[] productId; - private int bPartnerId; - private BigDecimal linesTotals; - private BigDecimal grandTotals; - private BigDecimal totalTaxAmount; - private BigDecimal cardAmount; - private BigDecimal cashAmount; - private BigDecimal chequeAmount; - private BigDecimal totalCosts; - private BigDecimal salesExcVat; - private BigDecimal salesExempt; - private BigDecimal purchasesExcVat; - private BigDecimal purchasesExempt; - private BigDecimal creditNoteExcVat; - private BigDecimal creditNoteExempt; - private BigDecimal debitNoteExcVat; - private BigDecimal debitNoteExempt; - private BigDecimal total; - private String orderType; - private Timestamp date; - - public int getOrderId() - { - return orderId; - } - public void setOrderId(int orderId) - { - this.orderId = orderId; - } - public int[] getOrderLineId() - { - return orderLineId; - } - public void setOrderLineId(int[] orderLineId) - { - this.orderLineId = orderLineId; - } - public int[] getProductId() - { - return productId; - } - public void setProductId(int[] productId) - { - this.productId = productId; - } - public int getBPartnerId() - { - return bPartnerId; - } - public void setBPartnerId(int partnerId) - { - bPartnerId = partnerId; - } - public BigDecimal getLinesTotals() - { - return linesTotals; - } - public void setLinesTotals(BigDecimal linesTotals) - { - this.linesTotals = linesTotals; - } - public BigDecimal getGrandTotals() - { - return grandTotals; - } - public void setGrandTotals(BigDecimal grandTotals) - { - this.grandTotals = grandTotals; - } - public BigDecimal getTotalTaxAmount() - { - return totalTaxAmount; - } - public void setTotalTaxAmount(BigDecimal totalTaxAmount) - { - this.totalTaxAmount = totalTaxAmount; - } - public BigDecimal getCardAmount() - { - return cardAmount; - } - public void setCardAmount(BigDecimal cardAmount) - { - this.cardAmount = cardAmount; - } - public BigDecimal getCashAmount() - { - return cashAmount; - } - public void setCashAmount(BigDecimal cashAmount) - { - this.cashAmount = cashAmount; - } - public BigDecimal getChequeAmount() - { - return chequeAmount; - } - public void setChequeAmount(BigDecimal chequeAmount) - { - this.chequeAmount = chequeAmount; - } - public BigDecimal getTotalCosts() - { - return totalCosts; - } - public void setTotalCosts(BigDecimal totalCosts) - { - this.totalCosts = totalCosts; - } - public BigDecimal getSalesExcVat() - { - return salesExcVat; - } - public void setSalesExcVat(BigDecimal salesExcVat) - { - this.salesExcVat = salesExcVat; - } - public BigDecimal getSalesExempt() - { - return salesExempt; - } - public void setSalesExempt(BigDecimal salesExempt) - { - this.salesExempt = salesExempt; - } - public BigDecimal getCreditNoteExcVat() - { - return creditNoteExcVat; - } - public void setCreditNoteExcVat(BigDecimal creditNoteExcVat) - { - this.creditNoteExcVat = creditNoteExcVat; - } - public BigDecimal getCreditNoteExempt() - { - return creditNoteExempt; - } - public void setCreditNoteExempt(BigDecimal creditNoteExempt) - { - this.creditNoteExempt = creditNoteExempt; - } - public BigDecimal getTotal() - { - return total; - } - public void setTotal(BigDecimal total) - { - this.total = total; - } - public String getOrderType() - { - return orderType; - } - public void setOrderType(String orderType) - { - this.orderType = orderType; - } - public Timestamp getDate() - { - return date; - } - public void setDate(Timestamp date) - { - this.date = date; - } - public BigDecimal getDebitNoteExcVat() - { - return debitNoteExcVat; - } - public void setDebitNoteExcVat(BigDecimal debitNoteExcVat) - { - this.debitNoteExcVat = debitNoteExcVat; - } - public BigDecimal getDebitNoteExempt() - { - return debitNoteExempt; - } - public void setDebitNoteExempt(BigDecimal debitNoteExempt) - { - this.debitNoteExempt = debitNoteExempt; - } - public BigDecimal getPurchasesExcVat() - { - return purchasesExcVat; - } - public void setPurchasesExcVat(BigDecimal purchasesExcVat) - { - this.purchasesExcVat = purchasesExcVat; - } - public BigDecimal getPurchasesExempt() - { - return purchasesExempt; - } - public void setPurchasesExempt(BigDecimal purchasesExempt) - { - this.purchasesExempt = purchasesExempt; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/SearchBean.java b/posterita/posterita/src/main/org/posterita/beans/SearchBean.java deleted file mode 100644 index bc990d6916..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/SearchBean.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 15, 2006 by ashley -* -*/ - -package org.posterita.beans; - -import java.util.ArrayList; - -public class SearchBean -{ - - protected String searchText; - protected ArrayList andCriteriasList; - protected ArrayList orCriteriasList; - protected ArrayList notCriteriasList; - - public SearchBean(String searchText) - { - this.searchText = searchText; - andCriteriasList = new ArrayList(); - orCriteriasList = new ArrayList(); - notCriteriasList = new ArrayList(); - } - - public ArrayList getAndCriteriasList() - { - return andCriteriasList; - } - - public void setAndCriteriasList(ArrayList andCriteriasList) - { - this.andCriteriasList = andCriteriasList; - } - - public ArrayList getNotCriteriasList() - { - return notCriteriasList; - } - - public void setNotCriteriasList(ArrayList notCriteriasList) - { - this.notCriteriasList = notCriteriasList; - } - - public ArrayList getOrCriteriasList() - { - return orCriteriasList; - } - - public void setOrCriteriasList(ArrayList orCriteriasList) - { - this.orCriteriasList = orCriteriasList; - } - - public String getSearchText() - { - return searchText; - } - - public void setSearchText(String searchText) - { - this.searchText = searchText; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/SearchOrderBean.java b/posterita/posterita/src/main/org/posterita/beans/SearchOrderBean.java deleted file mode 100644 index 02a2f4c8a2..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/SearchOrderBean.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 8, 2005 by praveen - * - */ -package org.posterita.beans; - -public class SearchOrderBean extends UDIBean -{ - - public Integer getOrderId() - { - return orderId; - } - - public void setOrderId(Integer orderId) - { - this.orderId = orderId; - } - - public Integer getFirst() - { - return first; - } - - public void setFirst(Integer first) - { - this.first = first; - } - - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ShipperBean.java b/posterita/posterita/src/main/org/posterita/beans/ShipperBean.java deleted file mode 100644 index eab92da52f..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ShipperBean.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - - -public class ShipperBean extends UDIBean -{ - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/ShoppingCartBean.java b/posterita/posterita/src/main/org/posterita/beans/ShoppingCartBean.java deleted file mode 100644 index 36fa13aa98..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/ShoppingCartBean.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.ArrayList; - - -public class ShoppingCartBean extends UDIBean -{ - private ArrayList items; - private String currency; - private BigDecimal totalPrice; - private int pricelistId; - - public String getCurrency() - { - return currency; - } - - public void setCurrency(String currency) - { - this.currency = currency; - } - - public ArrayList getItems() - { - return items; - } - - public void setItems(ArrayList items) - { - this.items = items; - } - - public BigDecimal getTotalPrice() - { - return totalPrice; - } - - public void setTotalPrice(BigDecimal totalPrice) - { - this.totalPrice = totalPrice; - } - - public int getPricelistId() { - return pricelistId; - } - - public void setPricelistId(int pricelistId) { - this.pricelistId = pricelistId; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/StatementOfAccountBean.java b/posterita/posterita/src/main/org/posterita/beans/StatementOfAccountBean.java deleted file mode 100644 index d683a280e5..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/StatementOfAccountBean.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. POSTERITA SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * Aug 12, 2008 10:39:24 PM by praveen - * - */ - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; - -public class StatementOfAccountBean -{ - private Timestamp date; - private String reference; - private String docType; - private int docId; - private String details; - private BigDecimal credit; - private BigDecimal debit; - private BigDecimal balance; - - public Timestamp getDate() { - return date; - } - public void setDate(Timestamp date) { - this.date = date; - } - public String getReference() { - return reference; - } - public void setReference(String reference) { - this.reference = reference; - } - public String getDocType() { - return docType; - } - public void setDocType(String docType) { - this.docType = docType; - } - public String getDetails() { - return details; - } - public void setDetails(String details) { - this.details = details; - } - public BigDecimal getCredit() { - return credit; - } - public void setCredit(BigDecimal credit) { - this.credit = credit; - } - public BigDecimal getDebit() { - return debit; - } - public void setDebit(BigDecimal debit) { - this.debit = debit; - } - public BigDecimal getBalance() { - return balance; - } - public void setBalance(BigDecimal balance) { - this.balance = balance; - } - public int getDocId() { - return docId; - } - public void setDocId(int docId) { - this.docId = docId; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/StockBean.java b/posterita/posterita/src/main/org/posterita/beans/StockBean.java deleted file mode 100644 index 17fee5e726..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/StockBean.java +++ /dev/null @@ -1,347 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - - - -public class StockBean extends UDIBean -{ - public String getKeyword2() - { - return keyword2; - } - - public void setKeyword2(String keyword2) - { - this.keyword2 = keyword2; - } - - public Integer getProductCategoryId() - { - return productCategoryId; - } - - public void setProductCategoryId(Integer productCategoryId) - { - this.productCategoryId = productCategoryId; - } - - public Integer getMake() - { - return make; - } - public void setMake(Integer make) - { - this.make = make; - } - - public String getAvailableForBackOrderFilter() { - - return availableForBackOrderFilter; - } - - public void setAvailableForBackOrderFilter(String availableForBackOrderFilter) - { - this.availableForBackOrderFilter = availableForBackOrderFilter; - } - - public Integer getModel() - { - return model; - } - - public void setModel(Integer model) - { - this.model = model; - } - - public Integer getColour() - { - return colour; - } - - public void setColour(Integer colour) - { - this.colour = colour; - } - - public Integer getTransmission() - { - return transmission; - } - - public void setTransmission(Integer transmission) - { - this.transmission = transmission; - } - - public Integer getYear() - { - return year; - } - - public void setYear(Integer year) - { - this.year = year; - } - - public Boolean getIsWholesaler() - { - return isWholesaler; - } - - public void setIsWholesaler(Boolean isWholesaler) - { - this.isWholesaler = isWholesaler; - } - - public Integer getRegionId() - { - return regionId; - } - - public void setRegionId(Integer regionId) - { - this.regionId = regionId; - } - - - - public Integer[] getCheckBox() - { - return checkBox; - } - public void setCheckBox(Integer [] checkBox) - { - this.checkBox = checkBox; - } - - public Integer getReserveStatus() - { - return reserveStatus; - } - - public void setReserveStatus(Integer reserveStatus) - { - this.reserveStatus = reserveStatus; - } - - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public Integer getAllocationId() - { - return allocationId; - } - - public void setAllocationId(Integer allocationId) - { - this.allocationId = allocationId; - } - - public String getWarehouseType() - { - return warehouseType; - } - - public void setWarehouseType(String warehouseType) - { - this.warehouseType = warehouseType; - } - - public Integer getFirst() - { - return first; - } - - public void setFirst(Integer first) - { - this.first = first; - } - - public Integer getWarehouseId() - { - return warehouseId; - } - - public void setWarehouseId(Integer warehouseId) - { - this.warehouseId = warehouseId; - } - public Integer getDocumentId() { - return documentId; - } - public void setDocumentId(Integer documentId) { - this.documentId = documentId; - } - - public String getETAFilter() - { - return ETAFilter; - } - - public void setETAFilter(String filter) - { - ETAFilter = filter; - } - - public Integer getDesign() - { - return design; - } - public void setDesign(Integer design) - { - this.design = design; - } - public Integer getSize() - { - return size; - } - public void setSize(Integer size) - { - this.size = size; - } - public Integer getStyle() - { - return style; - } - public void setStyle(Integer style) - { - this.style = style; - } - - public Integer getColourAttributeValueId() - { - return colourAttributeValueId; - } - - public void setColourAttributeValueId(Integer colourAttributeValueId) - { - this.colourAttributeValueId = colourAttributeValueId; - } - - public Integer getDesignAttributeValueId() - { - return designAttributeValueId; - } - - public void setDesignAttributeValueId(Integer designAttributeValueId) - { - this.designAttributeValueId = designAttributeValueId; - } - - public Integer getModelAttributeValueId() - { - return modelAttributeValueId; - } - - public void setModelAttributeValueId(Integer modelAttributeValueId) - { - this.modelAttributeValueId = modelAttributeValueId; - } - - public Integer getSizeAttributeValueId() - { - return sizeAttributeValueId; - } - - public void setSizeAttributeValueId(Integer sizeAttributeValueId) - { - this.sizeAttributeValueId = sizeAttributeValueId; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public String getOrderType() - { - return orderType; - } - - public void setOrderType(String orderType) - { - this.orderType = orderType; - } - - public Integer getAttributeId() - { - return attributeId; - } - - public void setAttributeId(Integer attributeId) - { - this.attributeId = attributeId; - } - - public String getKeyword() - { - return keyword; - } - - public void setKeyword(String keyword) - { - this.keyword = keyword; - } - - public String getBackOrder() - { - return backOrder; - } - - public void setBackOrder(String backOrder) - { - this.backOrder = backOrder; - } - - public String getFieldName() - { - return fieldName; - } - - public void setFieldName(String fieldName) - { - this.fieldName = fieldName; - } - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/StockMovementBean.java b/posterita/posterita/src/main/org/posterita/beans/StockMovementBean.java deleted file mode 100644 index 4fd1f1dcf3..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/StockMovementBean.java +++ /dev/null @@ -1,459 +0,0 @@ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.ArrayList; - -public class StockMovementBean -{ - private String isApproved; - private String address1; - private String address2; - private Integer movementLineId; - private Integer lineNo; - private Integer moveConfirmId; - private String orgFromName; - private String orgToName; - private Integer index; - private String movementDate; - private String documentNo; - private String documentType; - private String docStatus; - private Integer movementId; - private Integer refNo; - private StockMovementBean stock; - private ArrayList stockList; - private Boolean isActive; - private Integer orgFromId; - private Integer orgToId; - private BigDecimal qtyToMove; - private BigDecimal qtyOnHand; - private Integer orgId; - private String uom; - private Integer productId; - private String productName; - private String description; - private String barCode; - private BigDecimal quantity; - private String orgName; - private String fromDate; - private String toDate; - private Integer salesPriceListId; - private BigDecimal stockValue; - private String ifAdd; - private Integer priceListId; - private Integer noOfPack; - private String reference; - private Integer month; - private Integer year; - - public BigDecimal getStockValue() - { - return stockValue; - } - - public void setStockValue(BigDecimal stockValue) - { - this.stockValue = stockValue; - } - - public Integer getSalesPriceListId() - { - return salesPriceListId; - } - - public void setSalesPriceListId(Integer salesPriceListId) - { - this.salesPriceListId = salesPriceListId; - } - - public String getIsApproved() - { - return isApproved; - } - - public void setIsApproved(String isApproved) - { - this.isApproved = isApproved; - } - - public String getAddress1() - { - return address1; - } - - public void setAddress1(String address1) - { - this.address1 = address1; - } - - public String getAddress2() - { - return address2; - } - - public void setAddress2(String address2) - { - this.address2 = address2; - } - - public Integer getMovementLineId() - { - return movementLineId; - } - - public void setMovementLineId(Integer movementLineId) - { - this.movementLineId = movementLineId; - } - - public Integer getLineNo() - { - return lineNo; - } - - public void setLineNo(Integer lineNo) - { - this.lineNo = lineNo; - } - - public Integer getMoveConfirmId() - { - return moveConfirmId; - } - - public void setMoveConfirmId(Integer moveConfirmId) - { - this.moveConfirmId = moveConfirmId; - } - - public String getOrgFromName() - { - return orgFromName; - } - - public void setOrgFromName(String orgFromName) - { - this.orgFromName = orgFromName; - } - - public String getOrgToName() - { - return orgToName; - } - - public void setOrgToName(String orgToName) - { - this.orgToName = orgToName; - } - - public Integer getIndex() - { - return index; - } - - public void setIndex(Integer index) - { - this.index = index; - } - - public String getMovementDate() - { - return movementDate; - } - - public void setMovementDate(String movementDate) - { - this.movementDate = movementDate; - } - - public String getDocumentNo() - { - return documentNo; - } - - public void setDocumentNo(String documentNo) - { - this.documentNo = documentNo; - } - - public String getDocumentType() - { - return documentType; - } - - public void setDocumentType(String documentType) - { - this.documentType = documentType; - } - - public String getDocStatus() - { - return docStatus; - } - - public void setDocStatus(String docStatus) - { - this.docStatus = docStatus; - } - - public Integer getMovementId() - { - return movementId; - } - - public void setMovementId(Integer movementId) - { - this.movementId = movementId; - } - - public Integer getRefNo() - { - return refNo; - } - - public void setRefNo(Integer refNo) - { - this.refNo = refNo; - } - - public StockMovementBean getStock() - { - return stock; - } - - public void setStock(StockMovementBean stock) - { - this.stock = stock; - } - - public ArrayList getStockList() - { - return stockList; - } - - public void setStockList(ArrayList stockList) - { - this.stockList = stockList; - } - - public Boolean getIsActive() - { - return isActive; - } - - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - - public Integer getOrgFromId() - { - return orgFromId; - } - - public void setOrgFromId(Integer orgFromId) - { - this.orgFromId = orgFromId; - } - - public Integer getOrgToId() - { - return orgToId; - } - - public void setOrgToId(Integer orgToId) - { - this.orgToId = orgToId; - } - - public BigDecimal getQtyToMove() - { - return qtyToMove; - } - - public void setQtyToMove(BigDecimal qtyToMove) - { - this.qtyToMove = qtyToMove; - } - - public BigDecimal getQtyOnHand() - { - return qtyOnHand; - } - - public void setQtyOnHand(BigDecimal qtyOnHand) - { - this.qtyOnHand = qtyOnHand; - } - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public String getUom() - { - return uom; - } - - public void setUom(String uom) - { - this.uom = uom; - } - - public Integer getProductId() - { - return productId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - public String getProductName() - { - return productName; - } - - public void setProductName(String productName) - { - this.productName = productName; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public String getBarCode() - { - return barCode; - } - - public void setBarCode(String barCode) - { - this.barCode = barCode; - } - - public void setQuantity(BigDecimal quantity) - { - this.quantity = quantity; - } - - public BigDecimal getQuantity() - { - return this.quantity; - } - - public String getOrgName() - { - return orgName; - } - - public void setOrgName(String orgName) - { - this.orgName = orgName; - } - - public String getFromDate() - { - return fromDate; - } - - public void setFromDate(String fromDate) - { - this.fromDate = fromDate; - } - - public String getToDate() - { - return toDate; - } - - public void setToDate(String toDate) - { - this.toDate = toDate; - } - - public String getIfAdd() { - return ifAdd; - } - public void setIfAdd(String ifAdd) { - this.ifAdd = ifAdd; - } - - public void updateQuantity(StockMovementBean original, StockMovementBean itemToAdd, boolean add) - { - BigDecimal originalQuantity = original.getQtyToMove(); - - BigDecimal quantityToAdd = itemToAdd.getQtyToMove(); - - BigDecimal finalQuantity = null; - - if(!add) - finalQuantity= originalQuantity.subtract(quantityToAdd); - else - finalQuantity= originalQuantity.add(quantityToAdd); - - - original.setQtyToMove(finalQuantity); - } - - public Integer getPriceListId() - { - return priceListId; - } - - public void setPriceListId(Integer priceListId) - { - this.priceListId = priceListId; - } - - public Integer getNoOfPack() - { - return noOfPack; - } - - public void setNoOfPack(Integer noOfPack) - { - this.noOfPack = noOfPack; - } - - public String getReference() - { - return reference; - } - - public void setReference(String reference) - { - this.reference = reference; - } - - public Integer getMonth() - { - return month; - } - public void setMonth(Integer month) - { - this.month = month; - } - public Integer getYear() - { - return year; - } - public void setYear(Integer year) - { - this.year = year; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/SynchronizationBean.java b/posterita/posterita/src/main/org/posterita/beans/SynchronizationBean.java deleted file mode 100644 index 80e22b9ba8..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/SynchronizationBean.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.beans; - -import java.util.ArrayList; - -public class SynchronizationBean -{ - private ArrayList productNotInactivatedList; - private int productsInactivated; - private int errorsProductInactivate; - - public SynchronizationBean() - { - productNotInactivatedList = new ArrayList(); - } - - public int getErrorsProductInactivate() - { - return errorsProductInactivate; - } - - public void setErrorsProductInactivate(int errorsProductInactivate) - { - this.errorsProductInactivate = errorsProductInactivate; - } - - public ArrayList getProductNotInactivatedList() - { - return productNotInactivatedList; - } - - public void setProductNotInactivatedList(ArrayList productNotInactivatedList) - { - this.productNotInactivatedList = productNotInactivatedList; - } - - public int getProductsInactivated() - { - return productsInactivated; - } - - public void setProductsInactivated(int productsInactivated) - { - this.productsInactivated = productsInactivated; - } - - public void addNotInactivatedProduct(String productName) - { - this.productNotInactivatedList.add(productName); - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/SynchronizeCollectionBean.java b/posterita/posterita/src/main/org/posterita/beans/SynchronizeCollectionBean.java deleted file mode 100644 index 833c8c5af2..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/SynchronizeCollectionBean.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.beans; - -public class SynchronizeCollectionBean extends UDIBean -{ - public String getStartDay() - { - return startDay; - } - - public void setStartDay(String startDay) - { - this.startDay = startDay; - } - - public String getStartHour() - { - return startHour; - } - - public void setStartHour(String startHour) - { - this.startHour = startHour; - } - - public String getStartMinute() - { - return startMinute; - } - - public void setStartMinute(String startMinute) - { - this.startMinute = startMinute; - } - - public String getStartMonth() - { - return startMonth; - } - - public void setStartMonth(String startMonth) - { - this.startMonth = startMonth; - } - - public String getStartYear() - { - return startYear; - } - - public void setStartYear(String startYear) - { - this.startYear = startYear; - } - - public String getFromDate() - { - return fromDate; - } - - public void setFromDate(String fromDate) - { - this.fromDate = fromDate; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/TShirtProductDetailsBean.java b/posterita/posterita/src/main/org/posterita/beans/TShirtProductDetailsBean.java deleted file mode 100644 index 9b05ce4651..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/TShirtProductDetailsBean.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 5, 2006 by ashley -* -*/ - -package org.posterita.beans; - -public class TShirtProductDetailsBean extends UDIBean -{ - - - public String[] getColours() - { - return colours; - } - public void setColours(String[] colours) - { - this.colours = colours; - } - public String[] getSizes() - { - return sizes; - } - public void setSizes(String[] sizes) - { - this.sizes = sizes; - } - public Integer getProductId() - { - return productId; - } - public void setProductId(Integer productId) - { - this.productId = productId; - } - public String getImageLink() - { - return imageLink; - } - public void setImageLink(String imageLink) - { - this.imageLink = imageLink; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/TabularReportRecordBean.java b/posterita/posterita/src/main/org/posterita/beans/TabularReportRecordBean.java deleted file mode 100644 index 9c488c5f36..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/TabularReportRecordBean.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 06-Oct-2006 10:51:52 by praveen - * - */ - -package org.posterita.beans; - -import java.math.BigDecimal; - -public class TabularReportRecordBean -{ - private String productName; - private String date; - private BigDecimal price; - private BigDecimal qty; - - public String getDate() { - return date; - } - - public void setDate(String date) { - this.date = date; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public String getProductName() { - return productName; - } - - public void setProductName(String productName) { - this.productName = productName; - } - - public BigDecimal getQty() { - return qty; - } - - public void setQty(BigDecimal qty) { - this.qty = qty; - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/TaxBean.java b/posterita/posterita/src/main/org/posterita/beans/TaxBean.java deleted file mode 100644 index 144239c96d..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/TaxBean.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 28, 2006 - */ - - -package org.posterita.beans; - -import java.math.BigDecimal; - - -public class TaxBean extends UDIBean -{ - - public Integer getOrgId() { - return orgId; - } - public void setOrgId(Integer orgId) { - this.orgId = orgId; - } - public Boolean getIsActive() { - return isActive; - } - public void setIsActive(Boolean isActive) { - this.isActive = isActive; - } - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public Boolean getIsTaxExempted() { - return isTaxExempted; - } - public void setIsTaxExempted(Boolean isTaxExempted) { - this.isTaxExempted = isTaxExempted; - } - public Integer getTaxCategoryId() { - return taxCategoryId; - } - public void setTaxCategoryId(Integer taxCategoryId) { - this.taxCategoryId = taxCategoryId; - } - public Integer getTaxId() { - return taxId; - } - public void setTaxId(Integer taxId) { - this.taxId = taxId; - } - public String getTaxName() { - return taxName; - } - public void setTaxName(String taxName) { - this.taxName = taxName; - } - public BigDecimal getTaxRate() { - return taxRate; - } - public void setTaxRate(BigDecimal taxRate) { - this.taxRate = taxRate; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/TerminalBean.java b/posterita/posterita/src/main/org/posterita/beans/TerminalBean.java deleted file mode 100644 index b50d366e9c..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/TerminalBean.java +++ /dev/null @@ -1,398 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.beans; - -import java.sql.Timestamp; - -/** - * @author Ashley G Ramdass Apr 14, 2008 - */ -public class TerminalBean extends UDIBean -{ - protected Integer terminalId; - protected Integer purchasePriceListId; - protected Integer salesPriceListId; - - protected String cashbookTransferType; - protected String checkTransferType; - protected String cardTransferType; - protected Integer cardBankAccountId; - protected Integer checkBankAccountId; - protected Integer templateBPartnerId; - protected Integer cashbookTransferCashbookId; - protected Integer cashbookTransferBankAccountId; - protected Integer checkTransferCashbookId; - protected Integer checkTransferBankAccountId; - protected Integer cardTransferCashbookId; - protected Integer cardTransferBankAccountId; - protected Boolean autoLock; - protected Boolean locked; - protected Integer lockingTime; - protected Timestamp lastLockTime; - protected Timestamp unlockingTime; - - private String orgName; - private String poPriceList; - private String soPriceList; - private Boolean isCurrentTerminal = false; - - public Integer getTerminalId() - { - return (terminalId == null ? 0 : terminalId) ; - } - - public void setTerminalId(Integer terminalId) - { - this.terminalId = terminalId; - } - - public String getName() - { - return this.name; - } - - public void setName(String name) - { - this.name = name; - } - - public Integer getOrgId() - { - return (orgId == null ? 0 : orgId); - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public Integer getBpartnerId() - { - return (bpartnerId == null ? 0 : bpartnerId); - } - - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - - public Integer getWarehouseId() - { - return (warehouseId == null ? 0 : warehouseId); - } - - public void setWarehouseId(Integer warehouseId) - { - this.warehouseId = warehouseId; - } - - public Integer getPurchasePriceListId() - { - return (purchasePriceListId == null ? 0 : purchasePriceListId); - } - - public void setPurchasePriceListId(Integer purchasePriceListId) - { - this.purchasePriceListId = purchasePriceListId; - } - - public Integer getSalesPriceListId() - { - return (salesPriceListId == null ? 0 : salesPriceListId); - } - - public void setSalesPriceListId(Integer salesPriceListId) - { - this.salesPriceListId = salesPriceListId; - } - - public Integer getCashBookId() - { - return (cashBookId == null ? 0 : cashBookId); - } - - public void setCashBookId(Integer cashBookId) - { - this.cashBookId = cashBookId; - } - - public Integer getCheckBankAccountId() - { - return (checkBankAccountId == null ? 0 : checkBankAccountId); - } - - public void setCheckBankAccountId(Integer checkBankAccountId) - { - this.checkBankAccountId = checkBankAccountId; - } - - public Boolean getAutoLock() - { - return autoLock; - } - - public void setAutoLock(Boolean autoLock) - { - this.autoLock = autoLock; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public Integer getTemplateBPartnerId() - { - return (templateBPartnerId == null ? 0 : templateBPartnerId); - } - - public void setTemplateBPartnerId(Integer templateBPartnerId) - { - this.templateBPartnerId = templateBPartnerId; - } - - public Integer getCashbookTransferCashbookId() - { - return (cashbookTransferCashbookId == null ? 0 : cashbookTransferCashbookId); - } - - public void setCashbookTransferCashbookId(Integer cashTransferCashbookId) - { - this.cashbookTransferCashbookId = cashTransferCashbookId; - } - - public Integer getCashbookTransferBankAccountId() - { - return cashbookTransferBankAccountId; - } - - public void setCashbookTransferBankAccountId(Integer cashTransferBankAccountId) - { - this.cashbookTransferBankAccountId = cashTransferBankAccountId; - } - - public Integer getCheckTransferCashbookId() - { - return checkTransferCashbookId; - } - - public void setCheckTransferCashbookId(Integer checkTransferCashbookId) - { - this.checkTransferCashbookId = checkTransferCashbookId; - } - - public Integer getCheckTransferBankAccountId() - { - return checkTransferBankAccountId; - } - - public void setCheckTransferBankAccountId(Integer checkTransferBankAccountId) - { - this.checkTransferBankAccountId = checkTransferBankAccountId; - } - - public Integer getCardTransferCashbookId() - { - return cardTransferCashbookId; - } - - public void setCardTransferCashbookId(Integer cardTransferCashbookId) - { - this.cardTransferCashbookId = cardTransferCashbookId; - } - - public Integer getCardTransferBankAccountId() - { - return (cardTransferBankAccountId == null ? 0 : cardTransferBankAccountId); - } - - public void setCardTransferBankAccountId( - Integer cardTransferBankAccountId) - { - this.cardTransferBankAccountId = cardTransferBankAccountId; - } - - public Boolean getLocked() - { - return locked; - } - - public void setLocked(Boolean locked) - { - this.locked = locked; - } - - public Integer getCardBankAccountId() - { - return (cardBankAccountId == null ? 0 : cardBankAccountId); - } - - public void setCardBankAccountId(Integer cardBankAccountId) - { - this.cardBankAccountId = cardBankAccountId; - } - - public String getCashbookTransferType() - { - return cashbookTransferType; - } - - public void setCashbookTransferType(String cashbookTransferType) - { - this.cashbookTransferType = cashbookTransferType; - } - - public String getCheckTransferType() - { - return checkTransferType; - } - - public void setCheckTransferType(String checkTransferType) - { - this.checkTransferType = checkTransferType; - } - - public String getCardTransferType() - { - return cardTransferType; - } - - public void setCardTransferType(String cardTransferType) - { - this.cardTransferType = cardTransferType; - } - - /** - * @return the lockingTime - */ - public Integer getLockingTime() - { - return lockingTime; - } - - /** - * @param lockingTime the lockingTime to set - */ - public void setLockingTime(Integer lockingTime) - { - this.lockingTime = lockingTime; - } - - /** - * @return the orgName - */ - public String getOrgName() - { - return orgName; - } - - /** - * @param orgName the orgName to set - */ - public void setOrgName(String orgName) - { - this.orgName = orgName; - } - - /** - * @return the poPriceList - */ - public String getPoPriceList() - { - return poPriceList; - } - - /** - * @param poPriceList the poPriceList to set - */ - public void setPoPriceList(String poPriceList) - { - this.poPriceList = poPriceList; - } - - /** - * @return the soPriceList - */ - public String getSoPriceList() - { - return soPriceList; - } - - /** - * @param soPriceList the soPriceList to set - */ - public void setSoPriceList(String soPriceList) - { - this.soPriceList = soPriceList; - } - - /** - * @return the lastLockTime - */ - public Timestamp getLastLockTime() - { - return lastLockTime; - } - - /** - * @param lastLockTime the lastLockTime to set - */ - public void setLastLockTime(Timestamp lastLockTime) - { - this.lastLockTime = lastLockTime; - } - - /** - * @return the unlockingTime - */ - public Timestamp getUnlockingTime() - { - return unlockingTime; - } - - /** - * @param unlockingTime the unlockingTime to set - */ - public void setUnlockingTime(Timestamp unlockingTime) - { - this.unlockingTime = unlockingTime; - } - - /** - * @return The isCurrentTerminal - */ - public Boolean getIsCurrentTerminal() - { - return isCurrentTerminal; - } - - /** - * @param isCurrentTerminal The isCurrentTerminal to set - */ - public void setIsCurrentTerminal(Boolean isCurrentTerminal) - { - this.isCurrentTerminal = isCurrentTerminal; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/TestMod.java b/posterita/posterita/src/main/org/posterita/beans/TestMod.java deleted file mode 100644 index aedc1ea9ca..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/TestMod.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.posterita.beans; - -import java.math.BigDecimal; - -public class TestMod -{ - public static void main(String args[]) - { - BigDecimal qtyOnHand = new BigDecimal(100); - BigDecimal qtyEntered = new BigDecimal(50); - BigDecimal qtyOrdered = new BigDecimal(25); - - BigDecimal qty = qtyOnHand.multiply(qtyEntered).divide(qtyOrdered, 12, BigDecimal.ROUND_HALF_UP); - - System.out.println(qty); - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/TradeInBean.java b/posterita/posterita/src/main/org/posterita/beans/TradeInBean.java deleted file mode 100644 index 4f1f3c36a2..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/TradeInBean.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - - -public class TradeInBean extends CustomerBean -{ - - public Integer getBpartnerId() - { - return bpartnerId; - } - - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - - public Double getPriceEntered() - { - return priceEntered; - } - - public void setPriceEntered(Double priceEntered) - { - this.priceEntered = priceEntered; - } - - public String getVinNumber() - { - return vinNumber; - } - - public void setVinNumber(String vinNumber) - { - this.vinNumber = vinNumber; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/TrendsBean.java b/posterita/posterita/src/main/org/posterita/beans/TrendsBean.java deleted file mode 100644 index d6b82b7077..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/TrendsBean.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 15, 2005 by praveen - * - */ -package org.posterita.beans; - -public class TrendsBean -{ - private String model; - private String colour; - private int a1,m1; - private int a2,m2; - private int a3,m3; - private int sA1,sA2,sA3; - private int sM1,sM2,sM3; - - public TrendsBean(){} - - - public int getA1() { - return a1; - } - public void setA1(int a1) { - this.a1 = a1; - } - public int getA2() { - return a2; - } - public void setA2(int a2) { - this.a2 = a2; - } - public int getA3() { - return a3; - } - public void setA3(int a3) { - this.a3 = a3; - } - public String getColour() { - return colour; - } - public void setColour(String colour) { - this.colour = colour; - } - public int getM1() { - return m1; - } - public void setM1(int m1) { - this.m1 = m1; - } - public int getM2() { - return m2; - } - public void setM2(int m2) { - this.m2 = m2; - } - public int getM3() { - return m3; - } - public void setM3(int m3) { - this.m3 = m3; - } - public String getModel() { - return model; - } - public void setModel(String model) { - this.model = model; - } - public int getSA1() { - return sA1; - } - public void setSA1(int sa1) { - sA1 = sa1; - } - public int getSA2() { - return sA2; - } - public void setSA2(int sa2) { - sA2 = sa2; - } - public int getSA3() { - return sA3; - } - public void setSA3(int sa3) { - sA3 = sa3; - } - public int getSM1() { - return sM1; - } - public void setSM1(int sm1) { - sM1 = sm1; - } - public int getSM2() { - return sM2; - } - public void setSM2(int sm2) { - sM2 = sm2; - } - public int getSM3() { - return sM3; - } - public void setSM3(int sm3) { - sM3 = sm3; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/UDIBean.java b/posterita/posterita/src/main/org/posterita/beans/UDIBean.java deleted file mode 100644 index 0ae441f627..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/UDIBean.java +++ /dev/null @@ -1,816 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Stack; -import java.util.Vector; - -import org.apache.struts.upload.FormFile; -import org.posterita.core.JulianDate; - -public class UDIBean -{ - protected String bpAddress2; - protected String aaCardnumber; - protected String accountNo; - protected String accountType; - protected String accountName; - protected String address1; - protected String address2; - protected Boolean agreement; - protected String aisle; - protected Integer allocationId; - protected String allocationStatus; - protected String area; - protected String attribute; - protected Integer attributeId; - protected Integer attributeSetId; - protected Integer attributeSetInstanceId; - protected Integer [] sernoAttributeSetInstanceIds; - protected String attributeValue; - protected String availableForBackOrderFilter ="availableForBackOrder in ('Y', 'N')"; - protected Integer bankId; - protected Integer bankAccountId; - protected String bankName; - protected Integer basePriceListId; - protected String bin; - protected Integer bpartnerId; - protected Integer bPartnerLocationId; - protected Integer [] checkBox; - protected Boolean isChecked; - protected String checkNo; - protected String city; - protected Timestamp closingDate; - protected Integer colour; - protected String confirmEmail; - protected String confirmPassword; - protected Integer cost; - protected String counterOrderStatusInfo; - protected Integer counterOrgID; - protected String counterOrgName; - protected Double currentBalance; - protected String custIdNumber; - protected Timestamp dateCreated; - protected Timestamp dateUpdated; - protected Timestamp dateInvoiced; - protected Timestamp dateMovement; - protected Timestamp dateOrdered; - protected String datePromised; - protected Timestamp dateTrx; - protected String dealerName; - protected String description; - protected String district; - protected String docStatus; - protected Integer tradeInOrderlineId; - protected Integer attributeValueId; - protected String forward; - protected String birthdate; - - protected Boolean isFullAccess; - protected Boolean isOverwritePriceLimit; - - protected Boolean openDrawer = Boolean.TRUE; - - - - protected String docStatusCode; - - //1 is reserved -0 not reserved - - protected Integer documentId; - protected String documentNo; - - protected String documentType; - protected String email; - protected String endDay; - - protected String endHour; - protected String endMinute; - protected String endMonth; - protected String endYear; - protected String engineNo; - protected String engineNumber; - protected String fax; - protected String fromDate; - protected Integer fromOrderLineId; - protected Integer grandTotal; - protected BigDecimal grossProfit; - protected BigDecimal grossProfitPercentage; - protected BigDecimal totalGrossProfit; - protected BigDecimal totalGrossProfitPercentage; - protected Integer id; - protected Integer index; - protected Integer inOutId; - protected Integer invoiceId; - protected Boolean isAccessAllOrgs; - protected Boolean a; - protected String isApproved; - protected Boolean isAutomobile; - protected Boolean isAvailableForBackOrder = Boolean.valueOf("True"); - protected Boolean isClosable; - protected Boolean isCustomer; - protected Boolean isDefault = false; - protected String isDelivered; - protected Boolean isEmployee; - - protected String isInvoiced; - protected Boolean isMandatory = false; - protected Boolean isMotorcycle; - protected Boolean isNatisReleased; - protected String isPaid; - protected Boolean isPresentForProduct; - protected Boolean isPublic; - protected Boolean isQtyReserved; - protected String isReceipt; - protected Boolean isRetailer; - protected Boolean isSalesRep; - protected Boolean isActive = false; - protected Boolean isSoTrx; - protected Boolean isVendor; - protected Boolean isVisible; - protected Boolean isWholesaler; - protected String level; - protected BigDecimal limitPrice; - protected BigDecimal limitPriceIncl; - protected BigDecimal lineAmt; - protected Integer lineNetAmt; - protected Integer lineNo; - protected Integer lineTotalAmt; - protected ArrayList list; - protected BigDecimal listPrice; - protected BigDecimal listPriceIncl; - protected String location; - protected Integer locationId; - protected Integer locatorId; - protected String locatorName; - protected String logoName; - protected Integer m_attributesetinstance_id; - protected String maintenanceContractNumber; - protected Integer make; - protected Integer menuId; - protected String menuItemName; - protected String menuLink; - protected String message; - protected Integer messageID; - protected Integer minOutId; - protected String mobile; - protected Integer model; - protected Integer modelGroup; - protected Integer month; - protected Integer movementId; - protected Integer moveConfirmId; - protected Integer movementLineId; - protected String name; - - - protected Integer natisReleaseId; - protected String newEmail; - protected String newPassword; - protected Integer nextAvailableLocatorId; - protected String oldPassword; - protected Integer orderId; - protected ArrayList orderLineBean; - protected ArrayList roleBeanList = new ArrayList(); - protected Integer orderLineId; - protected int [] orderLineIds; - protected ArrayList orderLineList = new ArrayList(); - protected ArrayList InventoryLineList = new ArrayList(); - protected String orderStatusInfo; - protected String orderType; - protected Integer orgFromId; - protected String orgFromName; - protected Integer orgToId; - protected String orgToName; - protected String orgName; - protected String orgType; - protected Vector orgUsers; - protected Integer parentMenuId; - protected Integer partnerId; - protected Integer partnerLocationId; - protected String partnerName; - protected String password; - protected Stack path; - protected Integer payAmt; - protected Integer paymentId; - protected String phone; - protected String phone2; - protected String poReference; - protected String POReference; - protected String postalAddress; - protected String postalAddress1; - protected String postalCity; - protected String postalCode; - protected String postalPostalCode; - protected Integer prefOrderLineId; - protected BigDecimal priceActual; - protected Double priceEntered; - protected BigDecimal priceLimit; - protected BigDecimal priceList; - protected PriceListBean priceListBean; - protected ArrayList priceListBeanList; - protected Integer priceListVersionId; - protected ProductBean productBean; - protected ArrayList productBeanList = new ArrayList(); - protected Integer productCategoryId; - protected BigDecimal price; - - protected String productDetails; - protected Integer productId; - protected String productName; - protected Integer productQuantity; - protected Integer qtyInvoiced; - protected String qtyReserved; - protected BigDecimal quantity; - protected BigDecimal qtyOnHand; - protected BigDecimal qtyToMove; - protected String read; - protected Integer refInOutId; - protected Integer refNo; - protected Integer refOrderId; - protected Integer refOrderLineid; - protected Integer refToQuote; - protected ReportBean report; - ArrayList reportList = new ArrayList(); - protected String region; - protected Integer regionId; - protected String regionName; - protected String registerNumber; - - protected Integer reserveStatus; - - protected Integer roleId; - protected String roleName; - protected String routingNumber; - protected String sernoAttributeSetInstance; - protected String startDay; - protected String startHour; - protected String startMinute; - protected String startMonth; - protected String startYear; - protected Boolean status; - protected BigDecimal stdPrice; - protected BigDecimal stdPriceIncl; - protected Double stdPurchasePrice; - protected Double stdSalesPrice; - protected StockMovementBean stock; - protected ArrayList stockList = new ArrayList(); - protected String subject; - protected String submit; - - protected String surname; - protected Integer taxAmt; - protected Integer[] targetId; - protected String termsAgreement; - protected String toDate; - protected Integer toOrderLineId; - protected Integer totalLines; - protected Integer transmission; - protected Integer transmissionAttributeValueId; - protected String uom; - protected Integer userId; - protected Integer userID; - protected String username; - protected String vinNumber; - protected Integer warehouseId; - - protected Integer wareHouseId; - protected String warehouseName; - protected String warehouseType; - protected Integer year; - protected Integer yearAttributeValueId; - protected Integer makeAttributeValueId; - protected String[] qtyTargeted; - protected String sotrxFlag; - protected String bpName; - protected String compiereDocStatus; - protected String hondaDocStatus; - protected Integer first; - protected Integer licensingDistrictId; - protected String licensingDistrict; - - protected String passportNo; - protected String companyRegNo; - - protected String unitNumber; - protected Integer unitsPerPack; - protected String productCode; - protected Integer vehicleSpecsId; - protected String natisApplicationDate; - protected Timestamp processedDate; - - protected Timestamp natisRegistrationDate; - protected Timestamp wholesaleDate; - protected String natisControlNumber; - protected String natisRegisterNumber; - protected Integer natisModelNo; - protected String natisModelDescription; - - protected Integer enginePower; - protected Integer engineCapacity; - protected Integer tare; - protected Integer noOfWheels; - - protected Integer colourCodeMatchId; - protected String colourName; - protected String transmissionName; - protected String yearName; - - protected String mainColourCode; - protected String countryOfImpCode; - protected String shippingInvNo; - protected String estimatedTimeOfArrival; - protected String colourCodeHES; - - protected String licensingDistrictDescription; - protected String licensingDistrictCode; - - protected String bpAddress; - protected String bpPostalAddress; - - protected String bpPostalCode; - protected String bpCity; - protected String bpRegionName; - protected Integer bpRegionId; - - protected String releaseStatus; - protected String releasedBy; - protected String reservedStatus; - protected Timestamp natisreleaseDate; - - protected String uAddress1; - protected String uAddress2; - protected String uPostalAddress; - protected String uPostalCd; - protected String uCity; - protected String uRegion; - - protected String colourGroup; - - protected String modelMatching; - - protected boolean isCar; - protected ArrayList showroomTrafficBean; - - protected ArrayList showroomTrafficList = new ArrayList(); - protected Integer sales; - protected Integer traffic; - protected Integer prospects; - protected String modelName; - protected Integer modelId; - protected Integer trxId; - protected Integer modelCode; - protected Integer modelCodeId; - protected String dealerCode; - protected Integer dealerCodeId; - protected Integer salesRepId; - protected Boolean isAllocationWarehouse; - protected String name2; - protected Boolean canAlterOrder; - protected Boolean canCreateOrder; - protected Boolean canViewOrder; - protected Timestamp wholeSaleDate; - protected Integer orderlineCount; - protected Integer orderlineInvoicedCount; - protected JulianDate startDate; - protected JulianDate endDate; - protected Integer weekNo; - protected Integer attributeSetInstance; - protected String makeName; - protected String financeOption; - - protected String newVinNumber; - protected Integer attributesetinstanceIdFrom; - protected Integer attributesetinstanceIdTo; - protected ArrayList vinNumberList; - protected Integer productIds[]; - protected String reservedBy; - protected Boolean isTradeIn = Boolean.valueOf("true"); - protected String ETAFilter; - protected BigDecimal orderGrandTotal; - protected Integer orderIds[]; - - - protected Integer mImportVehiclesId; - protected String natisModelNumber; - protected Timestamp vehEstimateTimeOfArrival; - protected String vehTare; - protected String vehEngineCapacity; - protected String vehNoOfWheels; - protected String vehEnginePower; - protected Boolean colourMatchingPresent; - protected Boolean modelMatchingPresent; - protected Boolean productPresent; - protected String vehImportErrDesc; - - protected Integer modelMatchID; - protected String natisModelDesc; - protected String modelDesc; - protected String trans; - protected Boolean showActiveOnly; - protected Integer updateAttrValueId; - protected String active; - protected String visible; - protected Integer style; - protected Integer design; - protected Integer size; - protected String clientName; - - protected Integer designAttributeValueId; - protected Integer modelAttributeValueId; - protected Integer sizeAttributeValueId; - protected Integer colourAttributeValueId; - - - protected BigDecimal endingBalance; - protected String endingBalanceAsString; - protected BigDecimal amount; - protected String trxType; - protected BigDecimal amountGiven; - protected BigDecimal amountRefunded; - protected Integer cashBookId; - protected Integer cashId; - protected Integer cashLineId; - protected String cashType; - protected String cashTypeName; - protected String cashBookName; - protected String chequeNo; - protected String creditCardType; - protected String creditCardNumber; - protected String creditCardNumberEncrypted; - protected Integer creditCardExpMonth; - protected String creditCardExpMonthName; - protected Integer creditCardExpYear; - protected Integer [] posOrderLineIds; - protected Integer posId; - protected String posName; - protected String posDesc; - protected String saleRepName; - protected Integer priceListId; - protected String priceListName; - protected String paymentRule; - protected Integer cashJournalId; - protected String cashJournalName; - protected String cashJournalDisc; - protected String statmentDate; - protected Timestamp dateAcct; - protected BigDecimal invoiceAmount; - protected BigDecimal differenceAmount; - protected BigDecimal generalExpenseAmount; - protected BigDecimal generalReceiptsAmount; - protected BigDecimal bankAcctTransferAmount; - protected BigDecimal transferAmount; - protected Integer cashBookIds; - protected BigDecimal beginingBalance; - protected String beginingBalanceAsString; - protected BigDecimal statementDifference; - protected String keyword; - protected String backOrder; - protected String fieldName; - protected String applicationName; - protected String applicationWebContext; - protected Integer storeId; - protected Boolean isWebstoreFeatured; - protected String brandName; - protected String designName; - protected String sizeName; - protected String keyword1; - protected String keyword2; - protected String keyword3; - protected String keyword4; - protected String[] sizes; - protected String[] colours; - protected String imageLink; - - protected BigDecimal priceStandard; - protected String currency;// - - protected BigDecimal cashTotal; - protected BigDecimal chequeTotal; - protected BigDecimal cardTotal; - protected BigDecimal tillGrandTotal; - protected String purchasePriceList; - protected String purchasePriceLimit; - protected String purchasePriceStandard; - protected String barCode; - protected String salesPriceList; - protected String salesPriceLimit; - protected String salesPriceStandard; - protected String reportType; - protected Integer noOfProductsRequired; - protected BigDecimal openingBalanceQty; - protected BigDecimal qtyOfGoodsSold; - protected BigDecimal qtyOfGoodsReceived; - protected BigDecimal qtyOfGoodsReturned; - protected BigDecimal closeingBalanceQty; - protected BigDecimal qtyReturnedByCustomer; - protected String qtyAndItem; - protected String[] discountPercent; - protected String [] actualPrice; - protected FormFile file; - protected FormFile logo; - protected FormFile image; - - protected String userSurname; - protected Integer countryId; - protected String countryName; - protected String countryCode; - - protected String newName; - protected String imageName; - protected ArrayList productsList; - protected Double paymentByCash; - protected String paymentMethod; - protected Double paymentByCard; - protected Double paymentByChq; - protected Boolean isDeleteOldRecords=false; - protected String isSales; - protected Boolean isSOPriceList = false; - protected String ifAdd; - protected String productCategory; - protected String productClassification; - protected String trackingNo; - protected String revenueRecognition; - protected String cvv; - protected String creditCardPayment; - protected String shipmentMethod; - protected Boolean shipTo; - protected Boolean billTo; - protected Integer chargeId; - protected String chargeName; - protected BigDecimal chargeAmount; - - protected Integer revenueRecoId; - - protected int numberOfRequests; - protected String userName; - protected Integer requestId; - protected Integer toUserId; - protected String fromAddress; - protected String toAddresses; - protected String ccAddresses; - protected String bccAddresses; - protected String textMessage; - protected String hostAddress; - protected String priority; - protected String title; - protected Integer statusId; - - protected AttributeValuesPair attributeValuesPair; - protected HashMap attributeValuesMap; - protected Boolean isTextileProduct; - protected String qtyFilter; - protected String productType; - - - protected String attributeSetName; - - protected String attributeName; - protected ArrayList attributeValueList; - protected String [] attributeValueIds; - protected Double totalActualPrice; - protected String qtyNumberFilter; - protected Integer taxCategoryId; - protected String taxCategoryName; - protected String vendorName; - protected String timePeriod; - protected String chartType; - protected String salesGroup; - protected BigDecimal taxRate; - protected Integer accountId; - protected String dateRange; - protected Boolean transferAllAmount; - protected BigDecimal adjustmentAmount; - protected BigDecimal differenceAmt; - protected Boolean creatingFromOrder; - protected String transferType; - protected String priceQtyFilter; - protected Boolean hasImage; - protected String userPIN; - protected Boolean isSelfService; - protected BigDecimal cardDifference; - protected BigDecimal chequeDifference; - protected String documentNote; - protected String currencySymbole; - protected String invoiceDate; - protected Integer netDays; - protected Integer daysDue; - protected Timestamp dueDate; - protected String discountDate; - protected BigDecimal discountAmt; - protected BigDecimal invoiceGrandTotal; - protected BigDecimal paidAmt; - protected BigDecimal openAmt; - protected Integer currencyId; - protected Integer paymentTermId; - protected Integer invoiceScheduleId; - protected BigDecimal userDiscount; - - protected BigDecimal invoicedAmt; - protected BigDecimal pastDue91_plus; - protected BigDecimal pastDue61_90; - protected BigDecimal pastDue31_60; - protected BigDecimal pastDue1_30; - protected BigDecimal pastDue8_30; - protected BigDecimal pastDue1_7; - protected BigDecimal pastDueAmt; - protected BigDecimal dueAmt; - protected BigDecimal due0; - protected BigDecimal due1_7; - protected BigDecimal due8_30; - protected BigDecimal due0_30; - protected BigDecimal due31_60; - protected BigDecimal due61_90; - protected BigDecimal due91_PLUS; - - - protected BigDecimal paymentAmt; - protected BigDecimal overUnderPayment; - protected BigDecimal writeOffAmt; - protected String tenderType; - protected String invoiceNo; - protected BigDecimal creditUsed; - protected BigDecimal creditLimit; - protected BigDecimal revenue; - protected String paymentTermName; - protected Integer [] bpartnerIds; - - protected Integer blackListedId; - protected String blackListedBankName; - protected String blackListedChequeNo; - - protected Integer dunningId; - protected String dunningName; - - protected Integer dunningLevelId; - protected String dunningLevelName; - protected String dunningPrintText; - protected String dunningPrintNote; - protected Integer BP_Group_ID ; - protected String soCreditStatus; - protected String bpfirstSale; - protected String creditStatus; - public String docBasisType; - - //protected String applicationType; - protected BigDecimal amtMultiplier; - - - protected Integer commissionAmtId; - protected Integer commissionRunId; - protected Integer commissionLineId; - protected BigDecimal convertedAmt; - protected BigDecimal actualQty; - protected BigDecimal commissionAmt; - protected String commissionLineName; - protected Integer commissionDetailId; - protected String reference; - protected Integer invoiceLineId; - protected String info; - protected BigDecimal actualAmt; - protected String frequencyType; - protected String periodAndCurrencyDesc; - protected BigDecimal subtractAmt; - protected BigDecimal qtyInventoryIn; - protected BigDecimal qtyInventoryOut; - - protected String taxName; - protected Integer taxId; - protected Boolean isTaxExempted; - protected Integer [] invoiceIds; - protected Integer [] paymentIds; - protected String paymentNo; - protected BigDecimal taxedAmt; - protected String trxDate; - - protected Integer creditMemoId; - protected String creditMemoNumber; - - - protected Integer inventoryLineId; - protected Integer inventoryId; - protected BigDecimal qtyBook; - protected BigDecimal qtyCount; - protected BigDecimal qtyCsv; - - protected String inventoryNo; - protected String movementDate; - - protected Boolean afterDelivery; - protected Boolean fixedDueDate; - protected Boolean nextBusinessday; - protected Integer fixedMonthDay; - protected Integer fixedMonthOffset; - protected Integer fiedMonthCutoff; - protected String toBeShipped; - protected Integer discountDay1; - protected Integer discountDay2; - protected BigDecimal discountAmt1; - protected BigDecimal discountAmt2; - protected BigDecimal allocatedAmount; - protected BigDecimal bookQtyValue; - protected BigDecimal countQtyValue; - - protected PaymentBean paymentBeanIndex; - - protected BigDecimal [] allocateAmount; - - protected BigDecimal paymentAllocatedAmt; - protected BigDecimal AvailableAmt; - protected Integer [] inventoryIds; - protected Integer [] inventoryLineIds; - protected String historyType; - - protected String accountingValues; - - protected String fullDetails; - protected BigDecimal unitPrice; - protected BigDecimal unitPurchasePrice; - - // Additional fields required for user registration - protected String company; - protected String industry; - protected String comments; - - protected BigDecimal roundOffFactor; - protected Integer stdPrecision; - protected String isoCode; - protected String curSymbol; - protected String isSalesReport; - protected String receiptFooterMsg; - protected String branch; - protected String taxNo; - - /** Organisation **/ - protected Integer orgId; - - /** Common field used for searching **/ - protected String searchText; - - protected Integer webMenuId; - - public Boolean getIsActive() - { - return isActive; - } - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - - /** - * @param searchText search term - */ - public void setSearchText(String searchText) - { - this.searchText = searchText; - } - - /** - * @return search term - */ - public String getSearchText() - { - return this.searchText; - } - - /** - * @return Organisation - */ - public Integer getOrgId() - { - return orgId; - } - - /** - * @param orgId Organisation - */ - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - -} - - - diff --git a/posterita/posterita/src/main/org/posterita/beans/UDIPair.java b/posterita/posterita/src/main/org/posterita/beans/UDIPair.java deleted file mode 100644 index 437f9277f0..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/UDIPair.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 28-Jun-2005 by alok - * - */ -package org.posterita.beans; - -import java.util.ArrayList; - - -public class UDIPair implements Comparable -{ - - private Integer ID; - private String key; - private String value; - - private UDIPair pair; - private ArrayList arr; - - public UDIPair(Integer ID, String value) - { - this.ID = ID; - this.value = value; - } - - public UDIPair(String key, String value) - { - this.key = key; - this.value = value; - } - - - public UDIPair(UDIPair pair, ArrayList arr) - { - this.pair = pair; - this.arr = arr; - } - - - - public ArrayList getArr() { - return arr; - } - - - public void setArr(ArrayList arr) { - this.arr = arr; - } - - - public UDIPair getPair() { - return pair; - } - - - public void setPair(UDIPair pair) { - this.pair = pair; - } - - - /** - * @return Returns the iD. - */ - public Integer getID() { - return ID; - } - /** - * @param id The iD to set. - */ - public void setID(Integer id) { - ID = id; - } - /** - * @return Returns the value. - */ - public String getValue() { - return value; - } - /** - * @param value The value to set. - */ - public void setValue(String value) { - this.value = value; - } - /* (non-Javadoc) - * @see java.lang.Comparable#compareTo(java.lang.Object) - */ - public int compareTo(Object o) - { - UDIPair pair = (UDIPair) o; - - return this.getValue().compareTo(pair.getValue()); - } - - public String getKey() - { - return key; - } - - public void setKey(String key) - { - this.key = key; - } - - public String toString() - { - String str ="ID:" +getID() + " Value:" +getValue(); - return str; - } - } - diff --git a/posterita/posterita/src/main/org/posterita/beans/UserBean.java b/posterita/posterita/src/main/org/posterita/beans/UserBean.java deleted file mode 100644 index 8e8999676a..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/UserBean.java +++ /dev/null @@ -1,355 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 29, 2005 by din - */ - -package org.posterita.beans; - -import java.math.BigDecimal; - -public class UserBean extends UDIBean -{ - public Integer getOrgId() { - return orgId; - } - - public void setOrgId(Integer orgId) { - this.orgId = orgId; - } - - public Boolean getIsFullAccess() { - return isFullAccess; -} - -public void setIsFullAccess(Boolean isFullAccess) { - this.isFullAccess = isFullAccess; -} - - public BigDecimal getSubtractAmt() { - return subtractAmt; -} - -public void setSubtractAmt(BigDecimal subtractAmt) { - this.subtractAmt = subtractAmt; -} - public String getFrequencyType() { - return frequencyType; - } - public void setFrequencyType(String frequencyType) { - this.frequencyType = frequencyType; - } - public BigDecimal getAmtMultiplier() { - return amtMultiplier; -} -public void setAmtMultiplier(BigDecimal amtMultiplier) { - this.amtMultiplier = amtMultiplier; -} - public String getDocBasisType() { - return docBasisType; - } - public void setDocBasisType(String docBasisType) { - this.docBasisType = docBasisType; - } - public String getUserPIN() - { - return userPIN; - } - public void setUserPIN(String userPIN) - { - this.userPIN = userPIN; - } - public Integer getPartnerId() - { - return partnerId; - } - - public void setPartnerId(Integer partnerId) - { - this.partnerId = partnerId; - } - - public String getCountryName() { - return countryName; -} - -public void setCountryName(String countryName) { - this.countryName = countryName; -} - - public Integer getCountryId() { - return countryId; - } - - public void setCountryId(Integer countryId) { - this.countryId = countryId; - } - - public String getUserSurname() { - return userSurname; - } - - public void setUserSurname(String userSurname) { - this.userSurname = userSurname; - } - - public Integer getLocationId() - { - return locationId; - } - - public void setLocationId(Integer locationId) - { - this.locationId = locationId; - } - - public String getAddress1() - { - return address1; - } - - public void setAddress1(String address1) - { - this.address1 = address1; - } - - public String getAddress2() - { - return address2; - } - - public void setAddress2(String address2) - { - this.address2 = address2; - } - - public String getCity() - { - return city; - } - - public void setCity(String city) - { - this.city = city; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - public Boolean getIsActive() - { - return isActive; - } - - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } - - public String getPassword() - { - return password; - } - - public void setPassword(String password) - { - this.password = password; - } - - public String getConfirmPassword() - { - return confirmPassword; - } - - public void setConfirmPassword(String confirmPassword) - { - this.confirmPassword = confirmPassword; - } - - public String getPhone() - { - return phone; - } - - public void setPhone(String phone) - { - this.phone = phone; - } - - public String getPostalAddress() - { - return postalAddress; - } - - public void setPostalAddress(String postalAddress) - { - this.postalAddress = postalAddress; - } - - public String getUsername() - { - return username; - } - public void setUsername(String username) - { - this.username = username; - } - - public String getEmail() - { - return email; - } - - public void setEmail(String email) - { - this.email = email; - } - public String getFax() - { - return fax; - } - - public void setFax(String fax) - { - this.fax = fax; - } - - public Integer getRoleId() - { - return roleId; - } - - public void setRoleId(Integer roleId) - { - this.roleId = roleId; - } - public String getRoleName() - { - return roleName; - } - public void setRoleName(String roleName) - { - this.roleName = roleName; - } - public Boolean getIsSalesRep() - { - return isSalesRep; - } - - public void setIsSalesRep(Boolean isSalesRep) - { - this.isSalesRep = isSalesRep; - } - - public Integer getRegionId() - { - return regionId; - } - - public void setRegionId(Integer regionId) - { - this.regionId = regionId; - } - - public Integer getUserId() - { - return userId; - } - - public void setUserId(Integer userId) - { - this.userId = userId; - } - - public String getRegion() - { - return region; - } - public void setRegion(String region) - { - this.region = region; - } - - public String getName() - { - return name; - } - public void setName(String name) - { - this.name = name; - } - public String getCountryCode() - { - return countryCode; - } - public void setCountryCode(String countryCode) - { - this.countryCode = countryCode; - } - - public BigDecimal getUserDiscount() { - return userDiscount; - } - public void setUserDiscount(BigDecimal userDiscount) { - this.userDiscount = userDiscount; - } - - public String getPhone2() { - return phone2; - } - public void setPhone2(String phone2) { - this.phone2 = phone2; - } - - public String getComments() { - return comments; - } - - public void setComments(String comments) { - this.comments = comments; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public String getCompany() { - return company; - } - - public void setCompany(String company) { - this.company = company; - } - /*public String getUserSurname() { - return userSurname; - } - - public void setUserSurname(String userSurname) { - this.userSurname = userSurname; - }*/ -} diff --git a/posterita/posterita/src/main/org/posterita/beans/VendorBean.java b/posterita/posterita/src/main/org/posterita/beans/VendorBean.java deleted file mode 100644 index faa3c22bae..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/VendorBean.java +++ /dev/null @@ -1,122 +0,0 @@ -package org.posterita.beans; - -public class VendorBean extends UDIBean -{ - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - public Integer getCountryId() { - return countryId; - } - - public void setCountryId(Integer countryId) { - this.countryId = countryId; - } - - public String getPartnerName() - { - return partnerName; - } - - public void setPartnerName(String partnerName) - { - this.partnerName = partnerName; - } - - public String getAddress1() { - return address1; - } - - public void setAddress1(String address1) { - this.address1 = address1; - } - - public String getAddress2() { - return address2; - } - - public void setAddress2(String address2) { - this.address2 = address2; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getPhone2() { - return phone2; - } - - public void setPhone2(String phone2) { - this.phone2 = phone2; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getFax() { - return fax; - } - - public void setFax(String fax) { - this.fax = fax; - } - - public String getSurname() { - return surname; - } - - public void setSurname(String surname) { - this.surname = surname; - } - public Boolean getIsActive() { - return isActive; - } - - public void setIsActive(Boolean isActive) { - this.isActive = isActive; - } - - public Integer getBpartnerId() { - return bpartnerId; - } - - public void setBpartnerId(Integer bpartnerId) { - this.bpartnerId = bpartnerId; - } - public Integer getPriceListId() - { - return priceListId; - } - - public void setPriceListId(Integer priceListId) - { - this.priceListId = priceListId; - } -} - diff --git a/posterita/posterita/src/main/org/posterita/beans/WarehouseBean.java b/posterita/posterita/src/main/org/posterita/beans/WarehouseBean.java deleted file mode 100644 index 15d401f728..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/WarehouseBean.java +++ /dev/null @@ -1,187 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 26, 2005 by din - */ - -package org.posterita.beans; - -public class WarehouseBean extends UDIBean -{ - - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public String getWarehouseType() - { - return warehouseType; - } - - public void setWarehouseType(String warehouseType) - { - this.warehouseType = warehouseType; - } - - public Boolean getIsAllocationWarehouse() - { - return isAllocationWarehouse; - } - - public void setIsAllocationWarehouse(Boolean isAllocationWarehouse) - { - this.isAllocationWarehouse = isAllocationWarehouse; - } - - public Integer getWarehouseId() - { - return warehouseId; - } - - public void setWarehouseId(Integer warehouseId) - { - this.warehouseId = warehouseId; - } - - public String getWarehouseName() - { - return warehouseName; - } - - public void setWarehouseName(String warehouseName) - { - this.warehouseName = warehouseName; - } - - public String getAddress1() - { - return address1; - } - - public void setAddress1(String address1) - { - this.address1 = address1; - } - - public String getCity() - { - return city; - } - - public void setCity(String city) - { - this.city = city; - } - - public String getPostalAddress() - { - return postalAddress; - } - - public void setPostalAddress(String postalAddress) - { - this.postalAddress = postalAddress; - } - - public Integer getRegionId() - { - return regionId; - } - - public void setRegionId(Integer regionId) - { - this.regionId = regionId; - } - - public Boolean getIsPublic() - { - return isPublic; - } - - public void setIsPublic(Boolean isPublic) - { - this.isPublic = isPublic; - } - - public String getAisle() - { - return aisle; - } - - public void setAisle(String aisle) - { - this.aisle = aisle; - } - - public String getBin() - { - return bin; - } - - public void setBin(String bin) - { - this.bin = bin; - } - - public Boolean getIsDefault() - { - return isDefault; - } - - public void setIsDefault(Boolean isDefault) - { - this.isDefault = isDefault; - } - - public String getLevel() - { - return level; - } - - public void setLevel(String level) - { - this.level = level; - } - - public String getRegionName() - { - return regionName; - } - - public void setRegionName(String regionName) - { - this.regionName = regionName; - } - - public Boolean getIsActive() - { - return isActive; - } - - public void setIsActive(Boolean isActive) - { - this.isActive = isActive; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebDocumentBean.java b/posterita/posterita/src/main/org/posterita/beans/WebDocumentBean.java deleted file mode 100644 index 011fa944e9..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/WebDocumentBean.java +++ /dev/null @@ -1,609 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Jul 26, 2005 by din -*/ - -package org.posterita.beans; - -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MCashLine; -import org.compiere.model.MInOut; -import org.compiere.model.MInvoice; -import org.compiere.model.MLocation; -import org.compiere.model.MOrder; -import org.compiere.model.MPayment; - - -public class WebDocumentBean extends UDIBean -{ - String[] simpleCommand = new String[0]; - String[] complexCommand = new String[0]; - MBPartner me; - MBPartnerLocation mebpLocation; - MLocation meLocation; - - - - MBPartner you; - MBPartnerLocation youbpLocation; - MLocation youLocation; - String daysRemaining; - String month; - String year; - String displayCheckBox = null; - private String salesRep; - private String description; - - private ArrayList lines = new ArrayList(); - - private MOrder order; - private MInvoice invoice; - private MInOut minOut; - private MPayment payment; - private String tenderType; - private WebDocumentHeaderBean headerBean; - - private Properties ctx; - private ArrayList allocations; - - private BigDecimal totalLines; - private BigDecimal totalTax; - private BigDecimal grandTotal; - private String isPaid; - private String isShipped; - private Double paymentByCash; - private Double paymentByCard; - private Double paymentbyCheque; - private BigDecimal totalQty; - private MCashLine cashLine; - private BigDecimal subTotal; - - public BigDecimal getSubTotal() { - return subTotal; - } - - public void setSubTotal(BigDecimal subTotal) { - this.subTotal = subTotal; - } - - public String getCurrencySymbole() { - return currencySymbole; - } - public void setCurrencySymbole(String currencySymbole) { - this.currencySymbole = currencySymbole; - } - public BigDecimal getTotalQty() { - return totalQty; - } - public void setTotalQty(BigDecimal totalQty) { - this.totalQty = totalQty; - } - public String getIsPaid() - { - return isPaid; - } - public void setIsPaid(String isPaid) - { - this.isPaid = isPaid; - } - public String getIsShipped() - { - return isShipped; - } - public void setIsShipped(String isShipped) - { - this.isShipped = isShipped; - } - public String getTrackingNo() - { - return trackingNo; - } - public void setTrackingNo(String trackingNo) - { - this.trackingNo = trackingNo; - } - - - - public String getSalesRep() { - return salesRep; - } - public void setSalesRep(String salesRep) { - this.salesRep = salesRep; - } - public BigDecimal getGrandTotal() { - return grandTotal; - } - public void setGrandTotal(BigDecimal grandTotal) { - this.grandTotal = grandTotal; - } - public BigDecimal getTotalLines() { - return totalLines; - } - public void setTotalLines(BigDecimal totalLines) { - this.totalLines = totalLines; - } - public BigDecimal getTotalTax() { - return totalTax; - } - public void setTotalTax(BigDecimal totalTax) { - this.totalTax = totalTax; - } - - - public ArrayList getAllocations() { - return allocations; - } - public void setAllocations(ArrayList allocations) { - this.allocations = allocations; - } - - public WebDocumentHeaderBean getHeaderBean() - { - return headerBean; - } - - public void setHeaderBean(WebDocumentHeaderBean headerBean) - { - this.headerBean = headerBean; - } - - - public MOrder getOrder() - { - return order; - } - - public void setOrder(MOrder order) - { - this.order = order; - } - - public MInvoice getInvoice() - { - return invoice; - } - - public void setInvoice(MInvoice invoice) - { - this.invoice = invoice; - } - - - - public String[] getSimpleCommand() { - return simpleCommand; - } - - - public void setSimpleCommand(String[] simpleCommand) - { - this.simpleCommand = simpleCommand; - } - - - public MBPartner getMe() - { - return me; - } - - - public void setMe(MBPartner me) - { - this.me = me; - } - - - public MBPartnerLocation getMebpLocation() - { - return mebpLocation; - } - - - public void setMebpLocation(MBPartnerLocation mebpLocation) - { - this.mebpLocation = mebpLocation; - } - - - public MLocation getMeLocation() - { - return meLocation; - } - - - public void setMeLocation(MLocation meLocation) - { - this.meLocation = meLocation; - } - - - public MBPartner getYou() - { - return you; - } - - - public void setYou(MBPartner you) - { - this.you = you; - } - - - public MBPartnerLocation getYoubpLocation() - { - return youbpLocation; - } - - - public void setYoubpLocation(MBPartnerLocation youbpLocation) - { - this.youbpLocation = youbpLocation; - } - - - public MLocation getYouLocation() - { - return youLocation; - } - - - public void setYouLocation(MLocation youLocation) - { - this.youLocation = youLocation; - } - - - public ArrayList getLines() - { - return lines; - } - - public void setLines(ArrayList lines) - { - this.lines = lines; - } - - - public String[] getComplexCommand() - { - return complexCommand; - } - - - public void setComplexCommand(String[] complexCommand) - { - this.complexCommand = complexCommand; - } - - public String getDaysRemaining() - { - return daysRemaining; - } - - public void setDaysRemaining(String daysRemaining) - { - this.daysRemaining = daysRemaining; - } - - - - public String getMonth() - { - return month; - } - - public void setMonth(String month) - { - this.month = month; - } - - public String getYear() - { - return year; - } - - public void setYear(String year) - { - this.year = year; - } - - public String getDisplayCheckBox() - { - return displayCheckBox; - } - - public void setDisplayCheckBox(String displayCheckBox) - { - this.displayCheckBox = displayCheckBox; - } - - public String getSubmit() - { - return submit; - } - - public void setSubmit(String submit) - { - this.submit = submit; - } - - public Integer getOrderId() - { - return orderId; - } - - public void setOrderId(Integer orderId) - { - this.orderId = orderId; - } - - public String getPoReference() - { - return poReference; - } - - public void setPoReference(String poReference) - { - this.poReference = poReference; - } - - public String getTermsAgreement() - { - return termsAgreement; - } - - public void setTermsAgreement(String termsAgreement) - { - this.termsAgreement = termsAgreement; - } - - public ArrayList getOrderLineBean() - { - return orderLineBean; - } - public void setOrderLineBean(ArrayList orderLineBean) - { - this.orderLineBean = orderLineBean; - } - - public String getAddress1() - { - return address1; - } - - public void setAddress1(String address1) - { - this.address1 = address1; - } - - public String getCity() - { - return city; - } - - public void setCity(String city) - { - this.city = city; - } - - public String getDocStatus() - { - return docStatus; - } - - public void setDocStatus(String docStatus) - { - this.docStatus = docStatus; - } - - - public String getPartnerName() - { - return partnerName; - } - - public void setPartnerName(String partnerName) - { - this.partnerName = partnerName; - } - - - public Timestamp getDateOrdered() - { - return dateOrdered; - } - - public void setDateOrdered(Timestamp dateOrdered) - { - this.dateOrdered = dateOrdered; - } - - - public Integer getBpartnerId() - { - return bpartnerId; - } - public void setBpartnerId(Integer bpartnerId) - { - this.bpartnerId = bpartnerId; - } - - - public String getDatePromised() - { - return datePromised; - } - - public void setDatePromised(String datePromised) - { - this.datePromised = datePromised; - } - - public String getIsApproved() - { - return isApproved; - } - - public void setIsApproved(String isApproved) - { - this.isApproved = isApproved; - } - public String getIsDelivered() - { - return isDelivered; - } - public void setIsDelivered(String isDelivered) - { - this.isDelivered = isDelivered; - } - public String getIsInvoiced() - { - return isInvoiced; - } - public void setIsInvoiced(String isInvoiced) - { - this.isInvoiced = isInvoiced; - } - - public String getDocumentNo() - { - return documentNo; - } - - public void setDocumentNo(String documentNo) - { - this.documentNo = documentNo; - } - - public Boolean isSoTrx() - { - return isSoTrx; - } - - public void setIsSoTrx(Boolean isSoTrx) - { - this.isSoTrx = isSoTrx; - } - - public void setInvoiceId(Integer invoiceId) - { - this.invoiceId = invoiceId; - } - - public Integer getInvoiceId() - { - return invoiceId; - } - - - public MInOut getMinOut() - { - return minOut; - } - - public void setMinOut(MInOut minOut) - { - this.minOut = minOut; - } - - public Integer getPaymentId() - { - return paymentId; - } - - public void setPaymentId(Integer paymentId) - { - this.paymentId = paymentId; - } - - public MPayment getPayment() - { - return payment; - } - - public void setPayment(MPayment payment) - { - this.payment = payment; - } - - public Integer getMinOutId() - { - return minOutId; - } - - public void setMinOutId(Integer minOutId) - { - this.minOutId = minOutId; - } - - - public Properties getCtx() { - return ctx; - } - public void setCtx(Properties ctx) { - this.ctx = ctx; - } - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public Double getPaymentByCard() { - return paymentByCard; - } - public void setPaymentByCard(Double paymentByCard) { - this.paymentByCard = paymentByCard; - } - public Double getPaymentByCash() { - return paymentByCash; - } - public void setPaymentByCash(Double paymentByCash) { - this.paymentByCash = paymentByCash; - } - public Double getPaymentbyCheque() { - return paymentbyCheque; - } - public void setPaymentbyCheque(Double paymentbyCheque) { - this.paymentbyCheque = paymentbyCheque; - } - public String getTenderType() - { - return tenderType; - } - public void setTenderType(String tenderType) - { - this.tenderType = tenderType; - } - public MCashLine getCashLine() { - return cashLine; - } - public void setCashLine(MCashLine cashLine) { - this.cashLine = cashLine; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebDocumentHeaderBean.java b/posterita/posterita/src/main/org/posterita/beans/WebDocumentHeaderBean.java deleted file mode 100644 index f6ece97bdb..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/WebDocumentHeaderBean.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Created on Mar 13, 2005 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.posterita.beans; - -import java.sql.Timestamp; - -public class WebDocumentHeaderBean -{ - private String dcsRef; - private String dcsCounterRef; - private String documentStatus; - private String dealerRef; - private String dealerCounterRef; - private String documentTitle; - private String documentName; - private String from; - private String to; - private String date; - private String counterDate; - private String youName; - private String poReference; - private Timestamp dateOrdered; - private String documentHeader; - private String shipped; - private String paymentType; - private String paymentByCash; - private String paymentByCard; - private String paymentbyCheque; - private String bpartnerId; - - - - - - public String getPaymentType() { - return paymentType; - } - - public void setPaymentType(String paymentType) { - this.paymentType = paymentType; - } - - public String getShipped() - { - return shipped; - } - - public void setShipped(String shipped) - { - this.shipped = shipped; - } - - public String getDocumentHeader() - { - return documentHeader; - } - - public void setDocumentHeader(String documentHeader) - { - this.documentHeader = documentHeader; - } - - public String getYouName() { - return youName; - } - public void setYouName(String youName) { - this.youName = youName; - } - public String getCounterDate() { - return counterDate; - } - public void setCounterDate(String counterDate) { - this.counterDate = counterDate; - } - public String getDate() { - return date; - } - public void setDate(String date) { - this.date = date; - } - public String getDcsCounterRef() { - return dcsCounterRef; - } - public void setDcsCounterRef(String dcsCounterRef) { - this.dcsCounterRef = dcsCounterRef; - } - public String getDcsRef() { - return dcsRef; - } - public void setDcsRef(String dcsRef) { - this.dcsRef = dcsRef; - } - public String getDealerCounterRef() { - return dealerCounterRef; - } - public void setDealerCounterRef(String dealerCounterRef) { - this.dealerCounterRef = dealerCounterRef; - } - public String getDealerRef() { - return dealerRef; - } - public void setDealerRef(String dealerRef) { - this.dealerRef = dealerRef; - } - public String getDocumentName() { - return documentName; - } - public void setDocumentName(String documentName) { - this.documentName = documentName; - } - public String getDocumentStatus() { - return documentStatus; - } - public void setDocumentStatus(String documentStatus) { - this.documentStatus = documentStatus; - } - public String getDocumentTitle() { - return documentTitle; - } - public void setDocumentTitle(String documentTitle) { - this.documentTitle = documentTitle; - } - public String getFrom() { - return from; - } - public void setFrom(String from) { - this.from = from; - } - public String getTo() { - return to; - } - public void setTo(String to) { - this.to = to; - } - - public String getPoReference() - { - return poReference; - } - - public void setPoReference(String poReference) - { - this.poReference = poReference; - } - - public Timestamp getDateOrdered() - { - return dateOrdered; - } - - public void setDateOrdered(Timestamp dateOrdered) - { - this.dateOrdered = dateOrdered; - } - - public String getPaymentByCard() { - return paymentByCard; - } - - public void setPaymentByCard(String paymentByCard) { - this.paymentByCard = paymentByCard; - } - - public String getPaymentByCash() { - return paymentByCash; - } - - public void setPaymentByCash(String paymentByCash) { - this.paymentByCash = paymentByCash; - } - - public String getPaymentbyCheque() { - return paymentbyCheque; - } - - public void setPaymentbyCheque(String paymentbyCheque) { - this.paymentbyCheque = paymentbyCheque; - } - - public String getBpartnerId() - { - return bpartnerId; - } - - public void setBpartnerId(String bpartnerId) - { - this.bpartnerId = bpartnerId; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebInvoiceLineBean.java b/posterita/posterita/src/main/org/posterita/beans/WebInvoiceLineBean.java deleted file mode 100644 index 2ebf1a89f4..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/WebInvoiceLineBean.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - -import java.math.BigDecimal; - - -public class WebInvoiceLineBean extends WebOrderLineBean -{ - private Integer invoiceId; - private Integer qtyInvoiced; - //amount including tax - private BigDecimal lineTotalAmount; - - public BigDecimal getLineTotalAmt() - { - return lineTotalAmount; - } - - public void setLineTotalAmt(BigDecimal lineTotalAmt) - { - this.lineTotalAmount = lineTotalAmt; - } - - - - public Integer getInvoiceId() - { - return invoiceId; - } - - public void setInvoiceId(Integer invoiceId) - { - this.invoiceId = invoiceId; - } - - public Integer getQtyInvoiced() - { - return qtyInvoiced; - } - - public void setQtyInvoiced(Integer qtyInvoiced) - { - this.qtyInvoiced = qtyInvoiced; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebMinOutLineBean.java b/posterita/posterita/src/main/org/posterita/beans/WebMinOutLineBean.java deleted file mode 100644 index 2273eb5dda..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/WebMinOutLineBean.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - - -public class WebMinOutLineBean extends WebOrderLineBean -{ - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebOrderLineBean.java b/posterita/posterita/src/main/org/posterita/beans/WebOrderLineBean.java deleted file mode 100644 index f8ba1a220d..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/WebOrderLineBean.java +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Created on Mar 3, 2005 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.posterita.beans; - -import java.math.BigDecimal; -import java.util.ArrayList; - - -public class WebOrderLineBean -{ - private AttributeValuesPair attributeValuesPair; - private UDIPair[] actions; - private WebOrderLineBean myPref; - private WebOrderLineBean[] myChoices; - private BigDecimal discountPercentage; - private BigDecimal qtyTotal; - private BigDecimal taxRate; - - - //amount excluding tax - private BigDecimal lineNetAmt; - private BigDecimal taxAmt; - private BigDecimal priceActual; - private Integer orderLineId; - private Integer productId; - private ArrayList vinNumberPairs; - private Integer attributeSetInstanceId; - private String serno; - private Boolean isInvoiced; - private String engineNo; - private Boolean isQtyReserved; - private Integer partnerId; - private BigDecimal totalAmt; - private Integer tradeInOrderlineId; - private BigDecimal lineTotalAmt; - private String tradeInVin; - - private String productName; - private Integer count; - private BigDecimal qtyOrdered; - private BigDecimal grandTotal; - private String trxType; - private BigDecimal amountGiven; - private BigDecimal amountRefunded; - private Boolean isRejectable; - private String currency; - private String description; - private BigDecimal unitPrice; - private String uom; - - private BigDecimal discountAmt; - private BigDecimal writeOffAmt; - private BigDecimal subTotal; - - private BigDecimal unitPurchasePrice; - private BigDecimal grossProfit; - private BigDecimal totalGrossProfit; - private BigDecimal grossProfitPercentage; - private BigDecimal totalGrossProfitPercentage; - - public BigDecimal getGrossProfitPercentage() - { - return grossProfitPercentage; - } - - public void setGrossProfitPercentage(BigDecimal grossProfitPercentage) - { - this.grossProfitPercentage = grossProfitPercentage; - } - - public BigDecimal getTotalGrossProfitPercentage() - { - return totalGrossProfitPercentage; - } - - public void setTotalGrossProfitPercentage(BigDecimal totalGrossProfitPercentage) - { - this.totalGrossProfitPercentage = totalGrossProfitPercentage; - } - - public BigDecimal getSubTotal() { - return subTotal; - } - - public void setSubTotal(BigDecimal subTotal) { - this.subTotal = subTotal; - } - - public BigDecimal getDiscountAmt() { - return discountAmt; - } - - public void setDiscountAmt(BigDecimal discountAmt) { - this.discountAmt = discountAmt; - } - - public BigDecimal getWriteOffAmt() { - return writeOffAmt; - } - - public void setWriteOffAmt(BigDecimal writeOffAmt) { - this.writeOffAmt = writeOffAmt; - } - - public BigDecimal getUnitPrice() { - return unitPrice; - } - - public void setUnitPrice(BigDecimal unitPrice) { - this.unitPrice = unitPrice; - } - - public String getCurrency() - { - return currency; - } - - public void setCurrency(String currency) - { - this.currency = currency; - } - - /** - * @return Returns the amountGiven. - */ - public BigDecimal getAmountGiven() { - return amountGiven; - } - /** - * @param amountGiven The amountGiven to set. - */ - public void setAmountGiven(BigDecimal amountGiven) { - this.amountGiven = amountGiven; - } - /** - * @return Returns the amountRefunded. - */ - public BigDecimal getAmountRefunded() { - return amountRefunded; - } - /** - * @param amountRefunded The amountRefunded to set. - */ - public void setAmountRefunded(BigDecimal amountRefunded) { - this.amountRefunded = amountRefunded; - } - public String getTrxType() - { - return trxType; - } - - public void setTrxType(String trxType) - { - this.trxType = trxType; - } - public BigDecimal getGrandTotal() - { - return grandTotal; - } - - public void setGrandTotal(BigDecimal grandTotal) - { - this.grandTotal = grandTotal; - } - public BigDecimal getQtyOrdered() - { - return qtyOrdered; - } - - public void setQtyOrdered(BigDecimal qtyOrdered) - { - this.qtyOrdered=qtyOrdered; - } - - public Integer getCount() - { - return count; - } - - public void setCount(Integer count) - { - this.count=count; - } - - public String getProductName() - { - return productName; - } - - public void setProductName(String productName) - { - this.productName=productName; - } - - public Boolean getIsQtyReserved() - { - return isQtyReserved; - } - - public void setIsQtyReserved(Boolean isQtyReserved) - { - this.isQtyReserved = isQtyReserved; - } - - public String getEngineNo() { - return engineNo; - } - public void setEngineNo(String engineNo) { - this.engineNo = engineNo; - } - public Boolean getIsInvoiced() - { - return isInvoiced; - } - - public void setIsinvoiced(Boolean isInvoiced) - { - this.isInvoiced = isInvoiced; - } - - - public BigDecimal getPriceActual() - { - return priceActual; - } - - public void setPriceActual(BigDecimal priceActual) - { - this.priceActual = priceActual; - } - public BigDecimal getTaxAmt() - { - return taxAmt; - } - - public void setTaxAmt(BigDecimal taxAmt) - { - this.taxAmt = taxAmt; - } - - - public UDIPair[] getActions() - { - return actions; - } - public void setActions(UDIPair[] actions) - { - this.actions = actions; - } - public WebOrderLineBean[] getMyChoices() - { - return myChoices; - } - public void setMyChoices(WebOrderLineBean[] myChoices) - { - this.myChoices = myChoices; - } - public WebOrderLineBean getMyPref() - { - return myPref; - } - public void setMyPref(WebOrderLineBean myPref) - { - this.myPref = myPref; - } - - public void setLineNetAmt(BigDecimal lineNetAmt) - { - this.lineNetAmt = lineNetAmt; - } - - public BigDecimal getLineNetAmt() - { - return lineNetAmt; - } - - public AttributeValuesPair getAttributeValuesPair() - { - return attributeValuesPair; - } - - public void setAttributeValuesPair(AttributeValuesPair attributeValuesPair) - { - this.attributeValuesPair = attributeValuesPair; - } - - public void setOrderLineId(Integer orderLineId) - { - this.orderLineId = orderLineId; - } - - public Integer getOrderLineId() - { - return orderLineId; - } - - public void setProductId(Integer productId) - { - this.productId = productId; - } - - public Integer getProductId() - { - return productId; - } - - public void setAttributeSetInstanceid(Integer attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - - public Integer getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - - - public ArrayList getVinNumberPairs() - { - return vinNumberPairs; - } - - public void setVinNumberPairs(ArrayList vinNumberPairs) - { - this.vinNumberPairs = vinNumberPairs; - } - - public String getSerno() - { - return serno; - } - - public void setSerno(String serno) - { - this.serno = serno; - } - - public Integer getPartnerId() - { - return partnerId; - } - - public void setPartnerId(Integer partnerId) - { - this.partnerId = partnerId; - } - - public BigDecimal getTotalAmt() - { - return totalAmt; - } - - public void setTotalAmt(BigDecimal totalAmt) - { - this.totalAmt = totalAmt; - } - - public Integer getTradeInOrderlineId() - { - return tradeInOrderlineId; - } - - public void setTradeInOrderlineId(Integer tradeInOrderlineId) - { - this.tradeInOrderlineId = tradeInOrderlineId; - } - - public BigDecimal getLineTotalAmt() - { - return lineTotalAmt; - } - - public void setLineTotalAmt(BigDecimal lineTotalAmt) - { - this.lineTotalAmt = lineTotalAmt; - } - - public String getTradeInVin() - { - return tradeInVin; - } - - public void setTradeInVin(String tradeInVin) - { - this.tradeInVin = tradeInVin; - } - - - - public Boolean getIsRejectable() - { - return isRejectable; - } - - public void setIsRejectable(Boolean isRejectable) - { - this.isRejectable = isRejectable; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public BigDecimal getDiscountPercentage() { - return discountPercentage; - } - - public void setDiscountPercentage(BigDecimal discountPercentage) { - this.discountPercentage = discountPercentage; - } - - public BigDecimal getQtyTotal() { - return qtyTotal; - } - - public void setQtyTotal(BigDecimal qtyTotal) { - this.qtyTotal = qtyTotal; - } - - public String getUom() { - return uom; - } - - public void setUom(String uom) { - this.uom = uom; - } - - public BigDecimal getTaxRate() { - return taxRate; - } - - public void setTaxRate(BigDecimal taxRate) { - this.taxRate = taxRate; - } - - public BigDecimal getPurchasePriceList() - { - return unitPurchasePrice; - } - - public void setPurchasePriceList(BigDecimal purchasePriceList) - { - this.unitPurchasePrice = purchasePriceList; - } - - public BigDecimal getGrossProfit() - { - return grossProfit; - } - - public void setGrossProfit(BigDecimal grossProfit) - { - this.grossProfit = grossProfit; - } - - public BigDecimal getUnitPurchasePrice() - { - return unitPurchasePrice; - } - - public void setUnitPurchasePrice(BigDecimal unitPurchasePrice) - { - this.unitPurchasePrice = unitPurchasePrice; - } - - public BigDecimal getTotalGrossProfit() - { - return totalGrossProfit; - } - - public void setTotalGrossProfit(BigDecimal totalGrossProfit) - { - this.totalGrossProfit = totalGrossProfit; - } - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebStockBean.java b/posterita/posterita/src/main/org/posterita/beans/WebStockBean.java deleted file mode 100644 index 7b379e0277..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/WebStockBean.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.beans; - -import java.util.ArrayList; - - -public class WebStockBean -{ - private AttributeValuesBean attributeValuesBean; - private ArrayList regions; - - public AttributeValuesBean getAttributeValuesBean() - { - return attributeValuesBean; - } - - public void setAttributeValuesBean(AttributeValuesBean attributeValuesBean) - { - this.attributeValuesBean = attributeValuesBean; - } - - public ArrayList getRegions() - { - return regions; - } - - public void setRegions(ArrayList regions) - { - this.regions = regions; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebstoreProductImageFileBean.java b/posterita/posterita/src/main/org/posterita/beans/WebstoreProductImageFileBean.java deleted file mode 100644 index 8ff2977a1a..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/WebstoreProductImageFileBean.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.beans; - -import java.util.ArrayList; -import java.util.Iterator; - -public class WebstoreProductImageFileBean -{ - - private String fileName; - private String brandDesignModelColourAttr; - - private ArrayList sizeList; - - public WebstoreProductImageFileBean() - { - sizeList = new ArrayList(); - } - - public String getBrandDesignModelColourAttr() - { - return brandDesignModelColourAttr; - } - - public void setBrandDesignModelColourAttr(String brandDesignModelColourAttr) - { - this.brandDesignModelColourAttr = brandDesignModelColourAttr; - } - - public String getFileName() - { - return fileName; - } - - public void setFileName(String fileName) - { - this.fileName = fileName; - } - - public ArrayList getSizeList() - { - return sizeList; - } - - public void setSizeList(ArrayList sizeList) - { - this.sizeList = sizeList; - } - - public void addSize(String size) - { - sizeList.add(size); - } - - @Override - public boolean equals(Object obj) - { - boolean equals = false; - - if(obj instanceof WebstoreProductImageFileBean) - { - if(((WebstoreProductImageFileBean)obj).brandDesignModelColourAttr.equalsIgnoreCase(this.brandDesignModelColourAttr)) - { - WebstoreProductImageFileBean tWProductImageFileBean = (WebstoreProductImageFileBean)obj; - Iterator sizeIter = tWProductImageFileBean.getSizeList().iterator(); - while(sizeIter.hasNext()) - { - String s = sizeIter.next(); - if(this.sizeList.contains(s)) - { - equals = true; - break; - } - } - } - } - - return equals; - } -} diff --git a/posterita/posterita/src/main/org/posterita/beans/WebstoreUserBean.java b/posterita/posterita/src/main/org/posterita/beans/WebstoreUserBean.java deleted file mode 100644 index ea428e8fa2..0000000000 --- a/posterita/posterita/src/main/org/posterita/beans/WebstoreUserBean.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.beans; - -import java.math.BigDecimal; - -public class WebstoreUserBean -{ - - protected UserBean userBean; - protected AddressBean shipToAddrBean; - protected CreditCardBean creditCardBean; - protected Integer chargeId; // not in udibean yet - protected String tenderType; //i.e. Payment Method: by card, cash (not in udibean yet) - protected String deliveryViaRule; // MInOut.DELIVERYVIARULE_Shipper etc - protected String chargeName; - protected BigDecimal chargeAmount; - /* - * Will be used only in session. - * Step 1: Delivery Information - * Step 2: Payment Information - * Step 3: Order Confirmation - * Step 4: Finished - */ - protected String step; - - - - public String getStep() - { - return step; - } - public void setStep(String step) - { - this.step = step; - } - - public CreditCardBean getCreditCardBean() - { - return creditCardBean; - } - public void setCreditCardBean(CreditCardBean creditCardBean) - { - this.creditCardBean = creditCardBean; - } - public AddressBean getShipToAddrBean() - { - return shipToAddrBean; - } - public void setShipToAddrBean(AddressBean shipToAddrBean) - { - this.shipToAddrBean = shipToAddrBean; - } - public UserBean getUserBean() - { - return userBean; - } - public void setUserBean(UserBean userBean) - { - this.userBean = userBean; - } - - public String getTenderType() - { - return tenderType; - } - public void setTenderType(String tenderType) - { - this.tenderType = tenderType; - } - public Integer getChargeId() - { - return chargeId; - } - public void setChargeId(Integer chargeId) - { - this.chargeId = chargeId; - } - public String getChargeName() - { - return chargeName; - } - public void setChargeName(String chargeName) - { - this.chargeName = chargeName; - } - public BigDecimal getChargeAmount() - { - return chargeAmount; - } - public void setChargeAmount(BigDecimal chargeAmount) - { - this.chargeAmount = chargeAmount; - } - public String getDeliveryViaRule() - { - return deliveryViaRule; - } - public void setDeliveryViaRule(String deliveryViaRule) - { - this.deliveryViaRule = deliveryViaRule; - } - - - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/AbstractDocumentManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/AbstractDocumentManager.java deleted file mode 100644 index 320f8abc03..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/AbstractDocumentManager.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author vishee - */ - -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.util.Properties; - -import org.compiere.model.MAttributeSetInstance; -import org.compiere.model.MBPartner; -import org.compiere.model.MTax; -import org.compiere.util.Env; - -import org.posterita.beans.WebDocumentHeaderBean; - - -public class AbstractDocumentManager -{ - public static final String REF_PO = "Ref PO No:"; - public static final String COUNTER_REF_SO = "Ref SO No:"; - - public static final String DEALER_REF = "Dealer Purchase Order No:"; - public static final String DEALER_COUNTER_REF = "Dealer Purchase Order No:"; - - - - public static final String FROM = "From:"; - public static final String TO = "To:"; - - - protected static BigDecimal getLineTaxAmt(Properties ctx, BigDecimal lineNetAmt, int taxId, int lineId) - { - BigDecimal baseAmt = Env.ZERO; - - baseAmt = baseAmt.add(lineNetAmt); - - MTax tax = new MTax(ctx, taxId, null); - - return (tax.calculateTax(baseAmt, false, 4)); - } - - protected static String getSerno(Properties ctx, int attributeSetInstanceId) - { - if (attributeSetInstanceId == 0) - return ""; - - MAttributeSetInstance attributeSetInstance = new MAttributeSetInstance(ctx, attributeSetInstanceId, null); - - return attributeSetInstance.getSerNo(); - } - - protected static WebDocumentHeaderBean createWebDocumentHeader(Properties ctx, int orgId, int bpartnerID, String docStatus, boolean isSoTrx,String paymentType) - { - if (isSoTrx) - return getSalesOrderHeader(ctx, orgId, bpartnerID, docStatus,paymentType); - else - return getPurchaseOrderHeader(ctx, orgId, bpartnerID, docStatus); - } - - protected static WebDocumentHeaderBean getSalesOrderHeader(Properties ctx, int orgId, int bpartnerID, String docStatus,String paymentType) - { - WebDocumentHeaderBean headerBean = new WebDocumentHeaderBean(); - - headerBean.setDcsRef(COUNTER_REF_SO); - headerBean.setDcsCounterRef(REF_PO); - headerBean.setDealerRef(null); - headerBean.setPaymentType(paymentType); - - //set to null because SOReference is not currently available in system - headerBean.setDealerCounterRef(DEALER_COUNTER_REF); - //headerBean.setDocumentStatus(order.getZZ_HondaDocStatus()); - headerBean.setDate("Date Ordered:"); - headerBean.setDocumentName("Sales Order"); - - - String youName = null; - MBPartner youPartner = new MBPartner(ctx, bpartnerID, null); - - youName = youPartner.getName(); - - - headerBean.setYouName(youName); - - headerBean.setFrom(TO); - - headerBean.setTo(FROM); - - return headerBean; - } - - - - - private static WebDocumentHeaderBean getPurchaseOrderHeader(Properties ctx, int orgId, int bpartnerID, String docStatus) - { - WebDocumentHeaderBean headerBean = new WebDocumentHeaderBean(); - - headerBean.setDcsRef(REF_PO); - headerBean.setDcsCounterRef(COUNTER_REF_SO); - headerBean.setDealerRef(DEALER_REF); - //set to null because SOReference is not currently available in system - headerBean.setDealerCounterRef(null); - headerBean.setDocumentStatus(docStatus); - headerBean.setDate("Date Ordered:"); - headerBean.setDocumentName("Purchase order"); - - - MBPartner youBP = new MBPartner(ctx, bpartnerID, null); - String youName = youBP.getName(); - - headerBean.setYouName(youName); - - headerBean.setFrom(TO); - - headerBean.setTo(FROM); - - - return headerBean; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/AttributeValuesManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/AttributeValuesManager.java deleted file mode 100644 index cba2a9a2c6..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/AttributeValuesManager.java +++ /dev/null @@ -1,325 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author ashley - */ - -package org.posterita.businesslogic; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Properties; - -import org.compiere.model.MAttribute; -import org.compiere.model.MAttributeValue; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.posterita.beans.AttributeInstanceBean; -import org.posterita.beans.AttributeValuesPair; -import org.posterita.core.KeyNamePairUtil; -import org.posterita.exceptions.OperationException; -import org.posterita.keyname.ProductAttributeValueKeyNamePair; -import org.posterita.util.PoManager; - -public class AttributeValuesManager -{ - private static ArrayList getAttributeValues(Properties ctx, int attributeId, int productCategoryId ) throws OperationException - { - ArrayList attributeValues = ProductAttributeValueKeyNamePair.getKeyNamePairs(ctx, attributeId, productCategoryId); - - return attributeValues; - - } - - //retrieve the colour, model, transmission, year from an attributesetinstanceID - //returns a bean containing a colour, model, year, transmission keynamepair - - public static AttributeValuesPair retrieveAttributeValues(Properties ctx,int attributeSetInstanceId) throws OperationException - { - if (attributeSetInstanceId == 0) - return new AttributeValuesPair(); - - ArrayList attributeInstances = getMAttributeInstances(ctx); - - return retrieveAttributeValues(ctx, attributeSetInstanceId, attributeInstances); - } - - public static AttributeValuesPair retrieveAttributeValues(Properties ctx,int attributeSetInstanceId, ArrayList attributeInstances) throws OperationException - { - HashMap attributeValuesMap = getAttributeValues(ctx, attributeSetInstanceId, attributeInstances); - - AttributeValuesPair pair = new AttributeValuesPair(); - pair.setBrandAttributeValue((KeyNamePair)attributeValuesMap.get("Brand")); - pair.setModelAttributeValue((KeyNamePair) attributeValuesMap.get("Model")); - pair.setColourAttributeValue((KeyNamePair) attributeValuesMap.get("Colour")); - pair.setTransmissionAttributeValue((KeyNamePair) attributeValuesMap.get("Transmission")); - pair.setYearAttributeValue((KeyNamePair) attributeValuesMap.get("Year")); - pair.setDesignAttributeValue((KeyNamePair) attributeValuesMap.get("Design")); - pair.setSizeAttributeValue((KeyNamePair) attributeValuesMap.get("Size")); - pair.setStyleAttributeValue((KeyNamePair) attributeValuesMap.get("Style")); - - return pair; - } - - private static HashMap getAttributeValues(Properties ctx, int attributeSetInstanceId, ArrayList attributeInstances) throws OperationException - { - ArrayList sameAttributeSetInstances = getAttributeInstancesByAttributeSetInstance(attributeSetInstanceId, attributeInstances); - - Iterator iter = sameAttributeSetInstances.iterator(); - - HashMap attributeValuesMap = new HashMap(); - - AttributeInstanceBean attributeInstanceBean; - while (iter.hasNext()) - { - attributeInstanceBean = (AttributeInstanceBean) iter.next(); - attributeValuesMap = getAttributeValue(ctx,attributeInstanceBean, attributeValuesMap); - - } - - return attributeValuesMap; - - } - - @SuppressWarnings("unchecked") - private static HashMap getAttributeValue(Properties ctx, AttributeInstanceBean attributeInstanceBean, HashMap attributeValuesMap) throws OperationException - { - KeyNamePair pair = new KeyNamePair(attributeInstanceBean.getAttributeValueId(), attributeInstanceBean.getAttributeValue()); - attributeValuesMap.put(attributeInstanceBean.getAttribute(), pair); - - return attributeValuesMap; - } - - public static ArrayList getMAttributeInstances(Properties ctx) throws OperationException - { -// MOrg org = OrganisationManager.getHsafOrg(ctx); // Honda customised stuff - - int adOrgID = Env.getAD_Org_ID(ctx); - String sql = "select ai.m_attributeSetInstance_id," + - " ai.m_attributevalue_id," + - " ai.value," + - " attr.name," + - " attr.M_Attribute_ID" + - " from m_attributeInstance ai, M_Attribute attr " + - " where ai.m_attribute_id=attr.m_attribute_id" + - " and ai.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + - " and ai.AD_ORG_ID="+adOrgID; - - PreparedStatement pstmt =null; - - ArrayList attributeInstances = new ArrayList(); - try - { - pstmt = DB.prepareStatement(sql, null); - ResultSet rs = pstmt.executeQuery(); - - AttributeInstanceBean bean; - while (rs.next()) - { - bean = new AttributeInstanceBean(); - bean.setAttributeSetInstanceId(rs.getInt(1)); - bean.setAttributeValueId(rs.getInt(2)); - bean.setAttributeValue(rs.getString(3)); - bean.setAttribute(rs.getString(4)); - bean.setAttributeId(rs.getInt(5)); - attributeInstances.add(bean); - } - - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - finally - { - try - { - pstmt.close(); - } - catch (Exception ex) - { - } - pstmt = null; - } - - return attributeInstances; - } - - private static ArrayList getAttributeInstancesByAttributeSetInstance(int attributeSetInstanceId, ArrayList allAttributeInstances) - { - Iterator iter = allAttributeInstances.iterator(); - - AttributeInstanceBean bean; - ArrayList sameInstances = new ArrayList(); - while (iter.hasNext()) - { - bean = (AttributeInstanceBean) iter.next(); - if (bean.getAttributeSetInstanceId() == attributeSetInstanceId) - sameInstances.add(bean); - } - - - return sameInstances; - } - - public static MAttributeValue createAttributeValue(Properties ctx, String value, int attributeId, int productCategoryId, String trxName) throws OperationException - { - - MAttributeValue attributeValue = new MAttributeValue(ctx, 0, trxName); - attributeValue.setName(value); - attributeValue.setValue(value); -// attributeValue.setM_Product_Category_ID(productCategoryId); - attributeValue.setM_Attribute_ID(attributeId); - PoManager.save(attributeValue); - return attributeValue; - - } - - public static MAttributeValue getOrCreateAttributeValue(Properties ctx, int attributeId, String value, int productCategoryId, String trxName) throws OperationException - { - //check is attribute value exist before creating new one - int attributeValueIds[] = MAttributeValue.getAllIDs(MAttributeValue.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and Upper(name)=Upper('" + value + "')", trxName); - - MAttributeValue attributeValue; - if (attributeValueIds.length!= 0) - attributeValue = new MAttributeValue(ctx, attributeValueIds[0], trxName); - else - attributeValue = AttributeValuesManager.createAttributeValue(ctx, value, attributeId, productCategoryId, trxName); - - return attributeValue; - } - - public static MAttributeValue getAttributeValue(Properties ctx, int attributeId, int attributeSetInstanceId, String trxName) throws OperationException - { - String selStmt = "Select M_AttributeValue_ID from M_AttributeInstance where "; - selStmt += " AD_Client_ID=" + Env.getAD_Client_ID(ctx); - selStmt += " and M_AttributeSetInstance_ID=" + attributeSetInstanceId; - selStmt += " and M_Attribute_ID=" + attributeId; - - PreparedStatement pstmt = null; - - try - { - pstmt = DB.prepareStatement(selStmt, trxName); - ResultSet rs = pstmt.executeQuery(); - - if(!rs.next()) - throw new OperationException("Could not find Attribute Value id for Attribute id: " + attributeId + " and Attribute Set Instance Id: " + attributeSetInstanceId); - - int attributeValueId = rs.getInt(1); - rs.close(); - MAttributeValue attrValue = new MAttributeValue(ctx, attributeValueId, trxName); - return attrValue; - } - catch(SQLException sqlEx) - { - throw new OperationException("Could not execute query for getting attribute value: " + selStmt); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception ex) - {} - } - } - - public static ArrayList getAttributeValues(Properties ctx, int AttributeId) throws OperationException - { - StringBuffer whereClause = new StringBuffer(); - whereClause.append("M_AttributeValue_ID in ( "); - whereClause.append("select distinct M_AttributeValue_ID from M_AttributeInstance "); - whereClause.append("where AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " "); - whereClause.append(" and AD_Org_ID=" + Env.getAD_Org_ID(ctx) + " "); - whereClause.append("and M_Attribute_ID=" + AttributeId + " "); - whereClause.append(")"); - try - { - return KeyNamePairUtil.getData(ctx, MAttributeValue.Table_Name, whereClause.toString()); - } - catch(SQLException ex) - { - throw new OperationException("Could not retrieve Attribute Values with WhereClause: " + whereClause, ex); - } - } - - public static ArrayList getAttributes(Properties ctx) throws OperationException - { - String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " and IsActive='Y'"; - - try - { - return KeyNamePairUtil.getData(ctx, MAttribute.Table_Name, whereClause); - } - catch(SQLException ex) - { - throw new OperationException("Could not retrieve attributes with WhereClause: " + whereClause, ex); - } - } - - public static int changeAttributeValue(Properties ctx, int attributeValueId, String newValue, String trxName) throws OperationException - { - int retAttributeValueId; - String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx); - whereClause += " and AD_Org_ID=" + Env.getAD_Org_ID(ctx) + " and Upper(Name)=Upper('" + newValue + "')"; - - int attrValueIds[] = MAttributeValue.getAllIDs(MAttributeValue.Table_Name, whereClause, trxName); - - if(attrValueIds.length > 1) - throw new OperationException("Duplicate name found in Attribute Value: " + newValue); - - MAttributeValue attributeValue = new MAttributeValue(ctx, attributeValueId, trxName); - if(attributeValue.get_ID() == 0) - throw new OperationException("Could not load Attribute Value with ID: " + attributeValueId); - - if(attrValueIds.length == 0) - { - attributeValue.setName(newValue); - attributeValue.setValue(newValue); - retAttributeValueId = attributeValue.get_ID(); - } - else if(attributeValueId == attrValueIds[0]) - { - attributeValue.setIsActive(true); - attributeValue.setName(newValue); - attributeValue.setValue(newValue); - retAttributeValueId = attributeValue.get_ID(); - } - else - { - attributeValue.setIsActive(false); - retAttributeValueId = attrValueIds[0]; - } - - PoManager.save(attributeValue); - - return retAttributeValueId; - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/BankManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/BankManager.java deleted file mode 100644 index 74004d8778..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/BankManager.java +++ /dev/null @@ -1,333 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Alok Pathak - */ - -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.ArrayList; -import java.util.Properties; -import java.util.logging.Level; - -import org.compiere.model.MBankAccount; -import org.compiere.model.MClient; -import org.compiere.model.MLocation; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.BankAccountBean; -import org.posterita.beans.BankBean; -import org.posterita.core.CheckDuplicateEntities; -import org.posterita.exceptions.BankAlreadyExistException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.compiere.model.MBank; -import org.posterita.util.PoManager; - - -public class BankManager -{ - private static final CLogger log = CLogger.getCLogger(BankManager.class); - private static final String ROUTING_NUMBER="12345"; - - public static MBank createBank(Properties ctx, String bankName,String address1,String postalAddress1,String city,String routingNumber, String trxName) throws OperationException - { - - MBank bank = new MBank(ctx,0,trxName); - - if(CheckDuplicateEntities.checkDuplicateName(ctx,bankName,MBank.Table_Name)) - throw new BankAlreadyExistException("Bank already exists"); - - try - { - bank.setName(bankName); - bank.setRoutingNo(ROUTING_NUMBER); - - MLocation location = new MLocation(ctx,bank.getC_Location_ID(),trxName); - location.setAddress1(address1); - location.setPostal_Add(postalAddress1); - location.setCity(city); - location.setC_Country_ID(UdiConstants.COUNTRY_MAURITIUS); - - PoManager.save(location); - - bank.setC_Location_ID(location.get_ID()); - - PoManager.save(bank); - - } - catch(OperationException e) - { - throw new OperationException("Cannot create bank!!"); - } - - return bank; - - } - - public static MBankAccount createBankAccount(Properties ctx,int bankId,String accountNo,String accountType,double currentBalance, String trxName) throws OperationException - { - MBankAccount account; - - try - { - account = new MBankAccount(ctx,0,trxName); - account.setC_Bank_ID(bankId); - account.setAccountNo(accountNo); - account.setBankAccountType(accountType); - account.setC_Currency_ID(MClient.get(ctx).getC_Currency_ID()); - account.setIsDefault(true); - account.setCurrentBalance(new BigDecimal(currentBalance)); - - - PoManager.save(account); - } - catch(OperationException e) - { - throw new OperationException("Cannot create bank account!!"); - } - - return account; - - } - - - public static ArrayList getAllBanks(Properties ctx) throws OperationException - { - ArrayList list = new ArrayList(); - - //load all banks - int clientId = Env.getAD_Client_ID(ctx); - int orgId = Env.getAD_Org_ID(ctx); - - int id[] = MBank.getAllIDs(MBank.Table_Name," ad_client_id = "+clientId+" and ad_org_id = "+orgId +" and isactive = 'Y'" ,null); - BankBean bean; - - for(int i=0; i1) - throw new OperationException("Too many banks, not currently supported"); - - BankBean bean = (BankBean)allBanks.get(0); - bankId = bean.getBankId(); - } - - return bankId.intValue(); - } - - public static int getDefaultBankAccountId(Properties ctx, int adOrgId, String trxName) throws OperationException - { - String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " AND AD_Org_ID=" + adOrgId + " AND IsDefault='Y'"; - - int bankAccountIds[] = MBankAccount.getAllIDs(MBankAccount.Table_Name, whereClause, trxName); - - if (bankAccountIds.length == 0) - { - throw new OperationException("No default bank account found"); - } - else - { - return bankAccountIds[0]; - } - } - - - /** - * Retrieves all the active bank accounts that the user present in the application context can - * have access to - * @param ctx Context - * @param trxName Transaction - * @return List of Bank Account model data - * @throws OperationException If the data cannot be retrieved - */ - public static ArrayList getBankAccounts(Properties ctx, String trxName) throws OperationException - { - StringBuffer sqlStmt = new StringBuffer(); - sqlStmt.append("SELECT b.C_Bank_ID, b.Name, ba.C_BankAccount_ID, ba.bankAccountType, ba.AccountNo, ba.Description "); - sqlStmt.append("FROM C_Bank b INNER JOIN C_BankAccount ba ON b.C_Bank_ID=ba.C_Bank_ID "); - sqlStmt.append("WHERE b.AD_Client_ID=? AND b.IsActive='Y' AND ba.IsActive='Y' AND b.AD_Org_ID IN ("); - sqlStmt.append(Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)); - sqlStmt.append(")"); - sqlStmt.append(" AND NOT EXISTS (SELECT * FROM AD_OrgInfo oi WHERE oi.TransferBank_ID=b.C_Bank_ID)"); - - ArrayList paramList = new ArrayList(); - paramList.add(new Integer(Env.getAD_Client_ID(ctx))); - - return getBankAccounts(ctx, sqlStmt.toString(), paramList, trxName); - } - - /** - * Retrieves all the active bank accounts present for an organisation - * @param ctx Context - * @param trxName Transaction - * @return List of Bank Account model data - * @throws OperationException If the data cannot be retrieved - */ - public static ArrayList getBankAccounts (Properties ctx, int adOrgId, String trxName) throws OperationException - { - StringBuffer sqlStmt = new StringBuffer(); - sqlStmt.append("SELECT b.C_Bank_ID, b.Name, ba.C_BankAccount_ID, ba.bankAccountType, ba.AccountNo, ba.Description "); - sqlStmt.append("FROM C_Bank b INNER JOIN C_BankAccount ba ON b.C_Bank_ID=ba.C_Bank_ID "); - sqlStmt.append("WHERE b.AD_Client_ID=? AND b.IsActive='Y' AND ba.IsActive='Y' AND ba.AD_Org_ID=?"); - sqlStmt.append(" AND NOT EXISTS (SELECT * FROM AD_OrgInfo oi WHERE oi.TransferBank_ID=b.C_Bank_ID)"); - - ArrayList paramList = new ArrayList(); - paramList.add(new Integer(Env.getAD_Client_ID(ctx))); - paramList.add(new Integer(adOrgId)); - - return getBankAccounts(ctx, sqlStmt.toString(), paramList, trxName); - } - - /** - * Retrieves list of bank accounts based on the criteria defined in the SQL Statement - * @param ctx Context - * @param sqlSmt SQL Statement - * @param params Parameters to be used to build the SQL - * @param trxName Transaction - * @return List of Bank Account - * @throws OperationException If data cannot be retrieved - */ - private static ArrayList getBankAccounts(Properties ctx, String sqlSmt, ArrayList params, String trxName) throws OperationException - { - ArrayList list = new ArrayList(); - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - int paramIndex = 1; - pstmt = DB.prepareStatement(sqlSmt, trxName); - if (params != null) - { - for (int i = 0; i < params.size(); i++) - { - pstmt.setObject(paramIndex++, params.get(i)); - } - } - rs = pstmt.executeQuery(); - - while (rs.next()) - { - BankAccountBean bean = new BankAccountBean(); - bean.setBankId(rs.getInt(1)); - bean.setBankName(rs.getString(2)); - bean.setBankAccountId(rs.getInt(3)); - bean.setAccountType(rs.getString(4)); - bean.setAccountNo(rs.getString(5)); - list.add(bean); - } - } - catch (Exception ex) - { - log.log(Level.SEVERE, "Could not get bank account information", ex); - throw new OperationException("Could not get bank account information", ex); - } - finally - { - DB.close(rs, pstmt); - } - - return list; - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/CashManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/CashManager.java deleted file mode 100644 index 4ddac286a2..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/CashManager.java +++ /dev/null @@ -1,1406 +0,0 @@ -/* - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Alok Pathak - */ - -package org.posterita.businesslogic; - - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Properties; -import java.util.logging.Level; - -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MBankAccount; -import org.compiere.model.MCash; -import org.compiere.model.MCashBook; -import org.compiere.model.MCashLine; -import org.compiere.model.MCurrency; -import org.compiere.model.MDocType; -import org.compiere.model.MInvoice; -import org.compiere.model.MLocation; -import org.compiere.model.MOrg; -import org.compiere.model.MPayment; -import org.compiere.process.DocumentEngine; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.TimeUtil; -import org.posterita.beans.CashBean; -import org.posterita.beans.CashBookBean; -import org.posterita.beans.CashBookDetailBean; -import org.posterita.beans.CashLineBean; -import org.posterita.beans.CashSummaryBean; -import org.posterita.beans.CurrentTillAmountBean; -import org.posterita.beans.OpenItemBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.beans.WebDocumentHeaderBean; -import org.posterita.core.JulianDate; -import org.posterita.core.utils.FormatBigDecimal; -import org.posterita.exceptions.CanNotCloseTillException; -import org.posterita.exceptions.CashBookAlreadyAssignedException; -import org.posterita.exceptions.DataException; -import org.posterita.exceptions.NoCashJournalPresentException; -import org.posterita.exceptions.NullTransferAmountException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.TransferAmountExceedsTotalAmountException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - -public class CashManager -{ - private static final CLogger log = CLogger.getCLogger(CashManager.class); - - /** - * Adjust cash book (i.e: Expense, Receipts or Bank Transfer) - * @param ctx Context - * @param bean Transaction Details - * @param trxName Transaction - * @return Cash Journal Entry created - * @throws OperationException If entries could not be created or invalid transfer type - */ - public static MCashLine adjustCashBook(Properties ctx, CashBookDetailBean bean, String trxName) throws OperationException - { - MCash cash = getCashJournal(ctx,trxName); - - if(bean.getAdjustmentAmount() == null) - { - throw new NullTransferAmountException("Amount can not be null"); - } - - MCashLine cashLine = null; - - if(bean.getTransferType().equalsIgnoreCase(MCashLine.CASHTYPE_GeneralReceipts)) - { - cashLine = createCashLine(ctx, cash, bean.getAdjustmentAmount(), - MCashLine.CASHTYPE_GeneralReceipts, bean.getDescription(), trxName); - } - - else if(bean.getTransferType().equalsIgnoreCase(MCashLine.CASHTYPE_GeneralExpense)) - { - if(bean.getAdjustmentAmount().compareTo(cash.getEndingBalance()) > 0) - { - throw new TransferAmountExceedsTotalAmountException("cannot transfer amount more than the ending balance"); - } - cashLine = createCashLine(ctx, cash, bean.getAdjustmentAmount().negate(), - MCashLine.CASHTYPE_GeneralExpense, bean.getDescription(), trxName); - } - else if(bean.getTransferType().equalsIgnoreCase(MCashLine.CASHTYPE_BankAccountTransfer)) - { - if(bean.getAdjustmentAmount().compareTo(cash.getEndingBalance()) > 0) - { - throw new TransferAmountExceedsTotalAmountException("cannot transfer amount more than the ending balance"); - } - // @ashley TODO Refactor should be able to chose bank account on which to transfer - int bankAccountId = POSTerminalManager.getBankAccountId(ctx, MPayment.TENDERTYPE_Check); - cashLine = createBankTransferCashEntry(ctx, cash, bean.getAdjustmentAmount(), - bankAccountId, bean.getDescription(), trxName); - } - else - { - throw new OperationException("Invalid transfer type: " + bean.getTransferType()); - } - - return cashLine; - } - - /** - * Creates a new Journal entry - * @param ctx Context - * @param cashJournal Cash Journal - * @param amount Amount - * @param cashType Cash Type - * @param trxName Transaction - * @return The created journal entry (Cash Line) - * @throws OperationException If the entry cannot be created - */ - public static MCashLine createCashLine(Properties ctx, MCash cashJournal, BigDecimal amount, - String cashType, String trxName) throws OperationException - { - return createCashLine(ctx, cashJournal, amount, cashType, "", trxName); - } - - /** - * Creates a new Journal entry - * @param ctx Context - * @param cashJournal Cash Journal - * @param amount Amount - * @param cashType Cash Type - * @param description Description of the entry - * @param trxName Transaction - * @return The created journal entry (Cash Line) - * @throws OperationException If the entry cannot be created - */ - public static MCashLine createCashLine(Properties ctx, MCash cashJournal, BigDecimal transferAmount, - String cashType, String description, String trxName) throws OperationException - { - MCashLine cashLine = new MCashLine(ctx, 0, trxName); - cashLine.setC_Cash_ID(cashJournal.get_ID()); - cashLine.setAmount(transferAmount); - cashLine.setCashType(cashType); - cashLine.setDescription(description); - PoManager.save(cashLine); - return cashLine; - } - - /** - * Creates a new Bank Account transfer Journal entry - * @param ctx Context - * @param cashJournal Cash Journal - * @param amount Amount to transfer - * @param bankAccountId Bank Account - * @param trxName Transaction - * @return Cash Line entry - * @throws OperationException If the entry cannot be created - */ - public static MCashLine createBankTransferCashEntry(Properties ctx, MCash cashJournal, - BigDecimal transferAmount, int bankAccountId, String trxName) throws OperationException - { - return createBankTransferCashEntry(ctx, cashJournal, transferAmount, bankAccountId, null, trxName); - } - - /** - * Creates a new Bank Account transfer Journal entry - * @param ctx Context - * @param cashJournal Cash Journal - * @param amount Amount to transfer - * @param bankAccountId Bank Account - * @param description Description of the line - * @param trxName Transaction - * @return Cash Line entry - * @throws OperationException If the entry cannot be created - */ - public static MCashLine createBankTransferCashEntry(Properties ctx, MCash cashJournal, - BigDecimal amount, int bankAccountId, String description, String trxName) throws OperationException - { - MBankAccount bankAccount = new MBankAccount(ctx, bankAccountId, trxName); - - StringBuffer descr = new StringBuffer(); - // +ve/zero indicates transfer to bankAccount - // Though transfer of zero is meaningless - if (amount.signum() >= 0) - { - descr.append(" -> "); - } - else - { - descr.append(" <- "); - } - descr.append(bankAccount.getAccountNo()).append(" (BA)"); - - if (description != null && description.trim().length() > 0) - { - descr.append(" ").append(description); - } - - MCashLine cashLine = new MCashLine(ctx, 0, trxName); - cashLine.setC_Cash_ID(cashJournal.get_ID()); - cashLine.setDescription(descr.toString()); - cashLine.setAmount(amount.negate()); - cashLine.setCashType(MCashLine.CASHTYPE_BankAccountTransfer); - cashLine.setC_BankAccount_ID(bankAccountId); - PoManager.save(cashLine); - return cashLine; - } - - /** - * @param ctx Context - * @return List of Cash Book Details - * @throws OperationException - */ - public static CashBookDetailBean getCashBookDetails(Properties ctx, String trxName) throws OperationException - { - Integer cashBookId = POSTerminalManager.getCashBookId(ctx); - CashManager.getCashJournal(ctx, cashBookId, trxName); - - String sql ="select cash.C_CASH_ID," +//1 - "cash.C_CASHBOOK_ID," +//2 - "cash.NAME," +//3 - "cash.DESCRIPTION," +//4 - "cash.DATEACCT," +//5 - "cash.BEGINNINGBALANCE," +//6 - "cash.ENDINGBALANCE," +//7 - "cash.STATEMENTDIFFERENCE," +//8 - "cash.DOCSTATUS," +//9 - "book.name as bookName" +//10 - " from C_CASH cash,C_CASHBOOK book " + - " where cash.C_CASHBOOK_ID=book.C_CASHBOOK_ID"+ - " and book.C_CashBook_ID = " + cashBookId + - " and book.ad_client_id=" +Env.getAD_Client_ID(ctx)+ - " and book.AD_ORG_ID=" +Env.getAD_Org_ID(ctx) + - " order by cash.created desc"; - - CashBookDetailBean bean = null; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, trxName); - rs = pstmt.executeQuery(); - if(rs.next()) - { - bean = new CashBookDetailBean(); - bean.setCashJournalId(Integer.valueOf(rs.getInt(1))); - bean.setCashBookId(Integer.valueOf(rs.getInt(2))); - bean.setCashJournalName(rs.getString(3)); - bean.setCashJournalDisc(rs.getString(4)); - bean.setDateAcct(rs.getTimestamp(5)); - bean.setBeginingBalance( rs.getBigDecimal(6)); - bean.setEndingBalance(rs.getBigDecimal(7)); - bean.setStatementDifference(rs.getBigDecimal(8)); - bean.setDocStatus(rs.getString(9)); - bean.setCashBookName(rs.getString(10)); - } - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs, pstmt); - } - - if (bean == null) - { - throw new NoCashJournalPresentException("No Cash journal is present"); - } - - return bean; - } - - - public static ArrayList getCashBookDetailsForTill(Properties ctx,int cashBookId, Timestamp fromDate,Timestamp toDate) throws OperationException - { - - - String sql1 ="select c_cash_id from C_CASH where C_CASHBOOK_ID="+cashBookId+ - " and created between "+DB.TO_DATE(fromDate, false) + " AND " + DB.TO_DATE(toDate, false); - - String sql="select nvl(sum(AMOUNT),0)" + - " from C_CASHLINE" + - " where C_CASH_ID in (" +sql1+")"+ - " and AD_CLIENT_ID= " +Env.getAD_Client_ID(ctx)+ - " and CASHTYPE='I'"+ - " and created between " + DB.TO_DATE(fromDate, false) + - " and " + DB.TO_DATE(toDate, false) ; - - - CashBookDetailBean bean; - ArrayList list=new ArrayList(); - PreparedStatement pstmt = DB.prepareStatement(sql,null); - try - { - ResultSet rs=pstmt.executeQuery(); - while(rs.next()) - { - bean=new CashBookDetailBean(); - bean.setStatementDifference(rs.getBigDecimal(1)); - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - if(pstmt != null) - pstmt.close(); - } - catch(Exception ex){} - - pstmt = null; - } - - return list; - } - - - - - public static ArrayList getCashBookDetailsFyracle(Properties ctx) throws OperationException - { - Integer cashBookId=Integer.valueOf(POSTerminalManager.getCashBook(ctx).get_ID()); - String sql ="select cash.C_CASH_ID," +//1 - " cash.C_CASHBOOK_ID," +//2 - " cash.NAME," +//3 - " cash.DESCRIPTION," +//4 - " cash.DATEACCT," +//5 - " cash.BEGINNINGBALANCE," +//6 - " cash.ENDINGBALANCE," +//7 - " cash.STATEMENTDIFFERENCE," +//8 - " cash.DOCSTATUS," +//9 - " book.name bookName," +//10 - " cash.created, " +//11 - " cash.AD_CLIENT_ID," +//12 - " cash.AD_ORG_ID" +//13 - " from C_CASH cash,C_CASHBOOK book " + - " where cash.C_CASHBOOK_ID=book.C_CASHBOOK_ID"+ - " and cash.C_CASHBOOK_ID="+cashBookId+ - " and cash.ad_client_id="+Env.getAD_Client_ID(ctx)+ - " and cash.ad_org_id="+Env.getAD_Org_ID(ctx) + - " order by cash.created desc"; - - CashBookDetailBean bean; - ArrayList list=new ArrayList(); - PreparedStatement pstmt =DB.prepareStatement(sql,null); - try - { - ResultSet rs=pstmt.executeQuery(); - if(rs.next()) - { - bean=new CashBookDetailBean(); - bean.setCashJournalId(Integer.valueOf(rs.getInt(1))); - bean.setCashBookId(Integer.valueOf(rs.getInt(2))); - bean.setCashJournalName(rs.getString(3)); - bean.setCashJournalDisc(rs.getString(4)); - bean.setDateAcct(rs.getTimestamp(5)); - bean.setBeginingBalance(new BigDecimal(rs.getString(6))); - bean.setEndingBalance(new BigDecimal(rs.getString(7))); - bean.setStatementDifference(new BigDecimal(rs.getString(8))); - bean.setDocStatus(rs.getString(9)); - bean.setCashBookName(rs.getString(10)); - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - if(pstmt != null) - pstmt.close(); - } - catch(Exception ex){} - - pstmt = null; - } - - return list; - } - - - /** - * Adjusts the beginning balance on the latest Cash journal available for the Cash Book - * @param ctx Context - * @param terminalId Terminal - * @param trxName Transaction - * @throws OperationException If Cash Journal could not be updated - */ - public static void updateBeginningBalance(Properties ctx, int terminalId, String trxName) throws OperationException - { - int cashBookId = POSTerminalManager.getCashBookId(ctx, terminalId); - - updateCashBookBeginningBalance(ctx, cashBookId, trxName); - } - - - public static void updateCashBookBeginningBalance(Properties ctx, int cashBookId, String trxName) throws OperationException - { - int toJournalId=0; - CashBean bean1 = getData(ctx,cashBookId,true,trxName); - if(bean1!=null) - { - toJournalId = bean1.getCashJournalId().intValue(); - } - - CashBean bean2 = getData(ctx,cashBookId,false,trxName); - - BigDecimal endingBalance=null; - - if (bean2!=null) - endingBalance = bean2.getEndingBalance(); - - if (endingBalance==null) - endingBalance=new BigDecimal(0); - - MCash cash = new MCash(ctx,toJournalId,trxName); - - endingBalance = FormatBigDecimal.currency(endingBalance); - - cash.setBeginningBalance(endingBalance);//ending balance of the previous one is the begining balance of the new one - PoManager.save(cash); - } - - - private static String getDataSQL(Properties ctx, int cashBookId) - { - String sql="select * from " + - " (select cash.C_CASH_ID," +//1 - "cash.C_CASHBOOK_ID," +//2 - "cash.ENDINGBALANCE," +//3 - "cash.DOCSTATUS," + //4 - "cash.AD_CLIENT_ID," +//6 - " cash.AD_ORG_ID," +//7 - " cash.created"+//8 - " from C_CASH cash,C_CASHBOOK book" + - " where cash.C_CASHBOOK_ID=book.C_CASHBOOK_ID" + - "@DOCSTATUS@" + - " and book.C_CashBook_ID="+cashBookId+ - " and cash.ad_client_id=?"+ - " and cash.AD_ORG_ID=? order by cash.Created Desc) cashDetails"; - return sql; - } - - public static CashBean getData(Properties ctx,int cashBookId,boolean isLatest,String trxName) throws OperationException - { - - String sql = getDataSQL(ctx, cashBookId); - - if(isLatest) - sql=sql.replaceAll("@DOCSTATUS@"," and cash.docstatus <> 'CO'"); - else - sql=sql.replaceAll("@DOCSTATUS@"," and cash.docstatus = 'CO'"); - - PreparedStatement pstmt = DB.prepareStatement(sql,trxName); - CashBean bean=null; - - try - { - pstmt.setInt(1, Env.getAD_Client_ID(ctx)); - pstmt.setInt(2, Env.getAD_Org_ID(ctx)); - ResultSet rs=pstmt.executeQuery(); - if(rs.next()) - { - bean=new CashBean(); - bean.setCashJournalId(Integer.valueOf(rs.getInt(1))); - bean.setEndingBalance(rs.getBigDecimal(3)); - bean.setDocStatus(rs.getString(4)); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - if (pstmt != null) - pstmt.close(); - } - catch(Exception ex){} - - pstmt = null; - } - return bean; - } - - public static MCashBook createCashBook(Properties ctx, int orgId, String name, int currencyId, String trxName) throws OperationException - { - MCashBook cashBook = new MCashBook(ctx, 0, trxName); - cashBook.setName(name); - cashBook.setC_Currency_ID(currencyId); - cashBook.setAD_Org_ID(orgId); - PoManager.save(cashBook); - return cashBook; - } - - - private static MCash getCashJournal(Properties ctx, String trxName) throws OperationException - { - int cashBookId = POSTerminalManager.getCashBookId(ctx); - return getCashJournal(ctx, cashBookId, trxName); - } - - public static MCash getCashJournal(Properties ctx, int cashBookId, String trxName) throws OperationException - { - MCash cashJournal = getMcash(ctx, cashBookId, JulianDate.getTodayDateOnly(), trxName); - - if (cashJournal == null) - { - cashJournal = MCash.get(ctx, cashBookId, JulianDate.getTodayDateOnly(), trxName); - CashManager.updateCashBookBeginningBalance(ctx, cashBookId, trxName); - } - - return cashJournal; - } - - - private static MCash getMcash(Properties ctx, int C_CashBook_ID, - Timestamp dateAcct, String trxName) throws OperationException - { - MCash retValue = null; - - String sql; - - sql = "SELECT * FROM C_Cash c " - + "WHERE c.C_CashBook_ID=?" // #1 - //+ " AND TRUNC(c.StatementDate)=?" // #2 - + " AND c.Processed='N'" - + " AND c.docstatus='DR'"; - - PreparedStatement pstmt = null; - try - { - pstmt = DB.prepareStatement (sql, trxName); - - pstmt.setInt (1, C_CashBook_ID); - //pstmt.setTimestamp (2, TimeUtil.getDay(dateAcct)); - - ResultSet rs = pstmt.executeQuery (); - if (rs.next ()) - retValue = new MCash (ctx, rs, trxName); - rs.close (); - } - catch (Exception e) - { - throw new OperationException(e); - } - finally - { - try - { - if (pstmt != null) - pstmt.close (); - - } - catch (Exception e) - {} - - pstmt = null; - } - - return retValue; - - - } - - - /** - * @param ctx - * @param bean - * @param trxName - * @return - * @throws NullTransferAmountException - * @throws TransferAmountExceedsTotalAmountException - * @throws OperationException - */ - public static CashBookDetailBean CloseTill(Properties ctx, CashBookDetailBean bean, String trxName) - throws NullTransferAmountException, TransferAmountExceedsTotalAmountException, OperationException - { - int terminalId = POSTerminalManager.getTerminalId(ctx); - MCash cashJournal = getCashJournal(ctx, trxName); - - bean.setCash_id(cashJournal.get_ID()); - - BigDecimal transferAmt = (bean.getTransferAmount() == null ? Env.ZERO : bean.getTransferAmount()); - BigDecimal differenceAmt = (bean.getDifferenceAmt() == null ? Env.ZERO : bean.getDifferenceAmt()); - BigDecimal beginingBalance = bean.getBeginingBalance(); - BigDecimal netTransfer = null; - BigDecimal beginningBalanceDifference = Env.ZERO; - - CashBookDetailBean cbDetailsBean = getCashBookDetails(ctx, trxName); - - CurrentTillAmountBean currentAmountBean = POSManager.getCurrentTillAmount(ctx); - - beginningBalanceDifference = beginingBalance.subtract(cbDetailsBean.getBeginingBalance()); - - bean.setBeginingBalance(cbDetailsBean.getBeginingBalance()); - bean.setEndingBalance(cbDetailsBean.getEndingBalance()); - bean.setStatementDifference(cbDetailsBean.getStatementDifference()); - netTransfer = transferAmt.subtract(cbDetailsBean.getBeginingBalance()); - differenceAmt = (bean.getStatementDifference().subtract(netTransfer)).negate(); - bean.setDifferenceAmt(differenceAmt); - bean.setCashBookName(cbDetailsBean.getCashBookName()); - bean.setDocStatus(cbDetailsBean.getDocStatus()); - - if( bean.getDocStatus().equals(DocumentEngine.STATUS_Completed)) - { - throw new CanNotCloseTillException("Already closed,Cannot close till "); - } - - netTransfer = netTransfer.subtract(beginningBalanceDifference); - - if (differenceAmt.compareTo(Env.ZERO) != 0) - { - createCashLine(ctx, cashJournal, differenceAmt, MCashLine.CASHTYPE_Difference, trxName); - } - - BigDecimal cardTotal = currentAmountBean.getCardTotal(); - BigDecimal chequeTotal = currentAmountBean.getChequeTotal(); - - // Do Transfer for CardTotal and Cheque total here - - BigDecimal notifiedCardTotal = (bean.getCardTotal() == null ? Env.ZERO : bean.getCardTotal()); - BigDecimal notifiedChequeTotal = (bean.getChequeTotal() == null ? Env.ZERO : bean.getChequeTotal()); - bean.setCardDifference(Env.ZERO); - bean.setChequeDifference(Env.ZERO); - - if(cardTotal.compareTo(notifiedCardTotal) != 0) - { - bean.setCardDifference(notifiedCardTotal.subtract(cardTotal)); - } - - if(chequeTotal.compareTo(notifiedChequeTotal) != 0) - { - bean.setChequeDifference(notifiedChequeTotal.subtract(chequeTotal)); - } - - PoManager.save(cashJournal); - - POSTerminalManager.closeTerminal(ctx, terminalId, cashJournal, netTransfer, chequeTotal, cardTotal, trxName); - - PoManager.processIt(cashJournal, DocumentEngine.ACTION_Complete); - - return bean; - } - - - public static void closePreviousDraftedCashjournals(Properties ctx, int cashBookId,String trxName) throws OperationException - { - String sql = "SELECT C_CASH_ID FROM C_Cash c " - + "WHERE c.C_CashBook_ID=?" - + " AND c.Processed='N'" - + " AND c.docstatus='DR'" - + " AND TRUNC(c.StatementDate) getCashDetails(Properties ctx, int cashBookId, Integer month, Integer year, String trxName) throws OperationException - { - ArrayList cashList = new ArrayList(); - - int adClientId = Env.getAD_Client_ID(ctx); - String userOrg = Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); - - String sql = "Select C_Cash_ID, Name, Created, Updated, StatementDate, DateAcct, BeginningBalance, EndingBalance, DocStatus " - + " from C_Cash" - + " where AD_Client_ID=" + adClientId - + " and AD_Org_ID in (" + userOrg + ")" - + " and IsActive='Y'" - + " AND C_CashBook_ID=" + cashBookId; - - - if (month != null) - { - String mm = String.valueOf(month); - if (mm.length() == 1) - { - mm = "0" + mm; - } - sql = sql + " and to_char(Created, 'mm') = '" + mm +"'"; - } - - if (year != null) - sql = sql + " and to_char(Created, 'yyyy') = '" + year + "'"; - - sql += " order by created desc"; - - PreparedStatement pstmt = null; - - try - { - pstmt = DB.prepareStatement(sql, trxName); - ResultSet rs = pstmt.executeQuery(); - - while (rs.next()) - { - CashBean cashBean = new CashBean(); - cashBean.setCashId(rs.getInt(1)); - cashBean.setName(rs.getString(2)); - cashBean.setDateCreated(rs.getTimestamp(3)); - cashBean.setDateUpdated(rs.getTimestamp(4)); - cashBean.setStatmentDate(rs.getString(5)); - cashBean.setDateAcct(rs.getTimestamp(6)); - cashBean.setBeginingBalance(rs.getBigDecimal(7)); - cashBean.setEndingBalance(rs.getBigDecimal(8)); - cashBean.setDocStatus(rs.getString(9)); - - cashList.add(cashBean); - } - - rs.close(); - } - catch (Exception ex) - { - throw new OperationException("Cannot retrieve Cash with sql: " + sql, ex); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return cashList; - } - - - /** - * Loads a cash book - * @param ctx Context - * @param cashBookId Cash Book ID to be loaded - * @param trxName Transaction - * @return Cash Book PO - * @throws OperationException If teh cash book cannot be loaded - */ - public static MCashBook loadCashBook(Properties ctx, int cashBookId, String trxName) throws OperationException - { - MCashBook cashBook = new MCashBook(ctx, cashBookId, trxName); - if (cashBook.get_ID() <= 0) - { - throw new OperationException("Could not load cash book with id: " + cashBookId); - } - return cashBook; - } - - public static MCash loadCash(Properties ctx, int cashId, String trxName) throws OperationException - { - MCash cash = new MCash(ctx, cashId, trxName); - - if(cash.get_ID() == 0) - throw new OperationException("Could not load cash with i12,435.96d: " + cashId); - - return cash; - } - - public static CashSummaryBean getCashSummary(Properties ctx, int cashId, String trxName) throws OperationException - { - String sql = "select ca.CashType, sum(ca.Amount)" - + " from C_CASHLINE ca where C_cash_ID=" + cashId - + " group by ca.cashtype"; - - MCash cashJournal = new MCash(ctx, cashId, trxName); - CashSummaryBean bean = getCashSummary(ctx, sql, trxName); - bean.setBeginingBalance(cashJournal.getBeginningBalance()); - bean.setEndingBalance(cashJournal.getEndingBalance()); - return bean; - } - - public static CashSummaryBean getCashSummary(Properties ctx, String fromDate, String toDate, String trxName) throws OperationException - { - int adClientId = Env.getAD_Client_ID(ctx); - String userOrg = Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); - String sql = "select ca.CashType, sum(ca.Amount)" - + " from C_CASHLINE ca where ca.AD_Client_ID=" + adClientId - + " and ca.AD_Org_ID in (" + userOrg + ")" - + " and ca.Created between to_date('" + fromDate + "','DD-MM-YYYY HH24:MI:SS')" - + " and to_date('" + toDate + "','DD-MM-YYYY HH24:MI:SS') " - + " group by ca.cashtype"; - - return getCashSummary(ctx, sql, trxName); - } - - private static CashSummaryBean getCashSummary(Properties ctx, String sql, String trxName) throws OperationException - { - PreparedStatement pstmt = null; - CashSummaryBean cashSummaryBean = new CashSummaryBean(); - try - { - pstmt = DB.prepareStatement(sql, trxName); - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - String cashType = rs.getString(1); - BigDecimal amount = rs.getBigDecimal(2); - - if(MCashLine.CASHTYPE_BankAccountTransfer.equals(cashType)) - cashSummaryBean.setBankAcctTransferAmount(amount); - else if(MCashLine.CASHTYPE_Charge.equals(cashType)) - cashSummaryBean.setChargeAmount(amount); - else if(MCashLine.CASHTYPE_Difference.equals(cashType)) - cashSummaryBean.setDifferenceAmount(amount); - else if(MCashLine.CASHTYPE_GeneralExpense.equals(cashType)) - cashSummaryBean.setGeneralExpenseAmount(amount); - else if(MCashLine.CASHTYPE_GeneralReceipts.equals(cashType)) - cashSummaryBean.setGeneralReceiptsAmount(amount); - else if(MCashLine.CASHTYPE_Invoice.equals(cashType)) - cashSummaryBean.setInvoiceAmount(amount); - else - throw new OperationException("Unknown CashType: " + cashType); - } - - rs.close(); - } - catch(Exception ex) - { - throw new OperationException("Could not retrieve cash summary with sql: " + sql, ex); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return cashSummaryBean; - } - - public static ArrayList getCashLineHistory(Properties ctx, String fromDate, String todate, String trxName) throws OperationException - { - int adClientId = Env.getAD_Client_ID(ctx); - String userOrg = Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); - - String sql = "select cl.C_CashLine_ID, cl.CashType, rl.name, cl.Created, cl.C_Cash_ID, cl.C_Invoice_ID, cl.Amount, cu.CurSymbol, cl.Description " - + " from C_CashLine cl, AD_Ref_List rl, C_Currency cu " - + " where cl.AD_Client_ID= " + adClientId - + " and cl.AD_Org_ID in (" + userOrg + ") " - + " and rl.AD_Reference_ID = " + MCashLine.CASHTYPE_AD_Reference_ID - + " and cl.CashType = rl.Value" - + " and cu.C_Currency_ID = cl.C_Currency_ID" - + " and cl.Created between to_date('"+ fromDate+"','DD-MM-YYYY HH24:MI:SS') " - + " and to_date('" + todate+"','DD-MM-YYYY HH24:MI:SS') " - + " order by cl.created"; - - return getCashLineHistory(ctx, sql, trxName); - - } - - public static ArrayList getCashLineHistory(Properties ctx, int cashId, String trxName) throws OperationException - { - int adClientId = Env.getAD_Client_ID(ctx); - String userOrg = Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); - String sql = "select cl.C_CashLine_ID, cl.CashType, rl.name, cl.Created, cl.C_Cash_ID, cl.C_Invoice_ID, cl.Amount, cu.CurSymbol, cl.Description " - + " from C_CashLine cl, AD_Ref_List rl, C_Currency cu " - + " where cl.AD_Client_ID= " + adClientId - + " and cl.AD_Org_ID in (" + userOrg + ") " - + " and rl.AD_Reference_ID = " + MCashLine.CASHTYPE_AD_Reference_ID - + " and cl.CashType = rl.Value" - + " and cu.C_Currency_ID = cl.C_Currency_ID" - + " and cl.C_Cash_ID=" + cashId - + " order by cl.created"; - - - return getCashLineHistory(ctx, sql, trxName); - } - - private static ArrayList getCashLineHistory(Properties ctx, String sql, String trxName) throws OperationException - { - ArrayList repSummaryList = new ArrayList(); - - PreparedStatement pstmt = null; - - try - { - pstmt = DB.prepareStatement(sql, trxName); - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - int i = 0; - CashLineBean repSummaryBean = new CashLineBean(); - repSummaryBean.setCashLineId(rs.getInt(++i)); - repSummaryBean.setCashType(rs.getString(++i)); - repSummaryBean.setCashTypeName(rs.getString(++i)); - repSummaryBean.setDateCreated(rs.getTimestamp(++i)); - repSummaryBean.setCashId(rs.getInt(++i)); - repSummaryBean.setInvoiceId(rs.getInt(++i)); - repSummaryBean.setAmount(rs.getBigDecimal(++i)); - repSummaryBean.setCurrency(rs.getString(++i)); - repSummaryBean.setDescription(rs.getString(++i)); - repSummaryList.add(repSummaryBean); - } - - rs.close(); - } - catch(Exception ex) - { - throw new OperationException("Could not retrieve data for report summary with sql: " + sql, ex); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception ex){} - - pstmt = null; - } - - return repSummaryList; - } - - - public static MCashLine createCashLineForInvoice(Properties ctx,OpenItemBean bean,String trxName) throws OperationException - { - int cashBookId = POSTerminalManager.getCashBookId(ctx); - MCash cash = MCash.get(ctx,cashBookId,JulianDate.getTodayDateOnly(),trxName); - - MCashLine [] cashLines = cash.getLines(true); - if(cashLines.length==0) - { - updateCashBookBeginningBalance(ctx, cashBookId, trxName); - } - - //Load invoice - MInvoice invoice = new MInvoice(ctx, bean.getInvoiceId(), trxName); - MDocType dt = MDocType.get(ctx, invoice.getC_DocType_ID()); - - BigDecimal amt = bean.getPaymentAmt(); - BigDecimal discountAmt = bean.getDiscountAmt() == null ? Env.ZERO : bean.getDiscountAmt(); - BigDecimal writeOffAmt = bean.getWriteOffAmt() == null ? Env.ZERO : bean.getWriteOffAmt(); - - - if (MDocType.DOCBASETYPE_APInvoice.equals(dt.getDocBaseType()) - || MDocType.DOCBASETYPE_ARCreditMemo.equals(dt.getDocBaseType()) ) - { - amt = amt.negate(); - discountAmt = discountAmt.negate(); - writeOffAmt = writeOffAmt.negate(); - } - - MCashLine cashLine = new MCashLine(ctx,0,trxName); - cashLine.setC_Cash_ID(cash.get_ID()); - cashLine.setCashType(MCashLine.CASHTYPE_Invoice); - cashLine.setC_Invoice_ID(bean.getInvoiceId()); - cashLine.setC_Currency_ID(invoice.getC_Currency_ID()); - cashLine.setAmount(amt); - cashLine.setDiscountAmt(discountAmt); - cashLine.setWriteOffAmt(writeOffAmt); - - PoManager.save(cashLine); - return cashLine; - } - - /** - * Creates a new Cash Journal entry with the amount specified for the invoice - * @param ctx Context - * @param cashId Cash Journal - * @param invoiceId Invoice - * @param amount Cash Amount - * @param trxName Transaction - * @return Cash Journal Entry - * @throws OperationException If Cash Line creation failed - */ - public static MCashLine createCashLine(Properties ctx, int cashId, int invoiceId, - BigDecimal amount, BigDecimal writeOffAmout, BigDecimal discountAmt, - String trxName) throws OperationException - { - MInvoice invoice = new MInvoice(ctx, invoiceId, trxName); - if (invoice.get_ID() == 0) - { - throw new OperationException("Could not load invoice!!!"); - } - - MCashLine cashLine = new MCashLine(ctx, 0, trxName); - cashLine.setC_Cash_ID(cashId); - cashLine.setInvoice(invoice); - cashLine.setAmount(amount); - cashLine.setWriteOffAmt(writeOffAmout); - cashLine.setDiscountAmt(discountAmt); - PoManager.save(cashLine); - return cashLine; - } - - public static WebDocumentBean getWebCashPaymentBean(Properties ctx, int cashLineId) throws OperationException, DataException - { - MCashLine cashLine = new MCashLine(ctx,cashLineId,null); - MInvoice invoice = new MInvoice(ctx,cashLine.getC_Invoice_ID(),null); - if (cashLine == null) - throw new OperationException("Invalid operation payment is null"); - - if (cashLine.get_ID() == 0) - throw new OperationException("You have deleted this payment. You cannot view this payment."); - - WebDocumentBean bean = new WebDocumentBean(); - - bean.setPaymentId(Integer.valueOf(cashLine.get_ID())); - - int currencyId = cashLine.getC_Currency_ID(); - MCurrency currency = new MCurrency(ctx,currencyId,null); - bean.setCurrencySymbole(currency.getCurSymbol()); - - - MOrg myOrg = OrganisationManager.getMyOrg(ctx); - MBPartner me = new MBPartner(ctx, myOrg.getLinkedC_BPartner_ID(null), null); - bean.setMe(me); - // MOrg orderOrg = new MOrg(ctx, cashLine.getAD_Org_ID(), null); - - /* if (orderOrg.getLinkedC_BPartner_ID() != myOrg.getLinkedC_BPartner_ID()) - throw new DocumentDoesNotBelongToYouException("This payment does not belong to you. You do not have access to it."); - */ - - MBPartnerLocation meLocation[] = MBPartnerLocation.getForBPartner(ctx,me.get_ID()); - if (meLocation.length == 0) - throw new OperationException("No location has been set for your organisation. Please ask your administrator to set one for you"); - - MLocation location = new MLocation(ctx, meLocation[0].getC_Location_ID(), null); - - if (location == null) - throw new OperationException("You must have a location set for your business partner, Please ask your administrator to set one for you"); - - bean.setMeLocation(location); - - MBPartner you = new MBPartner(ctx, invoice.getC_BPartner_ID(), null); - - MBPartnerLocation youBPLocation[] = MBPartnerLocation.getForBPartner(ctx, you.get_ID()); - - if (youBPLocation.length ==0) - throw new OperationException("No location has been set for the dealer organisation. Please ask your administrator to set one for you"); - - MLocation youLocation = new MLocation(ctx, youBPLocation[0].getC_Location_ID(), null); - - bean.setYou(you); - bean.setYoubpLocation(youBPLocation[0]); - bean.setYouLocation(youLocation); - bean.setCashLine(cashLine); - - WebDocumentHeaderBean headerBean = PaymentManager.createWebDocumentHeader(ctx, invoice.getAD_Org_ID(),invoice.getC_BPartner_ID(), "Completed", true,"Cash"); - String tenderTypeName = "Cash"; - - - - headerBean.setPaymentType(tenderTypeName); - - bean.setHeaderBean(headerBean); - bean.setInvoice(invoice); - - return bean; - } - - /** - * Retrieves all the cash books having a name like the search criteria - * @param ctx Context - * @param searchText Search criteria based on the name of cash book - * @param trxName Transaction - * @return List of Cash book data model - * @throws OperationException If data could not retrieved - */ - public static ArrayList getCashBooks(Properties ctx, String searchText, String trxName) throws OperationException - { - String whereClause = "C_CashBook.Name LIKE (?)"; - - if (searchText == null) - { - searchText = ""; - } - - searchText = "%" + searchText.trim() + "%"; - - ArrayList paramsList = new ArrayList(); - paramsList.add(searchText); - - return getCashBooks(ctx, whereClause, null, paramsList, trxName); - } - - /** - * Retrieves all the active Cash books - * @param ctx Context - * @param trxName Transaction - * @return List of Cash book data model - * @throws OperationException If data could not be retrieved - */ - public static ArrayList getCashBooks(Properties ctx, String trxName) throws OperationException - { - return getCashBooks(ctx, "C_CashBook.IsActive='Y'", " ORDER BY C_CashBook.Name", null, trxName); - } - - /** - * Retrives all the cash book for a particular organisation - * @param ctx Context - * @param adOrgId Organisation Id - * @param trxName Transaction - * @return List of Cash book data model - * @throws OperationException If data could not retrieved - */ - public static ArrayList getAllCashbooks(Properties ctx, int adOrgId, String trxName) throws OperationException - { - String whereClause = "C_CashBook.IsActive='Y'AND C_CashBook.AD_Org_ID=?"; - - ArrayList paramsList = new ArrayList(); - paramsList.add(new Integer(adOrgId)); - return getCashBooks(ctx, whereClause, null, paramsList, trxName); - } - - /** - * Retrieves all the cash book that can be assigned on a terminal (i.e: Not already present on another terminal). - * @param ctx Context - * @param adOrgId Organisation - * @param trxName Transaction - * @return List of Cash book data model - * @throws OperationException If data could not be retrieved - */ - public static ArrayList getCashBooksForTerminal(Properties ctx, int adOrgId, int terminalId, String trxName) throws OperationException - { - StringBuffer whereClause = new StringBuffer(); - whereClause.append("C_CashBook.IsActive='Y'AND C_CashBook.AD_Org_ID=? "); - whereClause.append("AND NOT EXISTS (SELECT * FROM U_POSTerminal WHERE U_POSTerminal.U_POSTerminal_ID<>? "); - whereClause.append("AND U_POSTerminal.C_CashBook_ID=C_CashBook.C_CashBook_ID AND U_POSTerminal.IsActive='Y')"); - - ArrayList paramsList = new ArrayList(); - paramsList.add(new Integer(adOrgId)); - paramsList.add(new Integer(terminalId)); - - return getCashBooks(ctx, whereClause.toString(), " ORDER BY C_CashBook.Name", paramsList, trxName); - } - - /** - * Retrieves all the cash books based on the criteria defined in the where clause statement. - * @param ctx Context - * @param whereClause SQL Where clause - * @param orderByClause Order by clause - * @param params Parameters to set for the queries - * @param trxName Transaction - * @return List of Cash Book data model - * @throws OperationException If the data could not be retrieved - */ - private static ArrayList getCashBooks(Properties ctx, String whereClause, - String orderByClause, ArrayList params, String trxName) throws OperationException - { - ArrayList cashBookList = new ArrayList(); - PreparedStatement pstmt = null; - ResultSet rs = null; - - StringBuffer sqlStmt = new StringBuffer(); - sqlStmt.append("SELECT * FROM C_CashBook WHERE C_CashBook.AD_Client_ID=? "); - - if (whereClause != null && whereClause.trim().length() > 0) - { - sqlStmt.append(" AND "); - sqlStmt.append(whereClause); - } - sqlStmt.append(" AND C_CashBook.AD_Org_ID IN (") - .append(Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)) - .append(") "); - - if (orderByClause == null || orderByClause.length() == 0) - { - orderByClause = "ORDER BY Name"; - } - sqlStmt.append(orderByClause); - - try - { - int paramIndex = 1; - pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); - pstmt.setInt(paramIndex++, Env.getAD_Client_ID(ctx)); - - if (params != null) - { - for (int i = 0; i < params.size(); i++) - { - pstmt.setObject(paramIndex++, params.get(i)); - } - } - - rs = pstmt.executeQuery(); - - while (rs.next()) - { - MCashBook cashBook = new MCashBook(ctx, rs, trxName); - CashBookBean bean = new CashBookBean(); - bean.setCashBookId(cashBook.get_ID()); - bean.setCashBookName(cashBook.getName()); - bean.setDescription(cashBook.getDescription()); - bean.setOrgId(cashBook.getAD_Org_ID()); - bean.setIsActive(cashBook.isActive()); - bean.setIsDefault(cashBook.isDefault()); - bean.setCurrencyId(cashBook.getC_Currency_ID()); - bean.setCurrency(cashBook.getC_Currency().getISO_Code()); - cashBookList.add(bean); - } - } - catch (Exception ex) - { - log.log(Level.SEVERE, "Could not get cash books", ex); - throw new OperationException("Could not retrieve cash books", ex); - } - finally - { - DB.close(rs, pstmt); - } - - return cashBookList; - } - - /** - * Returns the Cash book data model from its PO - * @param cashBook Cash Book PO - * @return Cash Book data model - */ - public static CashBookBean getBean(MCashBook cashBook) - { - CashBookBean bean = new CashBookBean(); - bean.setOrgId(cashBook.getAD_Org_ID()); - bean.setCashBookId(cashBook.get_ID()); - bean.setCashBookName(cashBook.getName()); - bean.setCurrencyId(cashBook.getC_Currency_ID()); - bean.setDescription(cashBook.getDescription()); - bean.setIsActive(cashBook.isActive()); - bean.setIsDefault(cashBook.isDefault()); - - return bean; - } - - /** - * Returns the PO for the Cash Book from it's data model - * @param ctx Context - * @param bean Cash Book data model - * @param trxName Transaction - * @return Cash Book PO - * @throws OperationException If the Cash Book PO could not be loaded - */ - public static MCashBook getPO(Properties ctx, CashBookBean bean, String trxName) throws OperationException - { - MCashBook cashBook = new MCashBook(ctx, bean.getCashBookId(), trxName); - if (cashBook.get_ID() != bean.getCashBookId()) - { - // Happens only when trying to load a cash book that is not present - // and the PO model resets the Id to 0 - throw new OperationException("Could not load cash book"); - } - cashBook.setAD_Org_ID(bean.getOrgId()); - cashBook.setC_Currency_ID(bean.getCurrencyId()); - cashBook.setDescription(bean.getDescription()); - cashBook.setName(bean.getCashBookName()); - cashBook.setIsActive(bean.getIsActive()); - cashBook.setIsDefault(bean.getIsDefault()); - - return cashBook; - } - - /** - * Returns the data model of the Cash Book PO - * @param ctx Context - * @param cashBookId Cash Book ID - * @param trxName Transaction - * @return Cash Book data model - * @throws OperationException If Cash book PO could not be loaded - */ - public static CashBookBean getCashBook(Properties ctx, int cashBookId, String trxName) throws OperationException - { - MCashBook cashBook = new MCashBook(ctx, cashBookId, trxName); - if (cashBook.get_ID() <= 0) - { - throw new OperationException("Could not load Cash Book with id: " + cashBookId); - } - - return getBean(cashBook); - } - - /** - * Creates or updates a Cash Book. For creation the cash book id in the data model should be 0 - * otherwise it will try to load a cash book with the id provided - * @param ctx Context - * @param bean Data Model of the cash book - * @param trxName Transaction - * @return Cash Book PO - * @throws OperationException If the Cash Book PO could not be loaded or updated - */ - public static MCashBook createUpdateCashBook(Properties ctx, CashBookBean bean, String trxName) throws OperationException - { - MCashBook cashBook = getPO(ctx, bean, trxName); - if (!cashBook.isActive() && POSTerminalManager.isCashbookPresentOnTerminal(ctx, cashBook.get_ID(), trxName)) - { - throw new CashBookAlreadyAssignedException("Cannot deactivate the cash book as it has been assigned to a terminal"); - } - PoManager.save(cashBook); - bean.setCashBookId(cashBook.get_ID()); - return cashBook; - } - - - /** - * Updates the active status of a cash book - * @param ctx Context - * @param cashBookId Cash book ID - * @param active Whether to set the cash book active or not - * @param trxName Transaction - * @throws OperationException If Cash Book could not be loaded or updated - */ - public static void updateCashBookStatus(Properties ctx, int cashBookId, boolean active, String trxName) throws OperationException - { - MCashBook cashBook = loadCashBook(ctx, cashBookId, trxName); - - if (!active && POSTerminalManager.isCashbookPresentOnTerminal(ctx, cashBookId, trxName)) - { - throw new CashBookAlreadyAssignedException("Cannot deactivate the cash book as it has been assigned to a terminal"); - } - - cashBook.setIsActive(active); - PoManager.save(cashBook); - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/CashTransferManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/CashTransferManager.java deleted file mode 100644 index ec6c4c9d5e..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/CashTransferManager.java +++ /dev/null @@ -1,171 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.Properties; - -import org.compiere.model.MBankAccount; -import org.compiere.model.MCash; -import org.compiere.model.MCashBook; -import org.compiere.model.MCashLine; -import org.compiere.process.DocumentEngine; -import org.posterita.exceptions.OperationException; -import org.posterita.util.PoManager; - -/** - * @author Ashley G Ramdass - * May 26, 2008 - */ -public class CashTransferManager -{ - /** - * Transfers money from a Bank Account to another one. - * - * @param ctx Context - * @param fromBankAccountId From Bank Account - * @param toBankAccountId To Bank Account - * @param currencyId Currency - * @param amount Amount to Transfer - * @param dateAcct Accounting Date - * @param trxName Transaction - * @throws OperationException if documents can't be created or processed - */ - public static void transferBankToBank(Properties ctx, int fromBankAccountId, int toBankAccountId, - int currencyId, BigDecimal amount, Timestamp dateAcct, String trxName) throws OperationException - { - MBankAccount fromBankAccount = new MBankAccount(ctx, fromBankAccountId, trxName); - MBankAccount toBankAccount = new MBankAccount(ctx, toBankAccountId, trxName); - - int fromCashBookId = OrganisationManager.getCreateTransferCashBook(ctx, fromBankAccount.getAD_Org_ID(), currencyId, trxName); - int toCashBookId = OrganisationManager.getCreateTransferCashBook(ctx, toBankAccount.getAD_Org_ID(), currencyId, trxName); - - MCash fromCashJournal = MCash.get(ctx, fromCashBookId, dateAcct, trxName); - if (fromCashJournal == null) - { - throw new OperationException("Could not create Cash Journal entry"); - } - - MCash toCashJournal = MCash.get(ctx, toCashBookId, dateAcct, trxName); - if (toCashJournal == null) - { - throw new OperationException("Could not create Cash Journal entry"); - } - - String description = fromBankAccount.getAccountNo() + " (BA) -> " + toBankAccount.getAccountNo() + " (BA)"; - - // Transfer from the bank account to the cash journal - MCashLine fromCashLine = new MCashLine(fromCashJournal); - fromCashLine.setC_Currency_ID(currencyId); - fromCashLine.setDescription(description); - fromCashLine.setCashType(MCashLine.CASHTYPE_BankAccountTransfer); - fromCashLine.setC_BankAccount_ID(fromBankAccountId); - fromCashLine.setAmount(amount); - fromCashLine.setIsGenerated(true); - PoManager.save(fromCashLine); - - // Transfer from the cash journal to the bank account - MCashLine toCashLine = new MCashLine(toCashJournal); - toCashLine.setC_Currency_ID(currencyId); - toCashLine.setDescription(description); - toCashLine.setCashType(MCashLine.CASHTYPE_BankAccountTransfer); - toCashLine.setC_BankAccount_ID(toBankAccountId); - toCashLine.setAmount(amount.negate()); - toCashLine.setIsGenerated(true); - PoManager.save(toCashLine); - - PoManager.processIt(fromCashJournal, DocumentEngine.ACTION_Complete); - - if (fromCashJournal.get_ID() != toCashJournal.get_ID()) - { - PoManager.processIt(toCashJournal, DocumentEngine.ACTION_Complete); - } - } - - /** - * Transfer money from a Cash Book to another - * @param ctx Context - * @param fromCashBookId From Cash Book - * @param toCashBookId To Cash Book - * @param currencyId Currency - * @param amount Amount to transfer - * @param dateAcct Accounting Date - * @param trxName Transaction - * @throws OperationException If documents can't be created or processed - */ - public static void transferCashBookToCashBook(Properties ctx, int fromCashBookId, int toCashBookId, - int currencyId, BigDecimal amount, Timestamp dateAcct, String trxName) throws OperationException - { - MCash fromJournal = MCash.get(ctx, fromCashBookId, dateAcct, trxName); - transferFromJournalToCashBook(ctx, fromJournal, toCashBookId, currencyId, amount, dateAcct, trxName); - } - - /** - * Transfer money from a Cash Book to another - * @param ctx Context - * @param fromCashBookId From Cash Book - * @param toCashBookId To Cash Book - * @param currencyId Currency - * @param amount Amount to transfer - * @param dateAcct Accounting Date - * @param trxName Transaction - * @throws OperationException If documents can't be created or processed - */ - public static void transferFromJournalToCashBook(Properties ctx, MCash cashJournal, int toCashBookId, - int currencyId, BigDecimal amount, Timestamp dateAcct, String trxName) throws OperationException - { - MCashBook fromCashBook = new MCashBook(ctx, cashJournal.getC_CashBook_ID(), trxName); - MCashBook toCashBook = new MCashBook(ctx, toCashBookId, trxName); - - int fromBankAccountId = OrganisationManager.getCreateTransferBankAccount(ctx, fromCashBook.getAD_Org_ID(), currencyId, null); - int toBankAccountId = OrganisationManager.getCreateTransferBankAccount(ctx, toCashBook.getAD_Org_ID(), currencyId, null); - - MCash toCash = MCash.get(ctx, toCashBookId, dateAcct, trxName); - - String description = fromCashBook.getName() + " (CB) -> " + toCashBook.getName() + " (CB)"; - - // Transfers the money from the cash book to the dummy bank account - MCashLine fromCashLine = new MCashLine(cashJournal); - fromCashLine.setDescription(description); - fromCashLine.setC_Currency_ID(currencyId); - fromCashLine.setCashType(MCashLine.CASHTYPE_BankAccountTransfer); - fromCashLine.setC_BankAccount_ID(fromBankAccountId); - fromCashLine.setAmount(amount.negate()); - fromCashLine.setIsGenerated(true); - PoManager.save(fromCashLine); - - if (fromBankAccountId != toBankAccountId) - { - // Transfer the amount between the two bank accounts - transferBankToBank(ctx, fromBankAccountId, toBankAccountId, currencyId, amount, dateAcct, trxName); - } - - // Transfers the money from the dummy bank account the cash book - MCashLine toCashLine = new MCashLine(toCash); - toCashLine.setDescription(description); - toCashLine.setC_Currency_ID(currencyId); - toCashLine.setCashType(MCashLine.CASHTYPE_BankAccountTransfer); - toCashLine.setC_BankAccount_ID(toBankAccountId); - toCashLine.setAmount(amount); - toCashLine.setIsGenerated(true); - PoManager.save(toCashLine); - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ClientManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/ClientManager.java deleted file mode 100644 index 443a1cade2..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/ClientManager.java +++ /dev/null @@ -1,333 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - **/ - -/** - @author ashley - */ - -package org.posterita.businesslogic; - -import java.io.File; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MClient; -import org.compiere.model.MCountry; -import org.compiere.model.MElement; -import org.compiere.model.MLocation; -import org.compiere.model.MOrg; -import org.compiere.model.MOrgInfo; -import org.compiere.model.MPeriodControl; -import org.compiere.model.MSetup; -import org.compiere.model.PO; -import org.compiere.print.PrintUtil; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.core.businesslogic.ImportManager; -import org.posterita.exceptions.NoClientFoundException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PathInfo; -import org.posterita.util.PoManager; - -public class ClientManager -{ - public static final String ACCOUNTING_FILE_PATH = PathInfo.PROJECT_HOME - + "/config/accounting/AccountingUS.csv"; - public static final String ACCOUNTS_IMPORT_FORMAT = "Accounting - Accounts"; - - // public static String ACCOUNTS_IMPORT_TABLE = "I_ElementValue"; - - private static MClient createClient(Properties nCtx, String clientName, - String orgName, int currencyId, String currencyName, int countryId, - String city, File file) throws OperationException - { - Properties ctx = Env.getCtx(); - - Env.setContext(ctx, "#AD_User_ID", 100); // set user as SuperUser - Env.setContext(ctx, UdiConstants.CLIENT_ID_CTX_PARAM, "11"); // Garden - // World - - MCountry.get(ctx, countryId); - - MSetup setup = new MSetup(ctx, 0); - - // Step 1 - boolean ok = setup.createClient(clientName, orgName, orgName, clientName - + " Client User", clientName + " Org User", null, null, null, null, null); - - if (ok) - { - // Generate Accounting - KeyNamePair currency = new KeyNamePair(currencyId, currencyName); - - if (!setup.createAccounting(currency, true, true, false, false, - false, file)) - { - throw new OperationException("Could not create accounting for client"); - } - - // Generate Entities - if (!setup.createEntities(countryId, city, 0, currency.getKey(), null, null)) - { - throw new OperationException( - "Could not create setup entities"); - } - - // Create Print Documents - PrintUtil.setupPrintForm(setup.getAD_Client_ID()); - } - else - { - throw new OperationException("Could not create client"); - } - int clientId = setup.getAD_Client_ID(); - - MClient client = MClient.get(ctx, clientId); - - return client; - } - - protected static void updateAccountingProcessor(Properties ctx, - int adClientId, String trxName) throws OperationException - { - String updStmt = "UPDATE C_AcctProcessor set FrequencyType='M' where AD_Client_ID=" - + adClientId; - - int updates = DB.executeUpdate(updStmt, trxName); - - if (updates == -1) - throw new OperationException( - "Accounting Processor could not be updated"); - } - - public static void createClientDependencies(Properties ctx, MClient client, - MOrg org, String address, int countryId, String city, - String postalAddress, String smtpHost, File file, String trxName) - throws OperationException { - // Set client smtp host for sending emails - client.setSMTPHost(smtpHost); - // client.setIsPostImmediate(true); - // client.setIsCostImmediate(true); - PoManager.save(client); - - // Create Organisation location - MLocation location = LocationManager.createLocation(ctx, org.get_ID(), address, "", postalAddress, city, 0, countryId, trxName); - - // Create Linked Business Partner - MBPartner bpartner = BPartnerManager.createLinkedBPartner(ctx, org.get_ID(), 0, org - .getName(), " ", false, false, false, false, address, - postalAddress, city, " ", countryId, trxName); - bpartner.setAD_OrgBP_ID(org.get_ID()); - PoManager.save(bpartner); - MOrgInfo orgInfo = org.getInfo(); - orgInfo.set_TrxName(trxName); - orgInfo.setC_Location_ID(location.getC_Location_ID()); - PoManager.save(orgInfo); - - openPeriods(ctx, trxName); - - ImportManager.importFile(ctx, file, ACCOUNTS_IMPORT_FORMAT, trxName); - ImportManager.importAccounting(ctx, Env.getAD_Client_ID(ctx), - getAccoutingElementId(ctx), false, true, true, trxName); - updateAccountingProcessor(ctx, Env.getAD_Client_ID(ctx), trxName); - } - - public static MClient getCreateClient(Properties ctx, String clientName, - String orgName, int currencyId, String currencyName, int countryId, - String city, String address, String postalAddress, String smtpHost, File file) - throws OperationException - { - MClient client; - Properties rctx = (Properties) ctx.clone(); - - if (isClientPresent(clientName)) - { - int clientId = getClientId(clientName); - client = new MClient(ctx, clientId, null); - } - else - { - client = createClient(rctx, clientName, orgName, currencyId, - currencyName, countryId, city, file); - Env.setContext(rctx, UdiConstants.CLIENT_ID_CTX_PARAM, client.get_ID()); - MOrg org = OrganisationManager.getOrgByName(rctx, orgName, null); - createClientDependencies(rctx, client, org, address, countryId, - city, postalAddress, smtpHost, file, null); - } - - return client; - } - - public static Properties getCtx(Properties ctx, String clientName, - String orgName) throws OperationException - { - int clientId = ClientManager.getClientId(clientName); - - // Set AD_Client_ID in the context - Env.setContext(ctx, UdiConstants.CLIENT_ID_CTX_PARAM, clientId); - - MOrg org = OrganisationManager.getOrgByName(ctx, orgName, null); - int orgId = org.get_ID(); - Env.setContext(ctx, UdiConstants.ORG_ID_CTX_PARAM, orgId); - Env.setContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM, orgId); - - return ctx; - } - - public static Properties getCtx(Properties ctx, int clientId, int orgId) { - Env.setContext(ctx, UdiConstants.CLIENT_ID_CTX_PARAM, clientId); - Env.setContext(ctx, UdiConstants.ORG_ID_CTX_PARAM, orgId); - Env.setContext(ctx, UdiConstants.USER_ID_CTX_PARAM, 100); - - return ctx; - } - - public static void openPeriods(Properties ctx, String trxName) - throws OperationException - { - int idPCs[] = PO.getAllIDs(MPeriodControl.Table_Name, " AD_CLIENT_ID =" - + Env.getAD_Client_ID(ctx), trxName); - - for (int i = 0; i < idPCs.length; i++) - { - MPeriodControl period = new MPeriodControl(ctx, idPCs[i], trxName); - period.setPeriodStatus(MPeriodControl.PERIODSTATUS_Open); - PoManager.save(period); - - } - } - - public static MClient loadClient(Properties ctx, int clientId, - String trxName) throws OperationException - { - MClient client = new MClient(ctx, clientId, trxName); - if (client.get_ID() == 0) - { - throw new OperationException("Could not load client with id: " - - + clientId); - } - return client; - } - - public static int getAccoutingElementId(Properties ctx) - throws OperationException { - int adClientId = Env.getAD_Client_ID(ctx); - - String whereClause = "AD_Client_ID=" + adClientId; - - int elementIds[] = MElement.getAllIDs(MElement.Table_Name, whereClause, - null); - - if (elementIds.length == 0) - throw new OperationException( - "No accounting element found for client with id: " - + adClientId); - else if (elementIds.length > 1) - throw new OperationException(elementIds.length - + " account elements found for client with id: " - + adClientId); - else - return elementIds[0]; - } - - public static void changeClientName(Properties ctx, String clientName, - String trxName) throws OperationException { - if (clientName == null || clientName.trim().length() == 0) - throw new OperationException("Client Name cannot be null"); - - int adClientId = Env.getAD_Client_ID(ctx); - - MClient client = loadClient(ctx, adClientId, trxName); - - if (!client.getName().equals(clientName)) { - client.setName(clientName); - - PoManager.save(client); - } - } - - public static void cleanData(Properties ctx, boolean deleteAll) - throws OperationException { - throw new RuntimeException("This operation is no more supported"); - } - - public static int getClientId(String clientName) throws OperationException { - String sql = "select ad_client_id from ad_client where upper(name)=upper('" - + clientName + "')"; - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - ResultSet rs = null; - - int clientID = 0; - try { - rs = pstmt.executeQuery(); - while (rs.next()) { - clientID = rs.getInt(1); - } - - rs.close(); - } catch (SQLException e) { - throw new OperationException(e); - } finally { - try { - pstmt.close(); - } catch (Exception ex) { - } - - pstmt = null; - } - - if (clientID == 0) - throw new NoClientFoundException("no client found for clientName " - + clientName); - - return clientID; - } - - public static boolean isClientPresent(String clientName) - throws OperationException { - try { - getClientId(clientName); - } catch (NoClientFoundException e) { - return false; - } - - return true; - } - - /* - * Retrieve all clients in the system for which POS/Webstore transactions - * are valid - */ - public static int[] getAvailableClientIds() { - int clientIds[] = MClient.getAllIDs(MClient.Table_Name, - "IsActive='Y' and AD_Client_ID not in (0)", null); - - return clientIds; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/CurrencyManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/CurrencyManager.java deleted file mode 100644 index 80e6d828e7..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/CurrencyManager.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.businesslogic; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MCurrency; -import org.compiere.model.MPriceList; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.posterita.Constants; -import org.posterita.exceptions.OperationException; - -public class CurrencyManager -{ - - /** - * Retrieves the currency symbol for the currency ID specified - * @param currencyId Currency ID - * @return Currency Symbol - */ - public static String getCurrencySymbol(int currencyId) throws OperationException - { - MCurrency cur = new MCurrency(new Properties(), currencyId, null); - - if (cur.get_ID() == 0) - return ""; //Do not throw error here - - return cur.getCurSymbol(); - } - - public static int getCurrencyPrecision(Properties ctx) throws OperationException - { - int pricelistId = Env.getContextAsInt(ctx, Constants.PRICE_LIST); - MPriceList priceList = MPriceList.get(ctx, pricelistId, null); - - if (priceList == null) - { - throw new OperationException("Price list cannot be null!"); - } - - MCurrency mCurrency = new MCurrency(ctx, priceList.getC_Currency_ID(), null); - - return mCurrency.getCostingPrecision(); - } - - public static MCurrency getCurrency(Properties ctx) throws OperationException - { - int pricelistId = POSTerminalManager.getSOPriceListId(ctx); - MPriceList priceList = MPriceList.get(ctx, pricelistId, null); - - if (priceList == null) - { - throw new OperationException("No price list set for POS Terminal"); - } - - MCurrency mCurrency = MCurrency.get(ctx, priceList.getC_Currency_ID()); - - return mCurrency; - } - - public static ArrayList getAllCurrencies() throws OperationException - { - ArrayList knPairList = new ArrayList(); - - String sql = "Select C_Currency_ID, Description from C_Currency order by description"; - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - int currencyId = rs.getInt(1); - String currencyDescription = rs.getString(2); - - knPairList.add(new KeyNamePair(currencyId, currencyDescription)); - } - } - catch(SQLException ex) - { - throw new OperationException("Could not get currencies with sql: " + sql, ex); - } - - return knPairList; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/CustomerCart.java b/posterita/posterita/src/main/org/posterita/businesslogic/CustomerCart.java deleted file mode 100644 index c0ae6eb4c8..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/CustomerCart.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Praveen Beekoo - */ -package org.posterita.businesslogic; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.posterita.beans.CustomerBean; -import org.posterita.businesslogic.administration.CustomerManager; - -public class CustomerCart -{ - - private HashMap customers = null; - private int noOfCustomers = 0; - private Properties ctx; - - - public CustomerCart(Properties ctx) - { - this.ctx = ctx; - customers = new HashMap(); - } - - public void addCustomer(int customer_id, int qty) - { - noOfCustomers++; - - Integer previousQty = customers.get(Integer.valueOf(customer_id)); - - if(previousQty == null) - { - customers.put(Integer.valueOf(customer_id),Integer.valueOf(qty)); - } - else - { - int newQty = previousQty.intValue() + qty; - customers.put(Integer.valueOf(customer_id),Integer.valueOf(newQty)); - } - } - - public void addCustomer(int customer_id) - { - addCustomer(customer_id, 1); - } - - public void removeCustomer(int customer_id, int qty) - { - Integer oldQty = customers.get(Integer.valueOf(customer_id)); - - if( oldQty == null ) - { - return; - } - else - { - if( oldQty.intValue() <= qty ) - { - removeCustomer( customer_id ); - noOfCustomers = noOfCustomers - oldQty.intValue(); - } - else - { - int newQty = oldQty.intValue() - qty; - customers.put(Integer.valueOf(customer_id),Integer.valueOf(newQty)); - noOfCustomers = noOfCustomers - qty; - } - } - } - - public void removeCustomer(int customer_id) - { - Integer qty = customers.remove(Integer.valueOf(customer_id)); - - if( qty == null ) - { - return; - } - - noOfCustomers = noOfCustomers - qty.intValue(); - } - - public void clear() - { - customers.clear(); - noOfCustomers = 0; - } - - public int getNoOfCustomers() - { - return noOfCustomers; - } - - public ArrayList getCustomers() throws Exception - { - ArrayList customerList = new ArrayList(); - CustomerBean bean = null; - Integer customerId = null; - - Set> entrySet = customers.entrySet(); - - for (Map.Entry entry : entrySet) - { - customerId = entry.getKey(); - - bean = CustomerManager.getCustomerDetails(ctx, customerId); - - customerList.add(bean); - } - - return customerList; - } - - public Integer[] getCustomerIDs() - { - Set set = customers.keySet(); - - if( set.isEmpty() ) - { - return new Integer[]{}; - } - - Integer[] ids = new Integer[]{}; - ids = set.toArray( ids ); - - return ids; - } - - public boolean hasCustomer( int customer_id ) - { - return customers.containsKey( Integer.valueOf(customer_id) ); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/EditBulkProductFromFileManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/EditBulkProductFromFileManager.java deleted file mode 100644 index 72eb26fb45..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/EditBulkProductFromFileManager.java +++ /dev/null @@ -1,336 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Alok Pathak - */ - -package org.posterita.businesslogic; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; -import java.util.StringTokenizer; - -import org.apache.struts.upload.FormFile; -import org.posterita.beans.ItemBean; -import org.posterita.beans.ProductBean; -import org.posterita.beans.ShoppingCartBean; -import org.posterita.businesslogic.performanceanalysis.CSVReportManager; -import org.posterita.businesslogic.stock.StockManager; -import org.posterita.exceptions.BarcodeAlreadyExistsException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductAlreadyExistException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.exceptions.ProductNotOnPriceListException; - - -public class EditBulkProductFromFileManager -{ - /* @SuppressWarnings("unchecked") - public static ShoppingCartBean addToProductCart(Properties ctx,ProductBean bean, ShoppingCartBean cartBean) throws OperationException,ProductNotFoundException,ProductNotOnPriceListException - { - ArrayList oldItems; - if (cartBean == null) - { - cartBean = new ShoppingCartBean(); - oldItems = new ArrayList(); - } - else - { - oldItems = cartBean.getItems(); - } - - ArrayList oldItemsClone = (ArrayList) oldItems.clone(); - ArrayList itemsToBeAdded = getProducts(bean); - oldItems = addToItemList(oldItemsClone, itemsToBeAdded); - - cartBean.setItems(oldItems); - return cartBean; - } - - private static ArrayList getProducts(ProductBean bean) - { - ArrayList list = new ArrayList(); - - Integer [] productIds = bean.getProductIds(); - ItemBean itemBean=null; - for(int i=0;i addToItemList(ArrayList items, ArrayList itemsToBeAdded) throws ProductNotOnPriceListException, OperationException - { - Iterator iter = itemsToBeAdded.iterator(); - ItemBean itemBean; - - ItemBean foundItemBean; - while (iter.hasNext()) - { - itemBean = (ItemBean) iter.next(); - - foundItemBean = StockManager.findItem(itemBean, items); - - if (foundItemBean == null) - items.add(itemBean); - - } - - return items; - } - - public static String createCSVFile(Properties ctx, Integer[] productIds) throws OperationException - { - - ArrayList fileData = new ArrayList(); - - Object[] headers = new Object[]{ - "Product ID", - "Name", - "Barcode", - "Purchase Price", - "Marked Price", - "Discounted Price"}; - - fileData.add(headers); - - Object[] productInfo = null; - - if( productIds != null ) - { - for( int i = 0; i< productIds.length; i++) - { - int productId = productIds[i]; - - ProductBean bean= POSProductManager.viewPOSProduct(ctx,productId, null); - - productInfo = new Object[6]; - - productInfo[0] = productId; - productInfo[1]=bean.getProductName(); - - - if( bean.getBarCode() == null ) - { - productInfo[2]=""; - } - else - { - productInfo[2]=bean.getBarCode(); - } - productInfo[3]=bean.getPurchasePriceStandard(); - productInfo[4]=bean.getSalesPriceList(); - productInfo[5]=bean.getSalesPriceStandard(); - - fileData.add(productInfo); - } - } - - - return CSVReportManager.generateCSVReport(ctx, fileData); - - } - - public static String createCSVFile(Properties ctx,ArrayList cartBeanItems) throws OperationException - { - - Iterator iter = cartBeanItems.iterator(); - ItemBean itemBean=null; - - ArrayList fileData = new ArrayList(); - - Object[] headers = new Object[]{ - "Product ID", - "Name", - "Barcode", - "Purchase Price", - "Marked Price", - "Discounted Price"}; - - fileData.add(headers); - - Object[] productInfo = null; - - while(iter.hasNext()) - { - productInfo = new Object[headers.length]; - - itemBean =(ItemBean)iter.next(); - - //TODO - int productId=itemBean.getProductId(); - - ProductBean bean= POSProductManager.viewPOSProduct(ctx,productId, null); - - productInfo[0] = productId; - productInfo[1]=bean.getProductName(); - productInfo[2]=bean.getBarCode(); - productInfo[3]=bean.getPurchasePriceStandard(); - productInfo[4]=bean.getSalesPriceList(); - productInfo[5]=bean.getSalesPriceStandard(); - fileData.add(productInfo); - } - - return CSVReportManager.generateCSVReport(ctx, fileData); - - } - - public static ArrayList updateAllProducts(Properties ctx, FormFile formFile,String trxName) throws NumberFormatException, ProductAlreadyExistException,BarcodeAlreadyExistsException, OperationException - { - ArrayList list=new ArrayList(); - - InputStream is = null; - BufferedInputStream bis = null; - BufferedReader reader = null; - - try - { - is = formFile.getInputStream(); - - bis = new BufferedInputStream(is); - - reader = new BufferedReader(new InputStreamReader(bis)); - - String s = null; - ProductBean bean=null; - String productId; - String name=null; - String purchasePrice=null; - String salePriceList=null; - String salePriceStd=null; - String barCode=null; - reader.readLine(); - - while((s=reader.readLine()) != null && s.trim().length()>0) - { - StringTokenizer st = new StringTokenizer(s,","); - - bean=new ProductBean(); - - productId=st.nextToken(); - productId=productId.replaceAll("\"",""); - name=st.nextToken(); - name=name.replaceAll("\"",""); - barCode=st.nextToken(); - barCode=barCode.replaceAll("\"",""); - purchasePrice=st.nextToken(); - purchasePrice=purchasePrice.replaceAll("\"",""); - salePriceList=st.nextToken(); - salePriceList=salePriceList.replaceAll("\"",""); - salePriceStd=st.nextToken(); - salePriceStd=salePriceStd.replaceAll("\"",""); - - bean.setProductId(Integer.valueOf(productId)); - bean.setBarCode(barCode); - bean.setProductName(name); - bean.setDescription(name); - bean.setPurchasePriceStandard(purchasePrice); - bean.setSalesPriceList(salePriceList); - bean.setSalesPriceStandard(salePriceStd); - bean.setIsActive(true); - bean.setSalesPriceLimit(salePriceStd); - POSProductManager.editProduct(ctx,bean,null,trxName); - } - } - catch (FileNotFoundException e) - { - throw new OperationException(e); - } - catch (IOException e) - { - throw new OperationException(e); - } - - finally - { - if (is != null) - { - try - { - is.close(); - } - catch(Exception ex) - {} - } - - if (bis != null) - { - try - { - bis.close(); - } - catch(Exception ex) - {} - } - - if (reader != null) - { - try - { - reader.close(); - } - catch(Exception ex) - {} - } - } - - return list; - } - - public static ProductCart addToCart( Properties ctx, ProductCart cart, int productId) - { - if ( ! cart.hasProduct (productId ) ) - { - cart.addProduct( productId ); - } - - return cart; - } - - public static ArrayList getProductList(Properties ctx, Integer[] productIds) throws OperationException - { - ArrayList productList = new ArrayList(); - - if( productIds != null ) - { - for( int i = 0; i< productIds.length; i++) - { - int productId = productIds[i]; - ProductBean bean= POSProductManager.viewPOSProduct(ctx,productId, null); - productList.add( bean ); - - } - } - - return productList; - }*/ -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/FileAttachmentManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/FileAttachmentManager.java deleted file mode 100644 index 972fcafe29..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/FileAttachmentManager.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 13, 2006 by praveen - * - */ -package org.posterita.businesslogic; - -import org.posterita.businesslogic.core.AttachmentManager; - - -public class FileAttachmentManager extends AttachmentManager -{ - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/GenericStockManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/GenericStockManager.java deleted file mode 100644 index f34605faf7..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/GenericStockManager.java +++ /dev/null @@ -1,280 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 6, 2005 by alok - **/ -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; -import java.util.StringTokenizer; - -import org.compiere.model.MProduct; -import org.compiere.util.DB; -import org.compiere.util.Env; - -import org.posterita.beans.AvailableProductSizeBean; -import org.posterita.beans.GenericProductBean; -import org.posterita.beans.ItemBean; -import org.posterita.beans.ProductImageInfo; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.exceptions.OperationException; - - -public class GenericStockManager -{ - public static final String DELIMITER = "_"; - - public static ArrayList getProducts(Properties ctx, int productCategoryId) throws OperationException - { - - ArrayList products = getProductsInStock(ctx, productCategoryId); - products = setImageInfo(ctx, products); - - return products; - } - - public static ArrayList getProductsInStock(Properties ctx, int productCategoryId) throws OperationException - { - String sql = "select p.name," + - " sum(s.qtyonhand)," + - " p.m_product_id," + - " p.description" + - " from m_product p, m_storage s" + - " where p.m_product_id = s.m_product_id" + - " and p.ad_client_id = " + Env.getAD_Client_ID(ctx) + - " and p.m_product_category_id = " + productCategoryId + - " and s.qtyonhand > 0" + - " group by p.name, p.m_product_id, description" + - " order by p.name"; - - PreparedStatement pstmt = null; - - ArrayList stock = new ArrayList(); - - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - rs = pstmt.executeQuery(); - - GenericProductBean stockBean; - while(rs.next()) - { - stockBean = new GenericProductBean(); - stockBean.setName(rs.getString(1)); - stockBean.setQtyOnHand(Integer.valueOf(rs.getInt(2))); - stockBean.setProductId(Integer.valueOf(rs.getInt(3))); - stockBean.setDescription(rs.getString(4)); - - stock.add(stockBean); - } - - rs.close(); - } - catch(SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch (Exception ex) - { - throw new OperationException(ex); - } - pstmt = null; - } - return stock; - } - - public static ArrayList setImageInfo(Properties ctx, ArrayList products) - { - Iterator iter = products.iterator(); - - ProductImageInfo info; - GenericProductBean bean; - while (iter.hasNext()) - { - bean = (GenericProductBean) iter.next(); - info = ProductManager.getProductImageInfo(ctx, bean.getProductId()); - bean.setImageInfo(info); - } - - return products; - } - - public static String getSize(String productName) - { - StringTokenizer tokenizer = new StringTokenizer(productName, DELIMITER); - - String size = tokenizer.nextToken(); - - - return size; - } - - public static AvailableProductSizeBean setSize(String size, AvailableProductSizeBean bean) - { - //TODO create a new sizeType which contains Small, Medium, Large and XLarge - if (size.equalsIgnoreCase("Small")) - bean.setExistsInSmall(Boolean.valueOf(true)); - - if (size.equalsIgnoreCase("Medium")) - bean.setExistsInMedium(Boolean.valueOf(true)); - - if (size.equalsIgnoreCase("Large")) - bean.setExistsInLarge(Boolean.valueOf(true)); - - if (size.equalsIgnoreCase("XLarge")) - bean.setExistsInXLarge(Boolean.valueOf(true)); - - return bean; - } - - public static String getLikeProductQueryString(Properties ctx, String productName) - { - StringTokenizer tokenizer = new StringTokenizer(productName, DELIMITER); - String colour = tokenizer.nextToken(); - String model = tokenizer.nextToken(); - - String likeProductQueryString = "'%" + colour + "%" + model + "'"; - - return likeProductQueryString; - } - - public static AvailableProductSizeBean getAvailableSizesForProduct(Properties ctx, int productId) throws OperationException - { - ArrayList sizes = getAvailableSizes(ctx, productId); - Iterator iter = sizes.iterator(); - AvailableProductSizeBean sizeBean = new AvailableProductSizeBean(); - String size; - - while (iter.hasNext()) - { - GenericProductBean bean = (GenericProductBean) iter.next(); - size = getSize(bean.getName()); - setSize(size, sizeBean); - } - - return sizeBean; - } - - public static ArrayList getAvailableSizes(Properties ctx, int productId) throws OperationException - { - MProduct product = new MProduct(ctx, productId, null); - - String productName = product.getName(); - - String likeQuery = getLikeProductQueryString(ctx, productName); - - String sql = "select p.name," + - " sum(s.qtyonhand)," + - " p.m_product_id," + - " p.description" + - " from m_product p, m_storage s" + - " where p.m_product_id = s.m_product_id" + - " and p.ad_client_id = " + Env.getAD_Client_ID(ctx) + - " and p.name like " + likeQuery + - " and s.qtyonhand > 0" + - " group by p.name, p.m_product_id, description" + - " order by p.name"; - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - ArrayList sizes = new ArrayList(); - ResultSet rs = null; - - try - { - rs = pstmt.executeQuery(); - - GenericProductBean bean; - String name; - - while (rs.next()) - { - bean = new GenericProductBean(); - name = rs.getString(1); - bean.setName(name); - sizes.add(bean); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return sizes; - } - - - - public static int getProduct(String name, String productSize) throws OperationException - { - StringTokenizer tokenizer = new StringTokenizer(name, DELIMITER); - String colour = tokenizer.nextToken(); - String size = tokenizer.nextToken(); - String model = tokenizer.nextToken(); - - size = productSize; - String productName = colour + DELIMITER + size + DELIMITER + model; - - int productIds[] = MProduct.getAllIDs(MProduct.Table_Name, "ad_client_id=1001806" + " and name='" - + productName + "'", null); - - if (productIds.length == 0) - throw new OperationException("Product not found!"); - - if (productIds.length > 1) - throw new OperationException("More than 1 product found for " + productName); - - return productIds[0]; - } - - public static ItemBean setBean(Integer productId, BigDecimal qty) - { - ItemBean itemBean = new ItemBean(); - itemBean.setProductId(productId); - itemBean.setQty(qty); - - return itemBean; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/HistoryFilterBean.java b/posterita/posterita/src/main/org/posterita/businesslogic/HistoryFilterBean.java deleted file mode 100644 index 9f6021aa80..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/HistoryFilterBean.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 15, 2005 by praveen - * - */ -package org.posterita.businesslogic; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.TreeSet; - -import org.posterita.beans.FilterBean; -import org.posterita.beans.UDIPair; - -public class HistoryFilterBean -{ - private TreeSet bPartnerList = new TreeSet(); - private TreeSet docStatusList = new TreeSet(); - - public HistoryFilterBean(ArrayList beans) - { - - if(beans!=null) - { - Iterator iter = beans.iterator(); - - while(iter.hasNext()) - { - FilterBean bean = iter.next(); - - if(bean.getPartnerId()!=null) - { - UDIPair pair = new UDIPair(bean.getPartnerId(),bean.getPartnerName()); - bPartnerList.add(pair); - } - - if(bean.getDocStatus()!= null) - { - UDIPair docStatusPair = new UDIPair(bean.getDocStatusCode(), bean.getDocStatus()); - docStatusList.add(docStatusPair); - } - } - } - - } - - - public TreeSet getBPartnerList() - { - return bPartnerList; - } - - public TreeSet getDocStatusList() - { - return docStatusList; - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ImportPosProductManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/ImportPosProductManager.java deleted file mode 100644 index 922a8a3a7f..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/ImportPosProductManager.java +++ /dev/null @@ -1,338 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on May 16, 2006 by alok - */ - - -package org.posterita.businesslogic; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.NoSuchElementException; -import java.util.Properties; -import java.util.StringTokenizer; - -import org.apache.struts.upload.FormFile; -import org.compiere.model.MStorage; -import org.compiere.model.MTax; -import org.compiere.model.MTransaction; -import org.compiere.model.MUOM; -import org.compiere.model.MWarehouse; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.posterita.beans.ProductBean; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.businesslogic.stock.StockManager; -import org.posterita.core.RandomStringGenerator; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.BarcodeAlreadyExistsException; -import org.posterita.exceptions.DuplicateUOMException; -import org.posterita.exceptions.ImportProductException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductAlreadyExistException; -import org.posterita.exceptions.ProductNotImportedException; -import org.posterita.exceptions.TaxRateNotDefineException; -import org.posterita.exceptions.UOMNotFoundException; -import org.posterita.exceptions.UOMValuePrecisionNotValidException; -import org.posterita.formatter.BigDecimalFormatter; -import org.posterita.util.PoManager; - - -public class ImportPosProductManager -{ - - public static ArrayList importSingleProducts(Properties ctx, FormFile formFile, int salesPriceListId, int purchasePriceListId, String trxName) throws NumberFormatException, ProductAlreadyExistException,BarcodeAlreadyExistsException, OperationException - { - ProductBean pbean = new ProductBean(); - ArrayList list=new ArrayList(); - InputStream is = null; - BufferedInputStream bis = null; - BufferedReader reader = null; - - int orgId = 0; //Import all products under org * so that it may be accessible to all orgs - StringBuffer csv = new StringBuffer(); - StringBuffer importProductEx = new StringBuffer(); - try - { - is = formFile.getInputStream(); - - bis = new BufferedInputStream(is); - - reader = new BufferedReader(new InputStreamReader(bis)); - - String s = null; - ProductBean bean=null; - String revenueRecognition=null; - String name=null; - String description= null; - String uom= null; - String purchasePrice=null; - String salePriceList=null; - String salePriceStd=null; - String salePriceLimit=null; - String barCode=null; - String taxRate=null; - String qty=null; - - Integer uomId = null; - Integer lineNumber = 1; //Skip Header in Import File - ArrayList uomErrorList = new ArrayList(); - BigDecimal qtyDB = new BigDecimal(0); - - boolean isProductImported = true; - String filename = ""; - String header = reader.readLine(); - - csv.append(header).append("\n"); - while((s=reader.readLine())!=null && s.trim().length()>0) - { - lineNumber++; - - StringTokenizer st = new StringTokenizer(s,","); - - bean=new ProductBean(); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - try - { - trx.start(); - try - { - revenueRecognition=st.nextToken(); - revenueRecognition=revenueRecognition.replaceAll("\"",""); - barCode=st.nextToken(); - barCode=barCode.replaceAll("\"",""); - name=st.nextToken(); - name=name.replaceAll("\"",""); - description=st.nextToken(); - description=description.replaceAll("\"",""); - uom=st.nextToken(); - uom=uom.replaceAll("\"",""); - purchasePrice=st.nextToken(); - purchasePrice=purchasePrice.replaceAll("\"",""); - salePriceList=st.nextToken(); - salePriceList=salePriceList.replaceAll("\"",""); - salePriceStd=st.nextToken(); - salePriceStd=salePriceStd.replaceAll("\"",""); - salePriceLimit=st.nextToken(); - salePriceLimit=salePriceLimit.replaceAll("\"",""); - taxRate=st.nextToken(); - taxRate=taxRate.replaceAll("\"",""); - qty=st.nextToken(); - qty=qty.replaceAll("\"",""); - - } - catch (NoSuchElementException e) - { - // TODO: handle exception - throw new ImportProductException("An error occurred while passing the data in the file."); - } - - if ((uom != null) || (uom != "")) - { - int[] uomIds = MUOM.getAllIDs(MUOM.Table_Name, "UPPER(name)='" + uom.toUpperCase() + "'" + "AND isActive = 'Y' AND AD_CLient_ID IN (0," + Env.getAD_Client_ID(ctx) +")", trxName); - - if (uomIds.length == 0) - throw new UOMNotFoundException("UOM '" + uom + "' does not exist. "); - else - if (uomIds.length > 1) - throw new DuplicateUOMException("Duplicate UOM name found - " + uom + ". Please make sure that the name is unique as it is not case sensitive."); - - MUOM muom = MUOM.get(ctx, uomIds[0]); - - int uomPrecision = MUOM.getPrecision(ctx, muom.getC_UOM_ID()); - uomId = muom.get_ID(); - qtyDB = new BigDecimal(qty); - - int enteredPrecision = StockManager.getQtyPrecision(qtyDB); - - if (enteredPrecision > uomPrecision) - throw new UOMValuePrecisionNotValidException("The precision entered for the quantity field of the product: '"+ name - + "' should not be greater than '" + uomPrecision); - } - - String whereClause=" AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and RATE="+taxRate; - int taxId []= MTax.getAllIDs(MTax.Table_Name,whereClause,trxName); - if(taxId.length==0) - throw new TaxRateNotDefineException(", the tax rate in the file ="+taxRate+" does not exist
"); - - MTax tax = new MTax(ctx,taxId[0],trxName); - - bean.setRevenueRecognition(revenueRecognition); - bean.setBarCode(barCode); - bean.setProductName(name); - bean.setIsActive(true); - bean.setDescription(description); - bean.setUomId(uomId); - bean.setPurchasePriceStandard(purchasePrice); - bean.setSalesPriceList(salePriceList); - bean.setSalesPriceStandard(salePriceStd); - bean.setSalesPriceLimit(salePriceLimit); - bean.setTaxCategoryId(tax.getC_TaxCategory_ID()); - bean.setOrgId(orgId); - - int productId = ProductManager.getSimilarProduct(ctx,name,trxName); - if (productId == 0) - { - pbean=POSProductManager.createSinglePOSProductForImport(ctx,bean,qtyDB,trxName); - productId = pbean.getProductId(); - } - else - { - pbean = POSProductManager.viewPOSProduct(ctx, productId, trxName); - } - BigDecimalFormatter formatter = new BigDecimalFormatter(); - BigDecimal salesPriceStd = (BigDecimal)formatter.unformat(salePriceStd); - BigDecimal salesPriceList = (BigDecimal)formatter.unformat(salePriceList); - BigDecimal salesPriceLimit = (BigDecimal)formatter.unformat(salePriceLimit); - - BigDecimal purchasePriceStd = (BigDecimal)formatter.unformat(purchasePrice); - PriceListManager.updatePriceLists(ctx, productId, salesPriceListId, salesPriceStd, - salesPriceList, salesPriceLimit, trx.getTrxName()); - PriceListManager.updatePriceLists(ctx, productId, purchasePriceListId, purchasePriceStd, - Env.ZERO, Env.ZERO, trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - importProductEx = importProductEx.append("
Product "+ name + " at line " + lineNumber + " not imported. ").append(e.getMessage()); - isProductImported = false; - csv.append(s).append("\"\n"); - } - finally - { - trx.close(); - } - list.add(pbean); - - } - if (!isProductImported) - { - filename = RandomStringGenerator.randomstring() + ".csv"; - String filepath = ReportManager.getReportPath(filename); - try - { - FileWriter writer = new FileWriter(filepath); - writer.write(csv.toString()); - writer.flush(); - writer.close(); - } - catch (IOException e1) - { - throw new OperationException(e1); - } - throw new ProductNotImportedException(filename+importProductEx.toString()); - } - } - catch (FileNotFoundException e) - { - e.printStackTrace(); - } - catch (IOException e) - { - e.printStackTrace(); - } - finally - { - if (is != null) - { - try - { - is.close(); - } - catch(Exception ex) - {} - } - - if (bis != null) - { - try - { - bis.close(); - } - catch(Exception ex) - {} - } - - if (reader != null) - { - try - { - reader.close(); - } - catch(Exception ex) - {} - } - } - return list; - } - - public static void importStockMStorage(Properties ctx,int m_product_id,BigDecimal qty,String trxName) throws OperationException - { - - int warehouseId=POSTerminalManager.getWarehouse(ctx).get_ID(); - - if (warehouseId==0) - throw new OperationException("no warehouse for this org"); - - MWarehouse warehouse = new MWarehouse(ctx,warehouseId,null); - int locatorId = warehouse.getDefaultLocator().get_ID(); - - MStorage st = MStorage.getCreate(ctx, locatorId, m_product_id, 0, trxName); - st.setQtyOnHand(st.getQtyOnHand().add(qty)); - st.setQtyReserved(new BigDecimal(0)); - st.setQtyOrdered(new BigDecimal(0)); - - PoManager.save(st); - - } - - public static void importStockMTransaction(Properties ctx,int m_product_id,BigDecimal qty, String trxName) throws OperationException - { - - int warehouseId=POSTerminalManager.getWarehouse(ctx).get_ID(); - - if (warehouseId==0) - throw new OperationException("no warehouse for this org"); - - MWarehouse warehouse = new MWarehouse(ctx,warehouseId,null); - - MTransaction trans = new MTransaction(ctx,0,trxName); - - trans.setM_Product_ID(m_product_id); - trans.setM_Locator_ID(warehouse.getDefaultLocator().get_ID()); - trans.setMovementQty(qty); - trans.setMovementType(MTransaction.MOVEMENTTYPE_InventoryIn); - trans.setMovementDate(new Timestamp(System.currentTimeMillis())); - - PoManager.save(trans); - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/InvoiceManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/InvoiceManager.java deleted file mode 100644 index d3995d488a..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/InvoiceManager.java +++ /dev/null @@ -1,1124 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 05-Jul-2005 by alok - * - */ -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MCharge; -import org.compiere.model.MClient; -import org.compiere.model.MCurrency; -import org.compiere.model.MDocType; -import org.compiere.model.MInOut; -import org.compiere.model.MInvoice; -import org.compiere.model.MInvoiceLine; -import org.compiere.model.MLocation; -import org.compiere.model.MOrder; -import org.compiere.model.MOrderLine; -import org.compiere.model.MOrg; -import org.compiere.model.MPInstance; -import org.compiere.model.MPInstancePara; -import org.compiere.model.MProcess; -import org.compiere.model.MProduct; -import org.compiere.model.MTax; -import org.compiere.print.ReportEngine; -import org.compiere.process.DocumentEngine; -import org.compiere.process.InvoiceGenerate; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.AttributeValuesPair; -import org.posterita.beans.CommandBean; -import org.posterita.beans.InvoiceHistoryBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.beans.WebDocumentHeaderBean; -import org.posterita.beans.WebInvoiceLineBean; -import org.posterita.beans.WebOrderLineBean; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.businesslogic.core.ChargeManager; -import org.posterita.core.UDIMap; -import org.posterita.exceptions.DataException; -import org.posterita.exceptions.NoOrderLineSelectedException; -import org.posterita.exceptions.OperationException; -import org.posterita.formatter.PrintFormatter; -import org.posterita.order.UDIOrderTypes; -import org.posterita.util.PoManager; - -public class InvoiceManager extends AbstractDocumentManager -{ - - private static final String CUSTOMER_INVOICE = "Customer Invoice"; - private static final String VENDOR_INVOICE = "Vendor Invoice"; - - public static MInvoice createCustomerInvoice(Properties ctx, int salesOrderId, String trxName) throws OperationException - { - MOrder so = new MOrder(ctx, salesOrderId, trxName); - - MOrderLine lines[] = so.getLines(); - - Integer soLinesIds[] = new Integer[lines.length]; - - if (soLinesIds.length == 0) - throw new NoOrderLineSelectedException("No order line selected"); - - MInvoice returnInvoice = null; - - for (int i = 0; i list = new ArrayList(); - - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - ResultSet rs = null; - - try - { - rs = pstmt.executeQuery(); - InvoiceHistoryBean bean; - while(rs.next()) - { - bean = new InvoiceHistoryBean(); - bean.setInvoiceId(Integer.valueOf(rs.getInt(1))); - bean.setPartnerName(rs.getString(2)); - bean.setPartnerId(Integer.valueOf(rs.getInt(3))); - bean.setDocumentNo(rs.getString(4)); - bean.setDocStatus(UDIMap.docStatusMap.get(rs.getString(5))); - bean.setDocStatusCode(rs.getString(5)); - bean.setOrderId(Integer.valueOf(rs.getInt(6))); - bean.setDateInvoiced(rs.getTimestamp(7)); - bean.setGrandTotal(Integer.valueOf(rs.getInt(8))); - bean.setIsPaid(rs.getString(9)); - list.add(bean); - - } - - rs.close(); - } - catch (SQLException e) - { - throw new SQLException(); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return list; - - } - - public static ArrayList viewInvoice(Properties ctx, Integer invoiceId) throws OperationException - { - if (invoiceId.intValue() == 0) - throw new OperationException("cannot view invoice with id 0"); - - MInvoice invoice = new MInvoice(ctx, invoiceId.intValue(), null); - - if (invoice.get_ID() == 0) - throw new OperationException("cannot view invoice with id 0"); - - ArrayList invoiceLines = retrieveInvoiceLineValues(ctx, invoice.getLines()); - - return invoiceLines; - - } - public static ArrayList retrieveInvoiceLineValues(Properties ctx, MInvoiceLine[] lines) throws OperationException - { - MInvoiceLine line; - MProduct product; - AttributeValuesPair attributeValuesPair; - WebInvoiceLineBean invoiceLinebean; - ArrayList invoiceLines = new ArrayList(); - for (int i = 0; i < lines.length; i++) - { - line = lines[i]; - product = new MProduct(ctx, line.getM_Product_ID(), null); - attributeValuesPair = AttributeValuesManager.retrieveAttributeValues(ctx, product.getM_AttributeSetInstance_ID()); - invoiceLinebean = new WebInvoiceLineBean(); - invoiceLinebean.setAttributeValuesPair(attributeValuesPair); - invoiceLinebean.setSerno(OrderReferenceManager.getSerno(ctx, line.getM_AttributeSetInstance_ID())); - invoiceLinebean.setLineNetAmt(line.getLineNetAmt()); - invoiceLinebean.setLineTotalAmt(line.getLineTotalAmt()); - invoiceLinebean.setTaxAmt(line.getTaxAmt()); - invoiceLines.add(invoiceLinebean); - } - - return invoiceLines; - - } - - public static WebDocumentBean getWebInvoiceBean(MInvoice invoice) throws OperationException, DataException - { - if (invoice == null) - throw new OperationException("Invalid operation invoice is null"); - - if (invoice.get_ID() == 0) - throw new OperationException("You have deleted this invoice. You cannot view this invoice."); - - WebDocumentBean bean = new WebDocumentBean(); - - bean.setInvoiceId(Integer.valueOf(invoice.get_ID())); - - Properties ctx = invoice.getCtx(); - - MOrg myOrg = OrganisationManager.getMyOrg(ctx); - MBPartner me = new MBPartner(ctx, myOrg.getLinkedC_BPartner_ID(null), null); - bean.setMe(me); - - // MOrg orderOrg = new MOrg(ctx, invoice.getAD_Org_ID(), null); - - int currencyId = invoice.getC_Currency_ID(); - MCurrency currency = new MCurrency(ctx,currencyId,null); - bean.setCurrencySymbole(currency.getCurSymbol()); - - - /*if (orderOrg.getLinkedC_BPartner_ID() != myOrg.getLinkedC_BPartner_ID()) - throw new DocumentDoesNotBelongToYouException("This invoice does not belong to you. You do not have access to it."); - */ - MBPartnerLocation meLocation[] = MBPartnerLocation.getForBPartner(ctx,me.get_ID()); - if (meLocation.length ==0) - throw new OperationException("No location has been set for your organisation. Please ask your administrator to set one for you"); - - - MLocation location = new MLocation(ctx, meLocation[0].getC_Location_ID(), null); - - if (meLocation == null) - throw new OperationException("You must have a location set for your business partner, Please ask your administrator to set one for you"); - - bean.setMeLocation(location); - - MBPartner you = new MBPartner(ctx, invoice.getC_BPartner_ID(), null); - bean.setYou(you); - - MBPartnerLocation youBPLocation[] = MBPartnerLocation.getForBPartner(ctx,you.get_ID()); - MLocation youLocation = new MLocation(ctx, youBPLocation[0].getC_Location_ID(), null); - - bean.setYoubpLocation(youBPLocation[0]); - bean.setYouLocation(youLocation); - - ArrayList lines = populateInvoiceLines(ctx , invoice.getLines()); - bean.setLines(lines); - bean = calculateInvoiceTotals(lines, bean); - - - WebDocumentHeaderBean headerBean = createWebDocumentHeader(ctx, invoice.getAD_Org_ID(), invoice.getC_BPartner_ID(), invoice.getDocStatus(), invoice.isSOTrx(),invoice.getPaymentRule()); - headerBean.setDocumentHeader(getDocumentHeader(invoice)); - - - int invoiceId = invoice.get_ID(); - - int[] shipmentIds = MInOut.getAllIDs(MInOut.Table_Name, "c_invoice_id=" + invoiceId, null); - - if (shipmentIds.length == 0) - headerBean.setShipped("No"); - else - headerBean.setShipped("Yes"); - - bean.setHeaderBean(headerBean); - - bean.setInvoice(invoice); - - MOrder order = new MOrder(ctx, invoice.getC_Order_ID(), null); - bean.setOrder(order); - - CommandBean cmdBean = new CommandBean(); - if (!invoice.isSOTrx()) - cmdBean = getVendorInvoiceWebCommands(invoice); - else - cmdBean = getCustomerInvoiceWebCommands(invoice); - - bean.setSimpleCommand(cmdBean.getSimpleCommand()); - bean.setComplexCommand(cmdBean.getComplexCommand()); - - - return bean; - } - - public static String getDocumentHeader(MInvoice invoice) - { - if (invoice.isSOTrx()) - return CUSTOMER_INVOICE; - - return VENDOR_INVOICE; - } - - - private static WebDocumentBean calculateInvoiceTotals(ArrayList webOrderLineList, WebDocumentBean webInvoiceLineBean) - { - Iterator iter = webOrderLineList.iterator(); - - WebInvoiceLineBean bean; - - BigDecimal totalLines = new BigDecimal(0); - BigDecimal totalTax = new BigDecimal(0); - BigDecimal grandTotal; - - BigDecimal roundedTotalLines; - BigDecimal roundedTotalTax; - BigDecimal roundedGrandTotal; - while(iter.hasNext()) - { - bean = (WebInvoiceLineBean) iter.next(); - totalLines = totalLines.add(bean.getLineNetAmt()); - totalTax = totalTax.add(bean.getTaxAmt()); - } - - grandTotal = totalLines.add(totalTax); - - - roundedTotalLines = round(totalLines, 2); - roundedTotalTax = round(totalTax, 2); - - roundedGrandTotal = round(grandTotal, 2); - - webInvoiceLineBean.setTotalLines(roundedTotalLines); - webInvoiceLineBean.setTotalTax(roundedTotalTax); - webInvoiceLineBean.setGrandTotal(roundedGrandTotal); - - return webInvoiceLineBean; - } - private static BigDecimal round(BigDecimal number, int decimalPlaces) - { - BigDecimal roundedNumber = number.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP); - - return roundedNumber; - } - - private static ArrayList populateInvoiceLines(Properties ctx, MInvoiceLine[] lines) throws OperationException - { - MInvoiceLine line; - MProduct product; - AttributeValuesPair attributeValuesPair; - ArrayList invoiceLines = new ArrayList(); - for (int i = 0; i < lines.length; i++) - { - line = lines[i]; - product = new MProduct(ctx, line.getM_Product_ID(), null); - attributeValuesPair = AttributeValuesManager.retrieveAttributeValues(ctx, product.getM_AttributeSetInstance_ID()); - WebInvoiceLineBean invoiceLineBean = new WebInvoiceLineBean(); - invoiceLineBean.setAttributeValuesPair(attributeValuesPair); - - BigDecimal roundedLineNetAmount = round(line.getLineNetAmt(), 2); - - //line tax amount - BigDecimal lineTaxAmount = getLineTaxAmt(line.getCtx(), line.getLineNetAmt(), line.getC_Tax_ID(), line.get_ID()); - BigDecimal roundedTaxAmount = round(lineTaxAmount, 2); - invoiceLineBean.setTaxAmt(roundedTaxAmount); - - - //lineTotalAmount = lineNetAmount + lineTaxAmount - BigDecimal lineTotalAmount = line.getLineNetAmt().add(lineTaxAmount); - BigDecimal roundedLineTotalAmount = round(lineTotalAmount, 2); - - invoiceLineBean.setLineTotalAmt(roundedLineTotalAmount); - invoiceLineBean.setQtyOrdered(line.getQtyEntered()); - - invoiceLineBean.setLineNetAmt(roundedLineNetAmount); - invoiceLineBean.setPriceActual(line.getPriceActual()); - - invoiceLineBean.setProductId(Integer.valueOf(line.getM_Product_ID())); - invoiceLineBean.setOrderLineId(Integer.valueOf(line.get_ID())); - - invoiceLineBean.setSerno(getSerno(ctx, line.getM_AttributeSetInstance_ID())); - - if(line.getM_Product_ID() == 0) - { - if(line.getC_Charge_ID() != 0) - { - MCharge charge = ChargeManager.loadCharge(ctx, line.getC_Charge_ID(), null); - invoiceLineBean.setDescription(charge.getName()); - } - else - invoiceLineBean.setDescription("Adjustment product"); - } - else - invoiceLineBean.setDescription(ProductManager.getProductName(ctx, line.getM_Product_ID())); - invoiceLines.add(invoiceLineBean); - } - - return invoiceLines; - } - - private static CommandBean getVendorInvoiceWebCommands(MInvoice invoice) throws OperationException - { - - if (invoice.isSOTrx()) - throw new OperationException("Invoice should be a vendor Invoice"); - - - String[] simpleCommands = new String[0]; - String[] complexCommands = new String[0]; - - CommandBean bean = new CommandBean(); - bean.setSimpleCommand(simpleCommands); - bean.setComplexCommand(complexCommands); - return bean; - } - - private static CommandBean getCustomerInvoiceWebCommands(MInvoice invoice) throws OperationException, DataException - { - - if (!invoice.isSOTrx()) - throw new OperationException("Invoice should be a customer invoice"); - - - String[] simpleCommands = null; - String[] complexCommands = null; - - CommandBean bean = new CommandBean(); - - if (invoice.getDocStatus().equals(DocumentEngine.STATUS_Drafted)) - { - simpleCommands = new String[]{Constants.INVOICE_ACTION_COMPLETE}; - complexCommands = new String[]{Constants.INVOICE_ACTION_CANCEL}; - } - - if (invoice.getDocStatus().equals(DocumentEngine.STATUS_Voided)) - { - complexCommands = new String[]{Constants.INVOICE_ACTION_DELETE}; - } - - if (invoice.getDocStatus().equals(DocumentEngine.STATUS_Completed)) - { - bean = getCIWebCommands(invoice); - return bean; - } - - - bean.setSimpleCommand(simpleCommands); - bean.setComplexCommand(complexCommands); - return bean; - } - - public static CommandBean getCIWebCommands(MInvoice invoice) throws OperationException, DataException - { - MOrder order = new MOrder(invoice.getCtx(), invoice.getC_Order_ID(), null); - - int[] docTypes = MDocType.getAllIDs(MDocType.Table_Name, " ad_client_id="+ Env.getAD_Client_ID(invoice.getCtx()) + " and DOCSUBTYPESO='" + MDocType.DOCSUBTYPESO_POSOrder+ "'", null ); - - String simpleCommands[] = null; - String complexCommands[] = null; - - //POS order - if (order.getC_DocType_ID() == docTypes[0]) - { - simpleCommands = new String[]{}; - complexCommands = new String[]{}; - } - - if (invoice.isPaid() && (!MinOutManager.isShipped(invoice.getCtx(), invoice))) - { - int[] shipmentIds = MInOut.getAllIDs(MInOut.Table_Name, "c_invoice_id=" + invoice.get_ID(), null); - - if (shipmentIds.length == 0) - simpleCommands = new String[]{Constants.MINOUT_ACTION_SHIP}; - else - if (shipmentIds.length > 1) - throw new DataException("This invoice has been shipped more than once!"); - - } - if (!invoice.isPaid() && (!MinOutManager.isShipped(invoice.getCtx(), invoice))) - { - simpleCommands = new String[] {Constants.INVOICE_ACTION_PAID, Constants.INVOICE_ACTION_PAID_AND_SHIP}; - } - - CommandBean bean = new CommandBean(); - bean.setSimpleCommand(simpleCommands); - bean.setComplexCommand(complexCommands); - - return bean; - } - - public static MInvoice deleteInvoice(Properties ctx, MInvoice invoice) throws OperationException - { - invoice.setIsActive(false); - PoManager.save(invoice); - - return invoice; - } - - public static boolean allOrderLinesInvoiced(Properties ctx, MOrder order) - { - MOrderLine[] lines = order.getLines(); - - MOrderLine line; - for (int i = 0; i < lines.length; i ++) - { - line = lines[i]; - - if (!line.getQtyInvoiced().equals(line.getQtyOrdered())) - return false; - - } - - return true; - } - - public static MInvoice voidInvoice(Properties ctx, MInvoice invoice) throws OperationException - { - - if (!invoice.isSOTrx()) - throw new OperationException("Only voiding of customer invoice is currently supported."); - - if (!invoice.getDocStatus().equals(DocumentEngine.STATUS_Drafted)) - throw new OperationException("The system only supports voiding of DRAFTED Invoice."); - - //we need to force void here because invoice has already been processed - //invoice.isProcessed=true - forceVoid(ctx, invoice); - - invoice = new MInvoice(ctx, invoice.get_ID(), invoice.get_TrxName()); - - return invoice; - } - - public static void forceVoid(Properties ctx, MInvoice invoice) throws OperationException - { - PreparedStatement pstmt1 = null; - PreparedStatement pstmt2 = null; - - String sql = "UPDATE C_Invoice SET DOCSTATUS=" + "'" - + DocumentEngine.STATUS_Voided + "'" - + " WHERE AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " AND C_INVOICE_ID=" + invoice.get_ID(); - - String sql2 = "UPDATE C_Invoice SET DOCACTION=" + "'" - + DocumentEngine.ACTION_None + "'" - + " WHERE AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " AND C_INVOICE_ID=" + invoice.get_ID(); - - pstmt1 = DB.prepareStatement(sql,invoice.get_TrxName()); - pstmt2 = DB.prepareStatement(sql2,invoice.get_TrxName()); - - try - { - pstmt1.executeUpdate(); - pstmt2.executeUpdate(); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - finally - { - try - { - pstmt1.close(); - pstmt2.close(); - } - catch (Exception e) - {} - - pstmt1 = null; - pstmt2 = null; - } - - } - - public static int[] getInvoiceIdsForOrder(Properties ctx, int orderId, String trxName) - { - String whereClause = "isACTIVE='Y' and C_Order_ID=" + orderId; - int invoiceIds[] = MInvoice.getAllIDs(MInvoice.Table_Name, whereClause, trxName); - return invoiceIds; - } - - public static MInvoice loadInvoice(Properties ctx, int invoiceId, String trxName) throws OperationException - { - MInvoice invoice = new MInvoice(ctx, invoiceId, trxName); - if(invoice.get_ID() == 0) - throw new OperationException("Could not load invoice with id: " + invoiceId); - - return invoice; - } - public static ArrayList populateInvoiceLines(Properties ctx, MInvoice invoice,boolean abbr) throws OperationException - { - MInvoiceLine [] lines=invoice.getLines(); - MInvoiceLine line; - MProduct product; - // AttributeValuesPair attributeValuesPair; - WebOrderLineBean orderLineBean; - BigDecimal qty = Env.ZERO; - - - ArrayList orderLines = new ArrayList(); - for (int i = 0; i < lines.length; i++) - { - line = lines[i]; - - product = new MProduct(ctx, line.getM_Product_ID(), null); - - int priceScale = line.getLineNetAmt().scale(); - - orderLineBean = new WebOrderLineBean(); - orderLineBean.setLineNetAmt(line.getLineNetAmt()); - BigDecimal lineTaxAmount = POSManager.getLineTaxAmt(line.getCtx(), line.getLineNetAmt(), line.getC_Tax_ID(),line.getQtyEntered()); - lineTaxAmount = lineTaxAmount.setScale(priceScale, RoundingMode.HALF_UP); - orderLineBean.setTaxAmt(lineTaxAmount); - BigDecimal lineTotalAmount = line.getLineNetAmt().add(orderLineBean.getTaxAmt()); - lineTotalAmount = lineTotalAmount.setScale(priceScale, RoundingMode.HALF_UP); - orderLineBean.setLineTotalAmt(lineTotalAmount); - - orderLineBean.setProductId(Integer.valueOf(line.getM_Product_ID())); - - - if (line.getM_Product_ID() == 0) - { - if(line.getC_Charge_ID() != 0) - { - MCharge charge = ChargeManager.loadCharge(ctx, line.getC_Charge_ID(), null); - orderLineBean.setProductName(charge.getName()); - } - else - throw new OperationException("Unknown Order line type with id: " + line.get_ID()); - } - else - { - if(abbr) - orderLineBean.setProductName(new PrintFormatter().format(product).toString()); - else - orderLineBean.setProductName(product.getName().replaceAll("~"," ")); - orderLineBean.setDescription(product.getDescription()); - } - - orderLineBean.setOrderLineId(Integer.valueOf(line.get_ID())); - orderLineBean.setIsinvoiced(Boolean.valueOf(false)); - orderLineBean.setIsQtyReserved(Boolean.valueOf(true)); - qty= qty.add(line.getQtyEntered()); - orderLineBean.setQtyTotal(qty); - - orderLineBean.setQtyOrdered(line.getQtyEntered()); - orderLineBean.setGrandTotal(invoice.getGrandTotal()); - - - - - orderLines.add(orderLineBean); - - } - - return orderLines; - } - - public static void printInvoice(Properties ctx,MInvoice invoice) throws OperationException - { - PrintManager.print(ctx,ReportEngine.INVOICE,invoice.get_ID()); - } - - /** - * - * @param ctx - * @param dateInvoiced - * @param orgId - * @param bPartnerId - * @param orderId - * @param consolidateDoc - * @param docAction - * @param trx - * @throws InstantiationException - * @throws IllegalAccessException - * @throws ClassNotFoundException - */ - public static void generateInvoices(Properties ctx, Timestamp dateInvoiced, int orgId, - int bPartnerId, int orderId, boolean isConsolidateDoc, String docAction, Trx trx) - throws InstantiationException, IllegalAccessException, ClassNotFoundException - { - String trxName = trx.getTrxName(); - int processId = MProcess.getProcess_ID("C_Invoice_Generate", trxName); - MProcess process = new MProcess(ctx, processId, trxName); - - MPInstance processInstance = new MPInstance(ctx, processId, 0); - processInstance.save(trxName); - - MPInstancePara paramDateInvoiced = new MPInstancePara(processInstance, 10); - paramDateInvoiced.setParameterName("DateInvoiced"); - paramDateInvoiced.setP_Date(dateInvoiced); - paramDateInvoiced.save(trxName); - - MPInstancePara paramOrgId = new MPInstancePara(processInstance, 20); - paramOrgId.setParameterName("AD_Org_ID"); - paramOrgId.setP_Number(orgId); - paramOrgId.save(trxName); - - MPInstancePara paramBPartnerId = new MPInstancePara(processInstance, 30); - paramBPartnerId.setParameterName("C_BPartner_ID"); - paramBPartnerId.setP_Number(bPartnerId); - paramBPartnerId.save(trxName); - - MPInstancePara paramOrderId = new MPInstancePara(processInstance, 40); - paramOrderId.setParameterName("C_Order_ID"); - paramOrderId.setP_Number(orderId); - paramOrderId.save(trxName); - - MPInstancePara paramConsolidateDoc = new MPInstancePara(processInstance, 50); - paramConsolidateDoc.setParameterName("ConsolidateDocument"); - paramConsolidateDoc.setP_String(isConsolidateDoc?"Y":"N"); - paramConsolidateDoc.save(trxName); - - MPInstancePara paramDocAction = new MPInstancePara(processInstance, 60); - paramDocAction.setParameterName("DocAction"); - paramDocAction.setP_String(docAction); - paramDocAction.save(trxName); - - ProcessInfo pi = new ProcessInfo(process.getDescription(), processId); - ProcessInfoParameter piDateInvoiced = new ProcessInfoParameter("DateInvoiced", dateInvoiced, null, null, null); - ProcessInfoParameter piOrgId = new ProcessInfoParameter("AD_Org_ID", orgId, null, null, null); - ProcessInfoParameter piBPartnerId = new ProcessInfoParameter("C_BPartner_ID", bPartnerId, null, null, null); - ProcessInfoParameter piOrderId = new ProcessInfoParameter("C_Order_ID", orderId, null, null, null); - ProcessInfoParameter piConsolidateDoc = new ProcessInfoParameter("ConsolidateDocument", isConsolidateDoc?"Y":"N", null, null, null); - ProcessInfoParameter piDocAction = new ProcessInfoParameter("DocAction", docAction, null, null, null); - - ProcessInfoParameter[] piParameters = new ProcessInfoParameter[]{piDateInvoiced, piOrgId, piBPartnerId, piOrderId, piConsolidateDoc, piDocAction}; - pi.setParameter(piParameters); - pi.setAD_PInstance_ID(processInstance.getAD_PInstance_ID()); - pi.setAD_Process_ID(processInstance.getAD_Process_ID()); - - ProcessManager.startProcess(ctx, InvoiceGenerate.class.getName(), pi, trx); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/LocationManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/LocationManager.java deleted file mode 100644 index e348fefa1b..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/LocationManager.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 22-Jul-2005 by alok - * - */ -package org.posterita.businesslogic; - -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MLocation; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - - -public class LocationManager -{ - - - public static MLocation saveLocation(Properties ctx, int orgId, int locationId, String address1,String address2, String postalAddress1, Integer regionId, String city,int countryId, String trxName) throws OperationException - { - MLocation location = null; - - if (locationId == 0) - location = new MLocation(ctx,locationId,trxName); - else - location = loadLocation(ctx, locationId, trxName); - - location.setAddress1(address1); - location.setAddress2(address2); - location.setCity(city); - location.setPostal_Add(postalAddress1); - location.setC_Country_ID(countryId); - location.setAD_Org_ID(orgId); - PoManager.save(location); - - return location; - } - - - public static MLocation createLocation(Properties ctx, int orgId, String address1,String address2, String postalAddress1, String city,int regionId, int countryId, String trxName) throws OperationException - { - MLocation location = new MLocation(ctx,0,trxName); - location.setAD_Org_ID(orgId); - location.setAddress1(address1); - location.setAddress2(address2); - location.setCity(city); - location.setPostal_Add(postalAddress1); - location.setC_Region_ID(regionId); - location.setC_Country_ID(countryId); - PoManager.save(location); - - return location; - } - - public static MLocation editLocation(Properties ctx,int locationId,String address1,String postalAddress1, Integer regionId, String city, String trxName) throws OperationException - { - - if(locationId<=0) - throw new OperationException("Location does not exist"); - - MLocation location; - - try - { - location = new MLocation(ctx,locationId,trxName); - - if(location==null) - throw new OperationException("Location does not exist"); - - - location.setAddress1(address1); - location.setCity(city); - location.setPostal_Add(postalAddress1); - - if(regionId!=null) - location.setC_Region_ID(regionId); - - PoManager.save(location); - - } - catch(OperationException e) - { - throw new OperationException("Could not edit location!!"); - } - - - return location; - - } - - public static MBPartnerLocation createDefaultBPLocation(Properties ctx, MBPartner bpartner) throws OperationException - { - MLocation location = LocationManager.createLocation(ctx, bpartner.getAD_Org_ID(), "","","", "",0, UdiConstants.COUNTRY_MAURITIUS, null); - - - MBPartnerLocation bplocation = new MBPartnerLocation(bpartner); - bplocation.setC_Location_ID(location.get_ID()); - PoManager.save(bplocation); - - bpartner.setPrimaryC_BPartner_Location_ID(bplocation.get_ID()); - PoManager.save(bpartner); - - return bplocation; - } - - public static MLocation loadLocation(Properties ctx, int locationId, String trxName) throws OperationException - { - MLocation location = new MLocation(ctx, locationId, trxName); - if(location.get_ID() == 0) - throw new OperationException("Could not load location with id: " + locationId); - return location; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/LoginManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/LoginManager.java deleted file mode 100644 index 0f2c1ea5a6..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/LoginManager.java +++ /dev/null @@ -1,473 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - **/ - -package org.posterita.businesslogic; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; -import java.util.Vector; - -import org.compiere.model.MClient; -import org.compiere.model.MOrg; -import org.compiere.model.MUser; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.WebInfo; -import org.compiere.util.WebUser; -import org.posterita.beans.ChangePasswordBean; -import org.posterita.beans.LoginBean; -import org.posterita.beans.OrgUsersBean; -import org.posterita.beans.UserBean; -import org.posterita.businesslogic.administration.RoleManager; -import org.posterita.businesslogic.administration.UserManager; -import org.posterita.exceptions.DataException; -import org.posterita.exceptions.DuplicatePINException; -import org.posterita.exceptions.EmailNotFoundException; -import org.posterita.exceptions.InvalidPINException; -import org.posterita.exceptions.InvalidPasswordLengthException; -import org.posterita.exceptions.InvalidRoleException; -import org.posterita.exceptions.NotLoggedInException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.SystemException; -import org.posterita.exceptions.UserInactiveException; -import org.posterita.exceptions.UserNotFoundException; -import org.posterita.exceptions.WrongPasswordException; -import org.posterita.lib.UdiConstants; -import org.posterita.pos.help.POSHelpManager; -import org.posterita.user.WebUserInfo; -import org.posterita.util.PoManager; - - -public class LoginManager -{ - - public WebUser checkLoginPassword(Properties ctx, LoginBean bean) throws UserNotFoundException, UserInactiveException, SQLException, OperationException, NotLoggedInException - { - WebUser wu = get (ctx, bean.getUsername()); - - wu.login(bean.getPassword()); - - // Ensure that the right user id is found in ctx, not the 1 used by compiere cache. - Env.setContext(ctx, "#AD_User_ID", wu.getAD_User_ID()); - setRoleContext(ctx); - - if (!wu.isLoggedIn()) - { - throw new NotLoggedInException(); - } - - return wu; - } - - - public void setRoleContext(Properties ctx) throws SQLException, OperationException - { - ArrayList list = RoleManager.getMyRoles(ctx); - - for (KeyNamePair pair : list) - { - Env.setContext(ctx, "#AD_Role_ID", pair.getKey()); - break; - } - - Env.setContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM, RoleManager.getRoleEditableOrgAccess(ctx)); - Env.setContext(ctx,UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM, RoleManager.getRoleViewableOrgAccess(ctx)); - } - - public WebUserInfo login (Properties ctx, WebUser wu) throws NotLoggedInException, InvalidRoleException, DataException, OperationException, SystemException - { - - WebInfo info = new WebInfo(ctx, wu); - WebUserInfo udiInfo = new WebUserInfo(ctx,wu,info); - -// MRole currentRole = new MRole(ctx, udiInfo.getRoleId().intValue(), null); - - return udiInfo; - } - - public WebUserInfo loginUser(Properties ctx, LoginBean bean) throws UserNotFoundException, UserInactiveException, NotLoggedInException, SQLException, OperationException, InvalidRoleException, DataException, SystemException - { - -// int originalRoleID = UserManager.getOriginalRoleID(ctx); - - MUser user = new MUser(ctx,bean.getUserId().intValue(),null); - - bean.setUsername(user.getName()); - bean.setPassword(user.getPassword()); - WebUser wu = checkLoginPassword(ctx, bean); - - WebUserInfo wuInfo = login(ctx, wu); - - return wuInfo; - } - - public boolean sendPassword(Properties ctx, UserBean bean, String subject, String content) throws SQLException, UserNotFoundException, EmailNotFoundException - { - MUser user = load(ctx, bean.getUsername()); - - if (user == null) - throw new UserNotFoundException(); - - String email = user.getEMail(); - - if (email == null || email.trim().length() == 0) - throw new EmailNotFoundException(); - - content = content + user.getPassword(); - - MClient client = new MClient(ctx,Env.getAD_Client_ID(ctx),null); - - String from = "Support "; - - return POSHelpManager.sendEmail(ctx, from, email, subject, content); - - - } - - - public static void changePassword(Properties ctx, ChangePasswordBean bean, WebUserInfo userInfo) throws WrongPasswordException, OperationException - { - - MUser user = new MUser(ctx, userInfo.getUser().getAD_User_ID(),null); - - String oldPassword = bean.getOldPassword(); - - if (!oldPassword.equals(userInfo.getUser().getPassword())) - throw new WrongPasswordException(); - - String newPassword = bean.getNewPassword(); - - if(newPassword.length()<6) - throw new InvalidPasswordLengthException("The password Should be at least six characters long"); - - - user.setPassword(newPassword); - - PoManager.save(user); - - WebUser webUser = WebUser.get(ctx,user.getEMail(),user.getPassword(), false); - - userInfo.setUser(webUser); - } - - - - protected static MUser load(Properties ctx, String username) throws SQLException - { - MUser m_bpc = null; - String sql = "SELECT * " - + "FROM AD_User " - + "WHERE AD_Client_ID=?" - + " AND Name=?"; - - if (username == null) - username = ""; - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, Env.getAD_Client_ID(ctx)); - pstmt.setString(2, username); - - rs = pstmt.executeQuery(); - - if (rs.next()) - { - m_bpc = new MUser (ctx, rs, null); - } - - rs.close(); - - } - catch (SQLException e) - { - throw e; - } - finally - { - try - { - pstmt.close (); - } - catch (Exception e) - { - - } - - pstmt = null; - } - - return m_bpc; - } - - - - private static WebUser get(Properties ctx, String username) throws SQLException, UserNotFoundException, UserInactiveException - { - MUser m_bpc = load(ctx, username); - - if (m_bpc == null) - throw new UserNotFoundException(); - - if (!m_bpc.isActive()) - throw new UserInactiveException(); - - WebUser wu = WebUser.get(ctx, m_bpc.getAD_User_ID()); - - return wu; - } - - public static ArrayList getOrgUsers(Properties ctx) - { - ArrayList orgUsers = new ArrayList(); - Vector users = null; - MOrg org = null; - OrgUsersBean bean = null; - - int ad_client_id = Env.getAD_Client_ID(ctx); - - StringBuffer whereClause = new StringBuffer(""); - whereClause.append(" AD_CLIENT_ID = " + ad_client_id); - whereClause.append(" AND ISACTIVE = 'Y'"); - whereClause.append(" AND ISVISIBLE = 'Y'"); - - - whereClause.append(" ORDER BY NAME"); - - int[] orgIds = MOrg.getAllIDs(MOrg.Table_Name,whereClause.toString(),null); - - for(int i=0; i getAccessibleOrgsKeyNamePair(Properties ctx) throws SQLException - { - int ad_user_id = Env.getAD_User_ID(ctx); - int ad_client_id = Env.getAD_Client_ID(ctx); - - String sql = "select distinct(org.AD_ORG_ID), org.name " + - " from AD_USER_ROLES usrRole, AD_USER usr, AD_ROLE role, AD_ORG org " + - " where org.AD_ORG_ID = role.AD_ORG_ID " + - " and usrRole.AD_USER_ID = usr.AD_USER_ID " + - " and usrRole.AD_ROLE_ID = role.AD_ROLE_ID " + - " and role.AD_CLIENT_ID = ? " + - " and usrRole.AD_USER_ID = ? " + - " order by org.name"; - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - ResultSet rs = null; - ArrayList orgList = new ArrayList(); - - try - { - pstmt.setInt(1,ad_client_id); - pstmt.setInt(2,ad_user_id); - - rs = pstmt.executeQuery(); - - while(rs.next()) - { - KeyNamePair pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); - - orgList.add(pair); - } - - rs.close(); - } - catch (SQLException e) - { - throw e; - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - - } - - - return orgList; - } - - public static ArrayList getUserRolesKeyNamePair(Properties ctx, int ad_org_id) throws SQLException - { - int ad_user_id = Env.getAD_User_ID(ctx); - int ad_client_id = Env.getAD_Client_ID(ctx); - - String sql = "select role.AD_ROLE_ID, role.NAME " + - " from AD_USER_ROLES usrRole, AD_USER usr, AD_ROLE role, AD_ORG org " + - " where org.AD_ORG_ID = role.AD_ORG_ID " + - " and usrRole.AD_USER_ID = usr.AD_USER_ID " + - " and usrRole.AD_ROLE_ID = role.AD_ROLE_ID " + - " and role.AD_CLIENT_ID = ? " + - " and role.AD_ORG_ID = ? " + - " and usrRole.AD_USER_ID = ? " + - " order by role.NAME"; - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - ResultSet rs = null; - ArrayList roleList = new ArrayList(); - - try - { - pstmt.setInt(1,ad_client_id); - pstmt.setInt(2,ad_org_id); - pstmt.setInt(3,ad_user_id); - - rs = pstmt.executeQuery(); - - while(rs.next()) - { - KeyNamePair pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); - - roleList.add(pair); - } - - rs.close(); - } - catch (SQLException e) - { - throw e; - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return roleList; - } - - - - private static String getallOrgsAccess(Properties ctx) throws SQLException - { - String sql = "SELECT o.AD_Org_ID,o.Name,o.IsSummary " // 1..3 - + "FROM AD_Role r, AD_Client c" - + " INNER JOIN AD_Org o ON (c.AD_Client_ID=o.AD_Client_ID OR o.AD_Org_ID=0) " - + "WHERE r.AD_Role_ID=?" // #1 - + " AND c.AD_Client_ID=?" // #2 - + " AND o.IsActive='Y'" - + " AND (r.IsAccessAllOrgs='Y' " - + "OR (r.IsUseUserOrgAccess='N' AND o.AD_Org_ID IN (SELECT AD_Org_ID FROM AD_Role_OrgAccess ra " - + "WHERE ra.AD_Role_ID=r.AD_Role_ID AND ra.IsActive='Y')) " - + "OR (r.IsUseUserOrgAccess='Y' AND o.AD_Org_ID IN (SELECT AD_Org_ID FROM AD_User_OrgAccess ua " - + "WHERE ua.AD_User_ID=? AND ua.IsActive='Y'))" // #3 - + ") " - + "ORDER BY o.Name"; - - String orgIds=""; - PreparedStatement pstmt = null; - new ArrayList(); - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, Env.getAD_Role_ID(ctx)); - pstmt.setInt(2, Env.getAD_Client_ID(ctx)); - pstmt.setInt(3, Env.getAD_User_ID(ctx)); - rs = pstmt.executeQuery(); - - // load Orgs - while (rs.next()) - { - if(orgIds=="") - orgIds = orgIds+rs.getInt(1)+""; - else - orgIds = orgIds+","+rs.getInt(1)+""; - } - - rs.close(); - } - catch (SQLException ex) - { - throw ex; - } - finally - { - try - { - pstmt.close(); - } - catch (Exception e) - {} - - pstmt = null; - } - - return orgIds; - - } - - public LoginBean getUserNameFromPIN(Properties ctx,String userPIN) throws DuplicatePINException, InvalidPINException - { - String whereClause="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " and USERPIN='"+userPIN+"'"; - - int [] userIds = MUser.getAllIDs(MUser.Table_Name,whereClause,null); - - if(userIds.length>1) - throw new DuplicatePINException("More than one user with same pin"); - if(userIds.length<1) - throw new InvalidPINException("Invalid PIN"); - - MUser user = new MUser(ctx,userIds[0],null); - - LoginBean bean = new LoginBean(); - bean.setUsername(user.getName()); - bean.setPassword(user.getPassword()); - - return bean; - - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/MenuManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/MenuManager.java deleted file mode 100644 index e40b56509b..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/MenuManager.java +++ /dev/null @@ -1,580 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 6, 2005 by alok - **/ -package org.posterita.businesslogic; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.MenuItemBean; -import org.posterita.core.MenuItem; -import org.posterita.core.bean.ElementBean; -import org.posterita.core.businesslogic.ElementManager; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.SystemException; -import org.posterita.factory.AbstractFactory; -import org.posterita.factory.POSMenuFactory; -import org.posterita.keyname.MenuKeyNamePair; -import org.compiere.model.MWebMenu; -import org.posterita.util.PoManager; - - -public class MenuManager -{ - - public static ArrayList getMenus(Properties ctx, int roleId) throws SystemException, OperationException - { - POSMenuFactory.getFactoryInstance(ctx); - ArrayList menuList = new ArrayList(); - int adRoleId = roleId; - - String sqlStatement = ""; - - sqlStatement = " select m.* " + - " from U_WebMENU m, U_RoleMenu rm " + - " where m.U_WebMenu_ID = rm.U_WebMenu_ID "+ - " and M.isActive='Y'"+ - " and rm.AD_Role_ID = " + adRoleId + -// " and m.AD_Client_ID = " + adClientId + // Menu not dependent on client - " order by m.Sequence, m.U_WebMenu_ID"; - - - PreparedStatement prepStatement = null; - try - { - prepStatement = DB.prepareStatement(sqlStatement, null); - ResultSet rs = prepStatement.executeQuery(); - - - while(rs.next()) - { - MWebMenu menu = new MWebMenu(ctx, rs, null); - - if (!menu.isActive()) - { - menu.setMenuLink("#"); - } - - menuList.add(menu); - } - rs.close(); - - } - catch(SQLException ex) - { - throw new SystemException(ex.getMessage()); - } - finally - { - try - { - prepStatement.close(); - } - catch(Exception e) - { - } - prepStatement = null; - } - return menuList; - } - - public static ArrayList getMenus(Properties ctx) throws SystemException, OperationException - { - int adRoleId = Env.getAD_Role_ID(ctx); - return MenuManager.getMenus(ctx, adRoleId); - } - - public static ArrayList getMenus(Properties ctx, HttpServletRequest request) throws SystemException, OperationException - { - ArrayList menuList = getMenus(ctx); - rewriteMenuURL(menuList, request); - - return menuList; - } - - - public static MenuItem buildMenuTree(Properties ctx, ArrayList menuList) - { - MenuItem rootMenuItem = MenuItem.getDummyMenuItem(ctx); - - Iterator menuIter = menuList.iterator(); - Iterator subIterator; - MWebMenu mMenu; - MWebMenu sMenu; - - - while(menuIter.hasNext()) - { - mMenu = (MWebMenu)menuIter.next(); - - if(mMenu.getParentMenu_ID() == 0) // Parent Menu - { - MenuItem mItem = new MenuItem(mMenu); - rootMenuItem.addSubMenu(mItem); - subIterator = menuList.iterator(); - - while(subIterator.hasNext()) - { - sMenu = (MWebMenu)subIterator.next(); - if(sMenu.getParentMenu_ID() == mMenu.get_ID()) - { - MenuItem sItem = new MenuItem(sMenu); - - String menuLink = sItem.getMenuLink(); - if(! menuLink.startsWith("javascript:")) - { - sItem.setMenuLink(sItem.getMenuLink() + sItem.getMenuId()); - } - - //sItem - mItem.addSubMenu(sItem); - } - } - //if(mItem.hasSubMenu()) - mItem.setMenuLink(mItem.getMenuLink() + mItem.getMenuId()); - } - } - - return rootMenuItem; - } - - public static void saveMenu(Properties ctx, MenuItemBean bean) throws OperationException - { - //when creating a new menu - MWebMenu menu; - if (bean.getMenuId().equals(Integer.valueOf(0))) - { - menu = new MWebMenu(ctx,0,null); - } -// when editing a menu - else - { - menu = new MWebMenu(ctx,bean.getMenuId().intValue(),null); - } - - menu.setIsActive(bean.getIsActive().booleanValue()); - menu.setDescription(bean.getDescription()); - PoManager.save(menu); - } - - public static MWebMenu createParentMenu(Properties ctx, String menuName, String moduleName, int sequence) throws OperationException - { - //MWebMenu menu = new MWebMenu(ctx, 0, null); - MWebMenu menu; - try { - menu = new MWebMenu(ctx, getMenuId(ctx, menuName), null); - } catch (SystemException e) - { - menu = new MWebMenu(ctx, 0, null); - } - - menu.setMenuLink("GetMenuItemsAction.do?action=getMenuItems&menuId="); - menu.setModule(moduleName); - menu.setPosition(AbstractFactory.MENU_POSITION_LEFT); - menu.setSequence(new BigDecimal(sequence)); - menu.setName(menuName); - - return menu; - } - - public static MWebMenu createSubMenu(Properties ctx,String menuName, String menuLink, String moduleName, int parentId, int sequence) throws OperationException - { - return createSubMenu(ctx, menuName, menuLink, moduleName, parentId, sequence, null); - } - - public static MWebMenu createSubMenu(Properties ctx,String menuName, String menuLink, String moduleName, int parentId, int sequence, String category) throws OperationException - { - MWebMenu menu; - try { - menu = new MWebMenu(ctx, getMenuId(ctx, menuName), null); - } catch (SystemException e) - { - menu = new MWebMenu(ctx, 0, null); - } - menu.setParentMenu_ID(parentId); - - if(!menuLink.contains("javascript")) - { - if (menuLink.endsWith(".do")) - menuLink = menuLink + "?menuId="; - else - menuLink = menuLink + "&menuId="; - } - - menu.setMenuLink(menuLink); - menu.setModule(moduleName); - menu.setSequence(new BigDecimal(sequence)); - menu.setPosition(AbstractFactory.MENU_POSITION_LEFT); - - menu.setName(menuName); - menu.setCategory(category); - return menu; - } - - - public static ArrayList getMenusForOrganisationType(Properties ctx) throws OperationException - { - - // Creating the menus first. -// MenuFactory factory = MenuFactory.getFactoryInstance(ctx); - - ArrayList menuList = new ArrayList(); - - String sqlStatement = ""; - - sqlStatement = "select * " + - "from U_WEBMENU m where " + //m.AD_Client_ID = " + adClientId + - " m.AD_CLIENT_ID=0"+ - " and m.AD_ORG_ID=0" + - " and m.isactive = 'Y'"; - -// sqlStatement += " and m." + OrganisationManager.getOrganisationSqlStatement(ctx); - - sqlStatement += " order by m.U_WebMenu_ID"; - - System.out.println(sqlStatement); - - PreparedStatement prepStatement = null; - ResultSet rs = null; - try - { - prepStatement = DB.prepareStatement(sqlStatement, null); - rs = prepStatement.executeQuery(); - - while(rs.next()) - { - // setting the link name to be either car / bike - //name = formatMenuName(ctx, name); - - MWebMenu menu = new MWebMenu(ctx, rs, null); - menuList.add(menu); - } - rs.close(); - - } - catch(SQLException ex) - { - throw new OperationException("Could not retrieve menu list with sql: " + sqlStatement, ex); - } - finally - { - - - DB.close(rs, prepStatement); - - rs = null; - prepStatement = null; - } - return menuList; - } - - - public static int[] getDefaultMenus(Properties ctx) throws OperationException - { - String whereClause = "AD_Client_ID=0 and AD_Org_ID=0 "; - whereClause += " and Position='TOP' and ParentMenu_ID is null"; - - int menuIds[] = MWebMenu.getAllIDs(MWebMenu.Table_Name, whereClause, null); - - if(menuIds == null) - throw new OperationException("Could not retrieve Default Menus, Where Clause: " + whereClause); - - return menuIds; - } - - public static int[] getMenuIdForOrganisation(Properties ctx) throws OperationException - { - int adClientId = Env.getAD_Client_ID(ctx); - - String whereClause = "AD_CLIENT_ID=" + adClientId; - - int menuIds[] = MWebMenu.getAllIDs(MWebMenu.Table_Name, whereClause, null); - - return menuIds; - } - - public static int[] getMenuIdForSuperUser(Properties ctx) throws OperationException - { - int adClientId = Env.getAD_Client_ID(ctx); - int adOrgId = Env.getAD_Org_ID(ctx); - - String whereClause = "AD_CLIENT_ID =" + adClientId + " and AD_ORG_ID = " + adOrgId + " and ISSUPERUSER = 'Y'"; - - int menuIds[] = MWebMenu.getAllIDs(MWebMenu.Table_Name, whereClause, null); - - return menuIds; - } - - public static ArrayList getClosableMenus(Properties ctx) throws OperationException - { - String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) - + " and isClosable='Y'"; - //+ filter; - - ArrayList menuKeyNamePairs; - - try - { - menuKeyNamePairs = MenuKeyNamePair.getData(ctx, MWebMenu.Table_Name, sql); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - - return menuKeyNamePairs; - } - - public static MenuItemBean getMenu(Properties ctx, int menuId) - { - MWebMenu menu = new MWebMenu(ctx, menuId, null); - - MenuItemBean bean = new MenuItemBean(); - bean.setDescription(menu.getDescription()); - bean.setMenuId(menu.get_ID()); - bean.setIsActive(menu.isActive()); - - return bean; - } - - public static MenuItemBean editMenu(Properties ctx, MenuItemBean bean) throws OperationException - { - MWebMenu menu = new MWebMenu(ctx, bean.getMenuId(), null); - menu.setDescription(bean.getDescription()); - menu.setIsActive(bean.getIsActive()); - PoManager.save(menu); - - bean.setName(menu.getName()); - - return bean; - } - - public static int[] getMenus(Properties ctx,String module) - { - int ad_client_id = Env.getAD_Client_ID(ctx); - int ad_org_id = Env.getAD_Org_ID(ctx); - - String whereClause = " and ad_client_id = "+ ad_client_id + - " and ad_org_id = "+ ad_org_id +" and isactive = 'Y'"; - - return MWebMenu.getAllIDs(MWebMenu.Table_Name,whereClause,null); - } - - - public static boolean getRoleMenuAccess(Properties ctx,String role) throws OperationException - { - int id = POSMenuFactory.getFactoryInstance(ctx).get(ctx,role).get_ID(); - - String sql="select AD_ROLE_ID from U_ROLEMENU where U_WEBMENU_ID="+id; - boolean access=false; - int currentRoleId=Env.getAD_Role_ID(ctx); - ResultSet rs = null; - PreparedStatement pstmt = DB.prepareStatement(sql,null); - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - if(rs.getInt(1)==currentRoleId) - { - access=true; - break; - } - - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - return access; - } - - public static int getMenuId(Properties ctx, String key) throws SystemException, OperationException - { - - String sqlStatement = "select u_webmenu_id from u_webmenu where lower(name)='" + key.toLowerCase() + "'"; - int menu_id = 0; - - PreparedStatement prepStatement = null; - try - { - prepStatement = DB.prepareStatement(sqlStatement, null); - ResultSet rs = prepStatement.executeQuery(); - - - if(rs.next()) - { - menu_id = rs.getInt(1); - } - rs.close(); - - } - catch(SQLException ex) - { - throw new SystemException(ex.getMessage()); - } - finally - { - try - { - prepStatement.close(); - } - catch(Exception e) - { - } - prepStatement = null; - } - return menu_id; - } - - public static String getMainMenus(Properties ctx, HttpServletRequest request) - { - ArrayList mainMenuList = (ArrayList) request.getSession().getAttribute(Constants.TOP_MENUS); - String mainMenu = ""; - Integer menuId = 0; - String styleClass = ""; - int count = 0; - - //Check which main menu link has been clicked so as to set style - if(request.getParameter("menuId") != null) - { - menuId = Integer.valueOf(request.getParameter("menuId")); - } - - if(mainMenuList != null) - { - Iterator itr = mainMenuList.iterator(); - StringWriter sw = new StringWriter(); - PrintWriter out = new PrintWriter(sw); - ElementBean elementBean = null; - - while(itr.hasNext()) - { - MenuItem menuItem = (MenuItem) itr.next(); - elementBean = ElementManager.getMsg(ctx, menuItem.getName()); - - if(menuId.compareTo(menuItem.getMenuId()) == 0 || (menuId == 0 && count == 0)) - { - styleClass = "currentpage"; - } - else - { - styleClass = ""; - } - - out.print(""); - - count ++; - } - - out.flush(); - - mainMenu = sw.toString(); - request.getSession().setAttribute(Constants.MAIN_MENUS, mainMenu); - - } - - return mainMenu; - } - - /** - * Rewrite all the URLs. Adds session id if not present - * @param menuList - * @param request - */ - public static void rewriteMenuURL(ArrayList menuList, HttpServletRequest request) - { - HttpSession session = request.getSession(); - String sessionID = session.getId(); - - for(MWebMenu menu : menuList) - { - String link = menu.getMenuLink(); - - int index = link.indexOf("?"); - if(index != -1) - { - String part1 = link.substring(0, index); - String part2 = link.substring(index); - - link = part1 + ";jsessionid=" + sessionID + part2; - - menu.setMenuLink(link); - } - } - } - - - public static Boolean isCashSalesAllowed(Properties ctx, int roleId) throws Exception - { - boolean isCashSalesAllowed = false; - ArrayList roleMenus = getMenus(ctx, roleId); - - if(roleMenus != null) - { - Iterator itr = roleMenus.iterator(); - - while(itr.hasNext()) - { - MWebMenu webMenu = (MWebMenu) itr.next(); - - if(webMenu.getName().equalsIgnoreCase("smenu.cash.sales")) - { - isCashSalesAllowed = true; - } - } - } - return isCashSalesAllowed; - } -} - - diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/MinOutManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/MinOutManager.java deleted file mode 100644 index 05e6b132d0..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/MinOutManager.java +++ /dev/null @@ -1,788 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 08-Jul-2005 by alok - * - */ -package org.posterita.businesslogic; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MDocType; -import org.compiere.model.MInOut; -import org.compiere.model.MInOutConfirm; -import org.compiere.model.MInOutLine; -import org.compiere.model.MInOutLineConfirm; -import org.compiere.model.MInvoice; -import org.compiere.model.MInvoiceLine; -import org.compiere.model.MLocation; -import org.compiere.model.MLocator; -import org.compiere.model.MOrder; -import org.compiere.model.MOrderLine; -import org.compiere.model.MOrg; -import org.compiere.model.MProduct; -import org.compiere.model.MWarehouse; -import org.compiere.print.ReportEngine; -import org.compiere.process.DocumentEngine; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.ChangeDocumentStatusBean; -import org.posterita.beans.CommandBean; -import org.posterita.beans.InOutHistoryBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.beans.WebDocumentHeaderBean; -import org.posterita.beans.WebMinOutLineBean; -import org.posterita.core.JulianDate; -import org.posterita.core.UDIMap; -import org.posterita.exceptions.DataException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ShipmentAlreadyExistsException; -import org.posterita.exceptions.TrackingNumberNotfoundException; -import org.posterita.util.PoManager; - -public class MinOutManager extends AbstractDocumentManager -{ - private static final String SHIPMENT_MADE = "Shipment Made"; - - //TODO pass warehouseId in list of arguments - public static MInOut createShipmentFromInvoice(Properties ctx,MInvoice invoice) throws OperationException - { - - - int SOId = invoice.getC_Order_ID(); - - MOrder order = new MOrder(ctx,SOId,invoice.get_TrxName()); - - MInvoiceLine[] lines = invoice.getLines(); - int []orderLineIds = new int[lines.length]; - for(int i=0;i 0) - { - inOut.setC_DocType_ID( docTypeShipmentIndirectId[0] ); - } else { - inOut.setC_DocType_ID(MDocType.DOCBASETYPE_MaterialDelivery); // @Trifon; old behavior - } - - PoManager.save(inOut); - - MInOutLine [] line=new MInOutLine[salesOrderLineid.length]; - - for(int i=0;i list = new ArrayList(); - ResultSet rs = null; - - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean = new InOutHistoryBean(); - bean.setInOutId(Integer.valueOf(rs.getInt(1))); - bean.setDocumentNo(rs.getString(2)); - bean.setDocStatus(UDIMap.docStatusMap.get(rs.getString(3))); - bean.setDocStatusCode(rs.getString(3)); - bean.setOrderId(Integer.valueOf(rs.getInt(4))); - bean.setDateOrdered(rs.getTimestamp(5)); - bean.setDateMovement(rs.getTimestamp(6)); - bean.setWarehouseId(Integer.valueOf(rs.getInt(7))); - bean.setPoReference(rs.getString(8)); - bean.setInvoiceId(Integer.valueOf(rs.getInt(9))); - bean.setRefInOutId(Integer.valueOf(rs.getInt(10))); - bean.setPartnerName(rs.getString(11)); - bean.setPartnerId(Integer.valueOf(rs.getString(12))); - list.add(bean); - } - - rs.close(); - } - catch (SQLException e) - { - throw e; - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - - return list; - } - - public static ArrayList getShipmentHistory(Properties ctx, String docStatus, Integer partnerId, Integer month, Integer year) throws SQLException - { - return getInOutHistory(ctx,"Y",docStatus,partnerId,month,year); - } - - public static ArrayList getReceiptHistory(Properties ctx, String docStatus, Integer partnerId, Integer month, Integer year) throws SQLException - { - return getInOutHistory(ctx,"N",docStatus,partnerId,month,year); - } - - public static WebDocumentBean getWebMinOutBean(Properties ctx, MInOut minOut) throws OperationException, DataException - { - if (minOut == null) - throw new OperationException("Invalid operation shipment/receipt is null"); - - if (minOut.get_ID() == 0) - throw new OperationException("You have deleted this shipment/receipt. You cannot view this shipment/receipt."); - - WebDocumentBean bean = new WebDocumentBean(); - - bean.setMinOutId(Integer.valueOf(minOut.get_ID())); - - MOrg myOrg = OrganisationManager.getMyOrg(ctx); - MBPartner me = new MBPartner(ctx, myOrg.getLinkedC_BPartner_ID(null), null); - bean.setMe(me); - - //Me Location--------------- - MBPartnerLocation meLocation[] = MBPartnerLocation.getForBPartner(ctx,me.get_ID()); - if (meLocation.length ==0) - throw new OperationException("No location has been set for your organisation. Please ask your administrator to set one for you"); - - MLocation location = new MLocation(ctx, meLocation[0].getC_Location_ID(), null); - - bean.setMeLocation(location); - - //End----------------- - - MBPartner you = new MBPartner(ctx, minOut.getC_BPartner_ID(), null); - bean.setYou(you); - - - //You Location------------ - MBPartnerLocation youBPLocation[] = MBPartnerLocation.getForBPartner(ctx, you.get_ID()); - - if (youBPLocation.length ==0) - throw new OperationException("No location has been set for the dealer organisation. Please ask your administrator to set one for you"); - - MLocation youLocation = new MLocation(ctx, youBPLocation[0].getC_Location_ID(), null); - - bean.setYoubpLocation(youBPLocation[0]); - bean.setYouLocation(youLocation); - - bean.setLines(getWebMinOutLines(ctx, minOut)); - - WebDocumentHeaderBean headerBean = createWebDocumentHeader(ctx, minOut.getAD_Org_ID(),minOut.getC_BPartner_ID(), minOut.getDocStatus(), minOut.isSOTrx(),null); - headerBean.setDocumentHeader(getDocumentHeader(minOut)); - - MDocType doctype = new MDocType(ctx, minOut.getC_DocType_ID(), null); - headerBean.setDocumentTitle(doctype.getName()); - bean.setHeaderBean(headerBean); - - bean.setMinOut(minOut); - - - MInvoice invoice = new MInvoice(ctx, minOut.getC_Invoice_ID(), null); - bean.setInvoice(invoice); - - CommandBean cmdBean = getShipmenttWebCommands(minOut); - - bean.setSimpleCommand(cmdBean.getSimpleCommand()); - bean.setComplexCommand(cmdBean.getComplexCommand()); - - return bean; - } - - public static String getDocumentHeader(MInOut minOut) - { - if (minOut.isSOTrx()) - return SHIPMENT_MADE; - - return SHIPMENT_MADE; - } - - public static ArrayList getMinOutLines(Properties ctx, MInOut inOut) throws OperationException - { - MInOutLine lines[] = inOut.getLines(); - - MInOutLine line; - WebMinOutLineBean inOutLine; - MProduct product; - ArrayList inOutLines = new ArrayList(); - for (int i = 0; i < lines.length; i++) - { - line = lines[i]; - inOutLine = new WebMinOutLineBean(); - product = new MProduct(ctx, line.getM_Product_ID(), null); - inOutLine.setAttributeValuesPair(AttributeValuesManager.retrieveAttributeValues(ctx, product.getM_AttributeSetInstance_ID())); - inOutLine.setSerno(getSerno(ctx,line.getM_AttributeSetInstance_ID())); - inOutLine.setQtyOrdered(line.getMovementQty()); - inOutLines.add(inOutLine); - } - - return inOutLines; - } - - public static ArrayList getWebMinOutLines(Properties ctx, MInOut inOut) throws OperationException - { - MInOutLine lines[] = inOut.getLines(); - - MInOutLine line; - WebMinOutLineBean inOutLine; - MProduct product; - ArrayList inOutLines = new ArrayList(); - for (int i = 0; i < lines.length; i++) - { - line = lines[i]; - - if (line.getM_Product_ID() != 0) - { - inOutLine = new WebMinOutLineBean(); - product = new MProduct(ctx, line.getM_Product_ID(), null); - inOutLine.setProductName(product.getName().replaceAll("~"," ")); - inOutLine.setDescription(product.getDescription()); - inOutLine.setQtyOrdered(line.getQtyEntered()); - - inOutLines.add(inOutLine); - } - } - - return inOutLines; - } - - //get receipt from shipment - public static MInOut getCounterDoc(Properties ctx, int shipmentId, String trxName) - { - MInOut shipment = new MInOut(ctx,shipmentId, trxName); - - if ((shipment == null)||(shipment.get_ID() == 0)) - throw new RuntimeException("no counter document found for shipment----" + shipment.get_ID()); - - if (!shipment.getDocStatus().equals(DocumentEngine.STATUS_Completed)) - throw new RuntimeException("cannot get counter document of shipment which is not completed"); - - - MInOut receipt = new MInOut(ctx, shipment.getRef_InOut_ID(), trxName); - - if ((receipt == null) ||(receipt.get_ID() == 0)) - throw new RuntimeException("no receipt found for shipment"); - - return receipt; - } - - public static MInOut getInitialDoc(Properties ctx, int shipmentId, String trxName) - { - String sql = " AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " and AD_Org_ID=" + Env.getAD_Org_ID(ctx) + " and Ref_InOut_ID=" + shipmentId; - - int minoutIds[] = MInOut.getAllIDs(MInOut.Table_Name, sql, trxName); - - if(minoutIds.length == 0) - throw new RuntimeException("Original shipment doc could not be found!"); - MInOut origInOut = new MInOut(ctx, minoutIds[0], trxName); - - return origInOut; - } - - public static boolean isShipped(Properties ctx, MInvoice invoice) throws OperationException - { - int minOutIds[] = MInOut.getAllIDs(MInOut.Table_Name, " ad_client_id=" + Env.getAD_Client_ID(ctx) + " and c_invoice_id=" + invoice.get_ID(), null); - - if (minOutIds.length == 0) - return false; - - if (minOutIds.length > 1) - throw new OperationException("More than 1 shipment found for invoice " + invoice.get_ID()); - - MInOut minout = new MInOut(ctx, minOutIds[0], null); - - if (!minout.getDocStatus().equals(DocumentEngine.STATUS_Completed)) - return false; - - int refInoutId = minout.getRef_InOut_ID(); - - if (refInoutId == 0) - return false; - - MInOut refInOut = new MInOut(ctx, refInoutId, null); - - if (!refInOut.getDocStatus().equals(DocumentEngine.STATUS_Completed)) - return false; - - return true; - } - - private static CommandBean getShipmenttWebCommands(MInOut inOut) throws OperationException, DataException - { - - String[] simpleCommands = null; - String[] complexCommands = null; - - CommandBean bean = new CommandBean(); - - if (inOut.getDocStatus().equals(DocumentEngine.STATUS_Drafted)) - { - simpleCommands = new String[]{Constants.MINOUT_ACTION_COMPLETE}; - complexCommands =new String[]{Constants.MINOUT_ACTION_CANCEL}; - } - - if (inOut.getDocStatus().equals(DocumentEngine.STATUS_Voided)) - { - complexCommands = new String[]{Constants.MINOUT_ACTION_DELETE}; - } - - - - bean.setSimpleCommand(simpleCommands); - bean.setComplexCommand(complexCommands); - return bean; - } - - public static WebDocumentBean changeMinOutStatus(Properties ctx, MInOut minOut, ChangeDocumentStatusBean bean) throws OperationException, DataException - { - WebDocumentBean webBean = new WebDocumentBean(); - - if(bean.getTrackingNo()==null) - throw new TrackingNumberNotfoundException("Please specify the FexdEx Tracking Number"); - - String submit = bean.getSubmit(); - - if (minOut == null) - { - throw new OperationException("Cannot change the status on an Shipment that does not exist anymore."); - } - - if (submit.equals(Constants.MINOUT_ACTION_COMPLETE)) - { - minOut.setTrackingNo(bean.getTrackingNo()); - PoManager.save(minOut); - minOut = MinOutManager.completeShipment(ctx,minOut); - } - - if (submit.equals(Constants.MINOUT_ACTION_CANCEL)) - { - minOut = forceVoid(ctx, minOut); - } - - if (submit.equals(Constants.MINOUT_ACTION_DELETE)) - { - minOut = deleteInOut(ctx, minOut); - } - - - webBean= MinOutManager.getWebMinOutBean(ctx,minOut); - - return webBean; - } - - - private static MInOut forceVoid(Properties ctx, MInOut inout) throws OperationException - { - PreparedStatement pstmt1 = null; - PreparedStatement pstmt2 = null; - - String sql = "UPDATE M_INOUT SET DOCSTATUS=" + "'" - + DocumentEngine.STATUS_Voided + "'" - + " WHERE AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " AND M_INOUT_ID=" + inout.get_ID(); - - String sql2 = "UPDATE M_INOUT SET DOCACTION=" + "'" - + DocumentEngine.ACTION_None + "'" - + " WHERE AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " AND M_INOUT_ID=" + inout.get_ID(); - - pstmt1 = DB.prepareStatement(sql,null); - pstmt2 = DB.prepareStatement(sql2,null); - - try - { - pstmt1.executeUpdate(); - pstmt2.executeUpdate(); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - finally - { - try - { - pstmt1.close(); - pstmt2.close(); - } - catch(Exception e) - {} - - pstmt1 = null; - pstmt2 = null; - } - - return inout; - - } - - public static MInOut deleteInOut(Properties ctx, MInOut inOut) throws OperationException - { - inOut.setIsActive(false); - PoManager.save(inOut); - - return inOut; - } - - public static void printInOut(Properties ctx,MInOut inOut) throws OperationException - { - PrintManager.print(ctx,ReportEngine.SHIPMENT,inOut.get_ID()); - } - - public static MInOut loadMInOut(Properties ctx, int minoutId, String trxName) throws OperationException - { - MInOut minout = new MInOut(ctx, minoutId, trxName); - if(minout.get_ID() == 0) - throw new OperationException("Could not load invoice with id: " + minout); - - return minout; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/OrderManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/OrderManager.java deleted file mode 100644 index 9db216349c..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/OrderManager.java +++ /dev/null @@ -1,482 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 8, 2006 by alok - */ - - -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MConversionRate; -import org.compiere.model.MDocType; -import org.compiere.model.MOrder; -import org.compiere.model.MOrderLine; -import org.compiere.model.MPriceList; -import org.compiere.model.MProduct; -import org.compiere.model.MTax; -import org.compiere.print.ReportEngine; -import org.compiere.process.DocAction; -import org.compiere.process.DocumentEngine; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.CreditCheckBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.businesslogic.administration.TaxManager; -import org.posterita.core.utils.FormatBigDecimal; -import org.posterita.exceptions.BPartnerNoLocationException; -import org.posterita.exceptions.BPartnerOverCreditLimitException; -import org.posterita.exceptions.OperationException; -import org.posterita.order.UDIOrderTypes; -import org.posterita.util.PoManager; - - -public class OrderManager -{ - - public static MOrder createOrder(Properties ctx, int bPartnerId,boolean isSotrx,int priceListId, String orderType, int warehouseId,String paymentRule,String trxName) throws OperationException - { - int terminalId = POSTerminalManager.getTerminalId(ctx); - if (terminalId == 0) - { - throw new OperationException("NO POS Terminal!!!"); - } - - MOrder order = new MOrder(ctx, 0, trxName); - MBPartner bPartner = new MBPartner(ctx, bPartnerId, trxName); - - if(bPartner.getPrimaryC_BPartner_Location_ID() == 0) - throw new BPartnerNoLocationException("Business partner has no location"); - order.setAD_Org_ID(Env.getAD_Org_ID(ctx)); - //order.setC_POS_ID(terminalId); TODO - Trifon; order.setU_POSTerminal_ID(terminalId); - order.setBPartner(bPartner); - order.setC_BPartner_ID(bPartner.get_ID()); - order.setC_BPartner_Location_ID(bPartner.getPrimaryC_BPartner_Location_ID()); - order.setIsSOTrx(isSotrx); - - order.setM_PriceList_ID(priceListId); - - MPriceList priceList = new MPriceList(ctx,priceListId,null); - order.setC_Currency_ID(priceList.getC_Currency_ID()); - order.setDocAction(DocumentEngine.ACTION_Complete); - order.setSalesRep_ID(Env.getAD_User_ID(ctx)); - - if(orderType.equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER_NO_SHIPMENT.getOrderType())) - { - /**because for credit orders, compiere generates shipment - * automatically, so we want a credit order with standard doc type*/ - - order.setC_DocTypeTarget_ID(getDocTypeFromOrderType(ctx, UDIOrderTypes.POS_ORDER.getOrderType(), isSotrx)); - order.setOrderType(UDIOrderTypes.CREDIT_ORDER.getOrderType()); - } - else - { - order.setC_DocTypeTarget_ID(getDocTypeFromOrderType(ctx, orderType, isSotrx)); - order.setOrderType(orderType); - } - - order.setM_Warehouse_ID(warehouseId); - order.setIsDiscountPrinted(true); - if(paymentRule != null) - order.setPaymentRule(paymentRule); - - order.setDateOrdered(new Timestamp(System.currentTimeMillis())); - order.setInvoiceRule(MOrder.INVOICERULE_Immediate); - - PoManager.save(order); - - return order; - } - - public static MOrderLine createOrderLine(Properties ctx,MOrder order,int productId, BigDecimal qty, BigDecimal discount, BigDecimal lineNet) throws OperationException - { - if(qty == null) - { - qty = Env.ONE; - } - - MOrderLine orderLine = new MOrderLine(order); - - MProduct product = new MProduct(ctx,productId, order.get_TrxName()); - MTax tax = TaxManager.getTaxFromCategory(ctx, product.getC_TaxCategory_ID(), order.get_TrxName()); - orderLine.setC_Tax_ID(tax.get_ID()); - orderLine.setC_UOM_ID(product.getC_UOM_ID()); - orderLine.setC_BPartner_ID(order.getC_BPartner_ID()); - // Must set Product Id before quantity Ordered. - orderLine.setM_Product_ID(productId); - orderLine.setQty(qty); - orderLine.setPrice(); - - //Bug fix, set price to 2dp - MPriceList orderPriceList = MPriceList.get(ctx, order.getM_PriceList_ID(), order.get_TrxName()); - - if (!orderPriceList.isTaxIncluded()) - { - BigDecimal taxAmt = tax.calculateTax(lineNet, true, 12); - BigDecimal lineNetWithoutTax = lineNet.subtract(taxAmt); - orderLine.setLineNetAmt(lineNetWithoutTax); - - BigDecimal unitPriceWithoutTax = lineNetWithoutTax.divide(qty, 12, BigDecimal.ROUND_HALF_DOWN); - - orderLine.setPriceEntered(unitPriceWithoutTax.setScale (2, BigDecimal.ROUND_HALF_UP)); - orderLine.setPriceActual(unitPriceWithoutTax.setScale (2, BigDecimal.ROUND_HALF_UP)); - } - else - { - BigDecimal unitPrice = lineNet.divide(qty, 12, BigDecimal.ROUND_HALF_DOWN); - orderLine.setLineNetAmt(lineNet.setScale (2, BigDecimal.ROUND_HALF_UP)); - orderLine.setPriceEntered(unitPrice.setScale (2, BigDecimal.ROUND_HALF_UP)); - orderLine.setPriceActual(unitPrice.setScale (2, BigDecimal.ROUND_HALF_UP)); - } - - if (discount.doubleValue() != 0.0) - { - orderLine.setDiscount(); - } - - PoManager.save(orderLine); - - return orderLine; - } - - public static BigDecimal getLineTaxAmtAfterDis(BigDecimal amt,BigDecimal rate) - { - return new BigDecimal (amt.doubleValue()/(100+rate.doubleValue())*100); - } - - public static MOrder completeOrder(Properties ctx,MOrder order) throws BPartnerOverCreditLimitException,OperationException - { - if(order.isSOTrx()==true) - { - CreditCheckBean crBean = OrderManager.checkBPartnerCreditLimit(ctx,order.getC_BPartner_ID(),order.get_ID(),order.get_TrxName()); - if(crBean.getValid()==false) - throw new BPartnerOverCreditLimitException(crBean.getMsg()); - } - - PoManager.processIt(order, DocumentEngine.ACTION_Complete); - - return order; - } - - static BigDecimal calculateActualPrice(Properties ctx,BigDecimal listPrice, BigDecimal discount) throws OperationException - { - double actualPrice; - double div = (discount.doubleValue()/100)*listPrice.doubleValue(); - actualPrice=listPrice.doubleValue()-(div); - - BigDecimal formattedBigDecimal = FormatBigDecimal.currency(actualPrice); - - return formattedBigDecimal; - } - - public static int getDocTypeFromOrderType(Properties ctx,String orderType, Boolean isSotrx) throws OperationException - { - - MDocType[] docBaseTypes; - - if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) - { - - return getDocTypeIDForStandardOrder(ctx); - } - - if(orderType.equalsIgnoreCase(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) - { - return getDocTypeIDForCustomerReturnOrder(ctx,isSotrx); - } - - - if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) - { - docBaseTypes = MDocType.getOfDocBaseType(ctx, MDocType.DOCBASETYPE_APCreditMemo); - if (docBaseTypes.length > 1) - throw new OperationException("Expected one document type for AP Credit Memo but got more than 1"); - - return docBaseTypes[0].get_ID(); - } - - - if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType())) - { - docBaseTypes = MDocType.getOfDocBaseType(ctx, MDocType.DOCBASETYPE_PurchaseOrder); - - for(int i=0; i 1) - throw new OperationException("Expected one document type for Standard order but got more than 1"); - - return docTypes[0]; - } - - public static int getDocTypeIDForCreditOrder(Properties ctx) throws OperationException - { - int [] docTypes = MDocType.getAllIDs(MDocType.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and DOCSUBTYPESO='"+MDocType.DOCSUBTYPESO_OnCreditOrder+"'",null); - if (docTypes.length > 1) - throw new OperationException("Expected one document type for Credit order but got more than 1"); - - return docTypes[0]; - } - - public static int getDocTypeIDForCustomerReturnOrder(Properties ctx, Boolean isSotrx) throws OperationException - { - char sotrx = ' '; - - if (isSotrx.equals(true)) - { - sotrx = 'Y'; - } - else - { - sotrx = 'N'; - } - - int [] docTypes = MDocType.getAllIDs(MDocType.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and DOCSUBTYPESO='"+MDocType.DOCSUBTYPESO_ReturnMaterial+"' and isSotrx='"+sotrx+"'",null); - if (docTypes.length > 1) - throw new OperationException("Expected one document type for Return Material but got more than 1"); - - return docTypes[0]; - } - - public static int[] getAllOrderlineIDs(Properties ctx,int orderId,String trxName) - { - String whereClause = "" + - " C_ORDER_ID =" + orderId + - " AND AD_CLIENT_ID =" + Env.getAD_Client_ID(ctx) + - " AND ISACTIVE = 'Y'"; - - return MOrderLine.getAllIDs(MOrderLine.Table_Name,whereClause,trxName); - } - - /** - * Checks the order to see whether it has some orderlines - * @return true if empty else false is returned - */ - public static boolean isOrderEmpty(Properties ctx,int orderId,String trxName) - { - int[] orderlineIDs = getAllOrderlineIDs(ctx,orderId,trxName); - - if(orderlineIDs==null||orderlineIDs.length==0) - { - return true; - } - - return false; - } - - public static MOrder prepareOrder(Properties ctx,int orderId,String trxName) throws OperationException - { - MOrder order = new MOrder(ctx,orderId,trxName); - order.processIt(DocumentEngine.ACTION_Prepare); - return order; - } - - public static MOrder loadOrder(Properties ctx, int orderId, String trxName) throws OperationException - { - MOrder order = new MOrder(ctx, orderId, trxName); - - if(order.get_ID() == 0) - throw new OperationException("Could not load order with id: " + orderId); - - return order; - } - - - public static void deleteDraftedOrder(Properties ctx, int orderId, String trxName) throws OperationException - { - MOrder order = loadOrder(ctx, orderId, trxName); - deleteDraftedOrder(ctx, order); - } - - - public static void deleteDraftedOrder(Properties ctx, MOrder order) throws OperationException - { - if(order.isProcessed()) - throw new OperationException("Cannot delete order that is already processed"); - - if(!order.getDocStatus().equals(DocAction.STATUS_Drafted)) - throw new OperationException("The order is not a drafted order"); - - deleteOrder(ctx, order); - } - - private static void deleteOrder(Properties ctx, MOrder order) throws OperationException - { - if(order == null) - throw new OperationException("Order cannot be null"); - - if(order.isProcessed()) - throw new OperationException("Cannot delete order that is already processed"); - - if(!order.delete(true)) - throw new OperationException("Could not delete order"); - } - - /** - * Deletes all the orderlines from the order - * @param ctx - * @param order the order - * @param trxName - * @throws OperationException - */ - public static void deleteOrderlines(Properties ctx, MOrder order, String trxName) throws OperationException - { - boolean isEmpty = OrderManager.isOrderEmpty(ctx, order.get_ID(), trxName); - - if(isEmpty) - { - return; - } - - //checks the status of the order - if(order.isProcessed()) - { - throw new OperationException("Cannot delete order that is already processed"); - } - - String sql = "DELETE FROM C_ORDERLINE WHERE C_ORDER_ID = " + order.get_ID(); - - int no = DB.executeUpdate(sql, trxName); - - if (no == -1) - { - throw new OperationException("Could not delete order lines"); - } - - }//deleteOrderlines - - - public static void rePrintOrder(Properties ctx,int orderId) throws OperationException - { - PrintManager.printOrder(ctx, orderId, null); - } - - public static void printOrder(Properties ctx,MOrder order) throws OperationException - { - if(order.getOrderType().equals(UDIOrderTypes.POS_ORDER.getOrderType())) - { - PrintManager.openCashDrawer(ctx); - } - PrintManager.printOrder(ctx, order.get_ID(), null); - } - - public static void printOrder(Properties ctx,MOrder order,OrderLineBean bean) throws OperationException - { - if(order.getOrderType().equals(UDIOrderTypes.POS_ORDER.getOrderType())) - { - PrintManager.openCashDrawer(ctx); - } - PrintManager.print(ctx,ReportEngine.ORDER,order.get_ID(),bean); - } - - public static CreditCheckBean checkBPartnerCreditLimit(Properties ctx,int bPartnerId,int orderId, String trxName) - { - MBPartner bp = new MBPartner(ctx,bPartnerId,trxName); - String m_processMsg=null; - - MOrder order = new MOrder(ctx,orderId,trxName); - CreditCheckBean bean= new CreditCheckBean(); - - boolean valid = true; - - if (MBPartner.SOCREDITSTATUS_CreditStop.equals(bp.getSOCreditStatus())) - { - valid = false; - - m_processMsg = "BPartnerCreditStop - TotalOpenBalance= " - + bp.getTotalOpenBalance() - + ", CreditLimit= " + bp.getSO_CreditLimit(); - } - if (MBPartner.SOCREDITSTATUS_CreditHold.equals(bp.getSOCreditStatus())) - { - valid = false; - - m_processMsg = "BPartnerCreditHold - TotalOpenBalance= " - + bp.getTotalOpenBalance() - + ", CreditLimit= " + bp.getSO_CreditLimit(); - } - - BigDecimal grandTotal = MConversionRate.convertBase(ctx, - order.getGrandTotal(),order.getC_Currency_ID(), order.getDateOrdered(), - order.getC_ConversionType_ID(), Env.getAD_Client_ID(ctx), Env.getAD_Org_ID(ctx)); - - if (MBPartner.SOCREDITSTATUS_CreditHold.equals(bp.getSOCreditStatus(grandTotal))) - { - valid = false; - - m_processMsg = "BPartnerOverCreditHold - TotalOpenBalance= " - + bp.getTotalOpenBalance() + ", GrandTotal = " + order.getGrandTotal() - + ", CreditLimit= " + bp.getSO_CreditLimit(); - } - - if (MBPartner.SOCREDITSTATUS_NoCreditCheck.equals(bp.getSOCreditStatus())) - { - valid = true; - - m_processMsg = "BPartnerCreditHold - TotalOpenBalance= " - + bp.getTotalOpenBalance() - + ", CreditLimit= " + bp.getSO_CreditLimit(); - } - - if (MBPartner.SOCREDITSTATUS_NoCreditCheck.equals(bp.getSOCreditStatus(order.getGrandTotal()))) - { - valid = true; - - m_processMsg = "BPartnerOverCreditHold - TotalOpenBalance= " - + bp.getTotalOpenBalance() + ", GrandTotal = " + order.getGrandTotal() - + ", CreditLimit= " + bp.getSO_CreditLimit(); - } - bean.setValid(valid); - bean.setMsg(m_processMsg); - return bean; - } - -} - diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/OrderReferenceManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/OrderReferenceManager.java deleted file mode 100644 index df6d734c10..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/OrderReferenceManager.java +++ /dev/null @@ -1,354 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 28-Jun-2005 by alok - * - */ -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MCharge; -import org.compiere.model.MCurrency; -import org.compiere.model.MLocation; -import org.compiere.model.MOrder; -import org.compiere.model.MOrderLine; -import org.compiere.model.MOrg; -import org.compiere.model.MPayment; -import org.compiere.model.MPriceList; -import org.compiere.model.MPriceListVersion; -import org.compiere.model.MProduct; -import org.compiere.model.MUser; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.AttributeValuesPair; -import org.posterita.beans.WebDocumentBean; -import org.posterita.beans.WebDocumentHeaderBean; -import org.posterita.beans.WebOrderLineBean; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.businesslogic.core.ChargeManager; -import org.posterita.exceptions.InvalidAddressException; -import org.posterita.exceptions.OperationException; -import org.posterita.order.UDIOrderTypes; - - -public class OrderReferenceManager extends AbstractDocumentManager -{ - - public static final String PURCHASE_ORDER = "Purchase Order"; - public static final String SALES_ORDER = "Sales Order"; - private static final String SO_MATERIAL_RETURN_ORDER = "Material Return Order"; - private static final String PO_MATERIAL_RETURN_ORDER = "Material Return Order"; - - - - public static WebDocumentBean getWebOrderBean(Properties ctx,MOrder order) throws InvalidAddressException,OperationException - { - if (order == null) - throw new OperationException("Invalid operation order is null"); - - if (order.get_ID() == 0) - throw new OperationException("You have deleted this order. You cannot view this order."); - - WebDocumentBean bean = new WebDocumentBean(); - - bean.setOrderId(Integer.valueOf(order.get_ID())); - bean.setDescription(order.getDescription()); - - int currencyId = order.getC_Currency_ID(); - MCurrency currency = new MCurrency(ctx,currencyId,null); - bean.setCurrencySymbole(currency.getCurSymbol()); - - - - MOrg myOrg = OrganisationManager.getMyOrg(ctx); - - MBPartner me = null; - - - me = BPartnerManager.getCreateLinkedBPartner(ctx, myOrg, null); - - MOrg orderOrg = new MOrg(ctx, order.getAD_Org_ID(), null); - - - MBPartnerLocation meLocations[] = MBPartnerLocation.getForBPartner(ctx,me.get_ID()); - - MLocation meLocation = null; - - if (meLocations.length == 0) - { - MBPartnerLocation meBPLocation = LocationManager.createDefaultBPLocation(ctx, me); - meLocation = new MLocation(ctx, meBPLocation.getC_Location_ID(), null); - } - else - meLocation = new MLocation(ctx, meLocations[0].getC_Location_ID(), null); - - MBPartner you = new MBPartner(ctx, order.getC_BPartner_ID(), null); - - MBPartnerLocation youBPLocations[] = MBPartnerLocation.getForBPartner(ctx, you.get_ID()); - MBPartnerLocation youBPLocation = null; - - if (youBPLocations.length==0) - youBPLocation = LocationManager.createDefaultBPLocation(ctx, you); - else - youBPLocation = youBPLocations[0]; - - MLocation youLocation = new MLocation(ctx, youBPLocation.getC_Location_ID(), null); - - ArrayList webOrderLines = getWebOrderLines(order); - bean.setLines(webOrderLines); - - bean = calculateOrderTotals(webOrderLines, bean); - - WebDocumentHeaderBean headerBean=null; - - - bean.setYouLocation(youLocation); - bean.setYou(you); - bean.setMeLocation(meLocation); - bean.setMe(me); - bean.setYoubpLocation(youBPLocation); - - String paymentRule=null; - if(order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) - paymentRule=Constants.PAYMENT_RULE_CASH; - else if - (order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) - paymentRule=Constants.PAYMENT_RULE_CHEQUE; - else if - (order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) - paymentRule=Constants.PAYMENT_RULE_CARD; - else if - (order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_DirectDebit)) - paymentRule=Constants.PAYMENT_RULE_CARD; - else if - (order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) - paymentRule=Constants.PAYMENT_RULE_CREDIT; - else - paymentRule=Constants.PAYMENT_RULE_MIXED; - - - headerBean = createWebDocumentHeader(ctx, order.getAD_Org_ID(),order.getC_BPartner_ID(), order.getDocStatus(), order.isSOTrx(),paymentRule); - - - - bean.setHeaderBean(headerBean); - - String isPaid = isPaid(ctx, order.getC_Order_ID(), null); - bean.setIsPaid(isPaid); - - //load the order again - order = new MOrder(ctx, order.getC_Order_ID(), null); - bean.setOrder(order); - headerBean.setDocumentHeader(getOrderHeader(order)); - - int salesRepId = order.getSalesRep_ID(); - MUser salesRep = new MUser(ctx, salesRepId, null); - bean.setSalesRep(salesRep.getName()); - - - return bean; - } - - private static String isPaid(Properties ctx, int orderId, String trxName) - { - int[] paymentIds = MPayment.getAllIDs(MPayment.Table_Name, "c_order_id=" + orderId, trxName); - - if (paymentIds.length == 0) - return Constants.NO_CHAR; - - MPayment payment = new MPayment(ctx, paymentIds[0], trxName); - - if (payment.getDocStatus().equals(MPayment.DOCSTATUS_Completed)) - return Constants.YES_CHAR; - else - return Constants.NO_CHAR; - } - - - /* - * calculates totals for tax, lines and grand total - * returns rounded figures to 2 d.p - */ - private static WebDocumentBean calculateOrderTotals(ArrayList webOrderLineList, WebDocumentBean webOrderLineBean) - { - Iterator iter = webOrderLineList.iterator(); - - WebOrderLineBean bean; - - BigDecimal totalLines = new BigDecimal(0); - BigDecimal totalTax = new BigDecimal(0); - BigDecimal grandTotal; - - BigDecimal roundedTotalLines; - BigDecimal roundedTotalTax; - BigDecimal roundedGrandTotal; - while(iter.hasNext()) - { - bean = (WebOrderLineBean) iter.next(); - BigDecimal lineNetAmt = bean.getLineNetAmt() == null?Env.ZERO:bean.getLineNetAmt(); - BigDecimal taxAmt = bean.getTaxAmt() == null? Env.ZERO:bean.getTaxAmt(); - BigDecimal discountAmt = bean.getDiscountAmt() == null?Env.ZERO:bean.getDiscountAmt(); - BigDecimal writeOffAmt = bean.getWriteOffAmt() == null?Env.ZERO:bean.getWriteOffAmt(); - totalLines = totalLines.add(lineNetAmt).subtract(discountAmt).subtract(writeOffAmt); - totalTax = totalTax.add(taxAmt); - } - - grandTotal = totalLines.add(totalTax); - - - roundedTotalLines = round(totalLines, 2); - roundedTotalTax = round(totalTax, 2); - - roundedGrandTotal = round(grandTotal, 2); - - webOrderLineBean.setTotalLines(roundedTotalLines); - webOrderLineBean.setTotalTax(roundedTotalTax); - webOrderLineBean.setGrandTotal(roundedGrandTotal); - - return webOrderLineBean; - } - - private static BigDecimal round(BigDecimal number, int decimalPlaces) - { - BigDecimal roundedNumber = number.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP); - - return roundedNumber; - } - - private static String getOrderHeader(MOrder order) throws OperationException - { - return getMaterialReturnOrderHeader(order); - } - - private static String getMaterialReturnOrderHeader(MOrder order) - { - if (order.isSOTrx()) - return SO_MATERIAL_RETURN_ORDER; - - return PO_MATERIAL_RETURN_ORDER; - } - - - - - - public static ArrayList populateOrderLines(Properties ctx, MOrderLine[] lines, MOrder order) throws OperationException - { - MOrderLine line; - MProduct product; - AttributeValuesPair attributeValuesPair; - WebOrderLineBean orderLineBean; - ArrayList orderLines = new ArrayList(); - - int priceListId = order.getM_PriceList_ID();/*Env.getContextAsInt(ctx,UdiConstants.PRICELIST_CTX_PARAM);*/ - int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); - - MPriceListVersion priceListVersion = new MPriceListVersion(ctx, priceListVersionId, null); - MPriceList priceList = new MPriceList(ctx, priceListVersion.getM_PriceList_ID(), null); - MCurrency currency = new MCurrency(ctx, priceList.getC_Currency_ID(), null); - - for (int i = 0; i < lines.length; i++) - { - line = lines[i]; - - product = new MProduct(ctx, line.getM_Product_ID(), null); - attributeValuesPair = AttributeValuesManager.retrieveAttributeValues(ctx, product.getM_AttributeSetInstance_ID()); - orderLineBean = new WebOrderLineBean(); - orderLineBean.setAttributeValuesPair(attributeValuesPair); - - - orderLineBean.setQtyOrdered(line.getQtyOrdered()); - orderLineBean.setPriceActual(line.getPriceActual()); - BigDecimal roundedLineNetAmount = round(line.getLineNetAmt(), 2); - orderLineBean.setLineNetAmt(roundedLineNetAmount); - - //line tax amount - if (UDIOrderTypes.WEBSTORE_ORDER.getOrderType().equals(order.getOrderType())) - { - orderLineBean.setTaxAmt(new BigDecimal(0)); - - if (line.getM_Product_ID() == 0) - { - if(line.getC_Charge_ID() != 0) - { - MCharge charge = ChargeManager.loadCharge(ctx, line.getC_Charge_ID(), null); - orderLineBean.setDescription(charge.getName()); - } - else - throw new OperationException("Unknown Order line type with id: " + line.get_ID()); - } - else - orderLineBean.setDescription(ProductManager.getProductName(ctx, line.getM_Product_ID())); - } - else - { - BigDecimal lineTaxAmount = getLineTaxAmt(line.getCtx(), line.getLineNetAmt(), line.getC_Tax_ID(), line.get_ID()); - BigDecimal roundedTaxAmount = round(lineTaxAmount, 2); - orderLineBean.setTaxAmt(roundedTaxAmount); - } - - - BigDecimal lineTotalAmount = line.getLineNetAmt().add(orderLineBean.getTaxAmt()); - BigDecimal roundedLineTotalAmount = round(lineTotalAmount, 2); - - orderLineBean.setLineTotalAmt(roundedLineTotalAmount); - - orderLineBean.setProductId(Integer.valueOf(line.getM_Product_ID())); - orderLineBean.setOrderLineId(Integer.valueOf(line.get_ID())); - orderLineBean.setIsinvoiced(Boolean.valueOf(false)); - orderLineBean.setIsQtyReserved(Boolean.valueOf(true)); - - orderLineBean.setCurrency(currency.getCurSymbol()); - - - if (line.getQtyInvoiced()!= null) - if (line.getQtyInvoiced().intValue() > 1) - orderLineBean.setIsinvoiced(Boolean.valueOf(true)); - - if(line.getQtyReserved()!=null) - if(line.getQtyReserved().equals(new BigDecimal(0))) - orderLineBean.setIsQtyReserved(Boolean.valueOf(false)); - - orderLineBean.setSerno(getSerno(ctx, line.getM_AttributeSetInstance_ID())); - - - orderLines.add(orderLineBean); - } - - return orderLines; - } - - - - public static ArrayList getWebOrderLines(MOrder order) throws OperationException - { - ArrayList orderLines = OrderReferenceManager.populateOrderLines(order.getCtx(), order.getLines(true, null), order); - - return orderLines; - } - - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/OrganisationManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/OrganisationManager.java deleted file mode 100644 index eb35e25db9..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/OrganisationManager.java +++ /dev/null @@ -1,609 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 21-Jun-2005 by alok - * - */ -package org.posterita.businesslogic; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Properties; -import java.util.StringTokenizer; -import java.util.logging.Level; - -import org.compiere.model.MAcctSchema; -import org.compiere.model.MAttachment; -import org.compiere.model.MAttachmentEntry; -import org.compiere.model.MBPartner; -import org.compiere.model.MBank; -import org.compiere.model.MBankAccount; -import org.compiere.model.MCashBook; -import org.compiere.model.MLocation; -import org.compiere.model.MOrg; -import org.compiere.model.MOrgInfo; -import org.compiere.model.MUser; -import org.compiere.model.MWarehouse; -import org.compiere.print.MPrintFormatItem; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.posterita.Constants; -import org.posterita.beans.OrgBean; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.businesslogic.administration.WarehouseManager; -import org.posterita.businesslogic.core.AccountingManager; -import org.posterita.businesslogic.core.AttachmentManager; -import org.posterita.core.CheckDuplicateEntities; -import org.posterita.core.exception.IOOperationException; -import org.posterita.core.utils.IOUtil; -import org.posterita.exceptions.LogoException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.OrganisationAlreadyExistsException; -import org.posterita.exceptions.WarehouseAlreadyExistsException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - -public class OrganisationManager -{ - private static final CLogger logger = CLogger.getCLogger(OrganisationManager.class); - - public static final int COUNTRY_ID = UdiConstants.COUNTRY_MAURITIUS; - - - public static MOrg editOrganisation(Properties ctx, Integer orgId, String orgName, String description, - String address1, String address2, String city, Integer countryId, String postalAddress1, - boolean isActive, String receiptFooterMsg, String trxName) throws OperationException - { - - if(orgId==null) - { - throw new OperationException("Invalid organisation id"); - } - - MOrg mOrg = loadOrganisation(ctx, orgId.intValue(), trxName); - - if (!mOrg.getName().equals(orgName)) - { - if(CheckDuplicateEntities.checkDuplicateName(ctx,orgName,"AD_ORG")) - throw new OrganisationAlreadyExistsException("The Organisation already exists"); - } - - mOrg.setName(orgName); - mOrg.setValue(orgName); - mOrg.setIsActive(isActive); - mOrg.setDescription(description); - // mOrg.setIsVisible(isVisible); - - PoManager.save(mOrg); - - MBPartner bp = new MBPartner(ctx, mOrg.getLinkedC_BPartner_ID(trxName), trxName); - bp.setName(orgName); - bp.setValue(orgName + "_" + orgId); - - PoManager.save(bp); - - MUser user = new MUser(ctx, bp.getPrimaryAD_User_ID(), trxName); - user.setName(orgName); - user.setPassword(orgName); - PoManager.save(user); - - MOrgInfo orgInfo = mOrg.getInfo(); - MLocation location = updateOrCreateLocation(ctx, orgInfo.getC_Location_ID(), orgInfo.getAD_Org_ID(), address1, - address2, postalAddress1, city, countryId, trxName); - - orgInfo.setC_Location_ID(location.get_ID()); - orgInfo.setReceiptFooterMsg(receiptFooterMsg); - - PoManager.save(orgInfo); - orgInfo.set_TrxName(trxName); - - return mOrg; - } - - public static MOrg getMyOrg(Properties ctx) throws OperationException - { - return getMyOrg(ctx, null); - } - - - public static MOrg getMyOrg(Properties ctx, String trxName) throws OperationException - { - MOrg org = new MOrg(ctx, Env.getAD_Org_ID(ctx), trxName); - - if (org == null) - throw new OperationException("Organisation cannot be resolved"); - - return org; - } - - public static int getLinkedBusinessPartnerID(Properties ctx, int orgId) throws OperationException - { - - MOrg org = new MOrg(ctx, orgId, null); - - return org.getLinkedC_BPartner_ID(null); - - } - - - - public static OrgBean getOrganisation(Properties ctx, int orgId) throws OperationException - { - OrgBean bean = null; - - MOrg mOrg = new MOrg(ctx, orgId, null); - - MOrgInfo orgInfo = mOrg.getInfo(); - if (orgInfo != null) - { - MLocation location = MLocation.get(ctx, orgInfo.getC_Location_ID(), null); - - bean = new OrgBean(); - bean.setOrgId(Integer.valueOf(mOrg.get_ID())); - bean.setOrgName(mOrg.getName()); - bean.setCity(location.getCity()); - bean.setPostalAddress(location.getPostal_Add()); - bean.setAddress1(location.getAddress1()); - bean.setAddress2(location.getAddress2()); - bean.setRegion(location.getRegionName()); - bean.setIsActive(Boolean.valueOf(mOrg.isActive())); - bean.setReceiptFooterMsg(orgInfo.getReceiptFooterMsg()); - } - return bean; - } - - public static void deactivateOrganisation(Properties ctx, int orgId) throws OperationException - { - MOrg mOrg = new MOrg(ctx,orgId,null); - - if(mOrg==null) - throw new OperationException("Organisation does not exist"); - - mOrg.setIsActive(false); - - mOrg.save(); - - } - - public static MOrg getOrgByName(Properties ctx, String orgName, String trxName) throws OperationException - { - int orgIds[] = MOrg.getAllIDs(MOrg.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and name='" + orgName + "'", trxName); - - if (orgIds.length == 0) - throw new OperationException("Org not found" + orgName); - - return new MOrg(ctx, orgIds[0], trxName); - } - - - public static MOrg loadOrganisation(Properties ctx, int adOrgID, String trxName) throws OperationException - { - MOrg org = new MOrg(ctx, adOrgID, trxName); - if(org.get_ID() == 0) - throw new OperationException("Cannot load Organisation with id: " + adOrgID); - - return org; - } - - public static void uploadLogo(Properties ctx, InputStream inStream, String trxName) throws OperationException - { - byte imageData[] = IOUtil.getByteArray(inStream); - - int adClientId = Env.getAD_Client_ID(ctx); - - String imageName = UdiConstants.PRINTFORMAT_ITEM_LOGO + UdiConstants.IMAGE_EXTENSION; - String whereClause = "AD_Client_ID=" + adClientId + " and Name = '" + UdiConstants.PRINTFORMAT_ITEM_LOGO + "'"; - - int logoPrintFormatItems[] = MPrintFormatItem.getAllIDs(MPrintFormatItem.Table_Name, whereClause, trxName); - for(int i = 0; i < logoPrintFormatItems.length; i++) - { - MPrintFormatItem printFormatItem = new MPrintFormatItem(ctx, logoPrintFormatItems[i], trxName); - AttachmentManager.deleteAvailableAttachment(ctx, MPrintFormatItem.Table_ID, logoPrintFormatItems[i], trxName); - AttachmentManager.addAttachment(ctx, MPrintFormatItem.Table_ID, logoPrintFormatItems[i], imageName, imageData, trxName); - printFormatItem.setImageIsAttached(true); - PoManager.save(printFormatItem); - } - - int adOrgId = Env.getAD_Org_ID(ctx); - - MAttachment attachment = FileAttachmentManager.deleteAvailableAttachmentEntry(ctx, MOrg.Table_ID, adOrgId, imageName, null); - - //TODO Refactor - if(attachment == null) - FileAttachmentManager.addAttachment(ctx, MOrg.Table_ID, adOrgId, imageName, imageData, null); - else - FileAttachmentManager.addAttachmentEntry(ctx, attachment, imageName, imageData, null); - } - - public static byte[] getLogo(Properties ctx, String trxName) throws LogoException - { - int adOrgId = Env.getAD_Org_ID(ctx); - - MAttachment attachment = MAttachment.get(ctx, MOrg.Table_ID, adOrgId); - - if(attachment == null) - throw new LogoException("Could not load logo for Organisation with id: " + adOrgId); - - ArrayList attachmentList = AttachmentManager.getAttachmentEntriesWithPrefix(ctx, attachment, UdiConstants.PRINTFORMAT_ITEM_LOGO, trxName); - - try - { - if(attachmentList.size() == 0) - throw new LogoException("Could not load logo for Organisation with id: " + adOrgId); - else if(attachmentList.size() > 1) - throw new LogoException("Ambiguity in locating organisation logo; " + attachmentList.size() + " possible logos found for Organisation with id: " + adOrgId); - else - return IOUtil.getByteArray(attachmentList.get(0).getInputStream()); - } - catch(IOOperationException ex) - { - throw new LogoException("Could not retrieve logo for organisation with id: " + adOrgId); - } - } - - - - - //----------------------------------------------------------------------------------------------------------------- - /** - * Returns all organisations that match this organisation name or return all organisations if orgName is null. - * - * @return arraylist of organisation beans - * @param ctx ctx - * @param orgName organisation Name to load - * @param trxName transaction name - * @throws OperationException - */ - public static ArrayList getOrganisations(Properties ctx, String orgName, String trxName) throws OperationException - { - ArrayList list = new ArrayList(); - - if (orgName == null) - { - orgName = ""; - } - orgName = orgName.toUpperCase(); - String whereClause = "AD_CLIENT_ID = " + Env.getAD_Client_ID(ctx) + " AND UPPER(NAME) LIKE '%" +orgName + "%'"; - - int[] ids = MOrg.getAllIDs(MOrg.Table_Name, whereClause, trxName); - - for(int id : ids) - { - OrgBean bean = getOrganisation(ctx, id); - list.add(bean); - } - - return list; - } - - /** - * Updates or Creates organisation - * @param ctx ctx - * @param bean organisation bean - * @param trxName transaction name - * - * @return organisation - * @throws OperationException - * @throws WarehouseAlreadyExistsException - */ - public static MOrg updateOrCreateOrganisation(Properties ctx, OrgBean bean, String trxName) throws OperationException, WarehouseAlreadyExistsException - { - Integer ad_org_id = bean.getOrgId(); - MOrg org = null; - String address1 = bean.getAddress1() == null? "" : bean.getAddress1(); - String address2 = bean.getAddress2() == null? "" : bean.getAddress2(); - - if (ad_org_id == null || ad_org_id == 0) - { - - org = createOrganisation(ctx, bean.getOrgName(),bean.getDescription(),bean.getIsActive(), trxName); - - // set org location - MLocation location = LocationManager.createLocation(ctx, org.get_ID(),address1, address2, bean.getPostalAddress(), - bean.getCity(), 0, bean.getCountryId(), trxName); - - // create a linked business partner for that organisation - BPartnerManager.createLinkedBPartner(ctx, org.getAD_Org_ID(), 0, org.getName(), - "", true, true, false, false, location.getAddress1(), - location.getPostal(), location.getCity(), null, location.getC_Country_ID(), trxName); - - // create a sales representative - MBPartner salesRepBPartner = BPartnerManager.createBPartner(ctx, org.get_ID(), - org.getLinkedC_BPartner_ID(trxName), org.getName() + " Sales Rep", " ", - false, false, true, true, location.getAddress1(), location.getPostal(), location.getCity(), - " ", location.getC_Country_ID(), trxName); - MUser salesRepUser = new MUser(ctx, 0, trxName); - salesRepUser.setC_BPartner_ID(salesRepBPartner.get_ID()); - salesRepUser.setName(org.getName() + " " + "Sales Rep"); - PoManager.save(salesRepUser); - - // warehouse with default locators - String warehouseName = org.getName() + " Warehouse"; - MWarehouse warehouse = WarehouseManager.createWarehouse(ctx, org.get_ID(), warehouseName, address1, location.getPostal(), - location.getCity(), location.getC_Region_ID(), location.getC_Country_ID(), trxName); - - // web store - String hostUrl = "http://www." + org.getName() + ".com/"; - StoreManager.createStore(ctx, org.getName(), org.getName()+" pos", org.getAD_Org_ID(), - Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM), - salesRepUser.getAD_User_ID(), warehouse.getM_Warehouse_ID(), "pos", hostUrl, trxName); - - // load orgInfo and set details - MOrgInfo orgInfo = org.getInfo(); - orgInfo.set_TrxName(trxName); - orgInfo.setC_Location_ID(location.getC_Location_ID()); - orgInfo.setM_Warehouse_ID(warehouse.getM_Warehouse_ID()); - orgInfo.setReceiptFooterMsg(bean.getReceiptFooterMsg()); - PoManager.save(orgInfo); - - // cashbook - String cashBookName = org.getName() + " Cash Book"; - MAcctSchema[] acctSchema = MAcctSchema.getClientAcctSchema(ctx, org.getAD_Client_ID()); - int currencyId = acctSchema[0].getC_Currency_ID(); - MCashBook cashBook = CashManager.createCashBook(ctx, org.get_ID(), cashBookName, currencyId, trxName); - - MBPartner defCashBPartner = BPartnerManager.saveBPartner(ctx, org.getAD_Org_ID(), 0, org.getLinkedC_BPartner_ID(trxName), - org.getName() + " Standard Customer", " ", true, false, false, false, " ", " ", - location.getPostal(), location.getC_Region_ID(),location.getCity(), "", "", "", location.getC_Country_ID(), - true, true, trxName); - - MBank bank = new MBank(ctx, 0, trxName); - bank.setAD_Org_ID(org.getAD_Org_ID()); - bank.setName(org.getName() + " Bank"); - bank.setRoutingNo("123456789"); - bank.setC_Location_ID(orgInfo.getC_Location_ID()); - PoManager.save(bank); - - MBankAccount bankAccount = new MBankAccount(ctx, 0, trxName); - bankAccount.setAD_Org_ID(org.getAD_Org_ID()); - bankAccount.setC_Bank_ID(bank.get_ID()); - bankAccount.setBankAccountType(MBankAccount.BANKACCOUNTTYPE_Checking); - bankAccount.setC_Currency_ID(currencyId); - bankAccount.setAccountNo("123456789"); - bankAccount.setIsDefault(true); - PoManager.save(bankAccount); - - } - - else - { - org = editOrganisation(ctx, ad_org_id, bean.getOrgName(), bean.getDescription(), address1, address2, bean.getCity(), - bean.getCountryId(), bean.getPostalAddress(), bean.getIsActive(), bean.getReceiptFooterMsg(), trxName); - } - - return org; - } - - - private static MOrg createOrganisation(Properties ctx, String orgName, - String description, Boolean isActive,String trxName) throws OperationException - { - - MOrg org = new MOrg(ctx,0,trxName); - org.setName(orgName); - org.setIsActive(isActive); - org.setDescription(description); - PoManager.save(org); - - return org; - } - - public static void activateOrganisation(Properties ctx, OrgBean bean, String trxName) throws OperationException - { - int ad_org_id = bean.getOrgId(); - - MOrg org = MOrg.get(ctx, ad_org_id); - - boolean isActive = org.isActive(); - org.setIsActive(!isActive); - - PoManager.save(org); - } - - public static MLocation updateOrCreateLocation(Properties ctx,Integer locationId, Integer orgId, String address1, - String address2, String postalAddress1,String city,int countryId, String trxName) throws OperationException - { - MLocation location = new MLocation(ctx,locationId,trxName); - location.setAD_Org_ID(orgId); - location.setAddress1(address1); - location.setAddress2(address2); - location.setCity(city); - location.setPostal_Add(postalAddress1); - location.setC_Country_ID(countryId); - PoManager.save(location); - - return location; - } - public static ArrayList getAllOrgPairs(Properties ctx, String trxName) - { - ArrayList pairList = new ArrayList(); - - int clientId = Env.getAD_Client_ID(ctx); - - int[] orgIds = MOrg.getAllIDs(MOrg.Table_Name, "ad_client_id=" + clientId, trxName); - - for (int i = 0; i < orgIds.length; i++) - { - MOrg org = MOrg.get(ctx, orgIds[i]); - KeyNamePair pair = org.getKeyNamePair(); - pairList.add(pair); - } - - return pairList; - } - - public static ArrayList getUserOrgPairs(Properties ctx) - { - return getUserOrgPairs(ctx, true); - } - - public static ArrayList getUserOrgPairs(Properties ctx, boolean viewStarOrg) - { - ArrayList pairList = new ArrayList(); - - String userOrg = Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); - - StringTokenizer token = new StringTokenizer(userOrg, ","); - - while (token.hasMoreTokens()) - { - String orgStrId = token.nextToken(); - int orgId = Integer.parseInt(orgStrId); - - if (orgId == 0) - { - if (viewStarOrg) - { - KeyNamePair allOrgPair = new KeyNamePair(0, Constants.ALL_ORGANISATIONS); - pairList.add(allOrgPair); - } - - } - else - { - MOrg org = MOrg.get(ctx, orgId); - pairList.add(org.getKeyNamePair()); - } - - } - - return pairList; - } - - - public static int[] getUserViewableOrganisations(Properties ctx) - { - int defaultOrganisations[] = new int[] {Env.getAD_Org_ID(ctx)}; - String viewableOrganisations = Env.getContext(ctx, UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM); - - if (viewableOrganisations == null || viewableOrganisations.trim().length() == 0) - { - return defaultOrganisations; - } - - ArrayList orgList = new ArrayList(); - - try - { - StringTokenizer tokenizer = new StringTokenizer(viewableOrganisations, ","); - while (tokenizer.hasMoreTokens()) - { - String org = tokenizer.nextToken(); - orgList.add(Integer.parseInt(org.trim())); - } - } - catch (Exception ex) - { - logger.log(Level.SEVERE, "Could not retrieve organisations, cause: " + ex.getMessage(), ex); - } - - if (orgList.size() > 0) - { - int organisations[] = new int[orgList.size()]; - System.arraycopy(orgList.toArray(), 0, organisations, 0, orgList.size()); - return organisations; - } - - return defaultOrganisations; - } - - - public static int getCreateTransferBankAccount(Properties ctx, int adOrgId, int currencyId, String trxName) throws OperationException - { - String sqlStmt = "SELECT C_BankAccount_ID FROM C_BankAccount ba " - + "INNER JOIN C_Bank b ON ba.C_Bank_ID=b.C_Bank_ID " - + "INNER JOIN AD_OrgInfo oi ON b.C_Bank_ID=oi.TransferBank_ID " - + "WHERE oi.AD_Org_ID=? AND ba.C_Currency_ID=? "; - - int bankAccountId = DB.getSQLValue(trxName, sqlStmt, adOrgId, currencyId); - - if (bankAccountId != -1) - { - return bankAccountId; - } - - MOrgInfo orgInfo = MOrgInfo.get(ctx, adOrgId, trxName); - int bankId = orgInfo.getTransferBank_ID(); - - if (bankId <= 0) - { - MBank bank = new MBank(ctx, 0, trxName); - bank.setName("BANK ACCOUNT FOR TRANSFERS"); - bank.setDescription("** DO NOT USE **"); - bank.setRoutingNo("NOT USED"); - bank.setC_Location_ID(orgInfo.getC_Location_ID()); - bank.setIsOwnBank(true); - - PoManager.save(bank); - bankId = bank.get_ID(); - - orgInfo.set_TrxName(trxName); - orgInfo.setTransferBank_ID(bankId); - PoManager.save(orgInfo); - } - - MBankAccount bankAccount = new MBankAccount(ctx, 0, trxName); - bankAccount.setC_Bank_ID(bankId); - bankAccount.setBankAccountType(MBankAccount.BANKACCOUNTTYPE_Checking); // TODO Should consider to create a new type - bankAccount.setAccountNo("NOT USED"); - bankAccount.setC_Currency_ID(currencyId); - bankAccount.setIsDefault(false); - bankAccount.setCurrentBalance(Env.ZERO); - PoManager.save(bankAccount); - - return bankAccount.get_ID(); - } - - - public static int getCreateTransferCashBook(Properties ctx, int adOrgId, int currencyId, String trxName) throws OperationException - { - MOrgInfo orgInfo = MOrgInfo.get(ctx, adOrgId, trxName); - - if (orgInfo.getTransferCashBook_ID() > 0) - { - return orgInfo.getTransferCashBook_ID(); - } - - MCashBook cashBook = new MCashBook(ctx, 0, trxName); - cashBook.setAD_Org_ID(adOrgId); - cashBook.setName("CASH BOOK FOR TRANSFERS"); - cashBook.setDescription("** DO NOT USE **"); - cashBook.setC_Currency_ID(currencyId); - PoManager.save(cashBook); - - int dummyCashElementValue = AccountingManager.getCreateDummyCashElement(ctx, trxName); - - // No model defined for cashbook accounting - StringBuffer updateStmt = new StringBuffer(); - - updateStmt.append("UPDATE C_CashBook_Acct SET CB_Asset_Acct="); - updateStmt.append(dummyCashElementValue); - updateStmt.append(" WHERE C_CashBook_ID="); - updateStmt.append(cashBook.get_ID()); - - int updated = DB.executeUpdate(updateStmt.toString(), trxName); - if (updated <= 0) - { - throw new OperationException("Could not update cash book accounting"); - } - - return cashBook.get_ID(); - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/POSBpartnerInfoManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/POSBpartnerInfoManager.java deleted file mode 100644 index d493679f00..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/POSBpartnerInfoManager.java +++ /dev/null @@ -1,317 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 26, 2006 by alok - */ - -package org.posterita.businesslogic; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.util.DB; -import org.compiere.util.Env; - -import org.posterita.Constants; -import org.posterita.beans.BPartnerInfoBean; -import org.posterita.beans.POSHistoryBean; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; - -public class POSBpartnerInfoManager { - - public static ArrayList getPartnerInfo(Properties ctx, - boolean isCustomer) throws OperationException { - return getPartnerInfo(ctx, 0, null, isCustomer); - } - - public static ArrayList getPartnerInfo(Properties ctx, - String partnerName, boolean isCustomer) throws OperationException { - return getPartnerInfo(ctx, 0, partnerName, isCustomer); - } - - public static ArrayList getPartnerInfo(Properties ctx, - int bPartnerId, boolean isCustomer) throws OperationException { - return getPartnerInfo(ctx, bPartnerId, null, isCustomer); - } - - public static ArrayList getPartnerInfo(Properties ctx, - int bPartnerId, String partnerName, boolean isCustomer) - throws OperationException { - String sql = "select bp.c_bpartner_id," - + // 1 - "bp.name," - + // 2 //"bp.name||' ' ||bp.name2," + //2 - "loc.address1," - + // 3 - "loc.address2," - + // 4 - "loc.city," - + // 5 - "bploc.phone," - + // 6 - "bploc.phone2," - + // 7 - "bploc.fax," - + // 8 - "bp.TOTALOPENBALANCE," - + // 9 - "bp.SO_CREDITUSED," - + // 10 - "bp.SO_CREDITLIMIT," - + // 11 - "bp.ACTUALLIFETIMEVALUE," - + // 12 - "bp.C_Dunning_id," - + // 13 - "bp.FIRSTSALE, " - + // 14 - //"DECODE(bp.SOCREDITSTATUS,'" - "CASE WHEN bp.SOCREDITSTATUS='" - + MBPartner.SOCREDITSTATUS_CreditHold - //+ "','" - + "' THEN '" - + Constants.CREDIT_HOLD - //+ "'," - //+ "'" - + "' WHEN bp.SOCREDITSTATUS='" - + MBPartner.SOCREDITSTATUS_CreditStop - //+ "','" - + "' THEN '" - + Constants.CREDIT_STOP - //+ "'," - + "' WHEN bp.SOCREDITSTATUS='" - + MBPartner.SOCREDITSTATUS_NoCreditCheck - //+ "','" - + "' THEN '" - + Constants.NO_CREDIT_CHECK - //+ "'," - + "' WHEN bp.SOCREDITSTATUS='" - //+ "'" - + MBPartner.SOCREDITSTATUS_CreditOK - //+ "','" - + "' THEN '" - + Constants.CREDIT_OK - //+ "'," - + "' WHEN bp.SOCREDITSTATUS='" - //+ "'" - + MBPartner.SOCREDITSTATUS_CreditWatch - //+ "','" - + "' THEN '" - + Constants.CREDIT_WATCH - //+ "',bp.SOCREDITSTATUS) creditStatus" - + "' ELSE bp.SOCREDITSTATUS END AS creditStatus" - + // 15 - " from C_BPARTNER bp left join (C_BPARTNER_LOCATION bploc left join C_LOCATION loc on bploc.c_location_id=loc.c_location_id)" - + " on bp.C_BPARTNER_ID=bploc.C_BPARTNER_ID" - + " where bp.AD_ORG_ID in (" - + Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM) + ")" - + " and bp.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx); - - if (isCustomer) - sql = sql + " and bp.ISCUSTOMER='Y' "; - - else - sql = sql + " and bp.ISVENDOR='Y' "; - - if (bPartnerId != 0) - sql = sql + " and bp.c_bpartner_id=" + bPartnerId; - - if (partnerName != null) - // sql=sql+" and lower(bp.name||' ' ||"+ "bp.name2) like - // lower('%"+partnerName+"%')"; - sql = sql + " and lower(bp.name) like lower('%" + partnerName - + "%')"; - - BPartnerInfoBean bean = null; - - ArrayList list = new ArrayList(); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - ResultSet rs = null; - - try { - rs = pstmt.executeQuery(); - while (rs.next()) - - { - bean = new BPartnerInfoBean(); - bean.setBpartnerId(rs.getInt(1)); - bean.setPartnerName(rs.getString(2)); - bean.setAddress1(rs.getString(3)); - bean.setAddress2(rs.getString(4)); - bean.setCity(rs.getString(5)); - bean.setPhone(rs.getString(6)); - bean.setPhone2(rs.getString(7)); - bean.setFax(rs.getString(8)); - bean.setIsCustomer(isCustomer); - bean.setOpenAmt(rs.getBigDecimal(9)); - bean.setCreditUsed(rs.getBigDecimal(10)); - bean.setCreditLimit(rs.getBigDecimal(11)); - bean.setRevenue(rs.getBigDecimal(12)); - bean.setDunningId(rs.getInt(13)); - bean.setBpfirstSale(rs.getString(14)); - bean.setSoCreditStatus(rs.getString(15)); - list.add(bean); - } - - rs.close(); - } catch (SQLException e) { - throw new OperationException(e); - } finally { - try { - - pstmt.close(); - } catch (Exception e) { - } - - pstmt = null; - } - - return list; - - } - - public static ArrayList getbPartnerTrxDetails( - Properties ctx, int bPartnerId, boolean isCustomer) - throws OperationException { - - String sql = "select pr.name," + // 1 - " acc.M_PRODUCT_ID," + // 2 - "sum(-acc.qty)," + "sum(acc.AMTACCTCR-acc.AMTACCTDR) as amt" + // 4 - " from FACT_ACCT acc,m_product pr" - + " where acc.M_product_id=pr.m_product_id" - + " and acc.C_BPARTNER_ID=" + bPartnerId - + " and acc.ad_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " and acc.ACCOUNT_ID ="; - - if (isCustomer) - sql = sql - + "(select C_ELEMENTVALUE_ID from c_elementvalue where VALUE='41000' and AD_CLIENT_ID=" - + Env.getAD_Client_ID(ctx) + ")"; - else - sql = sql - + "(select C_ELEMENTVALUE_ID from c_elementvalue where VALUE='21100' and AD_CLIENT_ID=" - + Env.getAD_Client_ID(ctx) + ")"; - - sql = sql + " group by pr.name,acc.M_PRODUCT_ID"; - - BPartnerInfoBean bean = null; - - ArrayList list = new ArrayList(); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - ResultSet rs = null; - - try { - rs = pstmt.executeQuery(); - while (rs.next()) - - { - bean = new BPartnerInfoBean(); - bean.setProductName(rs.getString(1)); - bean.setProductId(rs.getInt(2)); - bean.setQuantity(rs.getBigDecimal(3)); - bean.setAmount(rs.getBigDecimal(4)); - list.add(bean); - } - - rs.close(); - } catch (SQLException e) { - throw new OperationException(e); - } finally { - try { - - pstmt.close(); - } catch (Exception e) { - } - - pstmt = null; - } - - return list; - - } - - public static ArrayList getBpartnerOrderHistory(Properties ctx, - int bPartnerId) throws OperationException { - String sql = "select ord.C_ORDER_ID," + // 1 - // "inv.c_invoice_id," + - "ord.created," + // 2 - "ord.grandtotal," + // 3 - "ord.DOCUMENTNO," + // 4 - "bp.name," + // 5 - " ord.orderType," + // 6 - " bp.C_BPARTNER_ID" + // 7 - " from c_order ord,C_BPARTNER bp" - + " where ord.C_BPARTNER_ID=bp.C_BPARTNER_ID" - + " and ord.AD_ORG_ID=" + Env.getAD_Org_ID(ctx) - + " and ord.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " and ord.c_bpartner_id=" + bPartnerId - + " and ord.isActive='Y'" + " and ord.docstatus in ('CO','CL')"; - - sql = sql + " order by ord.created desc"; - - System.out.println(sql); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - POSHistoryBean bean = null; - ArrayList list = new ArrayList(); - ResultSet rs = null; - - try { - rs = pstmt.executeQuery(); - - while (rs.next()) { - bean = new POSHistoryBean(); - bean.setOrderId(Integer.valueOf(rs.getInt(1))); - - bean.setDateAcct(rs.getTimestamp(2)); - bean.setOrderGrandTotal(rs.getBigDecimal(3)); - bean.setDocumentNo(rs.getString(4)); - bean.setPartnerName(rs.getString(5)); - bean.setOrderType(rs.getString(6)); - bean.setBpartnerId(rs.getInt(7)); - - list.add(bean); - - } - - rs.close(); - } catch (SQLException e) { - throw new OperationException(e); - } finally { - try { - - pstmt.close(); - } catch (Exception e) { - } - - pstmt = null; - } - - return list; - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/POSClientManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/POSClientManager.java deleted file mode 100644 index ca3c470b14..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/POSClientManager.java +++ /dev/null @@ -1,317 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - **/ - -/** - @author ashley - */ - -package org.posterita.businesslogic; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.Iterator; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MBankAccount; -import org.compiere.model.MCashBook; -import org.compiere.model.MClient; -import org.compiere.model.MCommission; -import org.compiere.model.MCurrency; -import org.compiere.model.MDiscountSchema; -import org.compiere.model.MLocation; -import org.compiere.model.MOrg; -import org.compiere.model.MOrgInfo; -import org.compiere.model.MPOSTerminal; -import org.compiere.model.MPriceList; -import org.compiere.model.MPriceListVersion; -import org.compiere.model.MRole; -import org.compiere.model.MRoleMenu; -import org.compiere.model.MStore; -import org.compiere.model.MTaxCategory; -import org.compiere.model.MUser; -import org.compiere.model.MWarehouse; -import org.compiere.util.Env; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.administration.RoleManager; -import org.posterita.businesslogic.administration.TaxManager; -import org.posterita.businesslogic.administration.UserManager; -import org.posterita.businesslogic.administration.WarehouseManager; -import org.posterita.core.FileManager; -import org.posterita.core.bean.ClientBean; -import org.posterita.exceptions.ClientAlreadyExistException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.WarehouseAlreadyExistsException; -import org.posterita.factory.GenericSystemObjectsFactory; -import org.posterita.factory.POSMenuFactory; -import org.posterita.factory.SystemObjectsFactory; -import org.posterita.lib.UdiConstants; -import org.compiere.model.MBank; -import org.compiere.model.MWebMenu; -import org.posterita.util.PoManager; - -public class POSClientManager extends ClientManager -{ - public static final String LOCATOR_SUFFIX = "Locator"; - public static final String SALES_REP_SUFFIX = "Sales Rep"; - public static final String DEFAULT_POS_TERMINAL = "Terminal 1"; - public static final String STORE_SUFFIX = "POS"; - public static final String taxCategoryName1 = "VAT"; - public static final String taxCategoryName2 = "Tax Exempt"; - public static final String CONTEXT_SUFFIX = "pos"; - public static final String STYLESHEET = "posteritaWarmsCSS.jsp"; - - public static Properties createPOSDetails(Properties ctx, int currencyId, String currencyName, String hostURL, String trxName) throws OperationException, WarehouseAlreadyExistsException - { - - int adClientId = Env.getAD_Client_ID(ctx); - int adOrgID = Env.getAD_Org_ID(ctx); - - MClient client = ClientManager.loadClient(ctx, adClientId, trxName); - MOrg org = OrganisationManager.loadOrganisation(ctx, adOrgID, trxName); - - String clientName = client.getName(); - String orgName = org.getName(); - - MOrgInfo orgInfo = org.getInfo(); - if(orgInfo == null) - throw new OperationException("Organisation does not have an Organisation Info"); - - int locationId = orgInfo.getC_Location_ID(); - if(locationId == 0) - throw new OperationException("Organistion does not have a location"); - - MLocation orgLocation = LocationManager.loadLocation(ctx, locationId, trxName); - - String city = orgLocation.getCity(); - int countryId = orgLocation.getCountry().get_ID(); - - String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " and AD_Org_ID=" + Env.getAD_Org_ID(ctx); - - int discountSchemaIds[] = MDiscountSchema.getAllIDs(MDiscountSchema.Table_Name, whereClause, trxName); - if(discountSchemaIds == null || discountSchemaIds.length == 0) - throw new OperationException("No Discount schema defined"); - - System.out.println("Creating Location..."); - - String cashBookName = orgName + " Cash Book"; - String posTerminalName = DEFAULT_POS_TERMINAL; - String salesPriceListName = orgName + " Sales Price List"; - String salesPriceListVersionName = orgName + " Sales Price List Version"; - String purchasePriceListName = orgName + " Purchase Price List"; - String purchasePriceListVersionName = orgName + " Purchase Price List Version"; - String warehouseName = orgName + " Warehouse"; - - - System.out.println("Creating Cash Book..."); - MCashBook cashBook = CashManager.createCashBook(ctx, org.get_ID(), cashBookName, currencyId, trxName); - - System.out.println("Creating Sales Pricelist..."); - MPriceList salesPriceList = PriceListManager.createPriceList(ctx, salesPriceListName, currencyId, 2, true, trxName); - System.out.println("Creating Purchase Pricelist..."); - MPriceList purchasePriceList = PriceListManager.createPriceList(ctx, purchasePriceListName, currencyId, 2, false, trxName); - - MPriceListVersion salesPriceListVersion = new MPriceListVersion(salesPriceList); - salesPriceListVersion.setName(salesPriceListVersionName); - salesPriceListVersion.setM_DiscountSchema_ID(discountSchemaIds[0]); - - PoManager.save(salesPriceListVersion); - - MPriceListVersion purchasePriceListVersion = new MPriceListVersion(purchasePriceList); - purchasePriceListVersion.setName(purchasePriceListVersionName); - purchasePriceListVersion.setM_DiscountSchema_ID(discountSchemaIds[0]); - PoManager.save(purchasePriceListVersion); - - System.out.println("Creating Bank..."); - MBank bank = new MBank(ctx, 0, trxName); - bank.setName(orgName + " Bank"); - bank.setRoutingNo("123456789"); - bank.setC_Location_ID(orgLocation.get_ID()); - PoManager.save(bank); - - System.out.println("Creating Bank Account..."); - MBankAccount bankAccount = new MBankAccount(ctx, 0, trxName); - bankAccount.setC_Bank_ID(bank.get_ID()); - bankAccount.setBankAccountType(MBankAccount.BANKACCOUNTTYPE_Checking); - bankAccount.setC_Currency_ID(currencyId); - bankAccount.setAccountNo("123456789"); - bankAccount.setIsDefault(true); - PoManager.save(bankAccount); - - - System.out.println("Creating Tax Categories..."); - MTaxCategory taxCategory15 = TaxManager.createTaxCategory(ctx, taxCategoryName1, trxName); - MTaxCategory taxCategory0 = TaxManager.createTaxCategory(ctx, taxCategoryName2, trxName); - - System.out.println("Creating Tax..."); - TaxManager.createTax(ctx, org.get_ID(), taxCategoryName1, taxCategory15.get_ID(), countryId, new BigDecimal("15.0"),taxCategoryName1,false, trxName); - TaxManager.createTax(ctx, org.get_ID(), taxCategoryName2, taxCategory0.get_ID(), countryId, new BigDecimal("0"), taxCategoryName1,true,trxName); - - System.out.println("Creating Warehouse..."); - MWarehouse warehouse = WarehouseManager.createWarehouse(ctx, org.get_ID(), warehouseName, - orgLocation.getC_Location_ID(), trxName); - - //set warehouse in org info - orgInfo.setM_Warehouse_ID(warehouse.getM_Warehouse_ID()); - orgInfo.save(); - - System.out.println("Creating Business Partners..."); - // Create Cash Transaction Business Partner - MBPartner defCashBPartner = BPartnerManager.createBPartner(ctx, org.get_ID(), org.getLinkedC_BPartner_ID(trxName), "Standard Customer", " ", true, false, false, false, " ", " ", city, " ", countryId, trxName); - MBPartner salesRepBPartner = BPartnerManager.createBPartner(ctx, org.get_ID(), org.getLinkedC_BPartner_ID(trxName), orgName + " Sales Rep", " ", false, false, true, true, " ", " ", city, " ", countryId, trxName); - - MUser salesRepUser = new MUser(ctx, 0, trxName); - salesRepUser.setC_BPartner_ID(salesRepBPartner.get_ID()); - salesRepUser.setName(orgName + " " + SALES_REP_SUFFIX); - PoManager.save(salesRepUser); - - - System.out.println("Creating POS Terminal..."); - MPOSTerminal terminal = POSTerminalManager.createPOSTerminal(ctx, org.get_ID(), posTerminalName, - cashBook.get_ID(), bankAccount.get_ID(), purchasePriceList.get_ID(), - salesPriceList.get_ID(), warehouse.get_ID(), defCashBPartner.get_ID(), - salesRepUser.get_ID(), trxName); - - - System.out.println("Creating Web store configuration..."); - - MStore store = StoreManager.createStore(ctx, clientName + " " + STORE_SUFFIX, - clientName + "pos", org.get_ID(), purchasePriceList.get_ID(), - salesRepUser.get_ID(), warehouse.get_ID(), "pos", hostURL, trxName) ; - - // Setting ctx with new configurations - Env.setContext(ctx, UdiConstants.TERMINAL_ID, String.valueOf(terminal.get_ID())); - Env.setContext(ctx, UdiConstants.U_POSTERMINAL_ID, String.valueOf(terminal.get_ID())); - Env.setContext(ctx, UdiConstants.PRICELIST_CTX_PARAM, String.valueOf(purchasePriceList.get_ID())); - Env.setContext(ctx, UdiConstants.POS_PURCHASE_PL_VERSION, String.valueOf(purchasePriceListVersion.get_ID())); - - return ctx; - } - - public static MUser createAdmin(Properties ctx, String userName, int orgId, String roleName, String password, String userPin, String address, String emailAddress, String trxName) throws OperationException - { - Properties nCtx = (Properties)ctx.clone(); - nCtx.setProperty("#AD_Client_ID", "0"); - nCtx.setProperty("#AD_Org_ID", "0"); - - MRole role = RoleManager.getOrCreateRole(ctx, orgId, roleName, true, BigDecimal.ZERO, true, true, true, true, true, true, trxName); - MUser user = UserManager.getOrCreateUser(ctx, 0, userName, true, address, address, address, password, emailAddress, true, "", 0, role.get_ID(), userPin,MCommission.DOCBASISTYPE_Invoice,new BigDecimal(10),MCommission.FREQUENCYTYPE_Monthly,new BigDecimal(0),false,trxName); - - String whereClause = " AD_Role_ID=" + role.get_ID(); - - int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause, trxName); - - for(int i = 0; i < roleMenuIds.length; i++) - { - MRoleMenu roleMenu = new MRoleMenu(ctx, roleMenuIds[i], trxName); - //roleMenu.delete(true); - } - - POSMenuFactory posMFactory = POSMenuFactory.getFactoryInstance(nCtx); - Iterator keyIter = posMFactory.getAllKeys(nCtx).iterator(); - - while(keyIter.hasNext()) - { - String key = (String)keyIter.next(); - MWebMenu menu = (MWebMenu)posMFactory.get(nCtx, key); - MRoleMenu roleMenu = new MRoleMenu(ctx, 0, trxName); - roleMenu.setAD_Role_ID(role.get_ID()); - roleMenu.setU_WebMenu_ID(menu.get_ID()); - PoManager.save(roleMenu); - } - - return user; - } - - public static String createClient(ClientBean clientBean) throws ClientAlreadyExistException, OperationException, WarehouseAlreadyExistsException - { - Properties ctx = Env.getCtx(); - Env.setContext(ctx, UdiConstants.USER_ID_CTX_PARAM, "100"); // SuperUser - - if(clientBean == null) - throw new OperationException("Bean cannot be null!!!"); - - if(ClientManager.isClientPresent(clientBean.getClientName())) - throw new ClientAlreadyExistException("Client with name: " + clientBean.getClientName() + " already exist!!!"); - - MCurrency currency = new MCurrency(ctx, clientBean.getCurrencyId(), null); - if(currency.get_ID() == 0) - throw new OperationException("Could not load currency with id: " + clientBean.getCurrencyId()); - - String hostUrl = "http://www." + clientBean.getClientName() + ".com/"; - File file = null; - FileOutputStream fos = null; - - try - { - file = File.createTempFile("accounting_" + System.currentTimeMillis(), ".csv"); - FileManager.write(clientBean.getFile().getInputStream(), file.getAbsolutePath()); - } - catch (FileNotFoundException e) - { - - e.printStackTrace(); - } - catch (IOException e) - { - - e.printStackTrace(); - } - finally - { - if (fos != null) - { - try - { - fos.close(); - } - catch(Exception ex) - {} - } - } - - ClientManager.getCreateClient(ctx, clientBean.getClientName(), clientBean.getOrgName(), clientBean.getCurrencyId(), currency.getDescription(), clientBean.getCountryId(), clientBean.getCity(), clientBean.getAddress1(), clientBean.getPostalAddress(), "", file); - ctx = ClientManager.getCtx(ctx, clientBean.getClientName(), clientBean.getOrgName()); - POSClientManager.createPOSDetails(ctx, clientBean.getCurrencyId(), currency.getDescription(), hostUrl, null); - - try - { - SystemObjectsFactory.reloadFactory(ctx); - GenericSystemObjectsFactory.reloadFactory(ctx); - /*GenericProductAttributeSetFactory.reloadFactory(ctx); - GenericProductAttributeFactory.reloadFactory(ctx);*/ - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - //AD_ORG_ID is set to 0 here so that Admin user can access all orgs - POSClientManager.createAdmin(ctx, clientBean.getUsername(), 0, clientBean.getRoleName(), clientBean.getPassword(), clientBean.getUserPIN(), clientBean.getAddress1(), clientBean.getEmail(), null); - - String storeContext = clientBean.getClientName() + "pos"; - return storeContext; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/POSGoodsManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/POSGoodsManager.java deleted file mode 100644 index 24d62e0927..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/POSGoodsManager.java +++ /dev/null @@ -1,616 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 27-Apr-2006 by alok - */ - - -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MInOut; -import org.compiere.model.MInOutConfirm; -import org.compiere.model.MInvoice; -import org.compiere.model.MOrder; -import org.compiere.model.MOrderLine; -import org.compiere.model.MPayment; -import org.compiere.model.MWarehouse; -import org.compiere.process.DocumentEngine; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.CreditCheckBean; -import org.posterita.beans.ItemBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.ProductBean; -import org.posterita.beans.ProductCategoryBean; -import org.posterita.businesslogic.creditsales.CreditOrderManager; -import org.posterita.exceptions.BPartnerOverCreditLimitException; -import org.posterita.exceptions.NoOrderLineFoundException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.order.UDIOrderTypes; -import org.posterita.util.PoManager; - - -public class POSGoodsManager -{ - public static final String GET_ALL_VENDORS="getAllVendors"; - public static final String GET_ALL_VENDORS_FOR_RETURN_NOTE="getAllVendorsForReturnNote"; - - public static MOrder createCustomerReturn(Properties ctx,OrderLineBean bean,ArrayList cartBeanItems,Integer bPartnerId,String reason,String trxName) throws BPartnerOverCreditLimitException,OperationException - { - return createGoodsReceiveNote(ctx,bean,cartBeanItems,true,bPartnerId,reason,trxName); - } - - public static MOrder createGoodsReceiveNote(Properties ctx,OrderLineBean bean,ArrayList cartBeanItems,Integer bPartnerId,String SupRef,String trxName)throws OperationException - { - return createGoodsReceiveNote(ctx,bean,cartBeanItems,false,bPartnerId,SupRef,trxName); - } - - - private static MOrder createGoodsReceiveNote(Properties ctx,OrderLineBean orderlineBean,ArrayList cartBeanItems,boolean isCustomerReturn,Integer bPartnerId,String desc,String trxName)throws BPartnerOverCreditLimitException,OperationException - { - MOrder order = null; - MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); - int priceListId=0; - Integer orderId = orderlineBean.getOrderId(); - String paymentRule=null; - String orderType=null; - - - if(orderId == null) - { - if(isCustomerReturn) - { - priceListId=POSTerminalManager.getSOPriceListId(ctx); - - if(orderlineBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) - { - paymentRule=MOrder.PAYMENTRULE_OnCredit; - orderType=UDIOrderTypes.CREDIT_MEMO.getOrderType(); - } - - else - { - paymentRule = orderlineBean.getPaymentRule(); - orderType=UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType(); - } - - order=OrderManager.createOrder(ctx,bPartnerId.intValue(),true,priceListId,orderType, - warehouse.get_ID(),paymentRule,trxName); - - if(orderlineBean.getPaymentTermId()!=null) - order.setC_PaymentTerm_ID(orderlineBean.getPaymentTermId()); - - int terminalId = POSTerminalManager.getTerminalId(ctx); - String posOrderDocNumber=orderlineBean.getDocumentNo(); - if(posOrderDocNumber!=null) - { - String whereClause1="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " and documentNo ='"+posOrderDocNumber+"'"; - int orderids1 []= MOrder.getAllIDs(MOrder.Table_Name,whereClause1,null); - - String number="R"+posOrderDocNumber; - String whereClause=null; - if(orderlineBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) - { - whereClause="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and orderType='"+UDIOrderTypes.CREDIT_MEMO.getOrderType()+ - "' and documentNo like('%"+number+"%')"; - } - else - { - whereClause="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and orderType='"+UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType()+ - "' and documentNo like('%"+number+"%')"; - } - - int orderids []= MOrder.getAllIDs(MOrder.Table_Name,whereClause,null); - int noOfOrders = orderids.length; - String docNumber=number+"_"+(noOfOrders+1); - order.setDocumentNo(docNumber); - order.setRef_Order_ID(orderids1[0]);//using it when complete the credit memo to find whether shipment has to be done or not - } - - if (terminalId == 0) - throw new OperationException("POS Id not present!!"); - - //order.setC_POS_ID(terminalId);TODO - Trifon; order.setU_POSTerminal_ID(terminalId); - } - else - { - priceListId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL); - order=OrderManager.createOrder(ctx,bPartnerId.intValue(),false,priceListId,UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType(), - warehouse.get_ID(),MOrder.PAYMENTRULE_Check,trxName); - } - } - else - { - //load existing order - order = OrderManager.loadOrder(ctx, orderId, trxName); - - //delete previous orderlines - OrderManager.deleteOrderlines(ctx, order, trxName); - } - - - boolean isDirty = false; - - if( bPartnerId != null ) - { - order.setC_BPartner_ID(bPartnerId); - isDirty = true; - } - - - if(desc!=null) - { - order.setDescription(desc); - isDirty = true; - } - - if( isDirty ) - { - PoManager.save(order); - } - - - - Iterator iter = cartBeanItems.iterator(); - ItemBean itemBean; - while(iter.hasNext()) - { - itemBean =(ItemBean)iter.next(); - - int m_product_id = itemBean.getProductId(); - BigDecimal qty = itemBean.getQty(); - BigDecimal actualPrice = itemBean.getActualPrice(); - BigDecimal discount = itemBean.getDiscountPercent(); - BigDecimal price = itemBean.getPrice(); - - OrderManager.createOrderLine(ctx, order, m_product_id, qty, discount, price); - } - - if(order.isSOTrx()==true) - { - CreditCheckBean crBean = OrderManager.checkBPartnerCreditLimit(ctx,order.getC_BPartner_ID(),order.get_ID(),order.get_TrxName()); - if(crBean.getValid()==false) - throw new BPartnerOverCreditLimitException(crBean.getMsg()); - } - - return order; - - } - - public static MOrder createAndCompletePODocuments(Properties ctx, int purchaseOrderId,String trxName) throws OperationException - { - MOrder purchaseOrder = new MOrder(ctx,purchaseOrderId,trxName); - - MOrderLine [] lines=purchaseOrder.getLines(); - - - if(lines.length==0) - { - throw new NoOrderLineFoundException("No OrderLines For This Order"); - } - - MOrder completedPurchaseOrder = completePurchaseOrder(ctx,purchaseOrder,"GRN No "+purchaseOrder.get_ID()); - - MInvoice draftedVendorInvoice = InvoiceManager.createVendorInvoice(ctx,purchaseOrder.get_ID(),trxName); - - MInvoice invoice = InvoiceManager.completeInvoice(ctx, draftedVendorInvoice); - - if(MInvoice.PAYMENTRULE_OnCredit.equals(invoice.getPaymentRule())) - { - //do nothing - } - else - { - MPayment draftedAPPayment = PaymentManager.createAPPayment(ctx,draftedVendorInvoice, trxName); - PaymentManager.completeAPPayment(ctx,draftedAPPayment); - } - - MWarehouse warehouse = new MWarehouse(ctx,purchaseOrder.getM_Warehouse_ID(),trxName); - - MInOut materialReceipt = MinOutManager.createMInOut(ctx,invoice,warehouse.get_ID()); - PoManager.save(materialReceipt); - - MInOutConfirm confirm=MinOutManager.createConfirmation(ctx,materialReceipt); - MinOutManager.completeConfirmation(ctx, confirm); - - MinOutManager.completeShipment(ctx, materialReceipt); - - OrderManager.printOrder(ctx,completedPurchaseOrder); - - return completedPurchaseOrder; - } - - public static MOrder completePurchaseOrder(Properties ctx, MOrder order,String POReference) throws BPartnerOverCreditLimitException,OperationException - { - - if (order.getDocStatus().equals(DocumentEngine.STATUS_Completed)) - throw new OperationException("Order has already been completed"); - - - - order.setPOReference(POReference); - - PoManager.processIt(order, DocumentEngine.ACTION_Complete); - - return order; - } - - - public static MOrder createGoodsReturnNote(Properties ctx,OrderLineBean orderlineBean,ArrayList cartBeanItems,Integer bPartnerId,String supRef,String trxName)throws OperationException - { - int purchasePLID = POSTerminalManager.getPOPriceListId(ctx); - MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); - - MOrder order = null; - Integer orderId = orderlineBean.getOrderId(); - - if(orderId == null) - { - order = OrderManager.createOrder(ctx,bPartnerId.intValue(),true,purchasePLID,UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType(), - warehouse.get_ID(),MOrder.PAYMENTRULE_Check,trxName); - } - else - { - //load existing order - order = OrderManager.loadOrder(ctx, orderId, trxName); - - //delete previous orderlines - OrderManager.deleteOrderlines(ctx, order, trxName); - } - - boolean isDirty = false; - - if( bPartnerId != null ) - { - MBPartner partner = new MBPartner(ctx, bPartnerId.intValue(), trxName); - order.setBPartner(partner); - isDirty = true; - } - - - if(supRef!=null) - { - order.setDescription(supRef); - isDirty = true; - } - - if( isDirty ) - { - PoManager.save(order); - } - - - Iterator iter = cartBeanItems.iterator(); - ItemBean itemBean; - - while(iter.hasNext()) - { - itemBean =(ItemBean)iter.next(); - OrderManager.createOrderLine(ctx,order,itemBean.getProductId().intValue(),itemBean.getQty(),new BigDecimal(0),new BigDecimal(0)) ; - } - return order; - } - - - public static ArrayList getAllSuppliers(Properties ctx) throws OperationException - { -// String sql = "select name||' '||name2 name," +//1 - String sql = "select name," +//1 FIXME Postgresql Fix, need more investigation to get to above functionality - "c_bpartner_id" +//2 - " from C_BPARTNER" + - " where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx) + - " and ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ - " and ISVENDOR='Y'"+ - " and isactive='Y'"+ - " order by upper(name)"; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - ArrayList list = new ArrayList(); - OrderLineBean bean = null; - ResultSet rs = null; - - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - bean = new OrderLineBean(); - bean.setPartnerName(rs.getString(1)); - bean.setBpartnerId(Integer.valueOf(rs.getInt(2))); - list.add(bean); - } - - rs.close(); - } - catch (SQLException e) - { - - throw new OperationException(e); - } - finally - { - try - { - - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return list; - } - - public static String getForward(Properties ctx,String isSales) - { - if(Boolean.valueOf(isSales).booleanValue()==true) - return GET_ALL_VENDORS; - else - return GET_ALL_VENDORS_FOR_RETURN_NOTE; - } - - - public static ArrayList getAllProductCategory(Properties ctx) throws OperationException - { - String sql="select name," + - "m_product_category_id" + - " from m_product_category"+ - " where AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ - " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ProductCategoryBean bean = null; - ArrayList list = new ArrayList(); - ResultSet rs = null; - - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - bean = new ProductCategoryBean(); - bean.setName(rs.getString(1)); - bean.setProductCategoryId(Integer.valueOf(rs.getInt(2))); - list.add(bean); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - - pstmt.close(); - } - catch (Exception e) - {} - - pstmt = null; - } - - return list; - - } - - - public static ArrayList getAllRevenueRecos(Properties ctx) throws OperationException - { - String sql="select name," + - "C_REVENUERECOGNITION_ID" + - " from C_REVENUERECOGNITION"+ - " where AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ - " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ProductCategoryBean bean = null; - ArrayList list = new ArrayList(); - ResultSet rs = null; - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - bean = new ProductCategoryBean(); - bean.setName(rs.getString(1)); - bean.setProductCategoryId(Integer.valueOf(rs.getInt(2))); - list.add(bean); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return list; - - } - -// private static int getBPartnerForProduct(Properties ctx, int productId) throws OperationException -// { -// -// String sql =" select c_bpartner_id from c_bpartner_product where "+ -// "AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ -// " and AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ -// " and M_PRODUCT_ID="+productId; -// -// int bPartnerId=0; -// -// PreparedStatement pstmt = DB.prepareStatement(sql,null); -// -// try -// { -// ResultSet rs = pstmt.executeQuery(); -// while(rs.next()) -// { -// bPartnerId=rs.getInt(1); -// } -// } -// catch (SQLException e) -// { -// throw new OperationException(e); -// } -// -// -// return bPartnerId; -// } - - public static ArrayList getAllTaxCategory(Properties ctx) throws OperationException - { - // MProduct product = new MProduct(ctx,productId,null); - - - String sql = "select tc.c_taxcategory_id, tc.name||' '||'Rate % '||tx.rate" + - " from c_taxcategory tc,C_TAX tx" + - " where tc.C_TAXCATEGORY_ID=tx.C_TAXCATEGORY_ID" + - " and tx.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " and tx.isActive='Y'"; - - - // - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ProductBean bean=null; - ArrayList list = new ArrayList(); - ResultSet rs = null; - - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - bean = new ProductBean(); - bean.setTaxCategoryId(Integer.valueOf(rs.getInt(1))); - bean.setTaxCategoryName(rs.getString(2)); - list.add(bean); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - - return list; - } - - public static MOrder completeCustomerReturnOrder( Properties ctx,int orderId, String trxName) throws OperationException - { - MOrder order = new MOrder(ctx, orderId, trxName); - - //this is dne to support the simple customer return order so that the shipment takes place - boolean delivered=true; - - if( order.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())|| order.getOrderType().equals(UDIOrderTypes.CREDIT_MEMO.getOrderType())) - { - if(order.getRef_Order_ID() != 0) //setting it while creating order - { - MOrder originalOrder = new MOrder(ctx,order.getRef_Order_ID(),trxName); - delivered=compareOrders(ctx,originalOrder,order); - } - } - if(delivered) - return POSManager.completePOSOrder(ctx,orderId,trxName); - else - return CreditOrderManager.completeCreditOrderWithOutShipment(ctx,order, trxName); - } - - private static boolean compareOrders(Properties ctx,MOrder orOrder,MOrder retOrder) throws OperationException - { - MOrderLine [] orOrderLine = orOrder.getLines(); - - MOrderLine [] retOrderLine = retOrder.getLines(); - - boolean delivered = false; - - for(int i=0;i maxDiscountAllowed ) - { - throw new DiscountLimitException("Discount Limit exceeded!"); - } - } - } - - if(bean.getBpartnerId() == null) - { - throw new OperationException("Business Partner cannot be null"); - } - - int cashBookId = POSTerminalManager.getCashBookId(ctx); - int terminalId = POSTerminalManager.getTerminalId(ctx); - int priceListId = POSTerminalManager.getSOPriceListId(ctx); - int warehouseId = POSTerminalManager.getWarehouseId(ctx); - - if(firstOrderOfTheDay(ctx)) - { - CashManager.closePreviousDraftedCashjournals(ctx, cashBookId, trxName); - } - - - String paymentRule=null; - - if (bean.getTrxType().equalsIgnoreCase(Constants.PAYMENT_RULE_CASH)) - paymentRule=MOrder.PAYMENTRULE_Cash; - else if(bean.getTrxType().equalsIgnoreCase(Constants.PAYMENT_RULE_CARD)) - paymentRule=MOrder.PAYMENTRULE_CreditCard; - else if(bean.getTrxType().equalsIgnoreCase(Constants.PAYMENT_RULE_CHEQUE)) - paymentRule=MOrder.PAYMENTRULE_Check; - else if(bean.getTrxType().equalsIgnoreCase(Constants.PAYMENT_RULE_MIXED)) - { - paymentRule=UdiConstants.PAYMENTRULE_MIXED; - validateMixedPaymentAmount(bean); - } - else if(bean.getTrxType().equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) - paymentRule=MOrder.PAYMENTRULE_OnCredit; - - else - throw new OperationException("Invalid Payment Rule"); - - //reusing existing order - MOrder order = null; - - Integer orderId = bean.getOrderId(); - if( orderId == null ) - { - //creating new order - order = OrderManager.createOrder(ctx, bean.getBpartnerId().intValue(), true, - priceListId, orderType.getOrderType(), warehouseId, paymentRule, trxName); - } - else - { - //updating existing order - MBPartner partner = new MBPartner(ctx, bean.getBpartnerId().intValue(), trxName); - order = new MOrder(ctx, orderId.intValue(), trxName); - - //deleting existing orderlines - OrderManager.deleteOrderlines(ctx, order, trxName); - - - order.setBPartner(partner); - order.setPaymentRule(paymentRule); - order.setDateOrdered(new Timestamp(System.currentTimeMillis())); - } - - //order.setC_POS_ID(terminalId);TODO - Trifon; order.setU_POSTerminal_ID(terminalId); - if(bean.getPaymentTermId()!=null) - { - order.setC_PaymentTerm_ID(bean.getPaymentTermId()); - } - PoManager.save(order); - - Iterator iter = cartBeanItems.iterator(); - ItemBean itemBean; - BigDecimal qtyTotal= BigDecimal.ZERO; - int i=0; - while(iter.hasNext()) - { - double actualPrice=0.0; - double discount=0.0; - itemBean =(ItemBean)iter.next(); - - if(bean.getDiscountPercent()!=null) - { - String discountEntered = bean.getDiscountPercent()[i]; - if( discountEntered == null || discountEntered.equals("")) - discount=0; - else - { - discount = Double.parseDouble(bean.getDiscountPercent()[i]); - actualPrice=Double.parseDouble(bean.getActualPrice()[i]); - } - } - - if(discount > 0.0) - { - MUser user = new MUser(ctx,Env.getAD_User_ID(ctx),null); - - MUserRoles[] userRole = MUserRoles.getOfUser(ctx,user.get_ID()); - - if (userRole.length == 0) - throw new OperationException("Role not found for user " + user.getName()); - - MRole role = new MRole(ctx,userRole[0].getAD_Role_ID(),null); - - MPriceList priceList = MPriceList.get(ctx, order.getM_PriceList_ID(), order.get_TrxName()); - int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, order.getM_PriceList_ID(), order.get_TrxName()); - BigDecimal limitPrice=ProductManager.getLimitPrice(ctx, priceListVersionId, itemBean.getProductId(), priceList.isSOPriceList(), order.get_TrxName()); - - MProduct product = new MProduct(ctx,itemBean.getProductId().intValue(),null); - MTax tax = TaxManager.getTaxFromCategory(ctx, product.getC_TaxCategory_ID(), order.get_TrxName()); - BigDecimal limitPriceWithTax = TaxManager.getPriceWithTax(ctx,limitPrice,tax.getRate()); - - if(role.isOverwritePriceLimit()==false && actualPrice/itemBean.getQty().doubleValue() < limitPriceWithTax.doubleValue()) - { - throw new LimitPriceViolatedException("Discount Exceeds Limit price, limit price is= "+limitPriceWithTax.doubleValue()); - } - else - { - itemBean.setDiscountPercent(new BigDecimal(discount)); - itemBean.setActualPrice(new BigDecimal(actualPrice)); - } - } - qtyTotal=qtyTotal.add(itemBean.getQty()); - itemBean.setQtyTotal(qtyTotal); - OrderManager.createOrderLine(ctx,order,itemBean.getProductId().intValue(),itemBean.getQty(),itemBean.getDiscountPercent(),itemBean.getActualPrice()) ; - i++; - } - - if(order.isSOTrx()==true) - { - CreditCheckBean crBean = OrderManager.checkBPartnerCreditLimit(ctx,order.getC_BPartner_ID(),order.get_ID(),order.get_TrxName()); - if(crBean.getValid()==false) - throw new BPartnerOverCreditLimitException(crBean.getMsg()); - } - - return order; - } - - private static void validateMixedPaymentAmount(OrderLineBean bean) throws InvalidTenderedAmountException - { - if(bean.getTrxType().equalsIgnoreCase(Constants.PAYMENT_RULE_MIXED)) - { - double cashAmt=0.0; - double chequeAmt=0.0; - double cardAmt =0.0; - - if(bean.getPaymentByCash()!=null) - cashAmt = bean.getPaymentByCash(); - if(bean.getPaymentByChq()!=null) - chequeAmt=bean.getPaymentByChq(); - if(bean.getPaymentByCard()!=null) - cardAmt = bean.getPaymentByCard(); - - BigDecimal total = FormatBigDecimal.currency(cashAmt+chequeAmt+cardAmt); - - double lineDiscount=0.0; - double sumActualAmt=0.0; - int count=0; - if(bean.getDiscountPercent()!=null && bean.getDiscountPercent().length>0) - { - for(int i=0;i0.0) - { - sumActualAmt= bean.getTotalActualPrice()-(bean.getTotalActualPrice()*(lineDiscount/100)); - } - - else - { - sumActualAmt=bean.getTotalActualPrice(); - } - - - if(total.doubleValue() !=sumActualAmt) - throw new InvalidTenderedAmountException("The Tendered Amount should be equal to the total amount"); - } - } - - - public static MInvoice createDocuments(Properties ctx, MOrder order) throws OperationException - { - MInvoice customerInvoice = createCustomerInvoice(ctx, order); - PoManager.processIt(customerInvoice, DocumentEngine.ACTION_Complete); - if (!customerInvoice.getPaymentRule().equalsIgnoreCase(MInvoice.PAYMENTRULE_Cash) && !customerInvoice.getPaymentRule().equals(MInvoice.PAYMENTRULE_OnCredit)) - { - MPayment paymentReceived = PaymentManager.createARReceipt(ctx, customerInvoice, customerInvoice.get_TrxName()); - PaymentManager.completePayment(ctx, paymentReceived); - } - - MInOut shipment = MinOutManager.createMInOut(ctx, customerInvoice, order.getM_Warehouse_ID()); - - if (customerInvoice.isCreditMemo()) - { - MInOutConfirm confirm=MinOutManager.createConfirmation(ctx,shipment); - MinOutManager.completeConfirmation(ctx, confirm); - } - MinOutManager.completeShipment(ctx, shipment); - order.setIsDelivered(true); - PoManager.save(order); - - if (firstCashInvoice(ctx, customerInvoice)) - { - CashManager.updateBeginningBalance(ctx, order.getC_POS_ID(), order.get_TrxName()); - } - - return customerInvoice; - - } - - public static MOrder completePOSOrder(Properties ctx,int orderId,OrderLineBean bean,String trxName) throws InvalidTenderedAmountException,BPartnerOverCreditLimitException,NoOrderLineFoundException,OperationException - { - MOrder order = new MOrder(ctx,orderId,trxName); - - if(order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) - { - if(bean.getAmountGiven()==null || bean.getAmountGiven().doubleValue()< order.getGrandTotal().doubleValue()) - { - throw new InvalidTenderedAmountException("The Amount given is Invalid"); - } - } - - if(order.getPaymentRule().equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED) && (bean.getPaymentByCash() == null || bean.getPaymentByCash() <= 0)) - { - if(bean.getAmountGiven()==null || bean.getAmountGiven().doubleValue() < bean.getPaymentByCash()) - { - throw new InvalidTenderedAmountException("The Amount given is Invalid"); - } - } - - order.setAmountTendered(bean.getAmountGiven()); - order.setAmountRefunded(bean.getAmountRefunded()); - PoManager.save(order); - - if(order.getLines().length==0) - { - throw new NoOrderLineFoundException("POS Order does not have any orderlines!"); - } - - PoManager.processIt(order, DocumentEngine.ACTION_Complete); - - Double cashAmt = bean.getPaymentByCash(); - if(cashAmt == null) - cashAmt = 0.0; - - Double chequeAmt=bean.getPaymentByChq(); - if(chequeAmt == null) - chequeAmt = 0.0; - - Double cardAmt = bean.getPaymentByCard(); - if(cardAmt == null) - cardAmt = 0.0; - - BigDecimal writeOffAmount = Env.ZERO; - - if (order.getAmountTendered() != null && order.getAmountRefunded() != null) - { - writeOffAmount = (order.getAmountTendered().subtract(order.getAmountRefunded())).subtract(order.getGrandTotal()); - } - - CheckoutBean checkoutBean = new CheckoutBean(); - checkoutBean.setAmountRefunded(order.getAmountRefunded()); - checkoutBean.setAmountTendered(order.getAmountTendered()); - checkoutBean.setBpartnerId(order.getC_BPartner_ID()); - checkoutBean.setCardAmt(new BigDecimal(cardAmt)); - checkoutBean.setCardNo(bean.getCreditCardNumber()); - checkoutBean.setCardType(bean.getCreditCardType()); - checkoutBean.setCashAmt(new BigDecimal(cashAmt)); - checkoutBean.setChequeAmt(new BigDecimal(chequeAmt)); - checkoutBean.setChequeNo(bean.getChequeNo()); - checkoutBean.setWriteOffAmt(writeOffAmount); - checkoutBean.setDiscountAmt(Env.ZERO); - - createAndCompleteDocuments(ctx, order, checkoutBean, trxName); - - return order; - } - - public static MOrder completePOSOrder(Properties ctx,int orderId, String trxName) throws OperationException - { - MOrder order = new MOrder(ctx, orderId, trxName); - - return completePOSOrder(ctx, order); - } - - public static MOrder completePOSOrder(Properties ctx,MOrder order) throws OperationException - { - MOrder completedOrder = OrderManager.completeOrder(ctx,order); - //if(completedOrder.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) - OrderManager.printOrder(ctx,completedOrder); - - createDocuments(ctx,completedOrder); - return completedOrder; - } - - public static MOrder completePOSOrderPrintInvoice(Properties ctx,MOrder order) throws OperationException - { - MOrder completedOrder = OrderManager.completeOrder(ctx,order); - MInvoice invoice = createDocuments(ctx,completedOrder); - InvoiceManager.printInvoice(ctx,invoice); - - return completedOrder; - } - - public static void createAndCompleteDocuments(Properties ctx, MOrder order, CheckoutBean bean, String trxName) throws OperationException - { - MInvoice invoice = createARInvoice(ctx,order.get_ID(), trxName); - createInvoiceLines(ctx, invoice, order, trxName); - PoManager.processIt(invoice, DocumentEngine.ACTION_Complete); - - if(order.getPaymentRule().equals(MOrder.PAYMENTRULE_OnCredit)) - { - //No payment for credit order - return; - } - - BigDecimal cashAmt = (bean.getCashAmt() == null ? Env.ZERO : bean.getCashAmt()); - BigDecimal cardAmt = (bean.getCardAmt() == null ? Env.ZERO : bean.getCardAmt()); - BigDecimal chequeAmt = (bean.getChequeAmt() == null ? Env.ZERO : bean.getChequeAmt()); - BigDecimal writeOffAmount = (bean.getWriteOffAmt() == null ? Env.ZERO : bean.getWriteOffAmt()); - BigDecimal discountAmt = (bean.getDiscountAmt() == null ? Env.ZERO : bean.getDiscountAmt()); - - boolean paymentCreated = false; - boolean discountApplied = false; - - /* - // Cash invoices creates automatically Cash Line entry upon completion of the invoice - // @see MInvoice.completeIt - // Reload cashLine to set writeOff Amt in case of cash payment - // because for each new cashline created, writeOff is set to zero by default - if (invoice.getPaymentRule().equals(MInvoice.PAYMENTRULE_Cash)) - { - paymentCreated = true; - - MCashLine cashLine = new MCashLine(ctx, invoice.getC_CashLine_ID(), trxName); - - if(cashLine != null) - { - cashLine.setWriteOffAmt(writeOffAmount); - cashLine.setDiscountAmt(discountAmt); - - if(!(discountAmt.compareTo(Env.ZERO)==0)) - { - cashLine.setAmount(invoice.getGrandTotal().subtract(discountAmt).subtract(writeOffAmount)); - } - else - { - cashLine.setAmount(invoice.getGrandTotal().subtract(writeOffAmount)); - } - - PoManager.save(cashLine); - } - else - { - throw new OperationException("Could not load CashLine"); - } - } - // For mixed payment with Cash being part - else if (cashAmt.compareTo(Env.ZERO) > 0 && invoice.getPaymentRule().equals(MInvoice.PAYMENTRULE_Mixed)) - { - int cashBookId = POSTerminalManager.getCashBookId(ctx); - MCash cash = MCash.get(ctx, cashBookId, invoice.getDateInvoiced(), trxName); - - if (cash == null) - { - throw new OperationException("Could not load Cash Journal to do cash entry"); - } - - //No WriteOff in case of Mixed Payment - MCashLine cashLine = CashManager.createCashLine(ctx, cash.get_ID(), - invoice.get_ID(), cashAmt, Env.ZERO, discountAmt, trxName); - invoice.setC_CashLine_ID(cashLine.get_ID()); - PoManager.save(cashLine); - - paymentCreated = true; - discountApplied = true; - } - */ - - //Modifications for cash payment - if (invoice.getPaymentRule().equals(MInvoice.PAYMENTRULE_Cash)) - { - paymentCreated = true; - BigDecimal amt = null; - - if(!(discountAmt.compareTo(Env.ZERO)==0)) - { - amt = invoice.getGrandTotal().subtract(discountAmt).subtract(writeOffAmount); - } - else - { - amt = invoice.getGrandTotal().subtract(writeOffAmount); - } - - MPayment paymentReceivedCash = PaymentManager.createARReceipt(ctx, invoice, - MPayment.TENDERTYPE_Cash, amt, invoice.get_TrxName()); - - paymentReceivedCash.setWriteOffAmt(writeOffAmount); - paymentReceivedCash.setDiscountAmt(discountAmt); - - PoManager.save(paymentReceivedCash); - PaymentManager.completePayment(ctx,paymentReceivedCash); - } - // For mixed payment with Cash being part - else if (cashAmt.compareTo(Env.ZERO) > 0 && invoice.getPaymentRule().equals(MInvoice.PAYMENTRULE_Mixed)) - { - //No WriteOff in case of Mixed Payment - MPayment paymentReceivedCash = PaymentManager.createARReceipt(ctx, invoice, - MPayment.TENDERTYPE_Cash, cashAmt, invoice.get_TrxName()); - - PoManager.save(paymentReceivedCash); - PaymentManager.completePayment(ctx,paymentReceivedCash); - - paymentCreated = true; - discountApplied = true; - } - //End of modifications - - - - // Enforce that check payment should be created only if Payment rule is check or mixed - if(chequeAmt.compareTo(Env.ZERO) > 0 - && (MInvoice.PAYMENTRULE_Check.equals(invoice.getPaymentRule()) || MInvoice.PAYMENTRULE_Mixed.equals(invoice.getPaymentRule()))) - { - MPayment paymentReceivedCheque = PaymentManager.createARReceipt(ctx, invoice, - MPayment.TENDERTYPE_Check, chequeAmt, invoice.get_TrxName()); - - if (bean.getChequeNo() != null && bean.getChequeNo().trim().length() > 0) - { - paymentReceivedCheque.setCheckNo(bean.getChequeNo()); - } - - if (!discountApplied && discountAmt.compareTo(Env.ZERO) > 0) - { - paymentReceivedCheque.setDiscountAmt(discountAmt); - } - - PoManager.save(paymentReceivedCheque); - PaymentManager.completePayment(ctx,paymentReceivedCheque); - - paymentCreated = true; - discountApplied = true; - } - - // Enforce that card payment should be created only if Payment rule is credit card or mixed - if (cardAmt.compareTo(Env.ZERO) > 0 - && (MInvoice.PAYMENTRULE_CreditCard.equals(invoice.getPaymentRule()) || MInvoice.PAYMENTRULE_Mixed.equals(invoice.getPaymentRule()))) - { - MPayment paymentReceivedCard = PaymentManager.createARReceipt(ctx, invoice, - MPayment.TENDERTYPE_CreditCard, cardAmt, invoice.get_TrxName()); - - if (bean.getCardType() != null && bean.getCardType().trim().length() > 0) - { - paymentReceivedCard.setCreditCardType(bean.getCardType()); - } - - if (bean.getCardNo() != null && bean.getCardNo().trim().length() > 0) - { - paymentReceivedCard.setCreditCardNumber(bean.getCardNo()); - } - - if (!discountApplied && discountAmt.compareTo(Env.ZERO) > 0) - { - paymentReceivedCard.setDiscountAmt(discountAmt); - } - - PoManager.save(paymentReceivedCard); - PaymentManager.completePayment(ctx,paymentReceivedCard); - - paymentCreated = true; - discountApplied = true; - } - - if (!paymentCreated) - { - throw new OperationException("No payments have been created!!!"); - } - - if (firstCashInvoice(ctx, invoice)) - CashManager.updateBeginningBalance(ctx, order.getC_POS_ID(),order.get_TrxName()); - - //@TODO not allowed to use MOrderLine getallids here, must use a manager. - int [] orderLines=MOrderLine.getAllIDs(MOrderLine.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and AD_ORG_ID="+Env.getAD_Org_ID(ctx)+" and C_ORDER_ID="+order.get_ID(),trxName); - MInOut shipment= MinOutManager.createShipment(ctx, order.get_ID(), orderLines, trxName); - MinOutManager.completeShipment(ctx,shipment); - } - - - public static ArrayList populateOrderLines(Properties ctx,MOrder order) throws OperationException - { - return populateOrderLines(ctx,order,false); - } - - public static ArrayList populateOrderLines(Properties ctx, MOrder order,boolean abbr) throws OperationException - { - MOrderLine [] lines=order.getLines(); - MOrderLine line; - MProduct product; - // AttributeValuesPair attributeValuesPair; - WebOrderLineBean orderLineBean; - BigDecimal qty = Env.ZERO; - BigDecimal totalGrossProfit = Env.ZERO; - BigDecimal totalGrossProfitPercentage = Env.ZERO; - - int priceListId = order.getM_PriceList_ID(); - - MPriceList priceList = MPriceList.get(ctx, priceListId, null); - ArrayList orderLines = new ArrayList(); - for (int i = 0; i < lines.length; i++) - { - line = lines[i]; - - product = new MProduct(ctx, line.getM_Product_ID(), null); - - orderLineBean = new WebOrderLineBean(); - orderLineBean.setProductName(product.getName()); - orderLineBean.setLineNetAmt(line.getLineNetAmt()); - BigDecimal lineTaxAmount = getLineTaxAmt(line.getCtx(), line.getLineNetAmt(), line.getC_Tax_ID(), priceList.isTaxIncluded(), line.getQtyOrdered()); - orderLineBean.setTaxAmt(lineTaxAmount); - BigDecimal lineTotalAmount = Env.ZERO; - if (priceList.isTaxIncluded()) - { - lineTotalAmount = line.getLineNetAmt(); - } - else - { - lineTotalAmount = line.getLineNetAmt().add(orderLineBean.getTaxAmt()); - } - - orderLineBean.setLineTotalAmt(lineTotalAmount); - orderLineBean.setUnitPrice(line.getPriceList().setScale(2, BigDecimal.ROUND_HALF_UP)); - orderLineBean.setPriceActual(line.getPriceActual()); - orderLineBean.setProductId(Integer.valueOf(line.getM_Product_ID())); - orderLineBean.setUom(product.getUOMSymbol()); - MTax tax = MTax.get(ctx, line.getC_Tax_ID()); - orderLineBean.setTaxRate(tax.getRate()); - BigDecimal multiplier = (tax.getRate().add(Env.ONEHUNDRED)).divide(Env.ONEHUNDRED); - - Integer purchasePriceListId = PriceListManager.getDefaultPriceListId(ctx, false); - Integer ppriceListVersionId = PriceListManager.getPriceListVersionID(ctx, purchasePriceListId, null); - MPriceList ppriceList = new MPriceList(ctx, purchasePriceListId, null); - MProductPrice pprice = MProductPrice.get(ctx, ppriceListVersionId, line.getM_Product_ID(), null); - - BigDecimal priceLimit = Env.ZERO; - - try - { - if(ppriceList.isTaxIncluded()) - { - priceLimit = pprice.getPriceLimit(); - } - else - { - priceLimit = pprice.getPriceLimit().multiply(multiplier); - } - } - catch(NullPointerException e) - { - priceLimit = Env.ZERO; - } - - orderLineBean.setPurchasePriceList(priceLimit.setScale(2, RoundingMode.HALF_DOWN)); - BigDecimal grossProfit = lineTotalAmount.subtract((priceLimit).multiply(line.getQtyOrdered())); - BigDecimal grossProfitPercentage = Env.ZERO; - - try - { - grossProfitPercentage = (grossProfit.divide(lineTotalAmount, 4, BigDecimal.ROUND_UP)).multiply(Env.ONEHUNDRED); - } - catch (ArithmeticException e) - { - grossProfitPercentage = Env.ZERO; - } - - totalGrossProfit = totalGrossProfit.add(grossProfit); - - orderLineBean.setGrossProfit(grossProfit.setScale(2, RoundingMode.HALF_DOWN)); - orderLineBean.setTotalGrossProfit(totalGrossProfit.setScale(2, RoundingMode.HALF_DOWN)); - orderLineBean.setGrossProfitPercentage(grossProfitPercentage.setScale(2, RoundingMode.HALF_DOWN)); - - if (line.getM_Product_ID() == 0) - { - if(line.getC_Charge_ID() != 0) - { - MCharge charge = ChargeManager.loadCharge(ctx, line.getC_Charge_ID(), null); - orderLineBean.setProductName(charge.getName()); - } - else - throw new OperationException("Unknown Order line type with id: " + line.get_ID()); - } - else - { - String description = product.getDescription(); - if(description == null) - { - description = product.getName(); - } - orderLineBean.setDescription(description); - } - - orderLineBean.setOrderLineId(Integer.valueOf(line.get_ID())); - orderLineBean.setIsinvoiced(Boolean.valueOf(false)); - orderLineBean.setIsQtyReserved(Boolean.valueOf(true)); - qty=qty.add(line.getQtyOrdered()); - orderLineBean.setQtyTotal(qty) ; - - orderLineBean.setQtyOrdered(line.getQtyOrdered()); - orderLineBean.setDiscountPercentage(line.getDiscount()); - BigDecimal discountAmt = Env.ZERO; - BigDecimal subTotal = Env.ZERO; - BigDecimal grandTotal = Env.ZERO; - - if (order.getPaymentRule().equals(MOrder.PAYMENTRULE_Cash) || order.getPaymentRule().equals(MOrder.PAYMENTRULE_Mixed)) - { - MInvoice invoice = MInvoice.get(ctx, order.getC_Invoice_ID()); - MCashLine cashLine = new MCashLine(ctx, invoice.getC_CashLine_ID(), null); - if (cashLine.getC_CashLine_ID() != 0) - { - discountAmt = cashLine.getDiscountAmt()==null? Env.ZERO: cashLine.getDiscountAmt(); - discountAmt = discountAmt.setScale(lineTotalAmount.scale(), RoundingMode.HALF_DOWN); - BigDecimal writeOffAmt = cashLine.getWriteOffAmt() == null? Env.ZERO: cashLine.getWriteOffAmt(); - writeOffAmt = writeOffAmt.setScale(lineTotalAmount.scale(), RoundingMode.HALF_DOWN); - - orderLineBean.setWriteOffAmt(writeOffAmt); - subTotal = order.getGrandTotal(); - grandTotal = cashLine.getAmount(); - } - } - - if (!order.getPaymentRule().equals(MOrder.PAYMENTRULE_Cash)) - { - int[] payIds = MPayment.getAllIDs(MPayment.Table_Name, "C_Invoice_ID = " + order.getC_Invoice_ID(), null); - for (int payId : payIds) - { - MPayment payment = new MPayment(ctx, payId, null); - - if (payment.get_ID() != 0) - { - if (payment.getDiscountAmt() != null) - { - discountAmt = discountAmt.add(payment.getDiscountAmt()); - } - subTotal = subTotal.add(payment.getPayAmt()); - grandTotal = grandTotal.add(payment.getPayAmt()); - } - } - } - - if(subTotal.compareTo(Env.ZERO)!=0) - { - try - { - totalGrossProfitPercentage = (totalGrossProfit.divide(subTotal, 4, BigDecimal.ROUND_UP)).multiply(Env.ONEHUNDRED); - } - catch (ArithmeticException e) - { - totalGrossProfitPercentage = Env.ZERO; - } - orderLineBean.setTotalGrossProfitPercentage(totalGrossProfitPercentage.setScale(2, BigDecimal.ROUND_HALF_UP)); - } - - orderLineBean.setDiscountAmt(discountAmt); - orderLineBean.setSubTotal(subTotal); - orderLineBean.setGrandTotal(grandTotal); - orderLines.add(orderLineBean); - } - - return orderLines; - } - - private static I_C_CashLine getCashLine(Properties ctx, MOrder order) throws OperationException - { - int invoiceId = order.getC_Invoice_ID(); - MInvoice invoice = new MInvoice(ctx, invoiceId, null); - I_C_CashLine cashLine = null; - try - { - cashLine = invoice.getC_CashLine(); - } - catch (Exception e) - { - throw new OperationException("No cash line generated for invoice: " + invoiceId); - } - return cashLine; - } - - public static WebDocumentBean calculateOrderTotals(ArrayList webOrderLineList) - { - Iterator iter = webOrderLineList.iterator(); - - WebOrderLineBean bean; - WebDocumentBean webDocumentBean=new WebDocumentBean(); - BigDecimal totalLines = Env.ZERO; - BigDecimal totalTax = Env.ZERO; - BigDecimal totalQty= Env.ZERO; - BigDecimal discountAmt = Env.ZERO; - BigDecimal writeOffAmt = Env.ZERO; - BigDecimal subTotal = Env.ZERO; - BigDecimal grandTotal = Env.ZERO; - - while(iter.hasNext()) - { - bean = (WebOrderLineBean) iter.next(); - totalLines = totalLines.add(bean.getLineNetAmt()); - totalTax = totalTax.add(bean.getTaxAmt()); - totalQty=totalQty.add(bean.getQtyTotal()); - if (bean.getDiscountAmt()!=null && bean.getDiscountAmt().compareTo(Env.ZERO)!=0) - { - discountAmt = bean.getDiscountAmt(); - } - if (bean.getWriteOffAmt()!=null && bean.getWriteOffAmt().compareTo(Env.ZERO)!=0) - { - writeOffAmt = bean.getWriteOffAmt(); - } - } - - subTotal = totalLines.add(totalTax); - grandTotal = subTotal.subtract(discountAmt).subtract(writeOffAmt); - - webDocumentBean.setTotalLines(totalLines); - webDocumentBean.setTotalTax(totalTax); - webDocumentBean.setSubTotal(subTotal); - webDocumentBean.setGrandTotal(grandTotal); - webDocumentBean.setTotalQty(totalQty); - return webDocumentBean; - } - - - public static String deleteOrderLines(Properties ctx,Integer[]orderlineIds,String trxName) throws OperationException - { - if((orderlineIds == null)||(orderlineIds.length == 0)) - { - throw new NoOrderLineSelectedException("Cannot delete orderlines. No orderlines supplied!"); - } - - MOrderLine orderLine = new MOrderLine(ctx,orderlineIds[0].intValue(),trxName); - MOrder order = new MOrder(ctx,orderLine.getC_Order_ID(),trxName); - - String orderType = order.getOrderType(); - - for(int i=0;i getPOSInfoReportData(Properties ctx, Timestamp fromDate, Timestamp todate, String trxName) throws OperationException - { - ArrayList list = getPOSInfo(ctx, fromDate, todate, trxName); - ArrayList reportData = new ArrayList(); - - Object[] headers = new Object[]{"POS Name","Organisation","Cash Total","Card Total","Cheque Total","Amount"}; - reportData.add(headers); - - NumberFormat formatter = new DecimalFormat("###,###,##0.00"); - - Object[] data = null; - String grandTotal = null; - - for (POSInfoBean bean : list) - { - data = new Object[6]; - - data[0] = bean.getPosName(); - data[1] = bean.getOrgName(); - data[2] = formatter.format(bean.getCashTotal().doubleValue()); - data[3] = formatter.format(bean.getCardTotal().doubleValue()); - data[4] = formatter.format(bean.getChequeTotal().doubleValue()); - - //format the currency - grandTotal = formatter.format(bean.getOrderGrandTotal().doubleValue()); - - data[5] = grandTotal; - - reportData.add(data); - } - - return reportData; - } - - protected static boolean firstCashInvoice(Properties ctx, MInvoice invoice) throws OperationException - { - boolean firstCashInvoice = false; - if (invoice != null && invoice.getC_CashLine_ID() > 0) - { - StringBuffer whereClause = new StringBuffer(); - whereClause.append("C_Cash_ID=(SELECT C_Cash_ID FROM C_CashLine WHERE C_CashLine_ID=") - .append(invoice.getC_CashLine_ID()) - .append(")"); - whereClause.append(" AND CashType='").append(MCashLine.CASHTYPE_Invoice).append("'"); - - int ids[] = MCashLine.getAllIDs(MCashLine.Table_Name, whereClause.toString(), invoice.get_TrxName()); - - firstCashInvoice = (ids.length == 1); - } - return firstCashInvoice; - } - - - public static BigDecimal getSumOfChequeAndCard(Properties ctx,Timestamp toDate,String paymentRule) throws OperationException - { - int terminalId = POSTerminalManager.getTerminalId(ctx); - BigDecimal grandTotal =null; - - String sql="select sum(pay.payAmt) " + - " from C_order ord,c_payment pay right outer join C_invoice inv on inv.c_Invoice_id=pay.c_Invoice_id" + - " where pay.created>="+ DB.TO_DATE(toDate, false) + - " and inv.c_order_id=ord.c_order_id"+ - " and ord.C_POS_ID="+terminalId+ - " and ord.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " and ord.AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ - " and inv.isSotrx='Y'"+ - " and ord.orderType in ('"+UDIOrderTypes.POS_ORDER.getOrderType()+"',"+ - "'"+UDIOrderTypes.CREDIT_ORDER.getOrderType()+"')"+ - " and pay.tenderType='"+paymentRule+"'"; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - try - { - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - if(rs.getString(1)==null) - grandTotal=new BigDecimal(0); - else - grandTotal=new BigDecimal(rs.getString(1)); - - grandTotal=grandTotal.add(paymentAmtWithOutInvoice(ctx,toDate,null,paymentRule,terminalId)); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) {} - - pstmt = null; - - } - - return grandTotal; - - } - - /** - * @ashley TODO Should look further into this workaround solution - * @param ctx - * @param fromDate - * @param toDate - * @param paymentRule - * @param terminalId - * @return - * @throws OperationException - */ - private static BigDecimal paymentAmtWithOutInvoice(Properties ctx, Timestamp fromDate, Timestamp toDate, - String paymentRule,int terminalId) throws OperationException - { - BigDecimal grandTotal =null; - String sql="select sum(pay.payAmt) " + - "from C_PAYMENT pay " ; - if(toDate==null) - { - sql=sql+ "where pay.created>= " + DB.TO_DATE(fromDate, false); - } - else - { - sql=sql+ " where pay.created between " + DB.TO_DATE(fromDate, false) + " AND " + DB.TO_DATE(toDate, false); - } - - - sql=sql+" and not exists(select * from c_invoice inv where pay.C_invoice_id=inv.c_invoice_id)" + - " and pay.tenderType='"+paymentRule+"'"; - - sql=sql+" and pay.description='"+terminalId+"'"; //pos id was saved into descriptuon while creating the payment for multiple invoice - - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - try - { - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - if(rs.getString(1)==null) - grandTotal=new BigDecimal(0); - else - grandTotal=new BigDecimal(rs.getString(1)); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) {} - - pstmt = null; - - } - - return grandTotal; - } - - - public static BigDecimal getSumOfChequeAndCardPaymentsForInfo(Properties ctx, Timestamp fromDate,Timestamp toDate,String paymentRule,int posId) throws OperationException - { - BigDecimal grandTotal =null; - - String sql="select sum(pay.payAmt) " + - " from C_INVOICE inv,C_order ord,c_payment pay " + - " where inv.c_order_id=ord.c_order_id"+ - " and inv.c_Invoice_id=pay.c_Invoice_id"+ - " and ord.C_POS_ID="+posId+ - " and ord.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " and ord.AD_ORG_ID="+Env.getAD_Org_ID(ctx)+ - " and inv.isSotrx='Y'"+ - " and ord.orderType in ('"+UDIOrderTypes.POS_ORDER.getOrderType()+"',"+ - "'"+UDIOrderTypes.CREDIT_ORDER.getOrderType()+"')"+ - " and pay.tenderType='"+paymentRule+"'"+ - " and pay.created between " + DB.TO_DATE(fromDate, false) + - " and " + DB.TO_DATE(toDate, false) ; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - try - { - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - if(rs.getString(1)==null) - grandTotal=new BigDecimal(0); - else - grandTotal=new BigDecimal(rs.getString(1)); - - grandTotal=grandTotal.add(paymentAmtWithOutInvoice(ctx,fromDate,toDate,paymentRule,posId)); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) {} - - pstmt = null; - - } - - return grandTotal; - - } - - /** - * It returns the date-time of last completed cash journal - * @param ctx - * @param cashBookId - * @return - * @throws OperationException - */ - public static Timestamp getTimeOfLastCompletedJournal(Properties ctx, int cashBookId, String trxName) throws OperationException - { - Timestamp lastDateTime = TimestampConvertor.getCurrentDateTimestamp(); - - StringBuffer sqlStmt = new StringBuffer(); - sqlStmt.append("SELECT MAX(cl.Created) FROM C_Cash c "); - sqlStmt.append("INNER JOIN C_CashLine cl ON cl.C_Cash_ID = c.C_Cash_ID "); - sqlStmt.append("WHERE c.C_CashBook_ID=? "); - sqlStmt.append("AND c.DocStatus IN ('CO', 'CL')"); - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); - pstmt.setInt(1, cashBookId); - - rs = pstmt.executeQuery(); - - if (rs.next() && rs.getTimestamp(1) != null) - { - lastDateTime = rs.getTimestamp(1); - } - } - catch (Exception exception) - { - throw new OperationException("Could not get last completed journal date and time", exception); - } - - return lastDateTime; - } - - private static CurrentTillAmountBean getCurrentTillForInfo(Properties ctx, int terminalId, Timestamp fromDate, Timestamp toDate) throws OperationException - { - BigDecimal cardSum = BigDecimal.valueOf(0.0); - BigDecimal chequeSum = BigDecimal.valueOf(0.0); - BigDecimal cashSum=new BigDecimal(0); - BigDecimal grandTotal; - BigDecimal beginingBalance=null; - BigDecimal statementDifference=null; - int cashBookId = POSTerminalManager.getCashBookId(ctx, terminalId); - cardSum = getSumOfChequeAndCardPaymentsForInfo(ctx,fromDate,toDate,MPayment.TENDERTYPE_CreditCard,terminalId); - chequeSum = getSumOfChequeAndCardPaymentsForInfo(ctx,fromDate,toDate,MPayment.TENDERTYPE_Check,terminalId); - ArrayList list = CashManager.getCashBookDetailsForTill(ctx, cashBookId,fromDate,toDate); - Iterator iter = list.iterator(); - - CashBookDetailBean cashDetBean; - while(iter.hasNext()) - { - cashDetBean = (CashBookDetailBean)iter.next(); - beginingBalance=cashDetBean.getBeginingBalance(); - statementDifference=cashDetBean.getStatementDifference(); - cashSum=cashDetBean.getStatementDifference(); - - } - - grandTotal = new BigDecimal(cardSum.doubleValue()+chequeSum.doubleValue()+cashSum.doubleValue()); - - CurrentTillAmountBean bean = new CurrentTillAmountBean(); - bean.setBeginingBalance(beginingBalance); - bean.setStatementDifference(statementDifference); - bean.setCardTotal(cardSum); - bean.setCashTotal(cashSum); - bean.setChequeTotal(chequeSum); - bean.setTillGrandTotal(grandTotal); - bean.setPosName(POSTerminalManager.getTerminalName(ctx, terminalId)); - - return bean; - } - - public static CurrentTillAmountBean getCurrentTillAmount(Properties ctx) throws OperationException - { - BigDecimal cardSum ; - BigDecimal chequeSum; - BigDecimal cashSum=new BigDecimal(0); - BigDecimal grandTotal; - BigDecimal beginingBalance=null; - BigDecimal statementDifference=null; - - int cashBookId = POSTerminalManager.getCashBookId(ctx); - Timestamp toDate = getTimeOfLastCompletedJournal(ctx, cashBookId, null); - cardSum = getSumOfChequeAndCard(ctx,toDate,MPayment.TENDERTYPE_CreditCard); - chequeSum = getSumOfChequeAndCard(ctx,toDate,MPayment.TENDERTYPE_Check); - CashBookDetailBean cashDetBean = CashManager.getCashBookDetails(ctx, null); - - // Recently completed journal and not new cash transaction performed - // Thus the Till beginning balance should be the ending balance - // as the new cash journal will have - if (DocumentEngine.STATUS_Completed.equals(cashDetBean.getDocStatus())) - { - beginingBalance = cashDetBean.getEndingBalance(); - statementDifference = Env.ZERO; - cashSum = beginingBalance; - } - else - { - beginingBalance=cashDetBean.getBeginingBalance(); - statementDifference=cashDetBean.getStatementDifference(); - cashSum=cashDetBean.getStatementDifference().add(cashDetBean.getBeginingBalance()); - } - - grandTotal = new BigDecimal(cardSum.doubleValue()+chequeSum.doubleValue()+cashSum.doubleValue()); - - CurrentTillAmountBean bean = new CurrentTillAmountBean(); - bean.setBeginingBalance(beginingBalance); - bean.setStatementDifference(statementDifference); - bean.setCardTotal(cardSum); - bean.setCashTotal(cashSum); - bean.setChequeTotal(chequeSum); - bean.setTillGrandTotal(grandTotal); - bean.setPosName(POSTerminalManager.getTerminalName(ctx)); - - return bean; - - } - - public static MInvoice createCustomerInvoice(Properties ctx, MOrder salesOrder) throws OperationException - { - MInvoice invoice = null; - - boolean isSOTrx = salesOrder.isSOTrx(); - - if (!isSOTrx) - throw new OperationException("Customer Invoice should be created from sales Order"); - - MDocType [] docType; - boolean isSotrx=true; - - if (salesOrder.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) - docType = MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_ARCreditMemo); - - else if (salesOrder.getOrderType().equals(UDIOrderTypes.CREDIT_MEMO.getOrderType())) - docType = MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_ARCreditMemo); - - else if (salesOrder.getOrderType().equals(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) - { - docType = MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_APCreditMemo); - isSotrx=false; - } - else - docType = MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_ARInvoice); - invoice = new MInvoice(salesOrder,docType[0].get_ID(),new Timestamp(System.currentTimeMillis())); - invoice.setIsSOTrx(isSotrx); - invoice.setC_Order_ID(salesOrder.get_ID()); - invoice.setPaymentRule(salesOrder.getPaymentRule()); - invoice.setC_DocTypeTarget_ID(docType[0].get_ID()); - invoice.setC_DocType_ID(docType[0].get_ID()); - invoice.setC_BPartner_ID(salesOrder.getC_BPartner_ID()); - invoice.setC_Currency_ID(salesOrder.getC_Currency_ID()); - invoice.setIsTaxIncluded(false); - invoice.setIsDiscountPrinted(true); - invoice.setTotalLines(salesOrder.getTotalLines()); - invoice.setGrandTotal(salesOrder.getGrandTotal()); - invoice.setC_PaymentTerm_ID(salesOrder.getC_PaymentTerm_ID()); - - PoManager.save(invoice); - - - MOrderLine [] orderLines=salesOrder.getLines(); - MInvoiceLine invoiceLine; - MTax tax; - - for( int i=0;i < orderLines.length;i++) - { - - invoiceLine = new MInvoiceLine(invoice); - invoiceLine.setOrderLine(orderLines[i]); - invoiceLine.setC_OrderLine_ID(orderLines[i].get_ID()); - invoiceLine.setQtyEntered(orderLines[i].getQtyEntered()); - invoiceLine.setM_AttributeSetInstance_ID(orderLines[i].getM_AttributeSetInstance_ID()); - - - tax = new MTax(ctx,orderLines[i].getC_Tax_ID(),null); - invoiceLine.setQty(orderLines[i].getQtyEntered()); - invoiceLine.setQtyEntered(orderLines[i].getQtyEntered()); - invoiceLine.setQtyInvoiced(orderLines[i].getQtyEntered()); - invoiceLine.setTaxAmt(tax.calculateTax(orderLines[i].getLineNetAmt(),false,3)); - invoiceLine.setLineNetAmt(orderLines[i].getLineNetAmt()); - invoiceLine.setLineTotalAmt(new BigDecimal(orderLines[i].getLineNetAmt().intValue()+tax.calculateTax(orderLines[i].getLineNetAmt(),false,3).intValue())); - - - PoManager.save(invoiceLine); - } - - return invoice; - } - - - /** - * Creates an Invoice for a sales order - * @param ctx Context - * @param salesOrderId Sales Order - * @param trxType Payment Rule - * @param trxName Transaction - * @return Invoice - * @throws OperationException if could not save invoice - */ - protected static MInvoice createARInvoice(Properties ctx, int salesOrderId, String trxName) throws OperationException - { - MOrder salesOrder = new MOrder(ctx,salesOrderId,trxName); - MInvoice invoice = null; - - boolean isSOTrx = salesOrder.isSOTrx(); - if (!isSOTrx) - { - throw new OperationException("AR Invoice should be created from sales Order"); - } - - if (!DocumentEngine.STATUS_Completed.equals(salesOrder.getDocStatus())) - { - throw new OperationException("Order not in completed status, Status: " + salesOrder.getDocStatus()); - } - - invoice = new MInvoice(salesOrder, 0, salesOrder.getDateOrdered()); - PoManager.save(invoice); - - return invoice; - } - - /** - * Create Invoice lines from OrderLines - * @param ctx - * @param invoice - * @param salesOrder - * @param trxName - * @throws OperationException if Line cannot be created - */ - protected static void createInvoiceLines(Properties ctx, MInvoice invoice, MOrder order, String trxName) throws OperationException - { - MOrderLine [] orderLines = order.getLines(); - MInvoiceLine invoiceLine; - - for( int i=0;i < orderLines.length;i++) - { - invoiceLine = new MInvoiceLine(invoice); - invoiceLine.setOrderLine(orderLines[i]); - invoiceLine.setQty(orderLines[i].getQtyEntered()); - PoManager.save(invoiceLine); - } - } - - public static boolean getCashDrawerStatusFromCookie(HttpServletRequest request) - { - String status = getDataFromCookie(request, "preference.cashdrawer"); - return "true".equalsIgnoreCase(status); - } - - public static String getPrintingTypeFromCookie(HttpServletRequest request) - { - return getDataFromCookie(request, "preference.printerType"); - } - - public static String getDataFromCookie(HttpServletRequest request, String key) - { - Cookie[] cookies = request.getCookies(); - String value = null; - - if(cookies != null) - { - for(int i=0;i cartItems = new ArrayList(); - - MOrderLine[] orderlines = order.getLines(); - MOrderLine orderline = null; - ItemBean item = null; - BigDecimal orderTotal = Env.ZERO; - BigDecimal orderTaxTotal = Env.ZERO; - BigDecimal orderQtyTotal = Env.ZERO; - - - for (int i = 0; i < orderlines.length; i++) - { - int c_tax_id = orderlines[i].getC_Tax_ID(); - MTax tax = new MTax(ctx, c_tax_id, null); - - orderline = orderlines[i]; - item = new ItemBean(); - item.setTaxRate(tax.getRate()); - - MProduct product = orderline.getProduct(); - - String description = product.getName(); - int productId = product.get_ID(); - BigDecimal qty = orderline.getQtyOrdered(); - String uom = product.getUOMSymbol(); - - //Prices - BigDecimal actualPrice = orderline.getPriceActual(); - BigDecimal lineNetAmt = actualPrice.multiply(qty); - - BigDecimal lineNetTaxAmt = tax.calculateTax(lineNetAmt, priceList.isTaxIncluded(), 2); - BigDecimal lineUnitTaxAmt = tax.calculateTax(actualPrice, priceList.isTaxIncluded(), 2); - - if (!priceList.isTaxIncluded()) - { - lineNetAmt = lineNetAmt.add(lineNetTaxAmt); - item.setUnitPrice(actualPrice); - item.setInclPrice(actualPrice.add(lineUnitTaxAmt)); - } - else - { - item.setInclPrice(actualPrice); - item.setUnitPrice(actualPrice.subtract(lineUnitTaxAmt)); - } - - item.setIsTaxIncluded(priceList.isTaxIncluded()); - item.setListPrice(orderline.getPriceList()); - item.setPriceLimit(orderline.getPriceLimit()); - item.setProductId(Integer.valueOf(productId)); - item.setDescription(description); - item.setQty(qty); - item.setUom(uom); - item.setProductName(product.getName()); - - item.setTaxAmt(lineNetTaxAmt); - item.setPrice(lineNetAmt); - item.setDiscountPercent(orderline.getDiscount()); - - //calculating totals - orderQtyTotal = orderQtyTotal.add(qty); - orderTaxTotal = orderTaxTotal.add(lineNetTaxAmt); - orderTotal = orderTotal.add(lineNetAmt); - - cartItems.add(item); - } - - cart.setTotalPrice(orderTotal); - cart.setItems(cartItems); - return cart; - } - - - public static ShoppingCartBean getShoppingCartForOrderInEdit(Properties ctx, int orderId, String trxName) throws OperationException - { - MOrder order = new MOrder(ctx, orderId, trxName); - - if(order==null) - throw new InvalidOrderIDException("Order is not present"); - - ShoppingCartBean cart = new ShoppingCartBean(); - - int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - String currency = PriceListManager.getCurrency(ctx, priceListId); - - /* if (currency.equals("EUR")) - cart.setCurrency(Constants.EURO_SIGN); - else */ - cart.setCurrency(currency); - - ArrayList cartItems = new ArrayList(); - - MOrderLine[] orderlines = order.getLines(); - MOrderLine orderline = null; - ItemBean item = null; - double total=0; - double taxTotal=0; - double priceTotal=0; - double qtyTotal=0; - - for (int i = 0; i < orderlines.length; i++) - { - orderline = orderlines[i]; - item = new ItemBean(); - - MProduct product = orderline.getProduct(); - - String description = product.getName(); - int productId = product.get_ID(); - BigDecimal qty = orderline.getQtyOrdered(); - - item.setProductId(Integer.valueOf(productId)); - item.setDescription(description); - item.setQty(qty); - - int [] taxIds = MTax.getAllIDs(MTax.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_TAXCATEGORY_ID="+product.getC_TaxCategory_ID() + " and isActive='Y'",null); - if(taxIds.length==0) - throw new OperationException("no tax Category for the product"); - MTax tax = new MTax(ctx,taxIds[0],null); - BigDecimal priceTax= tax.calculateTax(orderline.getLineNetAmt(),false,2); - - - - item.setUnitPrice(orderline.getPriceEntered()); - item.setStandardPrice(orderline.getLineNetAmt()); - item.setTaxAmt(priceTax); - item.setPrice(orderline.getLineNetAmt().add(priceTax)); - item.setActualPrice(orderline.getLineNetAmt().add(priceTax)); //initially price and the actual price are same - - priceTotal=priceTotal+orderline.getLineNetAmt().doubleValue(); - taxTotal=taxTotal+priceTax.doubleValue(); - total=total+orderline.getLineNetAmt().add(priceTax).doubleValue(); - qtyTotal=qtyTotal+qty.doubleValue(); - - item.setPriceTotal(new BigDecimal(priceTotal)); - item.setTaxTotal(new BigDecimal(taxTotal)); - item.setgrandTotal(new BigDecimal(total)); - item.setQtyTotal(new BigDecimal(qtyTotal)); - item.setDiscountPercent(orderline.getDiscount()); - - cartItems.add(item); - } - - //setting prices - // StockManager.setPOSItemPrices(ctx,cartItems,true); - - BigDecimal totalPrice = new BigDecimal(0.0d); - for(ItemBean bean:cartItems) - { - if(bean.getPriceTotal()!=null) - { - totalPrice = totalPrice.add(bean.getPriceTotal()); - } - } - - cart.setTotalPrice(totalPrice); - cart.setItems(cartItems); - - return cart; - } - - - - public static OrderBean getPOSOrderDetail(Properties ctx,String documentNo) throws InvalidOrderIDException,OperationException - { -// checking whether order exixts - int ids[] = MOrder.getAllIDs(MOrder.Table_Name,"ISACTIVE='Y' AND DOCUMENTNO = '" + documentNo + "' and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx),null); - - if((ids == null)||(ids.length == 0)) - { - throw new InvalidOrderIDException("Could not found order!"); - } - - if(ids.length>1) - throw new OperationException("two orders with same document number"); - - MOrder order= OrderManager.loadOrder(ctx, ids[0], null); - OrderBean bean=new OrderBean(); - bean.setOrderId(order.get_ID()); - bean.setBpartnerId(order.getC_BPartner_ID()); - bean.setDocStatus(order.getDocStatus()); - bean.setOrderType(order.getOrderType()); - bean.setPaymentTermId(order.getC_PaymentTerm_ID()); - - return bean; - - } - - public static MOrder createAndCompletePOSOrder(Properties ctx,OrderLineBean bean,ArrayList cartBeanItems) throws BPartnerOverCreditLimitException,OperationException, DiscountLimitException - { - - MOrder order = null; - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - order = createPOSOrder(ctx, bean, cartBeanItems,null/*trx.getTrxName()*/); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - throw (e); - } - finally - { - trx.close(); - } - - - OrderLineBean orderLineBean = new OrderLineBean(); - - if(order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) - { - MOrder newOrder = new MOrder(ctx,order.get_ID(),null);//has to load again as it is not getting the grand total - orderLineBean.setAmountGiven(newOrder.getGrandTotal()); - orderLineBean.setAmountRefunded(new BigDecimal(0)); - } - - order = completePOSOrder(ctx, order.get_ID(), orderLineBean, null); - - return order; - } - - public static BigDecimal getPayment(Properties ctx, int orderId, String tenderType, String trxName) throws OperationException - { - MOrder order = OrderManager.loadOrder(ctx,orderId,trxName); - - if(! UDIOrderTypes.POS_ORDER.getOrderType().equalsIgnoreCase(order.getOrderType())) - { - throw new OperationException("Only POS Orders are supported!"); - } - - if(! MOrder.DOCSTATUS_Completed.equalsIgnoreCase(order.getDocStatus())) - { - throw new OperationException("Document is not yet completed!"); - } - - boolean isCheck = MPayment.TENDERTYPE_Check.equalsIgnoreCase(tenderType); - boolean isCard = MPayment.TENDERTYPE_CreditCard.equalsIgnoreCase(tenderType); - boolean isCash = "S".equalsIgnoreCase(tenderType); - - if(isCash) - { - return order.getAmountTendered(); - } - - if(isCheck || isCard) - { - String whereClause = " C_ORDER_ID = " + orderId + - " AND TENDERTYPE = '" + tenderType + "'"; - - int[] ids = MPayment.getAllIDs(MPayment.Table_Name,whereClause,trxName); - - if(ids == null || ids.length == 0) - { - return new BigDecimal(0.0d); - } - - MPayment payment = new MPayment(ctx,ids[0],trxName); - - return payment.getPayAmt(); - } - - throw new OperationException("Invalid tender type :" + tenderType); - - } - - public static String getForward(Properties ctx,String orderType) - { - - if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) - { - return "/CreatePOSOrder.do"; - } - if(orderType.equalsIgnoreCase(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) - { - return "/CustomerReturnOrder.do"; - } - - if(orderType.equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) - { - return "/InitCreateCreditOrderAction.do?action=initCreateCreditOrder"; - } - - if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType())) - { - return "/GetAllPOSVendor.do?action=getAllVendors&isSales=true"; - } - if(orderType.equalsIgnoreCase(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) - { - return "/GetAllPOSVendor.do?action=getAllVendors&isSales=false"; - } - - else return "/CreatePartialPOSOrder.do"; - - } - - public static ArrayList getItemBean(ArrayList itemBean) - { - ArrayList list = new ArrayList(); - for(ItemBean bean : itemBean) - { - if(bean.getUnitPrice().compareTo(bean.getStandardPrice())==0 && bean.getDiscountPercent().doubleValue() > 0) - { - double disPer = bean.getDiscountPercent().doubleValue(); - double stanPrice = bean.getStandardPrice().doubleValue(); - double newStanPrice = stanPrice -( (stanPrice*disPer)/100); - bean.setStandardPrice(new BigDecimal(newStanPrice)); - - } - - list.add(bean); - } - - return list; - } - - //---------------------------------------------------------------------------------------------- - - public static int checkoutOrder(Properties ctx, CheckoutBean checkoutBean, ArrayList items, String trxName) throws Exception - { - boolean isSoTrx = true; - String orderType = checkoutBean.getOrderType(); - - int m_pricelist_id = POSTerminalManager.getSOPriceListId(ctx); - int m_warehouse_id = POSTerminalManager.getWarehouseId(ctx); - int cashBookId = POSTerminalManager.getCashBookId(ctx); - - //close previous cash journals - if(firstOrderOfTheDay(ctx)) - { - CashManager.closePreviousDraftedCashjournals(ctx, cashBookId, trxName); - } - - Integer c_bpartner_id = checkoutBean.getBpartnerId(); - - //takes bp pricelist - if(c_bpartner_id != null) - { - MBPartner bpartner = MBPartner.get(ctx, c_bpartner_id); - if(bpartner != null && bpartner.getM_PriceList_ID() > 0) - { - m_pricelist_id = bpartner.getM_PriceList_ID(); - } - } - else - { - //set standard customer - c_bpartner_id = POSTerminalManager.getCashBPartnerId(ctx); - } - - String tenderType = checkoutBean.getTenderType(); - String paymentRule = checkoutBean.getPaymentRuleFromTenderType(); - - //create order - MOrder order = OrderManager.createOrder(ctx, c_bpartner_id, isSoTrx, m_pricelist_id, orderType, - m_warehouse_id, paymentRule, trxName); - - - BigDecimal[] discounts = checkoutBean.getDiscount(); - BigDecimal grandTotal = Env.ZERO; - - for(int i=0; i items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - - ArrayList newItems = new ArrayList(); - - if (items == null || items.isEmpty()) - { - return; - } - - BigDecimal grandTotal = Env.ZERO; - BigDecimal grandTotalWithoutDiscount = Env.ZERO; - - int roleId = Env.getAD_Role_ID(ctx); - MRole role = MRole.get(ctx, roleId); - BigDecimal userDiscount = role.getUserDiscount(); - BigDecimal discountLimit = userDiscount; - - BigDecimal newOrderTotal = checkoutBean.getDiscountedTotal(); - BigDecimal newOrderDiscount = checkoutBean.getTotalDiscount(); - - if (newOrderDiscount.compareTo(discountLimit) == 1) // fraud! - { - throw new DiscountLimitException("user discount limit exceeded on total, " + - "discount percentage of " + newOrderDiscount +" was tried to be given"); - } - - Iterator itemBeanIter = items.iterator(); - BigDecimal priceLimitTotal = Env.ZERO; - - while (itemBeanIter.hasNext()) - { - ItemBean item = itemBeanIter.next(); - BigDecimal priceLimit = item.getPriceLimit(); - if (priceLimit == null) - { - throw new OperationException("Product "+ item.getProductName()+" has no price limit"); - } - priceLimitTotal = priceLimitTotal.add(priceLimit); - } - - if (priceLimitTotal.compareTo(newOrderTotal) == 1) //fraud! - { - throw new DiscountLimitException("user discount limit exceeded on total, " + - "total of " + newOrderTotal + "was tried to be given"); - } - - for(int i=0; i< prices.length; i++) - { - BigDecimal price = prices[i]; - Boolean isDiscOnInclUnitPrice = false; - BigDecimal discountedInclUnitPrice = Env.ZERO; - Boolean isDiscOnPerc = false; - Boolean isDiscOnTotal = false; - - if (isDiscOnInclUnitPrices != null) - { - isDiscOnInclUnitPrice = isDiscOnInclUnitPrices[i]; - } - if (discountedInclUnitPrices!= null) - { - discountedInclUnitPrice = discountedInclUnitPrices[i]; - } - if(isDiscountsOnPerc != null) - { - isDiscOnPerc = isDiscountsOnPerc[i]; - } - if(isDiscountsOnTotal != null) - { - isDiscOnTotal = isDiscountsOnTotal[i]; - } - ItemBean bean = items.get(i); - - BigDecimal unitPrice = bean.getUnitPrice(); - BigDecimal inclUnitPrice = bean.getInclPrice(); - BigDecimal listPrice = bean.getListPrice(); - BigDecimal qty = bean.getQty(); - BigDecimal total = Env.ZERO; - BigDecimal tax = bean.getTaxAmt(); - BigDecimal taxRate = bean.getTaxRate() == null? Env.ZERO: bean.getTaxRate(); - BigDecimal taxMulFactor = (taxRate.divide(Env.ONEHUNDRED, 2, RoundingMode.HALF_UP)).add(Env.ONE); - - BigDecimal discount = Env.ZERO; - BigDecimal actualPrice = Env.ZERO; - - if (priceList.isTaxIncluded()) - { - actualPrice = inclUnitPrice; - } - else - { - actualPrice = unitPrice; - } - - total = actualPrice.multiply(qty); - - // verify fraud - - if (!isDiscOnInclUnitPrice && !actualPrice.equals(discountedInclUnitPrice)) - { - if (discountedInclUnitPrice.compareTo(bean.getPriceLimit()) == -1) - { - throw new OperationException("incl unit price less than limit price, a value of " + - discountedInclUnitPrice + "was tried to be given"); - } - if (discountedInclUnitPrice.compareTo(bean.getListPrice()) == 1) - { - throw new OperationException("incl unit price less greater list price, a value of " + - discountedInclUnitPrice + "was tried to be given"); - } - } - if (!isDiscOnPerc && !discountPerc[i].equals(bean.getDiscountPercent())) - { - if (discountPerc[i].compareTo(Env.ZERO) == -1) - { - throw new OperationException("user discount less than zero on product " + - "" + bean.getProductName() +", discount percentage given is "+ discountPerc[i]); - } - if (discountPerc[i].compareTo(discountLimit) == 1) - { - throw new OperationException("user discount exceeds discount limit on product " + - "" + bean.getProductName() +", discount percentage given is "+ discountPerc[i]); - } - } - if (!isDiscOnTotal && !total.equals(price)) - { - if (price.compareTo(bean.getPriceLimit().multiply(bean.getQty())) == -1) - { - throw new OperationException("line total less than price limit total, a value of " + - price+" was tried to be given"); - } - - if (price.compareTo(bean.getListPrice().multiply(bean.getQty())) == 1) - { - throw new OperationException("line total greater than price list total, a value of " + - price+" was tried to be given"); - } - } - - if (isDiscOnInclUnitPrice) - { - discount = (listPrice.subtract(discountedInclUnitPrice)).divide(listPrice, 12, RoundingMode.HALF_UP).multiply(Env.ONEHUNDRED); - actualPrice = discountedInclUnitPrice; - } - else if (isDiscOnPerc) - { - discount = discountPerc[i]; - actualPrice = price.divide(qty, 2, RoundingMode.HALF_UP); - } - else if (isDiscOnTotal) - { - discount = ((total.subtract(price)).divide(total, 4, RoundingMode.HALF_UP)).multiply(Env.ONEHUNDRED); - actualPrice = price.divide(qty, 2, RoundingMode.HALF_UP); - bean.setIsDiscountOnTotal(false); // reset - } - - if (discount.compareTo(discountLimit) == 1) - { - throw new DiscountLimitException("user discount limit exceeded on product " + bean.getProductName() +", discount percentage given is "+ discount); - } - - // fraud verified - - bean.setActualPrice(actualPrice); - - if (priceList.isTaxIncluded()) - { - BigDecimal exclActualPrice = actualPrice.divide(taxMulFactor, 2, RoundingMode.HALF_UP); - tax = actualPrice.subtract(exclActualPrice); - unitPrice = actualPrice.divide(taxMulFactor, 2, RoundingMode.HALF_UP); - bean.setInclPrice(actualPrice); - } - else - { - tax = actualPrice.divide(taxMulFactor, 4).setScale(2, RoundingMode.HALF_UP); - bean.setInclPrice(actualPrice); - } - - bean.setTaxAmt(tax.multiply(qty)); - bean.setUnitPrice(unitPrice); - bean.setDiscountPercent(discount); - bean.setPrice(price); - bean.setIsDiscountOnInclUnitPrice(isDiscOnInclUnitPrice); - bean.setIsDiscountOnPercentage(isDiscOnPerc); - bean.setIsDiscountOnTotal(isDiscOnTotal); - - if (isDiscOnInclUnitPrice!=null && isDiscOnInclUnitPrice) - { - bean.setDiscountedInclUnitPrice(discountedInclUnitPrice); - bean.setDiscountedLinePrice(discountedInclUnitPrice); - } - // todo - remove that grand total hack - grandTotal = grandTotal.add(price); - bean.setgrandTotal(grandTotal); - grandTotalWithoutDiscount = grandTotalWithoutDiscount.add(total); - - newItems.add(bean); - } - - //Check for discount on total - request.getSession().setAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL, checkoutBean.getDiscountOnTotal()); - request.getSession().setAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL_PERCENT, checkoutBean.getDiscountOnTotalPercent()); - request.getSession().setAttribute(Constants.SHOPPING_CART_DISCOUNT_PERCENTAGE, newOrderDiscount); - request.getSession().setAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL, newOrderTotal); - request.getSession().setAttribute(Constants.SHOPPING_CART_TOTAL, grandTotal); - request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, newItems); - request.getSession().setAttribute(Constants.CHECKOUT_BEAN, checkoutBean); - - } - - - public static void setQuickDiscount(Properties ctx, CheckoutBean checkoutBean, HttpServletRequest request, String trxName) throws OperationException, DiscountLimitException - { - BigDecimal[] prices = checkoutBean.getDiscountedPrice(); - Boolean[] isDiscOnInclUnitPrices = checkoutBean.getIsDiscOnInclUnitPrice(); - BigDecimal[] discountPerc = checkoutBean.getDiscount(); - Boolean[] isDiscountsOnPerc = checkoutBean.getIsDiscOnPerc(); - Boolean[] isDiscountsOnTotal = checkoutBean.getIsDiscOnTotal(); - Integer priceListId = checkoutBean.getPriceListId(); - Integer productId = checkoutBean.getM_productId(); - BigDecimal totalLinesIncDisc = checkoutBean.getGrandTotal(); - MPriceList priceList = MPriceList.get(ctx, priceListId, trxName); - int priceListVersionId = 0; - - String currency = (String) request.getSession().getAttribute(Constants.CURRENCY_SYMBOLE); - - int roleId = checkoutBean.getRoleId(); - MRole role = MRole.get(ctx, roleId); - BigDecimal userDiscount = role.getUserDiscount(); - BigDecimal discountLimit = userDiscount; - boolean isDiscountAllowedOnTotal = role.isDiscountAllowedOnTotal(); - boolean isDiscountUptoLimitPrice = role.isDiscountUptoLimitPrice(); - boolean isOverideLimitPrice = role.isOverwritePriceLimit(); - - if (priceListId != null) - { - MPriceListVersion plv = PriceListManager.getPriceListVersion(ctx, priceListId, null, trxName); - priceListVersionId = plv.get_ID(); - } - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - - if (items == null || items.isEmpty()) - { - return; - } - - Iterator iter = items.iterator(); - ItemBean bean; - - if(isDiscountAllowedOnTotal && isDiscountsOnTotal[0]) - { - BigDecimal totalListPrice = Env.ZERO; - BigDecimal totalLimitPrice = Env.ZERO; - BigDecimal taxPerc = Env.ZERO; - BigDecimal grandTotal = Env.ZERO; - - for (ItemBean itemBean : items) - { - MPriceList sprice = new MPriceList(ctx, itemBean.getPriceListId(), null); - ProductBean details = POSProductManager.viewPOSProduct(ctx, itemBean.getProductId(), priceListId, null); - taxPerc = (details.getTaxRate().add(Env.ONEHUNDRED)).divide(Env.ONEHUNDRED, 4, BigDecimal.ROUND_HALF_UP); - - - if(sprice.isTaxIncluded()) - { - totalLimitPrice = totalLimitPrice.add(details.getPriceLimit()); - totalListPrice = totalListPrice.add(details.getPriceList()); - } - else - { - totalLimitPrice = totalLimitPrice.add(details.getPriceLimit().multiply(taxPerc)); - totalListPrice = totalListPrice.add(details.getPriceList().multiply(taxPerc)); - } - - grandTotal = itemBean.getGrandTotal(); - - } - - if(isDiscountUptoLimitPrice && !isOverideLimitPrice) - { - if(totalLinesIncDisc.compareTo(totalListPrice) == 1) - { - throw new OperationException("DISCOUNTED TOTAL EXCEEDS TOTAL LINES!!! A discount to price " + currency + totalLinesIncDisc +" was tried to be given"); - } - - if(totalLinesIncDisc.compareTo(totalLimitPrice) == 1) - { - throw new OperationException("TOTAL DISCOUNT EXCEEDED!!! A discount to price " + currency + totalLinesIncDisc +" was tried to be given"); - } - } - - if(!isDiscountUptoLimitPrice && isOverideLimitPrice) - { - if(userDiscount.compareTo(Env.ZERO) == 1) - { - BigDecimal discount = totalListPrice.subtract(totalLinesIncDisc) ; - BigDecimal discPerc = discount.divide(totalListPrice, 2, BigDecimal.ROUND_HALF_UP).multiply(Env.ONEHUNDRED); - - if(discPerc.compareTo(userDiscount) == 1) - { - throw new OperationException("DISCOUNT LIMIT EXCEEDED!!!"); - } - - discount = totalLinesIncDisc.subtract(grandTotal); - - if(discount.compareTo(Env.ZERO) == 1) - { - throw new OperationException("DISCOUNT CANNOT BE NAGATIVE!!!"); - } - } - - if(userDiscount.compareTo(Env.ZERO) == 0) - { - throw new OperationException("CANNOT APPLY DISCOUNT!!!
NO DISCOUNT PERCENTAGE SET"); - } - } - - if(isDiscountUptoLimitPrice && !isOverideLimitPrice) - { - if(userDiscount.compareTo(Env.ZERO) == 1) - { - if(totalLinesIncDisc.compareTo(totalLimitPrice) == -1) - { - throw new OperationException("CANNOT OVERRIDE LIMIT PRICE!!!"); - } - - if(totalLinesIncDisc.compareTo(totalListPrice) == 1) - { - throw new OperationException("DISCOUNTED TOTAL EXCEEDS TOTAL LINES!!!"); - } - } - - if(userDiscount.compareTo(Env.ZERO) == 0) - { - throw new OperationException("CANNOT APPLY DISCOUNT!!!
NO DISCOUNT PERCENTAGE SET"); - } - } - - if(isDiscountUptoLimitPrice && isOverideLimitPrice) - { - throw new OperationException("DISCOUNT ERROR!! CANNOT PROCESS YOUR REQUEST!!!"); - } - - BigDecimal discountAmt = totalListPrice.subtract(totalLinesIncDisc); - checkoutBean.setDiscountOnTotal(isDiscountsOnTotal[0]); - checkoutBean.setDiscountAmt(discountAmt); - checkoutBean.setDiscountedTotal(totalLinesIncDisc); - checkoutBean.setGrandTotal(totalLinesIncDisc); - - request.getSession().setAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL, totalLinesIncDisc); - } - else - { - - while (iter.hasNext()) - { - bean = (ItemBean) iter.next(); - if(bean.getProductId().equals(productId)) - { - BigDecimal price = prices[0]; - BigDecimal listPrice = bean.getListPrice(); - BigDecimal limitPrice = bean.getPriceLimit(); - BigDecimal qty = bean.getQty(); - BigDecimal total = Env.ZERO; - BigDecimal grandTotal = Env.ZERO; - BigDecimal grandTotalWithoutDiscount = Env.ZERO; - BigDecimal tax = bean.getTaxAmt(); - - MProduct product = new MProduct(ctx,productId, trxName); - MTax mtax = TaxManager.getTaxFromCategory(ctx, product.getC_TaxCategory_ID(), trxName); - - BigDecimal taxRate = mtax.getRate(); - BigDecimal taxMulFactor = (taxRate.divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_UP)).add(Env.ONE); - BigDecimal newTaxAmt = mtax.calculateTax(price.multiply(qty), true, 12).setScale(2, BigDecimal.ROUND_HALF_DOWN); - - if(!priceList.isTaxIncluded()) - { - listPrice = listPrice.multiply(taxMulFactor); - } - - if(isDiscountUptoLimitPrice) - { - if(price.compareTo(limitPrice) == -1) - { - throw new OperationException("You cannot exceed the limit price!! A discount to price " + currency + prices[0] +" was tried to be given"); - } - - if(price.compareTo(listPrice) == 1) - { - throw new OperationException("You cannot exceed the list price!! A discount to price " + currency + prices[0] +" was tried to be given"); - } - } - - if(isDiscountUptoLimitPrice && !isOverideLimitPrice) - { - if(price.compareTo(limitPrice) == -1) - { - throw new OperationException("You cannot exceed the limit price!! A discount to price " + currency + prices[0] +" was tried to be given"); - } - - if(price.compareTo(listPrice) == 1) - { - throw new OperationException("You cannot exceed the list price!! A discount to price " + currency + prices[0] +" was tried to be given"); - } - } - - if(!isDiscountUptoLimitPrice && isOverideLimitPrice) - { - if(userDiscount.compareTo(Env.ZERO) == 1) - { - if(discountPerc[0].compareTo(userDiscount) == 1) - { - throw new OperationException("DISCOUNT LIMIT EXCEEDED!!!"); - } - } - - if(userDiscount.compareTo(Env.ZERO) == 0) - { - throw new OperationException("CANNOT APPLY DISCOUNT!!!
NO DISCOUNT PERCENTAGE SET"); - } - } - - if(!isDiscountUptoLimitPrice && !isOverideLimitPrice) - { - if(userDiscount.compareTo(Env.ZERO) == 1) - { - if(discountPerc[0].compareTo(userDiscount) == 1) - { - throw new OperationException("DISCOUNT LIMIT EXCEEDED!!!"); - } - - if(discountPerc[0].compareTo(Env.ZERO) == -1) - { - throw new OperationException("DISCOUNT CANNOT BE NEGATIVE!!!"); - } - - if(price.compareTo(limitPrice) == -1) - { - throw new OperationException("CANNOT OVER RIDE LIMIT PRICE!!!"); - } - } - - if(userDiscount.compareTo(Env.ZERO) == 0) - { - throw new OperationException("CANNOT APPLY DISCOUNT!!!
NO DISCOUNT PERCENTAGE SET"); - } - - } - - if(isDiscountUptoLimitPrice && isOverideLimitPrice) - { - throw new OperationException("DISCOUNT ERROR!! CANNOT PROCESS YOUR REQUEST!!!"); - } - - bean.setInclPrice(price.setScale(2, BigDecimal.ROUND_HALF_UP)); - - BigDecimal incPriceExcVat = ((price.multiply(qty)).subtract(newTaxAmt)).divide(qty, 2, BigDecimal.ROUND_HALF_UP); - bean.setDiscountedLinePrice(incPriceExcVat.setScale(2, BigDecimal.ROUND_HALF_UP)); - bean.setDiscountedInclUnitPrice(incPriceExcVat); - bean.setUnitPrice(incPriceExcVat.setScale(2, BigDecimal.ROUND_HALF_UP)); - - bean.setTaxAmt(newTaxAmt.setScale(2, BigDecimal.ROUND_HALF_UP)); - bean.setIsDiscountOnInclUnitPrice(isDiscOnInclUnitPrices[0]); - bean.setIsDiscountOnPercentage(isDiscountsOnPerc[0]); - bean.setIsDiscountOnTotal(isDiscountsOnTotal[0]); - - bean.setPrice(price.multiply(qty)); - grandTotal = grandTotal.add(price); - bean.setgrandTotal(grandTotal); - grandTotalWithoutDiscount = grandTotalWithoutDiscount.add(total); - - } - } - } - //Check for discount on total - request.getSession().setAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL, checkoutBean.getDiscountOnTotal()); - request.getSession().setAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL_PERCENT, checkoutBean.getDiscountOnTotalPercent()); - request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, items); - request.getSession().setAttribute(Constants.CHECKOUT_BEAN, checkoutBean); - - } - - /*private static void validateUserInput(ItemBean itemBean, CheckoutBean checkoutBean) - { - BigDecimal discountLimit = checkoutBean.getDiscountLimit(); - BigDecimal[] prices = checkoutBean.getDiscountedPrice(); - Boolean[] isDiscOnInclUnitPrices = checkoutBean.getIsDiscOnInclUnitPrice(); - BigDecimal[] discountedInclUnitPrices = checkoutBean.getDiscInclUnitPrice(); - BigDecimal[] discountPerc = checkoutBean.getDiscount(); - Boolean[] isDiscountsOnPerc = checkoutBean.getIsDiscOnPerc(); - Boolean[] isDiscountsOnTotal = checkoutBean.getIsDiscOnTotal(); - - if (!isDiscOnInclUnitPrice && actualPrice.compareTo(discountedInclUnitPrice) == 1) - { - throw new OperationException("incl unit price not valid, a value of " + - discountedInclUnitPrice + "was tried to be given"); - } - if (!isDiscOnPerc && discountPerc[i].compareTo(bean.getDiscountPercent()) == 1) - { - throw new OperationException("user discount limit exceeded on product " + - "" + bean.getProductName() +", discount percentage given is "+ discountPerc[i]); - } - if (!isDiscOnTotal && !total.equals(price)) - { - if ((price.compareTo(bean.getPriceLimit().multiply(bean.getQty())) == -1) || total.compareTo(price)==-1) - throw new OperationException("line total not valid, a value of " + - price+" was tried to be given"); - } - - }*/ - - public static int createGoodsReceiveNote(Properties ctx, CheckoutBean checkoutBean, HttpServletRequest request, String trxName) throws OperationException - { - MOrder order = null; - - MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); - int priceListId = 0; - Integer bpartnerId = checkoutBean.getBpartnerId(); - - if (bpartnerId == null) - { - throw new MandatoryException("Vendor is mandatory"); - } - priceListId = checkoutBean.getPriceListId(); - - if(checkoutBean.getPriceListId() == null) - { - priceListId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL); - } - - order = OrderManager.createOrder(ctx,bpartnerId,false,priceListId,UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType(), - warehouse.get_ID(),checkoutBean.getPaymentRuleFromTenderType(),trxName); - - - PoManager.save(order); - - - //create orderlines - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - - for(int i=0; i items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - - MOrder order = POSGoodsManager.createCustomerReturn(ctx,orderBean,items,bpartnerId,reason,trxName); - POSGoodsManager.completeCustomerReturnOrder(ctx,order.get_ID(),trxName); - - return order.get_ID(); - } - - public static int createGoodsReturnNote(Properties ctx, CheckoutBean checkoutBean, HttpServletRequest request, String trxName) throws OperationException - { - MOrder order = null; - - MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); - int priceListId = 0; - Integer bpartnerId = checkoutBean.getBpartnerId(); - - if (bpartnerId == null) - { - throw new MandatoryException("Vendor is mandatory"); - } - priceListId = checkoutBean.getPriceListId(); - - if(checkoutBean.getPriceListId() == null) - { - priceListId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL); - } - - order = OrderManager.createOrder(ctx,bpartnerId,false,priceListId,UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType(), - warehouse.get_ID(),checkoutBean.getPaymentRuleFromTenderType(),trxName); - - - PoManager.save(order); - - - //create orderlines - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - - for(int i=0; i0) - { - ProductImageManager.clearImages(ctx, product.get_ID(), null); - ProductImageUploader.uploadImage(ctx, product.get_ID(), attachment, attachment.getFileName(), null); - } - return product; - } - - public static ProductBean viewPOSProduct(Properties ctx,int productId, int priceListId, String trxName) throws OperationException - { - ProductBean bean = viewPOSProduct(ctx, productId, trxName); - int priceListversionId = PriceListManager.getPriceListVersionID(ctx, priceListId, trxName); - - MProductPrice productPrice = MProductPrice.get(ctx, priceListversionId, productId, trxName); - if(productPrice != null) - { - bean.setPriceList(productPrice.getPriceList()); - bean.setPriceStandard(productPrice.getPriceStd()); - bean.setPriceLimit(productPrice.getPriceLimit()); - bean.setPriceListId(priceListId); - } - - return bean; - } - - public static ProductBean viewPOSProductForInventory(Properties ctx,int productId, int priceListId, String trxName) throws OperationException - { - ProductBean bean = viewPOSProduct(ctx, productId, trxName); - int priceListversionId = PriceListManager.getPriceListVersionID(ctx, priceListId, trxName); - - MProductPrice productPrice = MProductPrice.get(ctx, priceListversionId, productId, trxName); - if(productPrice != null) - { - bean.setPriceList(productPrice.getPriceList()); - bean.setPriceStandard(productPrice.getPriceStd()); - bean.setPriceLimit(productPrice.getPriceLimit()); - bean.setPriceListId(priceListId); - - MPOS pos = MPOS.get(ctx,Env.getContextAsInt(ctx,UdiConstants.TERMINAL_ID)); - BigDecimal QtyBook = MStorage.getQtyAvailable(pos.getM_Warehouse_ID(), productId,0, null); - bean.setQtyOnHand(QtyBook); - } - - return bean; - } - - // SENDYFIXME refactor handling of price list - public static ProductBean viewPOSProduct(Properties ctx,int productId, String trxName) throws OperationException - { - if (productId == 0) - { - ProductBean productBean = new ProductBean(); - productBean.setOrgId(0); - return productBean; - } - int warehouseId = WarehouseManager.getDefaultWarehouse(ctx).getM_Warehouse_ID(); - MLocator locator = MLocator.get(ctx, warehouseId, "", "0", "0", "0"); - BigDecimal qtyAvailable = MStorage.getQtyAvailable(warehouseId, locator.get_ID(), productId, 0, trxName); - - MProduct product = new MProduct(ctx,productId,trxName); - MProductPrice purchasePrice=null; - ProductBean bean= new ProductBean(); - - bean.setProductName(product.getName()); - bean.setOrgId(product.getAD_Org_ID()); - bean.setBarCode(product.getUPC()); - int revenueRecognitionId = product.getC_RevenueRecognition_ID(); - bean.setDescription(product.getDescription()); - bean.setProductCategoryId(product.getM_Product_Category_ID()); - bean.setProductId(productId); - bean.setIsActive(product.isActive()); - bean.setRevenueRecoId(revenueRecognitionId); - int taxCategoryId = product.getC_TaxCategory_ID(); - bean.setTaxCategoryId(taxCategoryId); - bean.setProductType(product.getProductType()); - bean.setGroup1(product.getGroup1()); - bean.setGroup2(product.getGroup2()); - bean.setUnitsPerPack(product.getUnitsPerPack()); - int uomId = product.getC_UOM_ID(); - MUOM uom = MUOM.get(ctx, uomId); - bean.setUom(uom.getName()); - bean.setUomId(uomId); - bean.setQtyOnHand(qtyAvailable); - bean.setOrgId(product.getAD_Org_ID()); - bean.setIsEditable(RoleManager.isEditable(ctx, product.getAD_Org_ID())); - - MProductCategory productCategory = new MProductCategory(ctx, product.getM_Product_Category_ID(), trxName); - bean.setProductCategoryName(productCategory.getName()); - - ProductImageInfo imageInfo = new ProductImageInfo(); - boolean isImagePresent = ProductManager.isProductImagePresent(ctx, productId, trxName); - imageInfo.setHasAttachment(isImagePresent); - - bean.setImageInfo(imageInfo); - - // FIXME bad handling of tax - need refactoring - MTaxCategory taxCategory = new MTaxCategory(ctx,product.getC_TaxCategory_ID(),trxName); - MTax tax = TaxManager.getTaxFromCategory(ctx, taxCategory.getC_TaxCategory_ID(), trxName); - bean.setTaxRate(tax.getRate()); - bean.setTaxCategoryName(taxCategory.getName()); - - MRevenueRecognition reco=new MRevenueRecognition(ctx,product.getC_RevenueRecognition_ID(),trxName); - bean.setRevenueRecognition(reco.getName()); - - int priceListId = POSTerminalManager.getSOPriceListId(ctx); - int salesPriceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, trxName); - bean.setPriceListId(priceListId); - - MPriceList m_priceList = MPriceList.get(ctx, priceListId, trxName); - bean.setIsTaxIncluded(m_priceList.isTaxIncluded()); - - MProductPrice productPrice = MProductPrice.get(ctx,salesPriceListVersionId, productId, null); - - if(productPrice!=null) - { - if(productPrice.getPriceList()==null) - bean.setSalesPriceList(0+""); - else - bean.setSalesPriceList(productPrice.getPriceList().toString()); - - if(productPrice.getPriceStd()==null) - bean.setSalesPriceStandard(0+""); - else - bean.setSalesPriceStandard(productPrice.getPriceStd().toString()); - - if(productPrice.getPriceLimit()==null) - bean.setSalesPriceLimit(0+""); - else - bean.setSalesPriceLimit(productPrice.getPriceLimit().toString()); - } - else - { - bean.setSalesPriceStandard(0+""); - } - - int purchasePriceListVersionId = StoreManager.getPriceListId(ctx); - purchasePrice = MProductPrice.get(ctx, purchasePriceListVersionId, productId, null); - if(purchasePrice==null) - bean.setPurchasePriceStandard(0+""); - else - bean.setPurchasePriceStandard(purchasePrice.getPriceList().toString()); - - return bean; - } - - - /*public static void editProduct(Properties ctx,ProductBean bean,String existingBarCode,String trxName) throws BarcodeAlreadyExistsException,CannotInactivateProductException, OperationException - { - MProductPrice purchasePrice ; - MProductPrice salesPrice; - - FormFile attachment = bean.getFile(); - - if(attachment != null && attachment.getFileName() != null && attachment.getFileName().length()>0 && !attachment.getFileName().equals("")) - { - ProductImageManager.clearImages(ctx, bean.getProductId(), trxName); - ProductImageUploader.uploadImage(ctx, bean.getProductId(), attachment, attachment.getFileName(), trxName); - } - - MProduct product = ProductManager.loadProduct(ctx, bean.getProductId(), trxName); - - product.setName(bean.getProductName()); - product.setDescription(bean.getDescription()); - product.setGroup1(bean.getGroup1()); - product.setGroup2(bean.getGroup2()); - if(bean.getTaxCategoryId()!=null) - product.setC_TaxCategory_ID(bean.getTaxCategoryId()); - product.setUPC(bean.getBarCode()); - product.setC_UOM_ID(bean.getUomId()); - - if(bean.getRevenueRecognition()!=null) - product.setC_RevenueRecognition_ID(getOrCreateRevenueRecognition(ctx,bean.getRevenueRecognition(),trxName).get_ID()); - - if(bean.getIsActive().equals(false)) - { - String errorMsg=checkQty(ctx,product.get_ID(),trxName); - if(errorMsg!=null) - throw new CannotInactivateProductException(errorMsg); - product.setIsActive(bean.getIsActive()); - } - - else - product.setIsActive(bean.getIsActive()); - - if(bean.getProductType()!=null) - { - if( bean.getProductType().equals(MProduct.PRODUCTTYPE_Service)) - { - String errorMsg=checkQty(ctx,product.get_ID(),trxName); - if(errorMsg!=null) - throw new CannotInactivateProductException(errorMsg); - product.setIsStocked(false); - - } - else - { - product.setIsStocked(true); - } - - if(bean.getProductType()!=null) - product.setProductType(bean.getProductType()); - } - - if(bean.getSalesPriceList()==null) - bean.setSalesPriceList("0"); - if(bean.getSalesPriceStandard()==null) - bean.setSalesPriceStandard(bean.getSalesPriceList()); - if(bean.getSalesPriceLimit()==null) - bean.setSalesPriceLimit(bean.getSalesPriceStandard()); - if(bean.getPurchasePriceStandard()==null) - bean.setPurchasePriceStandard("0"); - - double salesPriceL= Double.parseDouble(bean.getSalesPriceList())); - double salesPriceS=OrderManager.round(Double.parseDouble(bean.getSalesPriceStandard())); - double salesPriceLmt=OrderManager.round(Double.parseDouble(bean.getSalesPriceLimit())); - double purchasePriceSt=OrderManager.round(Double.parseDouble(bean.getPurchasePriceStandard())); - - - - - BigDecimal salesPriceList=FormatBigDecimal.currency(salesPriceL); - BigDecimal salesPriceStand= FormatBigDecimal.currency(salesPriceS); - BigDecimal salesPriceLimit=FormatBigDecimal.currency(salesPriceLmt); - BigDecimal purchasePriceStand=FormatBigDecimal.currency(purchasePriceSt); - - - int priceListId = POSTerminalManager.getSOPriceListId(ctx); - int salesPriceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, trxName); - - salesPrice = MProductPrice.get(ctx,salesPriceListVersionId,bean.getProductId(),trxName); - if(salesPrice==null) - salesPrice= new MProductPrice(ctx,salesPriceListVersionId,bean.getProductId(),trxName); - salesPrice.setPrices(salesPriceList,salesPriceStand,salesPriceLimit); - PoManager.save(salesPrice); - - int purchasePriceListVersionId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL_VERSION); - purchasePrice = MProductPrice.get(ctx,purchasePriceListVersionId,bean.getProductId(),trxName); - if(purchasePrice==null) - purchasePrice = new MProductPrice(ctx,purchasePriceListVersionId,bean.getProductId(),trxName); - purchasePrice.setPrices(purchasePriceStand,purchasePriceStand,purchasePriceStand); - PoManager.save(purchasePrice); - PoManager.save(product); - - createCosting(ctx,product,new BigDecimal(bean.getPurchasePriceStandard()),null, trxName); //null for not updating stock - }*/ - - - public static String checkQty(Properties ctx,int productId,String trxName) throws OperationException - { - MStorage[] storages = MStorage.getOfProduct(ctx, productId, trxName); - BigDecimal OnHand = Env.ZERO; - BigDecimal Ordered = Env.ZERO; - BigDecimal Reserved = Env.ZERO; - for (int i = 0; i < storages.length; i++) - { - OnHand = OnHand.add(storages[i].getQtyOnHand()); - Ordered = Ordered.add(storages[i].getQtyOrdered()); - Reserved = Reserved.add(storages[i].getQtyReserved()); - } - String errMsg = null; - if (OnHand.signum() != 0) - errMsg = "QtyOnHand = " + OnHand; - if (Ordered.signum() != 0) - errMsg += " , QtyOrdered = " + Ordered; - if (Reserved.signum() != 0) - errMsg += " , QtyReserved=" + Reserved; - if (errMsg != null) - { - return errMsg; - - } - - return errMsg; - } - - - private static MRevenueRecognition getOrCreateRevenueRecognition(Properties ctx,String name,String trxName) throws OperationException - { - MRevenueRecognition revenueRecognition; - int [] revenueRecIds = MRevenueRecognition.getAllIDs(MRevenueRecognition.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and AD_ORG_ID="+Env.getAD_Org_ID(ctx)+" and name='"+name+"'",trxName); - if(revenueRecIds.length>0) - { - revenueRecognition = new MRevenueRecognition(ctx,revenueRecIds[0],trxName); - return revenueRecognition; - } - - else - revenueRecognition = new MRevenueRecognition(ctx,0,trxName); - - revenueRecognition.setIsTimeBased(false); - revenueRecognition.setName(name); - revenueRecognition.setDescription(name); - - PoManager.save(revenueRecognition); - return revenueRecognition; - } - - public static ArrayList getArrayOfPriceList(Properties ctx, int productId) - { - ArrayList reportData = new ArrayList(); - - return reportData; - } - - - public static ArrayList viewAllProducts(Properties ctx,String name,String barCode,String description) throws ProductNotFoundException,OperationException - { - String sql="select m_product_id,name from m_product where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - if(name != null) - sql = sql+" and upper(name) like upper('%"+name+"%')"; - - if(barCode != null) - sql = sql+" and upc ='"+barCode+"'"; - - if(description != null && description.length() > 0) - { - sql = sql + " and upper(description) like upper('%" +description + "%')"; - } - - sql=sql+" order by name"; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - ResultSet rs; - ProductBean bean=null; - ArrayList list=new ArrayList(); - - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - bean=viewPOSProduct(ctx,rs.getInt(1), null); - list.add(bean); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return list; - } - - private static void createCosting(Properties ctx, MProduct product, BigDecimal costPrice, BigDecimal stock, String trxName) throws OperationException - { - MClient client = new MClient(ctx, Env.getAD_Client_ID(ctx), null); - - MCostElement costElements[] = MCostElement.getCostingMethods(client); - - for(int i = 0; i < costElements.length; i++) - { - MCost cost = MCost.get(product, 0, client.getAcctSchema(), 0, costElements[i].get_ID()); - cost.set_TrxName(trxName); - cost.setCurrentCostPrice(costPrice); - if(stock!=null) - cost.setCurrentQty(stock); - PoManager.save(cost); - } - } - - - public static String getProductCartAsCSV( Properties ctx, ProductCart cart ) throws OperationException - { - ArrayList productList = cart.getProducts(); - - ArrayList data = new ArrayList(); - Object[] headers = new Object[]{"Product ID","Name","Barcode","Qty"}; - - data.add( headers ); - Object[] row = null; - - for(ProductDetailsBean bean : productList) - { - row = new Object[4]; - - row[0] = bean.getProductId(); - row[1] = bean.getProductName(); - row[2] = bean.getBarCode(); - row[3] = bean.getQuantity(); - - data.add( row ); - } - - return CSVReportManager.generateCSVReport(ctx, data); - - } - - public static String getPrintBarcodeData( Properties ctx, ProductCart cart, String trxName ) throws OperationException - { - ArrayList productList = cart.getProducts(); - StringBuffer printData = new StringBuffer(); - BarcodeFormatter formatter = new BarcodeFormatter(); - ProductBean pBean = null; - PrintBarcodeBean barcodeBean = null; - - formatter.setShowSubtitle( false); - - for(ProductDetailsBean bean : productList) - { - Integer productId = bean.getProductId(); - BigDecimal quantity = bean.getQuantity(); - String barcode = bean.getBarCode(); - String productName = bean.getProductName(); - String salesPrice = null; - - pBean = viewPOSProduct(ctx, productId.intValue(), trxName); - salesPrice = pBean.getSalesPriceStandard(); - - if( barcode == null ) - { - barcode = ProductManager.getBarcodeForSimilarProducts( ctx, productId, trxName); - } - - barcodeBean = new PrintBarcodeBean(); - - productName = productName.replaceAll(ProductManager.PRODUCT_ATTRIBUTES_DELIMETER, " "); - - barcodeBean.setBarcode( barcode ); - barcodeBean.setTitle( productName ); - barcodeBean.setPrice( salesPrice ); - barcodeBean.setQty( quantity.intValue() ); - - String s = (String) formatter.format( barcodeBean ); - - printData.append(s); - - } - - //TODO send data to barcode printer - System.out.println( "---> Printing Barcode" ); - System.out.println( printData.toString() ); - - return printData.toString(); - } - - public static ProductSalesSummaryBean getProductSalesInfoSummary( Properties ctx, int product_id, String period, String trxName) throws OperationException - { - Date startDate = ReportDateManager.getStartDateForPeriod(period); - Date endDate = ReportDateManager.getEndDateForPeriod(period); - - SimpleDateFormat f = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - String fromDate = f.format(startDate); - String toDate = f.format(endDate); - - String sql = "select " + - "(qtyordered - qtyreturned) as NetQtySold," + //1.net qty sold - "(orderAmt - returnAmt) as NetAmount " + //2.net amount - - "from " + - "( select nvl(sum(ordline.QTYORDERED),0) as qtyordered, nvl(sum(ordline.LINENETAMT),0) as orderAmt " + - " from C_ORDERLINE ordline, C_ORDER ord, C_BPARTNER bp " + - " where ordline.M_PRODUCT_ID = ? " + //<----------1.productID - " and ord.C_ORDER_ID = ordline.C_ORDER_ID " + - " and bp.C_BPARTNER_ID = ord.C_BPARTNER_ID " + - " and bp.ISCUSTOMER = 'Y' " + - " and ORDERTYPE in ('POS Order','Credit Order') " + - " and ord.DATEORDERED between " + - " to_date( ? , 'DD-MM-YYYY HH24:MI:SS' )" + //<----------2.startDate - " and to_date( ? , 'DD-MM-YYYY HH24:MI:SS' )" + //<----------3.endDate - ") QTYORDERED, " + - - "( select nvl(sum(ordline.QTYORDERED),0) as qtyreturned, nvl(sum(ordline.LINENETAMT),0) as returnAmt " + - " from C_ORDERLINE ordline, C_ORDER ord, C_BPARTNER bp " + - " where ordline.M_PRODUCT_ID = ? " + //<----------4.productID - " and ord.C_ORDER_ID = ordline.C_ORDER_ID " + - " and bp.C_BPARTNER_ID = ord.C_BPARTNER_ID " + - " and bp.ISCUSTOMER = 'Y' " + - " and ORDERTYPE = 'Customer Return Order' " + - " and ord.DATEORDERED between " + - " to_date( ? , 'DD-MM-YYYY HH24:MI:SS' )" + //<----------5.startDate - " and to_date( ? , 'DD-MM-YYYY HH24:MI:SS' )" + //<----------6.endDate - ") QtyReturned " ; - - PreparedStatement pstmt = null; - ResultSet rs = null; - - ProductSalesSummaryBean bean = new ProductSalesSummaryBean(); - - try - { - pstmt = DB.prepareStatement( sql, trxName ); - pstmt.setInt( 1, product_id ); - pstmt.setInt( 4, product_id ); - - pstmt.setString(2, fromDate); - pstmt.setString(3, toDate); - pstmt.setString(5, fromDate); - pstmt.setString(6, toDate); - - - - rs = pstmt.executeQuery(); - - if( rs.next() ) - { - bean.setQtySold( rs.getBigDecimal(1) ); - bean.setTotalAmount( rs.getBigDecimal(2) ); - } - - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - rs = null; - pstmt = null; - } - - return bean; - -} - - public static ProductSalesSummaryBean getProductSalesInfoSummary( Properties ctx, int product_id, String trxName ) throws OperationException - { - String sql = "select " + - "prod.name, " + //1.product name - "(qtyordered - qtyreturned) as NetQtySold," + //2.net qty sold - "(orderAmt - returnAmt) as NetAmount, " + //3.net amount - "qtyonhand from " + //4.qty on hand - - "( select nvl(sum(ordline.QTYORDERED),0) as qtyordered, nvl(sum(ordline.LINENETAMT),0) as orderAmt " + - " from C_ORDERLINE ordline, C_ORDER ord, C_BPARTNER bp " + - " where ordline.M_PRODUCT_ID = ? " + - " and ord.C_ORDER_ID = ordline.C_ORDER_ID " + - " and bp.C_BPARTNER_ID = ord.C_BPARTNER_ID " + - " and bp.ISCUSTOMER = 'Y' " + - " and ORDERTYPE in ('POS Order','Credit Order') " + - ") QtyOrdered, " + - - "( select nvl(sum(ordline.QTYORDERED),0) as qtyreturned, nvl(sum(ordline.LINENETAMT),0) as returnAmt " + - " from C_ORDERLINE ordline, C_ORDER ord, C_BPARTNER bp " + - " where ordline.M_PRODUCT_ID = ? " + - " and ord.C_ORDER_ID = ordline.C_ORDER_ID " + - " and bp.C_BPARTNER_ID = ord.C_BPARTNER_ID " + - " and bp.ISCUSTOMER = 'Y' " + - " and ORDERTYPE = 'Customer Return Order'" + - ") QtyReturned, " + - - " ( select nvl(sum(qtyonhand),0) as qtyonhand from M_STORAGE where M_PRODUCT_ID = ? ) QtyOnHand , " + - - "M_Product prod where M_PRODUCT_ID = ?"; - - PreparedStatement pstmt = null; - ResultSet rs = null; - - ProductSalesSummaryBean bean = new ProductSalesSummaryBean(); - - try - { - pstmt = DB.prepareStatement( sql, trxName ); - pstmt.setInt( 1, product_id ); - pstmt.setInt( 2, product_id ); - pstmt.setInt( 3, product_id ); - pstmt.setInt( 4, product_id ); - - rs = pstmt.executeQuery(); - - if( rs.next() ) - { - bean.setProductName( rs.getString(1) ); - bean.setQtySold( rs.getBigDecimal(2) ); - bean.setTotalAmount( rs.getBigDecimal(3) ); - bean.setQtyOnHand( rs.getBigDecimal(4) ); - bean.setProductId( Integer.valueOf(product_id) ); - } - - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - rs = null; - pstmt = null; - } - - return bean; - - } - - public static ArrayList getProductSalesInfoDetails( Properties ctx, int product_id, String trxName ) throws OperationException - { - String sql = "" + - "select * from (" + - "select " + - "ord.DOCUMENTNO, " + //1.document No - "ord.DATEORDERED, " + //2.date ordered - "bp.name || ' ' || bp.name2, " + //3.customer name - "ord.ORDERTYPE, " + //4.order type - "ordline.QTYORDERED, " + //5.qty ordered - "ord.C_ORDER_ID, " + //6.order id - "ordline.linenetamt " + //7.line amount - - "from C_ORDERLINE ordline, C_ORDER ord, C_BPARTNER bp " + - "where ordline.M_PRODUCT_ID = ? " + - "and ord.C_ORDER_ID = ordline.C_ORDER_ID " + - "and bp.C_BPARTNER_ID = ord.C_BPARTNER_ID " + - "and bp.ISCUSTOMER = 'Y' " + - "order by ord.DATEORDERED desc" + - ") DocNum "; -// "where rownum <= ?"; - - PreparedStatement pstmt = null; - ResultSet rs = null; - - ArrayList list = new ArrayList(); - ProductSalesInfoBean bean = null; - - try - { - pstmt = DB.prepareStatement( sql, trxName ); - pstmt.setInt( 1, product_id ); - //pstmt.setInt( 2, maxNoOfRecords ); // limits the number of records returned - - rs = pstmt.executeQuery(); - - while( rs.next() ) - { - bean = new ProductSalesInfoBean(); - - bean.setDocumentNo( rs.getString(1)); - bean.setDateOrdered(rs.getDate(2)); - bean.setBpartnerName(rs.getString(3)); - bean.setOrderType(rs.getString(4)); - bean.setQtyOrderded(rs.getBigDecimal(5)); - bean.setOrderId(Integer.valueOf(rs.getInt(6))); - bean.setLineAmount(rs.getBigDecimal(7)); - - list.add( bean ); - } - - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - rs = null; - pstmt = null; - } - - return list; - - } - - public static ProductSalesSummaryBean[] getSalesBucket(Properties ctx, int productId, String trxName) throws OperationException - { - String[] periods = new String[]{ - ReportDateManager.CURRENT_YEAR, - ReportDateManager.LAST_6MONTHS, - ReportDateManager.LAST_3MONTHS, - ReportDateManager.LAST_2MONTHS, - ReportDateManager.CURRENT_MONTH, - ReportDateManager.CURRENT_WEEK, - ReportDateManager.TODAY - }; - - ProductSalesSummaryBean[] beans = new ProductSalesSummaryBean[periods.length]; - - for(int i = 0; i < periods.length; i++) - { - beans[i] = getProductSalesInfoSummary(ctx,productId,periods[i],trxName); - } - - return beans; - - } - - public static void editBulkProduct(Properties ctx, Integer[] productIds, ProductBean bean, String trxName) throws InvalidContentTypeException, OperationException - { - MProductPrice purchasePrice ; - MProductPrice salesPrice; - FormFile attachment = bean.getFile(); - boolean hasAttachment; - Integer productId; - MProduct product; - - hasAttachment = (attachment != null && !attachment.getFileName().equals("")); - - for(int i=0; i getUoms(Properties ctx, String trxName) - { - String orgs = RoleManager.getRoleViewableOrgAccess(ctx); - String whereClause = "ISACTIVE = 'Y' AND AD_CLIENT_ID IN (0," + Env.getAD_Client_ID(ctx) + ") AND AD_Org_ID IN (" + orgs + ")"; - int ids[] = MUOM.getAllIDs(MUOM.Table_Name, whereClause, trxName); - - ArrayList list = new ArrayList(); - for(int id : ids) - { - MUOM uom = MUOM.get(ctx, id); - KeyNamePair pair = uom.getKeyNamePair(); - list.add(pair); - } - - return list; - } - - public static ProductBean getProductBean(Properties ctx, - ArrayList list, Integer productId, Boolean isNext) throws OperationException - { - int index = -1; - - if (productId == 0) - { - ProductBean productBean = new ProductBean(); - productBean.setProductId(0); - productBean.setOrgId(0); - return productBean; - } - else - { - if (list != null) - { - Iterator iter = list.iterator(); - - while (iter.hasNext()) - { - ProductBean currBean = iter.next(); - if (currBean.getProductId().equals(productId)) - { - index = list.indexOf(currBean); - } - } - if (index != -1) - { - if (isNext!=null) - { - if (isNext) - { - int nextIndex = (index + 1)%list.size(); - index = nextIndex; - } - else - { - int previousIndex = (index-1)%list.size(); - if (previousIndex < 0) - { - previousIndex += list.size(); - } - index = previousIndex; - } - } - return viewPOSProduct(ctx, list.get(index).getProductId(), null); - } - else - { - throw new OperationException("product not found in search list"); - } - } - else - { - return viewPOSProduct(ctx, productId, null); - } - } - } - - public static ArrayList getProductBeans(Properties ctx, Integer priceListVersionId, String trxName) throws OperationException - { - PreparedStatement pstmt = null; - ResultSet rs = null; - ArrayList list = new ArrayList(); - StringBuffer query = new StringBuffer(); - - String orgs = RoleManager.getRoleViewableOrgAccess(ctx); - - query.append("SELECT M_Product_Id FROM M_ProductPrice where AD_CLIENT_ID = " + Env.getAD_Client_ID(ctx)); - - if(priceListVersionId != null) - { - query.append(" AND M_PriceList_Version_Id = " + priceListVersionId); - } - - query.append(" ORDER BY M_Product_Id"); - - try - { - pstmt = DB.prepareStatement(query.toString(), trxName); - rs = pstmt.executeQuery(); - - while(rs.next()) - { - ProductBean productBean = new ProductBean(); - productBean = viewPOSProduct(ctx, rs.getInt(1), trxName); - list.add(productBean); - } - } - - catch(SQLException e) - { - throw new OperationException(e); - } - - finally - { - if(pstmt != null) - { - try - { - pstmt.close(); - } - catch(SQLException e) - { - throw new OperationException(e); - } - } - - if(rs != null) - { - try - { - rs.close(); - } - catch(SQLException e) - { - throw new OperationException(e); - } - } - } - - return list; - } - - public static HashMap getOrderQtyInfoPerProduct(Properties ctx, Boolean isSOTrx, - Integer productId, String orgIds, Timestamp date1, Timestamp date2, String trxName) throws OperationException - { - DateFormatSymbols dfs = new DateFormatSymbols(Locale.ENGLISH); - String[] monthName = dfs.getMonths(); - - - HashMap dateQtymap = new HashMap(); - - String[] orgs = orgIds.split(","); - StringBuffer locatorIds = new StringBuffer(); - int i = 0; - for (String org:orgs ) - { - try - { - int orgId = Integer.parseInt(org); - locatorIds = locatorIds.append(WarehouseManager.getLocatorIds(ctx, orgId)); - if (orgId == 0) - { - break; - } - else - { - if (i < orgs.length -1) - { - locatorIds.append(","); - } - } - } - catch (NumberFormatException e) - {} - - i++; - } - - StringBuffer sql = new StringBuffer("SELECT SUM(trx.movementQty), trx.movementDate") - .append(" FROM M_Transaction trx") - .append(" WHERE trx.M_Product_ID = ? AND trx.M_Locator_ID IN (" + locatorIds+")") - .append(" AND trx.movementDate BETWEEN " + DB.TO_DATE(date1, true) +" AND " + DB.TO_DATE(date2, true)) - .append(" AND trx.movementType = ?") - .append(" GROUP BY trx.movementDate"); - - PreparedStatement pstmt =null; - ResultSet rs = null; - ArrayList list = new ArrayList(); - try - { - pstmt = DB.prepareStatement(sql.toString(), trxName); - pstmt.setInt(1, productId); - if (isSOTrx) - { - pstmt.setString(2, MTransaction.MOVEMENTTYPE_CustomerShipment); - } - else - { - pstmt.setString(2, MTransaction.MOVEMENTTYPE_VendorReceipts); - } - rs = pstmt.executeQuery(); - - while (rs.next()) - { - BigDecimal qty = rs.getBigDecimal(1); - Date date = rs.getDate(2); - list.add(date); - dateQtymap.put(date, qty); - } - } - catch (SQLException e) - { - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - Collections.sort(list); - - Iterator iter= list.iterator(); - StringBuffer monthYearList = new StringBuffer(); - - HashMap monthQtyMap = new HashMap(); - while (iter.hasNext()) - { - Date date = iter.next(); - - Calendar cal = Calendar.getInstance(); - cal.setTime(date); - - int month= cal.get(Calendar.MONTH); - int year = cal.get(Calendar.YEAR); - - String monthYear = monthName[month] + " " + year; - monthYearList.append(monthYear).append(","); - - BigDecimal qty = dateQtymap.get(date); - - if (monthQtyMap.containsKey(monthYear)) - { - qty = qty.add(monthQtyMap.get(monthYear)); - } - - monthQtyMap.put(monthYear, qty); - - } - - return monthQtyMap; - } - - public static ArrayList getExportData(Properties ctx, ArrayList list) throws IOException - { - ArrayList exportData = new ArrayList(); - String[] header = null; - - File importTemplate = new File(PathInfo.PROJECT_HOME + "/import/importTemplate.csv"); - BufferedReader bufReader = new BufferedReader(new FileReader(importTemplate)); - String line = bufReader.readLine(); - int i = 0; - int size = 0; - //read the template file header - if (line != null) - { - StringTokenizer st = new StringTokenizer(line,","); - size = st.countTokens(); - header = new String[size]; - while (st.hasMoreTokens()) - { - - header[i] = st.nextToken().replaceAll("\"",""); - i++; - } - } - //close the file - bufReader.close(); - exportData.add(header); - - if (list!=null && !list.isEmpty()) - { - Iterator productIter = list.iterator(); - - HashMap map = new HashMap(); - - while (productIter.hasNext()) - { - ProductBean productBean = productIter.next(); - map.put("Revenue Recognition", productBean.getRevenueRecognition()); - map.put("Barcode", productBean.getBarCode()); - map.put("Name", productBean.getProductName()); - map.put("Description", productBean.getDescription()); - map.put("UOM", productBean.getUom()); - map.put("Purchase Price", productBean.getPurchasePriceStandard()); - map.put("Marked Price", productBean.getSalesPriceList()); - map.put("Discounted Price", productBean.getSalesPriceStandard()); - map.put("Limit Price", productBean.getSalesPriceLimit()); - map.put("VAT %", productBean.getTaxRate()); - map.put("Stock in Hand", productBean.getQtyOnHand()); - - Object[] productLine = new Object[size]; - int count = 0; - for (String value : header) - { - if (map.containsKey(value)) - { - productLine[count] = map.get(value); - } - count++; - } - exportData.add(productLine); - map.clear(); - } - } - return exportData; - } - - public static ArrayList searchPOSGarmentAttributes(HttpServletRequest request) throws OperationException - { - Properties ctx = TmkJSPEnv.getCtx(request); - String attrName = null; - String attrValue = null; - - int ad_client_id = Env.getAD_Client_ID(ctx); - - ArrayList attributeValueList = new ArrayList(); - - String[] attributes = {"brand","colour","design","model","revenue_recognition"}; - - for(int i=0;i getAllAttributeSet(Properties ctx) throws OperationException - { - String sql = " select M_ATTRIBUTESET_ID,NAME from M_ATTRIBUTESET where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - AttributeBean bean =null; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - ArrayList list = new ArrayList(); - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { bean= new AttributeBean(); - bean.setAttributeSetId(Integer.valueOf(rs.getInt(1))); - bean.setAttributeSetName(rs.getString(2)); - list.add(bean); - } - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return list; - } - - - public static ArrayList getAllAttributeFromAttributeSet(Properties ctx,AttributeBean aBean) throws OperationException - { - - - String sql = "select att.M_ATTRIBUTE_ID," + - "att.name" + - " from M_ATTRIBUTEUSE u,M_ATTRIBUTE att" + - " where u.M_ATTRIBUTE_ID=att.M_ATTRIBUTE_ID"+ - " and M_ATTRIBUTESET_ID="+aBean.getAttributeSetId(); - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ArrayList list = new ArrayList(); - AttributeBean bean =null; - try - { - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean= new AttributeBean(); - bean.setAttributeId(Integer.valueOf(rs.getInt(1))); - bean.setAttributeName(rs.getString(2)); - if(aBean.getAttributeValueIds()==null) - { - bean.setAttributeValueList(getAttributeValues(ctx,bean.getAttributeId())); - } - else - { - bean.setAttributeValueList(getFilteredAttributeValues(ctx,aBean,bean.getAttributeId().intValue())); - } - - list.add(bean); - } - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - return list; - - } - - private static ArrayList getAttributeValues(Properties ctx,int attributeId) throws OperationException - { - - String sql = "select distinct M_ATTRIBUTEVALUE_ID,VALUE from M_ATTRIBUTEINSTANCE where M_ATTRIBUTE_ID= "+attributeId+" order by VALUE"; - - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ArrayList list = new ArrayList(); - AttributeBean bean =null; - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - bean= new AttributeBean(); - bean.setAttributeValueId(Integer.valueOf(rs.getInt(1))); - bean.setAttributeValue(rs.getString(2)); - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return list; - } - - - public static ArrayList getAllProducts(Properties ctx, Integer attributeSetId) throws OperationException - { - MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); - BigDecimal totalCost = BigDecimal.valueOf(0.0); -// int purchasePriceListVersionId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL_VERSION); - - int poPriceListId = POSTerminalManager.getPOPriceListId(ctx); - int purchasePriceListVersionId = PriceListManager.getPriceListVersionID(ctx, poPriceListId, null); - - String sql = "select pr.name," + - " SUM(st.QTYONHAND)," + - " st.M_PRODUCT_ID,"+ - " pr.M_ATTRIBUTESETINSTANCE_ID," + - " pr.UPC,"+ - " pp.PRICESTD"+ - " from M_STORAGE st,M_PRODUCT pr left outer join M_PRODUCTPRICE pp on pr.M_PRODUCT_ID = pp.M_PRODUCT_ID" + - " where st.M_PRODUCT_ID=pr.M_PRODUCT_ID" + - " and st.ad_client_id=" +Env.getAD_Client_ID(ctx)+ - " and st.AD_ORG_ID=" +Env.getAD_Org_ID(ctx)+ - " and st.M_LOCATOR_ID="+warehouse.getDefaultLocator().get_ID()+ - " and pp.M_PRICELIST_VERSION_ID="+purchasePriceListVersionId; - if (attributeSetId != null) - { - sql += " and pr.m_attributeset_id = " + attributeSetId; - } - sql += " group by pr.name,st.M_PRODUCT_ID, pr.M_ATTRIBUTESETINSTANCE_ID,pr.UPC,pp.PRICESTD"+ - " order by pr.name "; - - - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - AttributeBean bean =null; - ArrayList productsInStock =new ArrayList(); - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - bean= new AttributeBean(); - bean.setProductName(rs.getString(1)); - bean.setQuantity(rs.getBigDecimal(2)); - bean.setProductId(Integer.valueOf(rs.getInt(3))); - bean.setAttributeSetInstanceId(Integer.valueOf(rs.getInt(4))); - bean.setBarCode(rs.getString(5)); - totalCost = new BigDecimal(rs.getInt(2)).multiply(rs.getBigDecimal(6)); - bean.setPrice(totalCost); - productsInStock.add(bean); - } - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return productsInStock; - } - - public static ArrayList getProducts(Properties ctx, AttributeBean aBean) throws OperationException - { - - - MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); - - ArrayList attributeIdList = new ArrayList(); - - - for(int i=0;i productsInStock =new ArrayList(); - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - bean= new AttributeBean(); - bean.setProductName(rs.getString(1)); - bean.setQuantity(rs.getBigDecimal(2)); - bean.setProductId(Integer.valueOf(rs.getInt(3))); - bean.setAttributeSetInstanceId(Integer.valueOf(rs.getInt(4))); - bean.setBarCode(rs.getString(5)); - productsInStock.add(bean); - } - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - - return productsInStock; - - } - - public static ArrayList getFilteredAttributeValues(Properties ctx,AttributeBean aBean,int attributeId) throws OperationException - { - ArrayList attributeIdList = new ArrayList(); - for(int i=0;i list = new ArrayList(); - AttributeBean bean =null; - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - bean= new AttributeBean(); - bean.setAttributeValueId(Integer.valueOf(rs.getInt(1))); - bean.setAttributeValue(rs.getString(2)); - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return list; - } - - - - - public static ArrayList getStockFromSearch(Properties ctx, String searchString,String barCode,String qtyFilter) throws OperationException - { - - searchString = (searchString==null)? "" : searchString; - StringTokenizer st = new StringTokenizer(searchString,"+"); - - BigDecimal totalCost = BigDecimal.valueOf(0.0); - int purchasePLId = POSTerminalManager.getPOPriceListId(ctx); - int purchasePriceListVersionId = PriceListManager.getPriceListVersionID(ctx, purchasePLId, null); - - - String sql="select pr.name as name, sum(st.qtyonhand) as qty ,pr.UPC,pr.m_product_id,pp.PRICESTD" + - " from M_STORAGE st,M_PRODUCT pr left outer join M_PRODUCTPRICE pp on pr.M_PRODUCT_ID = pp.M_PRODUCT_ID" + - " and pp.M_PRICELIST_VERSION_ID="+purchasePriceListVersionId + - " where st.M_PRODUCT_ID=pr.M_PRODUCT_ID"; - - String token = null; - - while(st.hasMoreTokens()) - { - token = st.nextToken().trim(); - sql = sql + " and upper(pr.name) like upper('%"+token+"%' )"; - } - - if(barCode!=null && !barCode.equals("")) - sql=sql+" and pr.upc='"+barCode+"'"; - - sql=sql+" and pr.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and st.AD_ORG_ID="+Env.getAD_Org_ID(ctx); - - sql=sql+ " and st.M_LOCATOR_ID="+POSTerminalManager.getWarehouse(ctx).getDefaultLocator().get_ID(); - - sql=sql+" group by pr.name,pr.UPC,pr.m_product_id,pp.PRICESTD"; - - if(qtyFilter!=null && qtyFilter.length()!=0) - { - sql = "select * from (" + sql + ") stDetails where stDetails.qty" + qtyFilter; - } - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - AttributeBean bean =null; - ArrayList productsInStock =new ArrayList(); - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - BigDecimal quantity = rs.getBigDecimal(2); - BigDecimal price = rs.getBigDecimal(5); - - if (quantity == null) - { - quantity = BigDecimal.ZERO; - } - if (price == null) - { - price = BigDecimal.ZERO; - } - MProduct product = MProduct.get(ctx, rs.getInt(4)); - int uomPrecision = MUOM.getPrecision(ctx, product.getC_UOM_ID()); - String uom = product.getUOMSymbol(); - bean= new AttributeBean(); - bean.setProductName(rs.getString(1)); - bean.setQuantity(quantity.setScale(uomPrecision, BigDecimal.ROUND_HALF_UP)); - bean.setBarCode(rs.getString(3)); - - totalCost = quantity.multiply(price); - bean.setUnitPrice(price); - bean.setDescription(product.getDescription()); - bean.setPrice(totalCost.setScale(price.scale(),RoundingMode.HALF_UP)); - bean.setUom(uom); - - productsInStock.add(bean); - } - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return productsInStock; - - } - - - public static HashMap getStockByOrg(Properties ctx, Integer productId, Timestamp asOfDate, Integer orgId, String trxName) throws OperationException, SQLException - { - if (productId == null) - { - throw new OperationException("productId is null, cannot search stock qty by org"); - } - - String locatorIds = WarehouseManager.getLocatorIds(ctx, orgId); - - BigDecimal qty = Env.ZERO; - - int precision = ProductManager.getUOMPrecision(ctx, productId); - - StringBuffer movementTypes = new StringBuffer("'"+MTransaction.MOVEMENTTYPE_CustomerShipment +"', ") - .append("'"+MTransaction. MOVEMENTTYPE_CustomerReturns +"', ") - .append("'"+MTransaction. MOVEMENTTYPE_VendorReceipts +"', ") - .append("'"+MTransaction. MOVEMENTTYPE_VendorReturns +"', ") - .append("'"+MTransaction. MOVEMENTTYPE_InventoryOut +"', ") - .append("'"+MTransaction. MOVEMENTTYPE_InventoryIn +"', ") - .append("'"+MTransaction. MOVEMENTTYPE_MovementFrom +"', ") - .append("'"+MTransaction. MOVEMENTTYPE_MovementTo +"'") ; - - StringBuffer sql = new StringBuffer("SELECT SUM(trx.movementQty), loc.AD_Org_ID FROM M_Transaction trx") - .append(" INNER JOIN M_Locator loc ON trx.M_Locator_ID = loc.M_Locator_ID WHERE") - .append(" trx.M_Product_ID="+productId+ " AND trx.M_Locator_ID IN ("+ locatorIds + ")") - .append(" AND trx.movementDate <= "+ DB.TO_DATE(asOfDate, false)) - .append(" AND trx.movementType in ("+movementTypes+")") - .append(" GROUP BY loc.AD_Org_ID"); - - - - PreparedStatement pstmt = null; - ResultSet rs = null; - - HashMap orgStock = new HashMap(); - try - { - pstmt = DB.prepareStatement (sql.toString(), trxName); - rs = pstmt.executeQuery(); - - while (rs.next()) - { - qty = rs.getBigDecimal(1); - Integer org_Id = rs.getInt(2); - - qty = qty.setScale(precision, RoundingMode.HALF_UP); - - orgStock.put(org_Id, qty); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException("could not get stock enquiry data",e); - } - finally - { - close(pstmt, rs); - } - - String[] orgs = null; - - if (orgId == 0) - { - String orgIdList = Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM).toString(); - orgs = orgIdList.split(","); - } - else - { - orgs = new String[]{orgId + ""}; - } - - if (orgStock.isEmpty()) - { - for (String org : orgs) - { - Integer org_ID = Integer.parseInt(org); - orgStock.put(org_ID, Env.ZERO); - } - } - - return orgStock; - } - - public static HashMap getMonthlyStockAdjustments( - Properties ctx, int productId, String orgIds, Timestamp date1, Timestamp date2, - String trxName) throws OperationException - { - int precision = ProductManager.getUOMPrecision(ctx, productId); - int ad_client_id = Env.getAD_Client_ID(ctx); - - DateFormatSymbols dfs = new DateFormatSymbols(Locale.ENGLISH); - String[] monthName = dfs.getMonths(); - - HashMap monthQtyMap = new HashMap(); - HashMap dateQtymap = new HashMap(); - - StringBuffer movementTypes = new StringBuffer("'"+MTransaction. MOVEMENTTYPE_InventoryOut +"', ") - .append("'"+MTransaction. MOVEMENTTYPE_InventoryIn +"', ") - .append("'"+MTransaction. MOVEMENTTYPE_MovementFrom +"', ") - .append("'"+MTransaction. MOVEMENTTYPE_MovementTo +"'") ; - - StringBuffer sql = new StringBuffer(); - - sql.append(" SELECT SUM(movementQty), trx.movementDate FROM M_Transaction trx INNER JOIN") - .append(" M_Locator ml ON trx.M_Locator_ID = ml.M_Locator_ID") - .append(" WHERE trx.M_Product_ID = ?") - .append(" AND trx.movementType IN ("+movementTypes+")") - .append(" AND trx.AD_Client_ID = "+ad_client_id) - .append(" AND ml.AD_Org_ID IN ("+orgIds+")") - .append(" AND trx.movementDate BETWEEN "+DB.TO_DATE(date1, true) + " AND " + DB.TO_DATE(date2, true)) - .append(" GROUP BY trx.movementDate"); - - PreparedStatement pstmt =null; - ResultSet rs = null; - ArrayList list = new ArrayList(); - try - { - pstmt = DB.prepareStatement(sql.toString(), trxName); - pstmt.setInt(1, productId); - rs = pstmt.executeQuery(); - - while (rs.next()) - { - BigDecimal qty = rs.getBigDecimal(1); - Date date = rs.getDate(2); - - list.add(date); - - if (dateQtymap.containsKey(date)) - { - qty = qty.add(dateQtymap.get(date)); - } - dateQtymap.put(date, qty); - - } - } - catch (SQLException e) - { - throw new OperationException("could not retrieve montly stock adjustments with sql"+ sql, e); - } - finally - { - close(pstmt, rs); - } - - if (!list.isEmpty()) - { - Collections.sort(list); - - Iterator iter= list.iterator(); - StringBuffer monthYearList = new StringBuffer(); - /*String list_monthYears = POSReportManager.getListMonthYears(date1, date2);*/ - - - while (iter.hasNext()) - { - Date date = iter.next(); - - Calendar cal = Calendar.getInstance(); - cal.setTime(date); - - int month= cal.get(Calendar.MONTH); - int year = cal.get(Calendar.YEAR); - - String monthYear = monthName[month] + " " + year; - monthYearList.append(monthYear).append(","); - - BigDecimal qty = dateQtymap.get(date); - - if (monthQtyMap.containsKey(monthYear)) - { - qty = qty.add(monthQtyMap.get(monthYear)); - } - - monthQtyMap.put(monthYear, qty); - } - } - return monthQtyMap; - } - - - private static void close(PreparedStatement pstmt, ResultSet rs) throws OperationException - { - if (pstmt!=null) - { - try - { - pstmt.close(); - } - catch (Exception ex) - { - throw new OperationException("Could not close prepared statement" , ex); - } - finally - { - pstmt = null; - } - } - if (rs != null) - { - try - { - rs.close(); - } - catch (Exception ex) - { - throw new OperationException("Could not close result set", ex); - } - finally - { - rs = null; - } - } - } - - - public static ArrayList getStockAdjustments(Properties ctx, ArrayList reportData, - int productId, String orgIds, Timestamp date1, Timestamp date2, - String trxName) throws OperationException - { - - - String[] orgs = orgIds.split(","); - - - ArrayList orgIdList = new ArrayList(); - ArrayList orgNameList = new ArrayList(); - for (int i = 0; i map = new HashMap(); - map.put("I-", "Inventory Out"); - map.put("I+", "Inventory In"); - map.put("M-", "Movement Out"); - map.put("M+", "Movement In"); - - sql.append(" SELECT movementType, SUM(movementQty), ml.AD_Org_ID FROM M_Transaction trx INNER JOIN") - .append(" M_Locator ml ON trx.M_Locator_ID = ml.M_Locator_ID") - .append(" WHERE trx.M_Product_ID = " + productId) - .append(" AND movementType IN ('I+','I-','M+','M-')") - .append(" AND trx.AD_Client_ID = "+ad_client_id) - .append(" AND ml.AD_Org_ID IN ("+orgIds+")") - .append(" AND movementDate BETWEEN "+ DB.TO_DATE(date1, false)) - .append(" AND " + DB.TO_DATE(date2, false)) - .append(" GROUP BY movementType, ml.AD_Org_ID"); - - - PreparedStatement pstmt = null; - ResultSet rs = null; - - HashMap> moveTypeOrgMap = new HashMap>(); - - try - { - pstmt = DB.prepareStatement(sql.toString(), trxName); - rs = pstmt.executeQuery(); - HashMap orgList = null; - - while (rs.next()) - { - String movementType = rs.getString(1); - BigDecimal movementQty = rs.getBigDecimal(2); - Integer orgId = rs.getInt(3); - - if (movementQty == null) - { - movementQty = Env.ZERO; - } - - String moveType = map.get(movementType); - if (orgList == null) - { - orgList = new HashMap(); - orgList.put(orgId, movementQty); - } - - if (moveTypeOrgMap.isEmpty()) - { - moveTypeOrgMap.put(moveType, orgList); - } - else - { - if (moveTypeOrgMap.containsKey(moveType)) - { - HashMap newOrgList = moveTypeOrgMap.get(moveType); - BigDecimal qty = movementQty; - if (newOrgList.containsKey(orgId)) - { - qty = newOrgList.get(orgId); - if (qty!=null) - { - qty = qty.add(movementQty); - } - } - newOrgList.put(orgId, qty); - moveTypeOrgMap.put(moveType, newOrgList); - } - else - { - orgList = new HashMap(); - orgList.put(orgId, movementQty); - moveTypeOrgMap.put(moveType, orgList); - } - } - } - } - catch (SQLException e) - { - throw new OperationException("could not get stock adjustments",e); - } - finally - { - close(pstmt, rs); - } - - String[] moveTypeList = new String[map.size()]; - map.values().toArray(moveTypeList); - Object[] data = null; - - for (String movementType: moveTypeList) - { - HashMap orgQtyList = null; - - if (moveTypeOrgMap.containsKey(movementType)) - { - orgQtyList = moveTypeOrgMap.get(movementType); - } - - data = new Object[header.length]; - - data[0] = movementType; - for (int i=1; i< data.length; i++) - { - data[i] = Env.ZERO; - if (orgQtyList != null) - { - if (i <= orgIdList.size()) - { - int orgId = orgIdList.get(i-1); - if (orgQtyList.containsKey(orgId)) - { - BigDecimal qty = orgQtyList.get(orgId); - data[i] = qty; - } - } - } - } - reportData.add(data); - } - - return reportData; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/POSTerminalManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/POSTerminalManager.java deleted file mode 100644 index c38a4c3dfd..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/POSTerminalManager.java +++ /dev/null @@ -1,1165 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 8, 2006 by alok - */ - -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Properties; -import java.util.logging.Level; - -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.model.MBPartner; -import org.compiere.model.MCash; -import org.compiere.model.MCashBook; -import org.compiere.model.MCurrency; -import org.compiere.model.MPOS; -import org.compiere.model.MPOSTerminal; -import org.compiere.model.MPayment; -import org.compiere.model.MPriceList; -import org.compiere.model.MStore; -import org.compiere.model.MWarehouse; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.TerminalBean; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.InvalidTerminalCashBookException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.TerminalInactivateException; -import org.posterita.exceptions.TerminalLockedException; -import org.posterita.exceptions.TerminalNotFoundException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - -public class POSTerminalManager -{ - public static final CLogger logger = CLogger.getCLogger(POSTerminalManager.class); - - /** - * Creates a new POS Terminal - * @param ctx Context - * @param orgId Organisation - * @param name Name of the terminal - * @param cashbookId Cash Book - * @param bankAccountId Bank Account - * @param poPriceListId Purchase Price list - * @param soPriceListid Sales Price list - * @param warehouseId Warehouse - * @param cashBPartnerId BPartner to be used for Cash Transactions - * @param salesRepId Sales Representative - * @param trxName Transaction - * @return POS Terminal - * @throws OperationException If the terminal cannot be created - */ - public static MPOSTerminal createPOSTerminal(Properties ctx, int orgId, String name, - int cashbookId, int bankAccountId, int poPriceListId, int soPriceListid, int warehouseId,int cashBPartnerId, - int salesRepId, String trxName) throws OperationException - { - MPOSTerminal terminal = new MPOSTerminal(ctx, 0, trxName); - terminal.setAD_Org_ID(orgId); - terminal.setName(name); - terminal.setC_CashBook_ID(cashbookId); - terminal.setM_Warehouse_ID(warehouseId); - terminal.setPO_PriceList_ID(poPriceListId); - terminal.setSO_PriceList_ID(soPriceListid); - terminal.setCard_BankAccount_ID(bankAccountId); - terminal.setCheck_BankAccount_ID(bankAccountId); - terminal.setC_CashBPartner_ID(cashBPartnerId); - terminal.setCashBookTransferType(MPOSTerminal.CASHBOOKTRANSFERTYPE_BankAccount); - terminal.setCashTransferBankAccount_ID(bankAccountId); - PoManager.save(terminal); - return terminal; - } - - - /** - * Migrates old POS Terminal structure to the new one - * @param ctx Context - * @throws OperationException If new terminal cannot be created - */ - public static void migrateOldPOSTerminal(Properties ctx) throws OperationException - { - Trx trx = Trx.get(Trx.createTrxName(), true); - trx.start(); - - try - { - String whereClause = "IsActive='Y' AND AD_Client_ID=" + Env.getAD_Client_ID(ctx); - - int oldPosIds[] = MPOS.getAllIDs(MPOS.Table_Name, whereClause, trx.getTrxName()); - - for (int i = 0; i < oldPosIds.length; i++) - { - MPOS oldPOS = new MPOS(ctx, oldPosIds[i], trx.getTrxName()); - - String posName = oldPOS.getName(); - int warehouseId = oldPOS.getM_Warehouse_ID(); - int soPriceListId = oldPOS.getM_PriceList_ID(); - int cashBookId = oldPOS.getC_CashBook_ID(); - int cashBPartnerId = oldPOS.getC_BPartnerCashTrx_ID(); - int adOrgId = oldPOS.getAD_Org_ID(); - int bankAccountId = BankManager.getDefaultBankAccountId(ctx, adOrgId, trx.getTrxName()); - int salesRepId = oldPOS.getSalesRep_ID(); - MStore store = StoreManager.getStore(ctx); - if (store.get_ID() == 0) - { - throw new OperationException("Store could not be loaded"); - } - - int poPriceListId = store.getM_PriceList_ID(); - - MPOSTerminal terminal = createPOSTerminal(ctx, adOrgId, posName, cashBookId, bankAccountId, poPriceListId, soPriceListId, warehouseId, cashBPartnerId, salesRepId, trx.getTrxName()); - StringBuffer updateStmt = new StringBuffer(); - updateStmt.append("UPDATE C_Order SET C_POS_ID=").append(terminal.get_ID()); - updateStmt.append(" WHERE C_POS_ID=").append(oldPOS.get_ID()); - - DB.executeUpdate(updateStmt.toString(), trx.getTrxName()); - - oldPOS.setIsActive(false); - PoManager.save(oldPOS); - trx.commit(); - } - } - catch (Exception ex) - { - logger.log(Level.SEVERE, "Could not migrate old pos terminal", ex); - } - finally - { - trx.rollback(); - trx.close(); - } - } - - - /** - * Checks whether a check book can be set on a terminal - * @param ctx Context - * @param terminalId Terminal - * @param cashBookId Cash Book - * @param trxName Transaction - * @return Whether the cash book can be set on the terminal - * @throws OperationException If data cannot be retrieved - */ - public static boolean isCashBookAssignedValid(Properties ctx, int terminalId, int cashBookId, String trxName) throws OperationException - { - boolean valid = false; - - StringBuffer sqlStmt = new StringBuffer(); - sqlStmt.append("SELECT COUNT(*) FROM U_POSTerminal "); - sqlStmt.append("WHERE AD_Client_ID=? AND U_POSTerminal_ID<>? AND C_CashBook_ID=? "); - sqlStmt.append("AND U_POSTerminal.IsActive='Y' "); - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); - pstmt.setInt(1, Env.getAD_Client_ID(ctx)); - pstmt.setInt(2, terminalId); - pstmt.setInt(3, cashBookId); - - rs = pstmt.executeQuery(); - - if (rs.next()) - { - valid = (rs.getInt(1) == 0); - } - } - catch (Exception ex) - { - throw new OperationException("Could not check validity of Cash Book", ex); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - return valid; - } - - /** - * Checks whether a cash book has been assigned on a terminal - * @param ctx Context - * @param cashBookId Context - * @param trxName Transaction - * @return True if cash book is present on a terminal - */ - public static boolean isCashbookPresentOnTerminal(Properties ctx, int cashBookId, String trxName) - { - String sqlStmt = "SELECT U_POSTerminal_ID FROM U_POSTerminal WHERE AD_Client_ID=? AND C_CashBook_ID=? AND IsActive='Y'"; - - int terminalId = DB.getSQLValue(trxName, sqlStmt, Env.getAD_Client_ID(ctx), cashBookId); - - return (terminalId != -1); - } - - /** - * Creates or updates a terminal based on Data provided - * @param ctx Context - * @param bean Terminal data - * @param trxName Transaction - * @return POS Terminal PO - * @throws OperationException If data could not be updated - */ - public static MPOSTerminal createUpdatePOSTerminal(Properties ctx, TerminalBean bean, String trxName) throws OperationException - { - MPOSTerminal terminal = getPO(ctx, bean, trxName); - - if (bean.getIsActive() && !isCashBookAssignedValid(ctx, bean.getTerminalId(), bean.getCashBookId(), trxName)) - { - throw new InvalidTerminalCashBookException("The cash book assigned is already present on another terminal"); - } - else if (!bean.getIsActive() && !canInactivateTerminal(ctx, terminal.getAD_Org_ID(), terminal.get_ID(), trxName)) - { - throw new TerminalInactivateException("This terminal cannot be inactivated as no other active terminal available"); - } - - PoManager.save(terminal); - bean.setTerminalId(terminal.get_ID()); - return terminal; - } - - /** - * Returns the Persistent Object from the model used for the Terminal - * @param ctx Context - * @param bean Data model used - * @param trxName Transaction - * @return Terminal PO - * @throws OperationException If data in the model is not valid to construct the PO - */ - public static MPOSTerminal getPO(Properties ctx, TerminalBean bean, String trxName) throws OperationException - { - MPOSTerminal terminal = new MPOSTerminal(ctx, bean.getTerminalId(), trxName); - if (terminal.get_ID() != bean.getTerminalId()) - { - // Happens only when trying to load a terminal that is not present - // and the PO model resets the Id to 0 - throw new OperationException("Could not load terminal"); - } - terminal.setAD_Org_ID(bean.getOrgId()); - terminal.setName(bean.getName()); - terminal.setDescription(bean.getDescription()); - terminal.setC_CashBook_ID(bean.getCashBookId()); - terminal.setC_CashBPartner_ID(bean.getBpartnerId()); - terminal.setC_TemplateBPartner_ID(bean.getTemplateBPartnerId()); - terminal.setCheck_BankAccount_ID(bean.getCheckBankAccountId()); - terminal.setCard_BankAccount_ID(bean.getCardBankAccountId()); - terminal.setIsActive(bean.getIsActive()); - terminal.setLocked(bean.getLocked()); - terminal.setM_Warehouse_ID(bean.getWarehouseId()); - terminal.setPO_PriceList_ID(bean.getPurchasePriceListId()); - terminal.setSO_PriceList_ID(bean.getSalesPriceListId()); - - terminal.setAutoLock(bean.getAutoLock()); - - if (bean.getAutoLock()) - { - terminal.setLockTime(bean.getLockingTime()); - } - else - { - terminal.setLockTime(0); - } - - terminal.setCashBookTransferType(bean.getCashbookTransferType()); - if ( MPOSTerminal.CASHBOOKTRANSFERTYPE_CashBook.equals(bean.getCashbookTransferType())) - { - if (bean.getCashbookTransferCashbookId() == 0) - { - throw new OperationException("No cash book defined to transfer cash transactions"); - } - terminal.setCashTransferCashBook_ID(bean.getCashbookTransferCashbookId()); - terminal.setCashTransferBankAccount_ID(0); - } - else if (MPOSTerminal.CASHBOOKTRANSFERTYPE_BankAccount.equals(bean.getCashbookTransferType())) - { - if (bean.getCashbookTransferBankAccountId() == 0) - { - throw new OperationException("No bank account defined to transfer cash transactions"); - } - terminal.setCashTransferCashBook_ID(0); - terminal.setCashTransferBankAccount_ID(bean.getCashbookTransferBankAccountId()); - } - - - terminal.setCheckTransferType(bean.getCheckTransferType()); - if (MPOSTerminal.CHECKTRANSFERTYPE_CashBook.equals(bean.getCheckTransferType())) - { - if (bean.getCheckTransferCashbookId() == 0) - { - throw new OperationException("No cash book defined to transfer check transactions"); - } - terminal.setCheckTransferCashBook_ID(bean.getCheckTransferCashbookId()); - terminal.setCheckTransferBankAccount_ID(0); - } - else if (MPOSTerminal.CHECKTRANSFERTYPE_BankAccount.equals(bean.getCheckTransferType())) - { - if (bean.getCheckTransferBankAccountId() == 0) - { - throw new OperationException("No bank account defined to transfer check transactions"); - } - terminal.setCheckTransferCashBook_ID(0); - terminal.setCheckTransferBankAccount_ID(bean.getCheckTransferBankAccountId()); - } - - terminal.setCardTransferType(bean.getCardTransferType()); - if (MPOSTerminal.CARDTRANSFERTYPE_CashBook.equals(bean.getCardTransferType())) - { - if (bean.getCardTransferCashbookId() == 0) - { - throw new OperationException("No cash book defined to transfer credit card transactions"); - } - terminal.setCardTransferCashBook_ID(bean.getCardTransferCashbookId()); - terminal.setCardTransferBankAccount_ID(0); - } - else if (MPOSTerminal.CARDTRANSFERTYPE_BankAccount.equals(bean.getCardBankAccountId())) - { - if (bean.getCardBankAccountId() == 0) - { - throw new OperationException("No bank account defined to transfer credit card transactions"); - } - terminal.setCardTransferCashBook_ID(0); - terminal.setCardTransferBankAccount_ID(bean.getCardTransferBankAccountId()); - } - return terminal; - } - - - /** - * Retrieves the terminal id from the cookie stored in the client's browser - * @param request Server Request - * @return Terminal ID present in the cookie or null if not present - */ - public static String getTerminalFromCookie(HttpServletRequest request) - { - return POSManager.getDataFromCookie(request, Constants.POSTERMINAL); - } - - /** - * Retrieves the terminal id from the cookie stored in the client's browser - * @param request Server Request - * @return Terminal ID present in the cookie - * @throws OperationException If the Terminal Id is not valid - */ - public static int getTerminalIdFromCookie(HttpServletRequest request) throws OperationException - { - String strTerminalId = getTerminalFromCookie(request); - - int terminalId = -1; - - try - { - terminalId = Integer.parseInt(strTerminalId); - Properties ctx = TmkJSPEnv.getCtx(request); - loadTerminal(ctx, terminalId, null); - } - catch (Exception ex) - { - throw new OperationException("Could not retrieve terminal Id"); - } - return terminalId; - } - - /** - * Set the terminal id in the cookie that is stored in the client's browser - * @param response Response to be sent to the client - * @param terminalId Terminal Id - */ - public static void setTerminalInCookie(HttpServletResponse response, int terminalId) - { - Cookie cookie = new Cookie(Constants.POSTERMINAL, String.valueOf(terminalId)); - cookie.setMaxAge(365*24*60*60); - response.addCookie(cookie); - } - - /** - * Reset the terminal id in the cookie that is stored in the client's browser - * @param response Response to be sent to client - */ - public static void resetTerminalInCookie(HttpServletResponse response) - { - Cookie cookie = new Cookie(Constants.POSTERMINAL, ""); - response.addCookie(cookie); - } - - /** - * Checks whether a POS Terminal is present with the id provided - * and the context organisation - * @param ctx Context - * @param posId POS Terminal - * @return - */ - public static boolean isPOSTerminalAccessible(Properties ctx, int terminalId) - { - String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + - " AND AD_Org_ID=" + Env.getAD_Org_ID(ctx) + " AND U_PosTerminal_ID=" + terminalId - + " AND IsActive='Y'"; - - int posIds[] = MPOSTerminal.getAllIDs(MPOSTerminal.Table_Name, whereClause, null); - - if(posIds.length == 0) - { - return false; - } - return true; - } - - - /** - * Returns the terminal data model from the Terminal persistent object - * @param terminal Terminal PO - * @return Data model - */ - public static TerminalBean getBean(MPOSTerminal terminal) - { - int currentTerminalId = getTerminalId(terminal.getCtx()); - TerminalBean bean = new TerminalBean(); - bean.setTerminalId(terminal.getU_POSTerminal_ID()); - bean.setOrgId(terminal.getAD_Org_ID()); - bean.setName(terminal.getName()); - bean.setDescription(terminal.getDescription()); - bean.setAutoLock(terminal.isAutoLock()); - bean.setBpartnerId(terminal.getC_CashBPartner_ID()); - bean.setCashBookId(terminal.getC_CashBook_ID()); - bean.setCashbookTransferType(terminal.getCashBookTransferType()); - bean.setCashbookTransferBankAccountId(terminal.getCashTransferBankAccount_ID()); - bean.setCashbookTransferCashbookId(terminal.getCashTransferCashBook_ID()); - bean.setCheckBankAccountId(terminal.getCheck_BankAccount_ID()); - bean.setCheckTransferBankAccountId(terminal.getCheckTransferBankAccount_ID()); - bean.setCheckTransferCashbookId(terminal.getCheckTransferCashBook_ID()); - bean.setCheckTransferType(terminal.getCheckTransferType()); - bean.setCardBankAccountId(terminal.getCard_BankAccount_ID()); - bean.setCardTransferBankAccountId(terminal.getCardTransferBankAccount_ID()); - bean.setCardTransferCashbookId(terminal.getCardTransferCashBook_ID()); - bean.setCardTransferType(terminal.getCardTransferType()); - bean.setIsActive(terminal.isActive()); - bean.setLocked(terminal.isLocked()); - bean.setLockingTime(terminal.getLockTime()); - bean.setPurchasePriceListId(terminal.getPO_PriceList_ID()); - bean.setSalesPriceListId(terminal.getSO_PriceList_ID()); - bean.setTemplateBPartnerId(terminal.getC_TemplateBPartner_ID()); - bean.setWarehouseId(terminal.getM_Warehouse_ID()); - - if (currentTerminalId == terminal.get_ID()) - { - bean.setIsCurrentTerminal(true); - } - - return bean; - } - - - /** - * Retrieves POS Terminal - * @param ctx Context - * @param terminalId Terminal ID - * @param trxName Transaction - * @return Terminal - * @throws TerminalNotFoundException If the terminal does not exist or could not be loaded - */ - public static TerminalBean getTerminalBean(Properties ctx, int terminalId, String trxName) throws TerminalNotFoundException - { - MPOSTerminal posTerminal = new MPOSTerminal(ctx, terminalId, trxName); - if (posTerminal.get_ID() == 0) - { - throw new TerminalNotFoundException("Could not load terminal with id: " + terminalId); - } - - return getBean(posTerminal); - } - - /** - * Checks whether can activate - * @param ctx - * @param adOrgId - * @param trxName - * @return - */ - private static boolean canInactivateTerminal(Properties ctx, int adOrgId, int terminalId, String trxName) - { - String sqlStmt = "SELECT COUNT(*) FROM U_POSTerminal WHERE IsActive='Y' AND AD_Org_ID=? AND U_POSTerminal_ID<>?"; - - int count = DB.getSQLValue(trxName, sqlStmt, adOrgId, terminalId); - return (count >= 1); - } - - /** - * Updates the Terminal active state - * @param ctx Context - * @param terminalId Terminal ID - * @param active State of the terminal - * @param trxName Transaction - * @return Terminal Data model - * @throws OperationException If Terminal could not be updated - */ - public static TerminalBean updateTerminalStatus(Properties ctx, int terminalId, boolean active, String trxName) throws OperationException - { - MPOSTerminal terminal = loadTerminal(ctx, terminalId, trxName); - if (active && !isCashBookAssignedValid(ctx, terminalId, terminal.getC_CashBook_ID(), trxName)) - { - throw new InvalidTerminalCashBookException("Terminal cannot be reactivated as the cash book assigned to it is already being used"); - } - if (!active && !canInactivateTerminal(ctx, terminal.getAD_Org_ID(), terminalId, trxName)) - { - throw new TerminalInactivateException("Cannot inactivate this terminal as no active terminals present"); - } - terminal.setIsActive(active); - PoManager.save(terminal); - return getBean(terminal); - } - - /** - * Retrieves the Terminal ID from the applica - * @param ctx - * @return - */ - public static int getTerminalId(Properties ctx) - { - int terminalId = Env.getContextAsInt(ctx, UdiConstants.TERMINAL_ID); - return terminalId; - } - - /** - * Retrieves POS Terminal - * @param ctx Context - * @param terminalId Terminal ID - * @param trxName Transaction - * @return Terminal - * @throws TerminalNotFoundException If the terminal does not exist or could not be loaded - */ - public static MPOSTerminal loadTerminal(Properties ctx, int terminalId, String trxName) throws TerminalNotFoundException - { - MPOSTerminal posTerminal = new MPOSTerminal(ctx, terminalId, trxName); - if (posTerminal.get_ID() == 0) - { - throw new TerminalNotFoundException("Could not load terminal with id: " + terminalId); - } - - return posTerminal; - } - - /** - * Loads the PO of the terminal present in the application context - * @param ctx Context - * @return Terminal PO - * @throws TerminalNotFoundException If no terminal ID is present in the application context - * or the terminal ID is invalid - */ - public static MPOSTerminal loadTerminal(Properties ctx) throws TerminalNotFoundException - { - return loadTerminal(ctx, getTerminalId(ctx), null); - } - - /** - * Returns the Terminal PO from the terminal ID present in the application context - * @param ctx Context - * @return Terminal PO - * @throws TerminalNotFoundException If the terminal cannot be loaded - */ - public static MPOSTerminal getTerminal(Properties ctx) throws TerminalNotFoundException - { - int terminalId = getTerminalId(ctx); - return getTerminal(ctx, terminalId); - } - - /** - * Returns the Terminal PO from the terminal ID provided - * @param ctx Context - * @param terminalId - * @return - * @throws TerminalNotFoundException If the terminal cannot be loaded - */ - private static MPOSTerminal getTerminal(Properties ctx, int terminalId) throws TerminalNotFoundException - { - MPOSTerminal terminal = MPOSTerminal.get(ctx, terminalId); - if (terminal == null) - { - throw new TerminalNotFoundException("Terminal cannot be loaded; terminalId["+terminalId+"]"); - } - return terminal; - } - - /** - * Get all terminals from a search based on the name of the terminals - * @param ctx Context - * @param searchText Name search term - * @param trxName Transaction - * @return List of Terminals - * @throws OperationException If data cannot be retrieved - */ - public static ArrayList getTerminals(Properties ctx, String searchText, String trxName) throws OperationException - { - ArrayList terminalList = new ArrayList(); - StringBuffer sqlStmt = new StringBuffer(); - - sqlStmt.append("SELECT pos.*, o.Name as orgName, p1.Name as poPriceList, p2.Name as soPriceList "); - sqlStmt.append("FROM U_POSTerminal pos "); - sqlStmt.append("LEFT JOIN AD_Org o ON pos.AD_Org_ID=o.AD_Org_ID "); - sqlStmt.append("LEFT JOIN M_PriceList p1 ON pos.PO_PriceList_ID=p1.M_PriceList_ID "); - sqlStmt.append("LEFT JOIN M_PriceList p2 ON pos.SO_PriceList_ID=p2.M_PriceList_ID "); - sqlStmt.append("WHERE UPPER(pos.Name) LIKE UPPER(?) AND pos.AD_Client_ID=? "); - sqlStmt.append("AND pos.AD_Org_ID IN (").append(Env.getContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)).append(") "); - sqlStmt.append("ORDER BY pos.Name"); - PreparedStatement pstmt = null; - ResultSet rs = null; - - if (searchText == null) - { - searchText = ""; - } - - searchText = "%" + searchText.trim() + "%"; - - int currentTerminalId = getTerminalId(ctx); - - try - { - pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); - pstmt.setString(1, searchText); - pstmt.setInt(2, Env.getAD_Client_ID(ctx)); - - rs = pstmt.executeQuery(); - while (rs.next()) - { - MPOSTerminal terminal = new MPOSTerminal(ctx, rs, trxName); - TerminalBean terminalBean = getBean(terminal); - terminalBean.setOrgName(rs.getString("orgName")); - terminalBean.setPoPriceList(rs.getString("poPriceList")); - terminalBean.setSoPriceList(rs.getString("soPriceList")); - terminalBean.setIsCurrentTerminal(false); - - if (terminal.get_ID() == currentTerminalId) - { - terminalBean.setIsCurrentTerminal(true); - } - - terminalList.add(terminalBean); - } - } - catch (Exception ex) - { - logger.log(Level.SEVERE, "Could not retrieve terminals", ex); - throw new OperationException("Could not retrieve terminals, cause: " + ex.getMessage()); - } - finally - { - DB.close(rs, pstmt); - } - - return terminalList; - } - - - /** - * Retrieves list of active terminals - * @param ctx Context - * @param adOrgId Organisation - * @param trxName Transaction - * @return List of Active Terminals - * @throws OperationException If data cannot be retrieved - */ - public static ArrayList getAllActiveTerminals(Properties ctx, int adOrgId, String trxName) throws OperationException - { - ArrayList terminalList = new ArrayList(); - - String sqlStmt = "SELECT * FROM U_POSTerminal WHERE AD_Client_ID=? " + - "AND AD_Org_ID=? AND IsActive='Y' ORDER BY Name"; - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sqlStmt, trxName); - pstmt.setInt(1, Env.getAD_Client_ID(ctx)); - pstmt.setInt(2, adOrgId); - - rs = pstmt.executeQuery(); - - while (rs.next()) - { - MPOSTerminal terminal = new MPOSTerminal(ctx, rs, trxName); - TerminalBean terminalBean = getBean(terminal); - terminalList.add(terminalBean); - } - } - catch (Exception ex) - { - logger.log(Level.SEVERE, "Could not retrieve terminals", ex); - throw new OperationException("Could not retrieve terminals, cause: " + ex.getMessage()); - } - finally - { - DB.close(rs, pstmt); - } - - return terminalList; - } - - - /** - * Retrieves the currency for the Sales Price List for the POS Terminal - * @param ctx Context - * @return Currency of Sales PriceList - * @throws TerminalNotFoundException - */ - public static MCurrency getDefaultSalesCurrency(Properties ctx) throws TerminalNotFoundException - { - int salesPriceListId = POSTerminalManager.getSOPriceListId(ctx); - MPriceList priceList = new MPriceList(ctx, salesPriceListId, null); - MCurrency currency = new MCurrency(ctx, priceList.getC_Currency_ID(), null); - return currency; - } - - /** - * Retrieves the currency for the Sales Price List for the POS Terminal - * @param ctx Context - * @return Currency of Sales PriceList - * @throws OperationException - */ - public static MCurrency getDefaultPurchaseCurrency(Properties ctx) throws OperationException - { - int poPriceListId = getPOPriceListId(ctx); - MPriceList priceList = new MPriceList(ctx, poPriceListId, null); - MCurrency currency = new MCurrency(ctx,priceList.getC_Currency_ID(),null); - return currency; - } - - /** - * Retrieves the BPartner to be used for Cash Transactions for the the terminal present in - * the application context - * @param ctx Context - * @return BPartner - * @throws OperationException If the BPartner cannot be loaded - */ - public static MBPartner getCashBPartner(Properties ctx) throws OperationException - { - MPOSTerminal terminal = getTerminal(ctx); - int cashBPartnerId = terminal.getC_CashBPartner_ID(); - return BPartnerManager.loadBPartner(ctx, cashBPartnerId, null); - } - - /** - * Retrieves the ID of the BPartner defined on the Terminal present in application context - * that is to be used for Cash Transactions - * @param ctx Context - * @return ID of BPartner for cash transactions - * @throws TerminalNotFoundException If the terminal cannot be loaded - */ - public static int getCashBPartnerId(Properties ctx) throws TerminalNotFoundException - { - MPOSTerminal terminal = getTerminal(ctx); - int cashBPartnerId = terminal.getC_CashBPartner_ID(); - return cashBPartnerId; - } - - /** - * Returns the name of the printer to be used for server printing - * @param ctx Context - * @return Name of printer to be used for server printing - * @throws TerminalNotFoundException If the terminal cannot be loaded - */ - public static String getPOSPrinter(Properties ctx) throws TerminalNotFoundException - { - MPOSTerminal terminal = getTerminal(ctx); - return terminal.getPrinterName(); - } - - /** - * Returns the Cash Book associated with the terminal defined in the application context - * @param ctx Context - * @return Cash Book - * @throws OperationException If the cash book cannot be - */ - public static MCashBook getCashBook(Properties ctx) throws OperationException - { - int terminalId = Env.getContextAsInt(ctx,UdiConstants.TERMINAL_ID); - return getCashBook(ctx, terminalId); - } - - /** - * Returns the Cash Book ID of the Cash Book associated with the terminal defined in the - * application context - * @param ctx Context - * @return Cash Book ID - * @throws OperationException If the terminal cannot be loaded - */ - public static int getCashBookId(Properties ctx) throws OperationException - { - return getTerminal(ctx).getC_CashBook_ID(); - } - - /** - * Returns the Cash Book associated with the terminal provided - * @param ctx Context - * @param terminalId Terminal - * @return Cash Book - * @throws OperationException If the terminal/cash book cannot be loaded - */ - public static MCashBook getCashBook(Properties ctx, int terminalId) throws OperationException - { - MPOSTerminal terminal = getTerminal(ctx, terminalId); - int cashBookId = terminal.getC_CashBook_ID(); - MCashBook cashBook = CashManager.loadCashBook(ctx, cashBookId, null); - return cashBook; - } - - /** - * Retrieves the cash book ID associated with the terminal provided - * @param ctx Context - * @param terminalId Terminal ID - * @return Cash Book ID - * @throws OperationException If the terminal cannot be loaded - */ - public static int getCashBookId(Properties ctx, int terminalId) throws OperationException - { - MPOSTerminal terminal = getTerminal(ctx, terminalId); - return terminal.getC_CashBook_ID(); - } - - /** - * Retrieves the Warehouse associated with the terminal present in the application context - * @param ctx Context - * @return Warehouse - * @throws TerminalNotFoundException If the terminal cannot be loaded - */ - public static MWarehouse getWarehouse(Properties ctx) throws TerminalNotFoundException - { - int terminalId = Env.getContextAsInt(ctx,UdiConstants.TERMINAL_ID); - return getWarehouse(ctx, terminalId); - } - - /** - * Retrieves the Warehouse associated with the terminal provided - * @param ctx Context - * @param terminalId Terminal - * @return Warehouse - * @throws TerminalNotFoundException If terminal cannot be loaded - */ - public static MWarehouse getWarehouse(Properties ctx, int terminalId) throws TerminalNotFoundException - { - MPOSTerminal terminal = loadTerminal(ctx, terminalId, null); - int warehouseId = terminal.getM_Warehouse_ID(); - MWarehouse warehouse = new MWarehouse(ctx,warehouseId,null); - return warehouse; - } - - /** - * Retrieves the currency of the Cash Book associated with terminal in the application context - * @param ctx Context - * @return Currency of Cash Book - * @throws OperationException If terminal/cash book cannot be loaded - */ - public static MCurrency getCurrencyOfTerminalCashBook(Properties ctx) throws OperationException - { - int terminalId = Env.getContextAsInt(ctx,UdiConstants.TERMINAL_ID); - return getCurrencyOfTerminalCashBook(ctx, terminalId); - } - - /** - * Retrieves the currency of the Cash Book associated with the terminal provided - * @param ctx Context - * @param terminalId Terminal - * @return Currency of Cash Book - * @throws OperationException If Terminal/Cash Book cannot be loaded - */ - public static MCurrency getCurrencyOfTerminalCashBook(Properties ctx, int terminalId) throws OperationException - { - MCashBook cashBook = getCashBook(ctx, terminalId); - MCurrency currency = new MCurrency(ctx, cashBook.getC_Currency_ID(), null); - return currency; - } - - - /** - * Retrieves the name of the POS Terminal in context - * @param ctx Context - * @return Terminal Name - * @throws TerminalNotFoundException If the terminal cannot be loaded - */ - public static String getTerminalName(Properties ctx) throws TerminalNotFoundException - { - MPOSTerminal terminal = getTerminal(ctx); - return terminal.getName(); - } - - /** - * Retrieves the name of the POS Terminal - * @param ctx Context - * @param terminalId Terminal - * @return Terminal Name - * @throws TerminalNotFoundException If the terminal cannot be loaded - */ - public static String getTerminalName(Properties ctx, int terminalId) throws TerminalNotFoundException - { - MPOSTerminal terminal = getTerminal(ctx, terminalId); - return terminal.getName(); - } - - /** - * Retrieves the id of the sales price list associated with the POS Terminal in context. - * @param ctx context - * @return price list id - * @throws TerminalNotFoundException - */ - public static int getSOPriceListId(Properties ctx) throws TerminalNotFoundException - { - return getPriceListId(ctx, true); - } - - /** - * Retrieves the id of the purchase price list associated with the POS Terminal in context. - * @param ctx context - * @return price list id - * @throws TerminalNotFoundException - */ - public static int getPOPriceListId(Properties ctx) throws TerminalNotFoundException - { - return getPriceListId(ctx, false); - } - - /** - * Retrieves price list associated with the POS Terminal in context - * @param ctx Context - * @param isSOTrx Sales Pricelist - * @return Price List ID (Sales or Purchase) - * @throws TerminalNotFoundException - */ - public static int getPriceListId(Properties ctx, boolean isSOTrx) throws TerminalNotFoundException - { - MPOSTerminal terminal = getTerminal(ctx); - - if (isSOTrx) - { - return terminal.getSO_PriceList_ID(); - } - else - { - return terminal.getPO_PriceList_ID(); - } - } - - /** - * Updates the price list associated with the POS Terminal in context. - * @param ctx context - * @param priceListId price list id - * @param isSOTrx True for sales price list and false for purchase price list - * @throws OperationException - */ - public static void setTerminalPriceListId(Properties ctx, int priceListId, - boolean isSOTrx, String trxName) throws OperationException - { - MPOSTerminal terminal = loadTerminal(ctx); - terminal.set_TrxName(trxName); - - if (isSOTrx) - { - terminal.setSO_PriceList_ID(priceListId); - } - else - { - terminal.setPO_PriceList_ID(priceListId); - } - PoManager.save(terminal); - } - - /** - * Retrieves the organisation associated with the POS Terminal in context. - * @param ctx context - * @return Organisation Id (AD_Org_ID) - * @throws TerminalNotFoundException - */ - public static int getOrgId(Properties ctx) throws TerminalNotFoundException - { - MPOSTerminal terminal = getTerminal(ctx); - return terminal.getAD_Org_ID(); - } - - /** - * Retrieves the Warehouse associated with the POS Terminal in context. - * @param ctx context - * @return Warehouse Id (M_Warehouse_ID) - * @throws TerminalNotFoundException - */ - public static int getWarehouseId(Properties ctx) throws TerminalNotFoundException - { - MPOSTerminal terminal = getTerminal(ctx); - return terminal.getM_Warehouse_ID(); - } - - /** - * Return the Bank Account specified for a tender type on the terminal - * @param ctx Context - * @param tenderType Payment Tender Type - * @return Bank Account Id - * @throws OperationException If no Bank Account is defined for tender type - */ - public static int getBankAccountId(Properties ctx, String tenderType) throws OperationException - { - MPOSTerminal terminal = getTerminal(ctx); - int bankAccountId = 0; - - if (MPayment.TENDERTYPE_Check.equals(tenderType)) - { - bankAccountId = terminal.getCheck_BankAccount_ID(); - } - else if (MPayment.TENDERTYPE_CreditCard.equals(tenderType)) - { - bankAccountId = terminal.getCheck_BankAccount_ID(); - } - - if (bankAccountId <= 0) - { - throw new OperationException("No bank account defined on the terminal for the tender type: " + tenderType); - } - - return bankAccountId; - } - - /** - * Retrieves the lock status of the terminal present in the application context is locked - * @param ctx Context - * @return Lock status of the terminal - * @throws TerminalNotFoundException If terminal cannot be loaded - */ - public static boolean isTerminalLocked(Properties ctx) throws TerminalNotFoundException - { - int terminalId = getTerminalId(ctx); - return isTerminalLocked(ctx, terminalId); - } - - /** - * Retrieves the locked status of the terminal provided - * @param ctx Context - * @param terminalId Terminal - * @return Lock status of the terminal - * @throws TerminalNotFoundException If the terminal cannot be loaded - */ - public static boolean isTerminalLocked(Properties ctx, int terminalId) throws TerminalNotFoundException - { - MPOSTerminal terminal = getTerminal(ctx, terminalId); - return terminal.isLocked(); - } - - /** - * Update the lock status of the terminal in context - * @param ctx Context - * @param terminalId Terminal - * @param trxName Transaction - * @throws OperationException If terminal cannot be loaded/cannot update terminal status - */ - public static void setTerminalLockStatus(Properties ctx, int terminalId, boolean locked, String trxName) throws OperationException - { - MPOSTerminal terminal = loadTerminal(ctx); - terminal.setLocked(locked); - PoManager.save(terminal); - } - - - /** - * Closes the till (Terminal). Does all the transfer of money that has been defined on the terminal - * @param ctx Context - * @param terminalId Terminal - * @param cashJournal Cash Journal being used from the cash book - * @param cashAmount Cash amount that need to be transfered - * @param checkAmount Check amount that need to be transfered - * @param cardAmount Card amount that need to be transfered - * @param trxName Transaction - * @throws OperationException If terminal is locked or transfers cannot be done - */ - public static void closeTerminal(Properties ctx, int terminalId, MCash cashJournal, BigDecimal cashAmount, - BigDecimal checkAmount, BigDecimal cardAmount, String trxName) throws OperationException - { - if (isTerminalLocked(ctx, terminalId)) - { - throw new TerminalLockedException("Terminal is locked"); - } - - MPOSTerminal terminal = loadTerminal(ctx, terminalId, trxName); - int cashBookId = cashJournal.getC_CashBook_ID(); - MCashBook cashBook = new MCashBook(ctx, cashBookId, trxName); - int currencyId = cashBook.getC_Currency_ID(); - Timestamp dateAcct = cashJournal.getStatementDate(); - - if (MPOSTerminal.CASHBOOKTRANSFERTYPE_BankAccount.equals(terminal.getCashBookTransferType())) - { - int bankAccountId = terminal.getCashTransferBankAccount_ID(); - CashManager.createBankTransferCashEntry(ctx, cashJournal, cashAmount, bankAccountId, trxName); - } - else if (MPOSTerminal.CASHBOOKTRANSFERTYPE_CashBook.equals(terminal.getCashBookTransferType())) - { - int toCashBookId = terminal.getCashTransferCashBook_ID(); - CashTransferManager.transferFromJournalToCashBook(ctx, cashJournal, toCashBookId, currencyId, cashAmount, dateAcct, trxName); - } - - if (MPOSTerminal.CHECKTRANSFERTYPE_BankAccount.equals(terminal.getCheckTransferType())) - { - int fromBankAccountId = terminal.getCheck_BankAccount_ID(); - int toBankAccountId = terminal.getCheckTransferBankAccount_ID(); - CashTransferManager.transferBankToBank(ctx, fromBankAccountId, toBankAccountId, currencyId, checkAmount, dateAcct, trxName); - } - else if (MPOSTerminal.CHECKTRANSFERTYPE_CashBook.equals(terminal.getCheckTransferType())) - { - int fromBankAccountId = terminal.getCheck_BankAccount_ID(); - int toCashBookId = terminal.getCheckTransferCashBook_ID(); - MCash toCashJournal = CashManager.getCashJournal(ctx, toCashBookId, trxName); - CashManager.createBankTransferCashEntry(ctx, toCashJournal, checkAmount.negate(), fromBankAccountId, trxName); - } - - - if (MPOSTerminal.CARDTRANSFERTYPE_BankAccount.equals(terminal.getCardTransferType())) - { - int fromBankAccountId = terminal.getCard_BankAccount_ID(); - int toBankAccountId = terminal.getCard_BankAccount_ID(); - CashTransferManager.transferBankToBank(ctx, fromBankAccountId, toBankAccountId, currencyId, cardAmount, dateAcct, trxName); - } - else if (MPOSTerminal.CARDTRANSFERTYPE_CashBook.equals(terminal.getCardTransferType())) - { - int fromBankAccountId = terminal.getCard_BankAccount_ID(); - int toCashBookId = terminal.getCardTransferCashBook_ID(); - MCash toCashJournal = CashManager.getCashJournal(ctx, toCashBookId, trxName); - CashManager.createBankTransferCashEntry(ctx, toCashJournal, cardAmount.negate(), fromBankAccountId, trxName); - } - - if (terminal.isAutoLock()) - { - // Lock the terminal - terminal.setLocked(true); - } - - PoManager.save(terminal); - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/PartialPOSManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/PartialPOSManager.java deleted file mode 100644 index 8c4a526009..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/PartialPOSManager.java +++ /dev/null @@ -1,295 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 14-Mar-2006 - */ - - -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MOrder; -import org.compiere.model.MOrderLine; -import org.compiere.process.DocAction; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.ItemBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.core.DocStatusMap; -import org.posterita.exceptions.InvalidInvokeOrderStatusException; -import org.posterita.exceptions.InvalidOrderIDException; -import org.posterita.exceptions.InvalidOrderTypeException; -import org.posterita.exceptions.InvalidTenderedAmountException; -import org.posterita.exceptions.NoOrderLineFoundException; -import org.posterita.exceptions.NoOrderLineSelectedException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.order.UDIOrderTypes; -import org.posterita.util.PoManager; - - -public class PartialPOSManager extends POSManager -{ - public static void validateMixedPaymentAmount(OrderLineBean bean) throws InvalidTenderedAmountException - { - if(bean.getTrxType().equalsIgnoreCase("Mixed")) - { - double cashAmt = 0.0; - double chequeAmt = 0.0; - double cardAmt = 0.0; - - cashAmt = (bean.getPaymentByCash()!=null) ? bean.getPaymentByCash() : cashAmt; - chequeAmt = (bean.getPaymentByChq()!=null) ? bean.getPaymentByChq() : chequeAmt; - cardAmt = (bean.getPaymentByCard()!=null) ? bean.getPaymentByCard() : cardAmt; - - double sumActualAmt=bean.getTotalActualPrice(); - - - if( - (cashAmt+chequeAmt+cardAmt !=sumActualAmt)|| - (cashAmt<0.0)|| - (chequeAmt<0.0)|| - (cardAmt<0.0) - ) - { - throw new InvalidTenderedAmountException("The Tendered Amount should be equal to the total amount"); - } - } - } - - //FIXME - public static String deleteOrderLines(Properties ctx,Integer[]orderlineIds,String trxName) throws OperationException - { - if((orderlineIds == null)||(orderlineIds.length == 0)) - { - throw new NoOrderLineSelectedException("Cannot delete orderlines. No orderlines supplied!"); - } - - for(int i=0;i cartBeanItems, String trxName) throws OperationException - { - - MOrder order = new MOrder(ctx,orderId,trxName); - validateMixedPaymentAmount(bean); - - String paymentRule = getPaymentRule(ctx,bean.getTrxType()); - - order.setPaymentRule(paymentRule); - - PoManager.save(order); - - int i=0; - for(ItemBean itemBean : cartBeanItems) - { - double actualPrice = 0.0; - double discount = 0.0; - - if(bean.getDiscountPercent()!=null) - { - String discountEntered = bean.getDiscountPercent()[i]; - - if( discountEntered == null || discountEntered.equals("")) - { - discount = 0; - } - else - { - discount = Double.parseDouble(bean.getDiscountPercent()[i]); - - //double d = 100.0 - discount; - double priceWithDiscount = Double.parseDouble(bean.getActualPrice()[i]); - - // newPrice = (actualPrice + VAT) - discount - - actualPrice = (100.0 / 115.0) * priceWithDiscount; - } - } - - itemBean.setDiscountPercent(new BigDecimal(discount)); - itemBean.setActualPrice(new BigDecimal(actualPrice)); - - updateOrderLine(ctx,order,itemBean.getProductId().intValue(),itemBean.getDiscountPercent(),itemBean.getActualPrice()) ; - - i++; - } - - - return order; - } - - private static void updateOrderLine(Properties ctx,MOrder order,int productID,BigDecimal discount,BigDecimal actualPrice) throws OperationException - { - //load orderLine - int orderId = order.get_ID(); - - int id[] = MOrderLine.getAllIDs(MOrderLine.Table_Name,"C_ORDER_ID = "+orderId+" AND M_PRODUCT_ID = "+productID,order.get_TrxName()); - if((id==null)||(id.length==0)) - { - throw new OperationException("OrderLine not found."); - } - - String trxName = order.get_TrxName(); - - MOrderLine orderLine = new MOrderLine(ctx,id[0],trxName); - - //calculating new price - BigDecimal newActualPrice = OrderManager.calculateActualPrice(ctx,orderLine.getPriceActual(),discount); - orderLine.setPrice (newActualPrice); - - PoManager.save(orderLine); - - } - - public static MOrder invokePartialOrder(Properties ctx,int orderId,String trxName) throws InvalidOrderIDException,NoOrderLineFoundException,InvalidInvokeOrderStatusException - { - //checking whether order exixts - int ids[] = MOrder.getAllIDs(MOrder.Table_Name,"ISACTIVE='Y' AND C_ORDER_ID = " + orderId,null); - - if((ids == null)||(ids.length == 0)) - { - throw new InvalidOrderIDException("Could not found order!"); - } - - //loading order - MOrder order = new MOrder(ctx,ids[0],trxName); - - //checking order status - String status = order.getDocStatus(); - if((status.equals(DocAction.STATUS_Drafted))||(status.equals(DocAction.STATUS_InProgress))) - { - //looking for orderlines - if(OrderManager.isOrderEmpty(ctx,orderId,trxName)) - { - throw new NoOrderLineFoundException("Order does contain any orderlines!"); - } - } - else - { - //display err msg - String s = DocStatusMap.getDocStatusMap().get(status); - throw new InvalidInvokeOrderStatusException("Cannot invoke with status: " + s,s); - } - - return order; - } - - public static MOrder invokePartialOrder (Properties ctx, String documentNo, String trxName) throws InvalidOrderIDException,NoOrderLineFoundException,InvalidInvokeOrderStatusException, InvalidOrderTypeException - { - int orderId=getOrderIdFromDocumentNo(ctx,documentNo); - //loading order - MOrder order = new MOrder(ctx,orderId,trxName); - - //check order type - //only drafted pos orders can be invoked - String orderType = order.getOrderType(); - if(! orderType.equalsIgnoreCase( UDIOrderTypes.POS_ORDER.getOrderType() ) ) - { - throw new InvalidOrderTypeException("Can only POS orders "); - } - - //checking order status - String status = order.getDocStatus(); - if((status.equals(DocAction.STATUS_Drafted))||(status.equals(DocAction.STATUS_InProgress))) - { - //looking for orderlines - if(OrderManager.isOrderEmpty(ctx,orderId,trxName)) - { - throw new NoOrderLineFoundException("Order does contain any orderlines!"); - } - } - else - { - //display err msg - String s = DocStatusMap.getDocStatusMap().get(status); - throw new InvalidInvokeOrderStatusException("Cannot invoke with status: " + s,s); - } - - return order; - } - - public static int getOrderIdFromDocumentNo(Properties ctx,String documentNo) throws InvalidOrderIDException - { -// checking whether order exixts - int ids[] = MOrder.getAllIDs(MOrder.Table_Name,"ISACTIVE='Y' AND AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and DOCUMENTNO = '" + documentNo + "'",null); - - if((ids == null)||(ids.length == 0)) - { - throw new InvalidOrderIDException("Could not found order!"); - } - - return ids[0]; - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/PaymentAllocationManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/PaymentAllocationManager.java deleted file mode 100644 index 038eed7589..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/PaymentAllocationManager.java +++ /dev/null @@ -1,372 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 7, 2006 by alok - */ - - -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MAllocationHdr; -import org.compiere.model.MAllocationLine; -import org.compiere.model.MInvoice; -import org.compiere.model.MPayment; -import org.compiere.process.DocumentEngine; -import org.compiere.util.DB; -import org.compiere.util.Env; - -import org.posterita.beans.OpenItemBean; -import org.posterita.exceptions.AllocatedAmtMoreThanOpenAmtException; -import org.posterita.exceptions.CanNotCreatePaymentAllocationException; -import org.posterita.exceptions.NoAllocateeInvoiceException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.PayAmtNotEqualToAllocateAmtException; -import org.posterita.exceptions.TooManyAllocateInvoiceException; -import org.posterita.util.PoManager; - - -public class PaymentAllocationManager -{ - - - public static void allocate(Properties ctx, Integer[] invoiceIds, Integer[] paymentIds, String trxName) throws TooManyAllocateInvoiceException,CanNotCreatePaymentAllocationException,OperationException - { - - BigDecimal discountAmt = new BigDecimal(0); - BigDecimal writeOffAmt = new BigDecimal(0); - BigDecimal overUnderAmt = new BigDecimal(0); - int paymentId = 0; - int cashLineId=0; - int creditInvoiceId=0; - MInvoice invoice = null; - BigDecimal appliedAmt=new BigDecimal(0); - int count=0; - - if(invoiceIds==null || invoiceIds.length<1) - { - throw new NoAllocateeInvoiceException("Please select an Invoice to allocate"); - } - - if(invoiceIds.length<2 && (paymentIds==null || paymentIds.length<1)) - { - throw new NoAllocateeInvoiceException("Please select an Invoice to allocate"); - } - - - for(int i=0;i1) - throw new TooManyAllocateInvoiceException("can match only one credit Invoice"); - creditInvoiceId=invoice.get_ID(); - } - - } - if(count==0) - { - throw new NoAllocateeInvoiceException("Please select an Invoice to allocate"); - } - - MInvoice creditInvoice = new MInvoice(ctx,creditInvoiceId,null); - if(appliedAmt.doubleValue()>0) - { - if((appliedAmt.doubleValue())>creditInvoice.getOpenAmt().doubleValue()) - { - throw new CanNotCreatePaymentAllocationException("the allocation amt is more than open amt"); - } - } - - MAllocationHdr alloc = new MAllocationHdr (ctx, true, // manual - new Timestamp(System.currentTimeMillis()), creditInvoice.getC_Currency_ID(), Env.getContext(Env.getCtx(), "#AD_User_Name"), trxName); - alloc.setAD_Org_ID(Env.getAD_Org_ID(ctx)); - alloc.save(); - - if(invoiceIds.length>1) - { - for(int j=0;j0) - { - MPayment payment=null; - BigDecimal overUnderPaymentAmt = null; - for(int k=0;kcreditInvoice.getOpenAmt().doubleValue()) - { - overUnderPayment=availableAmt.subtract(creditInvoice.getOpenAmt()); - } - else - { - overUnderPayment=payment.getOverUnderAmt(); - } - */ - - MAllocationLine aLine = new MAllocationLine (alloc, allocationAmt, - payment.getDiscountAmt(), payment.getWriteOffAmt(),overUnderPaymentAmt ); - aLine.setDocInfo(creditInvoice.getC_BPartner_ID(),creditInvoice.getC_Order_ID(), creditInvoice.get_ID()); - aLine.setPaymentInfo(payment.get_ID(), cashLineId); - aLine.save(); - } - } - - - String sql = "SELECT invoiceOpen("+creditInvoiceId+", 0) FROM C_Invoice WHERE C_Invoice_ID = ?"; - BigDecimal open = DB.getSQLValueBD(null, sql, creditInvoiceId); - if (open != null && open.signum() == 0) - { - sql = "UPDATE C_Invoice SET IsPaid='Y' WHERE C_Invoice_ID=" + creditInvoiceId; - DB.executeUpdate(sql,null); - - } - - alloc.processIt(DocumentEngine.ACTION_Complete); - PoManager.save(alloc); - } - - private static BigDecimal getAvailableAmt(Properties ctx, int paymentId) throws OperationException - { - String sql = "select availableAmt from RV_payment where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " and C_Payment_id="+paymentId; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - BigDecimal availableAmt=new BigDecimal(0.0); - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - availableAmt=rs.getBigDecimal(1); - } - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - - pstmt.close(); - } - catch (SQLException e) - { - - } - - } - - return availableAmt; - } - - - - public static ArrayList getInvoiceToAllocate(Properties ctx,Integer [] invoiceIds,String trxName) throws TooManyAllocateInvoiceException,CanNotCreatePaymentAllocationException,OperationException - { - if(invoiceIds==null) - { - throw new NoAllocateeInvoiceException("Please select an Invoice to allocate"); - } - ArrayList list=new ArrayList(); - for (int i=0;i0) - { - for(int k=0;k0) - { - - for(int k=0;k list = new ArrayList(); - - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean= new PaymentHistoryBean(); - bean.setPaymentId(Integer.valueOf(rs.getInt(1))); - bean.setPartnerName(rs.getString(2)); - bean.setDocumentNo(rs.getString(3)); - bean.setDateTrx(rs.getTimestamp(4)); - bean.setIsReceipt(rs.getString(5)); - bean.setInvoiceId(Integer.valueOf(rs.getInt(6))); - bean.setCheckNo(rs.getString(7)); - bean.setPayAmt(Integer.valueOf(rs.getInt(8))); - bean.setDocStatus(UDIMap.docStatusMap.get(rs.getString(9))); - bean.setDocStatusCode(rs.getString(9)); - bean.setOrderId(Integer.valueOf(rs.getInt(10))); - bean.setPartnerId(Integer.valueOf(rs.getInt(11))); - list.add(bean); - } - - rs.close(); - - } - catch (SQLException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - - } - - return list; - } - - public static MPayment generatePayments(Properties ctx, MInvoice invoice) throws OperationException - { - //the normal flow for payment should be that - //first customer creates an AP Payment - //completes it - //this generates a counter(AR payment) document on HSAF side - - //however we assume that the customer has paid for the goods - //and generate his AP payment ourselves - - //get counter(vendor invoice) from customer Invoice - - MInvoice vendorInvoice = InvoiceManager.getCounterInvoice(ctx, invoice); - Properties newCtx = (Properties) ctx.clone(); - newCtx.setProperty(UdiConstants.ORG_ID_CTX_PARAM, "" + vendorInvoice.getAD_Org_ID()); - - //appayment is linked to vendor invoice - MPayment apPayment = createAPPayment(newCtx, vendorInvoice, vendorInvoice.get_TrxName()); - - //ar receipt is linked to customer invoice - MPayment completedAPPayment = completeAPPayment(newCtx, apPayment); - - //get generated AR receipt - int arReceiptIds[] = MPayment.getAllIDs(MPayment.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ref_payment_id=" + completedAPPayment.get_ID(),invoice.get_TrxName()); - - if (arReceiptIds.length == 0) - throw new RuntimeException("Expected an AR Receipt for AP Payment---" + apPayment.get_ID()); - - PaymentManager.completePayment(ctx, new MPayment(ctx,arReceiptIds[0],invoice.get_TrxName())); - return completedAPPayment; - } - - //retrieve AR receipt - public static MPayment getCounterPayment(Properties ctx, MPayment apPayment) - { - if (!apPayment.getDocStatus().equals(DocumentEngine.STATUS_Completed)) - throw new RuntimeException("Cannot get counter document of payment which has not been completed"); - - int arReceipts[] = MPayment.getAllIDs(MPayment.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ref_payment_id=" + apPayment.get_ID(), apPayment.get_TrxName()); - - if (arReceipts.length == 0) - throw new RuntimeException("counter payment document not found for payment--" + apPayment.get_ID()); - - MPayment receipt = new MPayment(ctx, arReceipts[0], apPayment.get_TrxName()); - - return receipt; - } - public static WebDocumentBean getWebPaymentBean(Properties ctx, MPayment payment) throws OperationException, DataException - { - if (payment == null) - throw new OperationException("Invalid operation payment is null"); - - if (payment.get_ID() == 0) - throw new OperationException("You have deleted this payment. You cannot view this payment."); - - WebDocumentBean bean = new WebDocumentBean(); - - bean.setPaymentId(Integer.valueOf(payment.get_ID())); - - int currencyId = payment.getC_Currency_ID(); - MCurrency currency = new MCurrency(ctx,currencyId,null); - bean.setCurrencySymbole(currency.getCurSymbol()); - - MOrg myOrg = OrganisationManager.getMyOrg(ctx); - MBPartner me = new MBPartner(ctx, myOrg.getLinkedC_BPartner_ID(null), null); - bean.setMe(me); - //MOrg orderOrg = new MOrg(ctx, payment.getAD_Org_ID(), null); - /* - if (orderOrg.getLinkedC_BPartner_ID() != myOrg.getLinkedC_BPartner_ID()) - throw new DocumentDoesNotBelongToYouException("This payment does not belong to you. You do not have access to it."); - */ - - MBPartnerLocation meLocation[] = MBPartnerLocation.getForBPartner(ctx,me.get_ID()); - if (meLocation.length ==0) - throw new OperationException("No location has been set for your organisation. Please ask your administrator to set one for you"); - - MLocation location = new MLocation(ctx, meLocation[0].getC_Location_ID(), null); - - if (location.get_ID() == 0) - throw new OperationException("You must have a location set for your business partner, Please ask your administrator to set one for you"); - - bean.setMeLocation(location); - - MBPartner you = new MBPartner(ctx, payment.getC_BPartner_ID(), null); - - MBPartnerLocation youBPLocation[] = MBPartnerLocation.getForBPartner(ctx, you.get_ID()); - - if (youBPLocation.length ==0) - throw new OperationException("No location has been set for the dealer organisation. Please ask your administrator to set one for you"); - - MLocation youLocation = new MLocation(ctx, youBPLocation[0].getC_Location_ID(), null); - - bean.setYou(you); - bean.setYoubpLocation(youBPLocation[0]); - bean.setYouLocation(youLocation); - - WebDocumentHeaderBean headerBean = createWebDocumentHeader(ctx, payment.getAD_Org_ID(),payment.getC_BPartner_ID(), payment.getDocStatus(), payment.isReceipt(),payment.getTenderType()); - headerBean.setDocumentHeader(getDocumentHeader(payment)); - - String tenderTypeName = MRefList.getListName(ctx, MPayment.TENDERTYPE_AD_Reference_ID,payment.getTenderType()); - - if(payment.getCheckNo()!=null) - { - tenderTypeName=tenderTypeName+" "+payment.getCheckNo(); - } - headerBean.setPaymentType(tenderTypeName); - - bean.setHeaderBean(headerBean); - - bean.setPayment(payment); - - MInvoice invoice = new MInvoice(ctx, payment.getC_Invoice_ID(), null); - - //order linked to invoice - MOrder order = new MOrder(ctx, invoice.getC_Order_ID(), null); - - bean.setOrder(order); - bean.setInvoice(invoice); - - CommandBean cmdBean = getCustomerPaymentWebCommands(payment); - bean.setSimpleCommand(cmdBean.getSimpleCommand()); - bean.setComplexCommand(cmdBean.getComplexCommand()); - - return bean; - } - - public static String getDocumentHeader(MPayment payment) - { - if (payment.isReceipt()) - return PAYMENT_RECEIVED; - - return PAYMENT_MADE; - } - - - -// public static void paidAndShip(Properties ctx, MInvoice invoice) throws OperationException -// { -// MPayment apPayment = generatePayments(ctx, invoice); -// MessageManager.sendPaymentMessage(apPayment,UDIDocActionValues.CONFIRM); -// MinOutManager.generateMinOut(ctx, invoice); -// -// } - - - - private static CommandBean getCustomerPaymentWebCommands(MPayment payment) throws OperationException, DataException - { - - //if (!payment.isReceipt()) - // throw new OperationException("Invoice should be a AR Receipt"); - - - String[] simpleCommands = null; - String[] complexCommands = null; - - CommandBean bean = new CommandBean(); - - if (payment.getDocStatus().equals(DocumentEngine.STATUS_Drafted)) - { - simpleCommands = new String[]{Constants.PAYMENT_ACTION_COMPLETE}; - complexCommands = new String[]{Constants.PAYMENT_ACTION_CANCEL}; - } - - if (payment.getDocStatus().equals(DocumentEngine.STATUS_Voided)) - { - complexCommands = new String[]{Constants.INVOICE_ACTION_DELETE}; - } - - if (payment.getDocStatus().equals(DocumentEngine.STATUS_Completed)) - { - - simpleCommands = new String[]{Constants.MINOUT_ACTION_SHIP}; - } - - - bean.setSimpleCommand(simpleCommands); - bean.setComplexCommand(complexCommands); - return bean; - } - - - public static MPayment loadPayment(Properties ctx, int paymentId, String trxName) throws OperationException - { - MPayment payment = new MPayment(ctx, paymentId, trxName); - if(payment.get_ID() == 0) - throw new OperationException("Could not load payment with id: " + paymentId); - - return payment; - } - - public static void printInvoice(Properties ctx,MPayment payment) throws OperationException - { - PrintManager.print(ctx,ReportEngine.REMITTANCE,payment.get_ID()); - } - - - public static MPayment createPayment(Properties ctx,PaymentBean bean,String trxName) throws OperationException - { - if(bean.getBpartnerId()==null) - { - throw new BPartnerNotFoundException("customer not found"); - } - - String docBaseType = MDocType.DOCBASETYPE_APPayment; - boolean isReceipt = false; - - if(bean.getIsSoTrx()) - { - docBaseType = MDocType.DOCBASETYPE_ARReceipt; - isReceipt = true; - } - - MDocType[] docTypes = MDocType.getOfDocBaseType(ctx, docBaseType); - if (docTypes.length == 0) - { - throw new OperationException("not document type found for payment"); - } - - MPayment payment = new MPayment(ctx,0,trxName); - payment.setC_DocType_ID(docTypes[0].get_ID()); - payment.setC_Currency_ID(POSTerminalManager.getCurrencyOfTerminalCashBook(ctx).get_ID()); - payment.setC_BPartner_ID(bean.getBpartnerId()); - - // @ashley TODO Fix inconsistent Transaction type in the codes - if(bean.getTrxType().equalsIgnoreCase("Card")) - { - payment.setTenderType(MPayment.TENDERTYPE_CreditCard); - } - else if(bean.getTrxType().equalsIgnoreCase("Cheque")) - { - payment.setTenderType(MPayment.TENDERTYPE_Check); - } - else if(bean.getTrxType().equalsIgnoreCase("Cash")) - { - payment.setTenderType(MPayment.TENDERTYPE_Cash); - } - else - { - throw new OperationException("invalid tender type"); - } - - - if(MPayment.TENDERTYPE_Cash.equals(payment.getTenderType())) - { - int cashbookId = POSTerminalManager.getCashBookId(ctx); - payment.setC_CashBook_ID(cashbookId); - } - else - { - int bankAccountId = POSTerminalManager.getBankAccountId(ctx, payment.getTenderType()); - payment.setC_BankAccount_ID(bankAccountId); - } - - - payment.setIsPrepayment(false); - - payment.setPayAmt(bean.getAmount()); - if(bean.getCreditCardNumber()!=null) - payment.setCreditCardNumber(bean.getCreditCardNumber()); - if(bean.getChequeNo()!=null) - payment.setCheckNo(bean.getChequeNo()); - - payment.setIsReceipt(isReceipt); - - if(isReceipt) - payment.setDescription("(AR Receipt) Payment Received"); - else - payment.setDescription("(AP Payment) Payment Made"); - - int posId = POSTerminalManager.getTerminalId(ctx); - payment.setDescription(""+posId); //To get the proper pos info posId is saved into description - - PoManager.save(payment); - - PoManager.processIt(payment, DocumentEngine.ACTION_Complete); - - return payment; - } - - /** - * Returns the tender type for a payment rule - * @param paymentRule Order/Invoice Payment Rule - * @return Tender Type - */ - public static String getTenderType(String paymentRule) - { - if(MInvoice.PAYMENTRULE_CreditCard.equals(paymentRule)) - { - return MPayment.TENDERTYPE_CreditCard; - } - else if(MInvoice.PAYMENTRULE_DirectDebit.equals(paymentRule)) - { - return MPayment.TENDERTYPE_DirectDebit; - } - else if(MInvoice.PAYMENTRULE_DirectDeposit.equals(paymentRule)) - { - return MPayment.TENDERTYPE_DirectDeposit; - } - else if (MInvoice.PAYMENTRULE_Check.equals(paymentRule)) - { - return MPayment.TENDERTYPE_Check; - } - else if (MInvoice.PAYMENTRULE_OnCredit.equals(paymentRule) - || MInvoice.PAYMENTRULE_Mixed.equals(paymentRule)) - { - // Returns Check by default for Credit and Mixed payment rules. - return MPayment.TENDERTYPE_Check; - } - else - { - throw new IllegalArgumentException("No tender type is defined for the payment rule: " + paymentRule); - } - } - - /** - * @param ctx Context - * @param currencyId CurrencyId whose roundOff Factor is required - * @param total Total price - * @param trxName Transaction Name - * @return writeOff Amount - */ - public static BigDecimal computeWriteOff(Properties ctx, Integer currencyId, BigDecimal total, String trxName) - { - BigDecimal writeoffAmt = Env.ZERO; - BigDecimal roundOffFactor; - - MCurrency currency = new MCurrency(ctx, currencyId, trxName); - roundOffFactor = currency.getRoundOffFactor(); - - //Calculate write off amount - if(roundOffFactor != null && roundOffFactor.doubleValue() != 0.0) - { - writeoffAmt = total.remainder(roundOffFactor); - } - - return writeoffAmt; - } - - public static PaymentDetailsBean getPaymentDetails(Properties ctx, int c_order_id, String trxName) throws OperationException - { - PaymentDetailsBean bean = new PaymentDetailsBean(); - - MOrder order = new MOrder(ctx, c_order_id, trxName); - - bean.setTenderedAmt(order.getAmountTendered()); - bean.setRefundedAmt(order.getAmountRefunded()); - - String sql = " SELECT SUM(AMOUNT) AS AMOUNT, SUM(WRITEOFF) AS WRITEOFF, SUM(DISCOUNT) AS DISCOUNT FROM (" + - " SELECT SUM(AMOUNT) AS AMOUNT, SUM(WRITEOFFAMT) AS WRITEOFF, SUM(DISCOUNTAMT) AS DISCOUNT FROM C_CASHLINE,C_INVOICE " + - " WHERE C_INVOICE.C_INVOICE_ID = C_CASHLINE.C_INVOICE_ID " + - " AND C_INVOICE.C_ORDER_ID = ? " + - " UNION " + - " SELECT SUM(PAYAMT) AS AMOUNT, SUM(WRITEOFFAMT) AS WRITEOFF, SUM(DISCOUNTAMT) AS DISCOUNT FROM C_PAYMENT,C_INVOICE " + - " WHERE C_INVOICE.C_INVOICE_ID = C_PAYMENT.C_INVOICE_ID " + - " AND C_INVOICE.C_ORDER_ID = ? " + - " ) PAYMENT"; - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sql, trxName); - pstmt.setInt(1, c_order_id); - pstmt.setInt(2, c_order_id); - - rs = pstmt.executeQuery(); - - if(rs.next()) - { - BigDecimal amount = rs.getBigDecimal(1); - BigDecimal writeOff = rs.getBigDecimal(2); - BigDecimal discount = rs.getBigDecimal(3); - - amount = amount == null? Env.ZERO : amount; - writeOff = writeOff == null? Env.ZERO : writeOff; - discount = discount == null? Env.ZERO : discount; - - bean.setWriteOffAmt(writeOff); - bean.setDiscountAmt(discount); - bean.setPayAmt(amount.setScale(2, BigDecimal.ROUND_UP)); - - } - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs, pstmt); - } - return bean; - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/PaymentTermManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/PaymentTermManager.java deleted file mode 100644 index 0d42a2eb6b..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/PaymentTermManager.java +++ /dev/null @@ -1,316 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 31, 2006 by alok - */ - - -package org.posterita.businesslogic; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MPaymentTerm; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.PaymentTermBean; -import org.posterita.exceptions.CannotDeactivatePaymentTermException; -import org.posterita.exceptions.InvalidNetDaysException; -import org.posterita.exceptions.MandatoryNameException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.PaymentTermAlreadyExistsException; -import org.posterita.util.PoManager; - - -public class PaymentTermManager -{ - - public static ArrayList getAllActivePaymentTerm(Properties ctx) throws OperationException - { - return getAllPaymentTerm(ctx,true); - } - public static ArrayList getAllPaymentTerm(Properties ctx,boolean isActive) throws OperationException - { - String sql = "select " + - " C_PAYMENTTERM_ID," +//1 - " NAME," +//2 - " NETDAYS,"+//3 - " CASE WHEN isActive = 'Y' THEN 'true' ELSE 'false' END AS active ," + - //" DECODE(isActive,'Y','true','false') active,"+//4 - " CASE WHEN AFTERDELIVERY = 'Y' THEN 'true' ELSE 'false' END AS delivery," + - //" DECODE(AFTERDELIVERY,'Y','true','false') delivery,"+//5 - " CASE WHEN ISDUEFIXED = 'Y' THEN 'true' ELSE 'false' END AS dueFixed," + - //" DECODE(ISDUEFIXED,'Y','true','false') dueFixed,"+// - " FIXMONTHCUTOFF,"+//7 - " FIXMONTHDAY,"+//8 - " FIXMONTHOFFSET"+//9 - " from C_PAYMENTTERM " + - " where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - if(isActive==true) - sql=sql+"and isActive = 'Y'"; - - - ArrayList list = new ArrayList(); - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs=null; - - - PaymentTermBean bean=null; - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - - bean=new PaymentTermBean(); - bean.setPaymentTermId(rs.getInt(1)); - bean.setPaymentTermName(rs.getString(2)); - bean.setNetDays(rs.getInt(3)); - bean.setIsActive(Boolean.parseBoolean(rs.getString(4))); - bean.setAfterDelivery(Boolean.parseBoolean(rs.getString(5))); - bean.setFixedDueDate(Boolean.parseBoolean(rs.getString(6))); - bean.setFiedMonthCutoff(rs.getInt(7)); - bean.setFixedMonthDay(rs.getInt(8)); - bean.setFixedMonthOffset(rs.getInt(9)); - - list.add(bean); - } - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - if(rs!=null) - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - - } - } - - return list; - } - - public static MPaymentTerm createEditPaymentTerm(Properties ctx,PaymentTermBean bean,String trxName ) throws OperationException - { - if(bean.getPaymentTermName()==null) - { - throw new MandatoryNameException(" name is mandatory"); - } - - - MPaymentTerm paymentTerm=null; - String whereClause="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and name='"+bean.getPaymentTermName()+"'"; - int [] paymentTermIds=MPaymentTerm.getAllIDs(MPaymentTerm.Table_Name,whereClause,null); - - if(bean.getPaymentTermId()==null) - { - paymentTerm = new MPaymentTerm(ctx,0,trxName); - if(paymentTermIds.length>0) - throw new PaymentTermAlreadyExistsException("The Payment Term Name already exists"); - } - else - { - paymentTerm = new MPaymentTerm(ctx,bean.getPaymentTermId(),trxName); - if(paymentTermIds.length>0 && !paymentTerm.getName().equalsIgnoreCase(bean.getPaymentTermName())) - throw new PaymentTermAlreadyExistsException("The Payment Term Name already exists"); - - } - paymentTerm.setName(bean.getPaymentTermName()); - paymentTerm.setValue(bean.getPaymentTermName()); - - if(bean.getIsActive()==false) - { - String whereClause1="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_PAYMENTTERM_ID="+bean.getPaymentTermId(); - - int [] bPids = MBPartner.getAllIDs(MBPartner.Table_Name,whereClause1,null); - if(bPids!=null && bPids.length>0) - { - throw new CannotDeactivatePaymentTermException("cannot deActivate payment term,have associated bPartner"); - - } - } - - paymentTerm.setIsActive(bean.getIsActive()); - paymentTerm.setAfterDelivery(bean.getAfterDelivery().booleanValue()); - if(bean.getFixedDueDate().booleanValue()==true) - { - paymentTerm.setIsDueFixed(true); - - /**The Fix Month Cutoff indicates the last - * day invoices can have to be included in the current - * due date. This field only displays when the fixed due date checkbox has been - * selected.*/ - paymentTerm.setFixMonthCutoff(bean.getFiedMonthCutoff().intValue()); - - /**The Fix Month Day indicates the day of the month that invoices are due. - This field only displays if the fixed due date checkbox is selected.*/ - paymentTerm.setFixMonthDay(bean.getFixedMonthDay()); - - /**The Fixed Month Offset indicates the number of - * months from the current month to indicate an invoice is due. - * A 0 indicates the same month, a 1 the following month. - * This field will only display if the fixed due date checkbox is selected.*/ - - if(bean.getFixedMonthOffset()==null) - bean.setFixedMonthOffset(0); - paymentTerm.setFixMonthOffset(bean.getFixedMonthOffset()); - - } - else - { - paymentTerm.setIsDueFixed(false); - if(bean.getNetDays()==null || bean.getNetDays().intValue()<0) - { - throw new InvalidNetDaysException(" net days cannot be negative"); - } - paymentTerm.setNetDays(bean.getNetDays()); - } - - if(bean.getDiscountDay1()!=null) - { - paymentTerm.setDiscountDays(bean.getDiscountDay1()); - } - if(bean.getDiscountAmt1()!=null) - { - paymentTerm.setDiscount(bean.getDiscountAmt1()); - } - if(bean.getDiscountDay2()!=null) - { - paymentTerm.setDiscountDays2(bean.getDiscountDay2()); - } - if(bean.getDiscountAmt2()!=null) - { - paymentTerm.setDiscount2(bean.getDiscountAmt2()); - } - PoManager.save(paymentTerm); - return paymentTerm; - } - - - public static PaymentTermBean getPaymentTerm(Properties ctx,int paymentTermId) throws OperationException - { - String sql = "select " + - " C_PAYMENTTERM_ID," +//1 - " NAME," +//2 - " NETDAYS,"+//3 - //" DECODE(isActive,'Y','true','false') active,"+//4 - " CASE WHEN isActive='Y' THEN 'true' ELSE 'false' END AS active,"+//4 - //" DECODE(AFTERDELIVERY,'Y','true','false') delivery,"+//5 - " CASE WHEN AFTERDELIVERY = 'Y' THEN 'true' ELSE 'false' END AS delivery,"+//5 - //" DECODE(ISDUEFIXED,'Y','true','false') dueFixed,"+//6 - " CASE WHEN ISDUEFIXED = 'Y' THEN 'true' ELSE 'false' END AS dueFixed,"+//6 - " FIXMONTHCUTOFF,"+//7 - " FIXMONTHDAY,"+//8 - " FIXMONTHOFFSET,"+//9 - " DISCOUNTDAYS,"+//10 - " DISCOUNT,"+//11 - " DISCOUNTDAYS2,"+//12 - " DISCOUNT2"+//13 - " from C_PAYMENTTERM " + - " where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " and C_PAYMENTTERM_ID ="+paymentTermId; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs=null; - - PaymentTermBean bean=null; - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - - bean=new PaymentTermBean(); - bean.setPaymentTermId(rs.getInt(1)); - bean.setPaymentTermName(rs.getString(2)); - bean.setNetDays(rs.getInt(3)); - bean.setIsActive(Boolean.parseBoolean(rs.getString(4))); - bean.setAfterDelivery(Boolean.parseBoolean(rs.getString(5))); - bean.setFixedDueDate(Boolean.parseBoolean(rs.getString(6))); - bean.setFiedMonthCutoff(rs.getInt(7)); - bean.setFixedMonthDay(rs.getInt(8)); - bean.setFixedMonthOffset(rs.getInt(9)); - bean.setDiscountDay1(rs.getInt(10)); - bean.setDiscountAmt1(rs.getBigDecimal(11)); - bean.setDiscountDay2(rs.getInt(12)); - bean.setDiscountAmt2(rs.getBigDecimal(13)); - - } - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - if(rs!=null) - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - - } - } - - return bean; - } - - - public static MPaymentTerm activatePaymentTerm(Properties ctx,int paymentTermId, boolean activate) throws OperationException - { - - - MPaymentTerm paymentTerm = new MPaymentTerm(ctx,paymentTermId,null); - - if(activate==true) - { - paymentTerm.setIsActive(true); - } - - else - { - String whereClause="AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_PAYMENTTERM_ID="+paymentTermId; - int [] bPids = MBPartner.getAllIDs(MBPartner.Table_Name,whereClause,null); - if(bPids!=null && bPids.length>0) - { - throw new CannotDeactivatePaymentTermException("cannot deActivate payment term,have associated bPartner"); - } - paymentTerm.setIsActive(false); - } - - - PoManager.save(paymentTerm); - return paymentTerm; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/PostingManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/PostingManager.java deleted file mode 100644 index 412d12fb9f..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/PostingManager.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * - * Copyright (c) 2007 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * 21 Dec 2007 17:34:13 by shameem - * - */ - -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.util.Properties; -import java.util.logging.Level; - -import org.compiere.model.MInvoice; -import org.compiere.model.MPInstance; -import org.compiere.process.FactAcctReset; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.util.CLogger; -import org.compiere.util.Env; - -public class PostingManager -{ - - static private CLogger cLog = CLogger.getCLogger(FactAcctReset.class); - - public static void resubmitPostingForInvoice(Properties ctx) - { - // TODO Auto-generated method stub - - BigDecimal clientId = new BigDecimal(Env.getAD_Client_ID(ctx)); - - BigDecimal invoiceIdTableId = new BigDecimal(MInvoice.Table_ID); - - ProcessInfoParameter param[] = - { - new ProcessInfoParameter("AD_Client_ID", clientId, null, null, null), - new ProcessInfoParameter("AD_Table_ID", invoiceIdTableId, null, null, null), - new ProcessInfoParameter("DeletePosting", "N", null, null, null), - }; - - - MPInstance instance = new MPInstance(ctx, 175, Env.getAD_Client_ID(ctx)); - - instance.save(); - - ProcessInfo poInfo = new ProcessInfo("Resubmit Posting", 175); - poInfo.setParameter(param); - poInfo.setAD_Process_ID(175); - poInfo.setAD_PInstance_ID(instance.get_ID()); - - - FactAcctReset factAcct = new FactAcctReset(); - boolean success = factAcct.startProcess(ctx,poInfo, null); - - - - if(success==false) - { - cLog.log(Level.FINE,"Error occurred while running process for resubmit posting for Invoice"); - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/PrintManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/PrintManager.java deleted file mode 100644 index b9cdfbba18..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/PrintManager.java +++ /dev/null @@ -1,398 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 23, 2006 - */ - - -package org.posterita.businesslogic; - -import java.io.FileOutputStream; -import java.lang.reflect.Constructor; -import java.math.BigDecimal; -import java.util.Calendar; -import java.util.Properties; -import java.util.logging.Level; - -import javax.print.DocFlavor; -import javax.print.DocPrintJob; -import javax.print.PrintException; -import javax.print.PrintService; -import javax.print.PrintServiceLookup; -import javax.print.SimpleDoc; - -import org.compiere.model.MCashLine; -import org.compiere.model.MUser; -import org.compiere.print.MPrintFormat; -import org.compiere.print.ReportEngine; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.UDIBean; -import org.posterita.exceptions.OperationException; -import org.posterita.util.IPrintFormatter; -import org.posterita.util.TmkPrinterConstants; - - -public class PrintManager -{ - private static final CLogger logger = CLogger.getCLogger(PrintManager.class); - - final static String SINGLE_LINE = "-----------------------------"; - final static String DOUBLE_LINE = "============================="; - final static String EMPTY_STRING = ""; - - public static void printAdjustCashbookReport(Properties ctx, MCashLine cashLine) throws OperationException - { - int ad_user_id = Env.getAD_User_ID(ctx); - - if (cashLine.get_ID() <= 0) - { - throw new OperationException("Could not load Cash Line"); - } - - BigDecimal adjustmentAmount = cashLine.getAmount(); - String transferType = cashLine.getCashType(); - String title = "Adjust Cashbook"; - - if(MCashLine.CASHTYPE_GeneralExpense.equals(transferType)) - { - transferType = "Expense"; - } - else if(MCashLine.CASHTYPE_BankAccountTransfer.equals(transferType)) - { - transferType = "Account Transfer"; - adjustmentAmount = adjustmentAmount.negate(); - } - else if(MCashLine.CASHTYPE_GeneralReceipts.equals(transferType)) - { - transferType = "Receipt"; - } - else - { - throw new OperationException("Transfer type cannot be processed"); - } - - //writing the report - StringBuffer reportData = new StringBuffer(); - - //adding report header - reportData.append(TmkPrinterConstants.LOGO1); - - //adding title - reportData.append(TmkPrinterConstants.BIG_FONT) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(title) - .append(TmkPrinterConstants.LINE_FEED); - - //setting small font - reportData.append(TmkPrinterConstants.SMALL_FONT); - - //adding customer name - MUser user = new MUser(ctx,ad_user_id,null); - String username = user.getName(); - - username = String.format("%1$-60s",username); - reportData.append(username).append(TmkPrinterConstants.LINE_FEED); - - //adding date - Calendar c = Calendar.getInstance(); - String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); - date = String.format("%1$-60s",date); - reportData.append(date) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.LINE_FEED); - - //1.header - reportData.append(TmkPrinterConstants.H_FULL_LINE_TOP) - .append(TmkPrinterConstants.LINE_FEED); - - String header = String.format("%1$-30s%2$-30s","Transfer Type","Amount"); - - reportData.append(header) - .append(TmkPrinterConstants.LINE_FEED); - - reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) - .append(TmkPrinterConstants.LINE_FEED); - - //2.body - - String body = String.format("%1$-30s%2$-30s", transferType, adjustmentAmount); - - reportData.append(body) - .append(TmkPrinterConstants.LINE_FEED); - - reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) - .append(TmkPrinterConstants.LINE_FEED); - - //3.footer - - String footer = "Sig: ..................................."; - footer = String.format("%1$60s",footer); - - reportData.append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.LINE_FEED) - .append(footer) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.PAPER_CUT); - - print(ctx,reportData.toString()); - openCashDrawer(ctx); - - } - - /** - * Return Postscript file for document - * @param ctx Context - * @param type Type of document (Order, Invoice, ..) - * @param recordId The document id for which to generate a PS - * @return Postscript data - * @throws OperationException - * - * @author Ashley - */ - public static byte[] getPDFData(Properties ctx, int type, int recordId) throws OperationException - { - ReportEngine re = ReportEngine.get(ctx, type, recordId); - return re.createPDFData(); - } - - public static void openCashDrawer(Properties ctx) throws OperationException - { - byte [] printData= {10,27,112,48,55,1}; - print(ctx, new String(printData)); - } - - public static void print(Properties ctx, int type,int recordId) throws OperationException - { - ReportEngine re = ReportEngine.get(ctx,type, recordId); - MPrintFormat printFormatter = re.getPrintFormat(); - - String classname = printFormatter.getClassname(); - - if (classname != null) - { - String args = printFormatter.getArgs(); - try - { - Class clazz = Class.forName(classname); - IPrintFormatter formatter = null; - - Class[] parameterTypes = new Class[]{ String.class}; - Object[] parameters = new Object[]{ args}; - - Constructor constructor = clazz.getConstructor(parameterTypes); - formatter = (IPrintFormatter) constructor.newInstance(parameters); - - String str = formatter.format(ctx, recordId); - int docCopies = re.getPrintInfo().getCopies(); - System.out.println(str); - - for (int i=0; i 0) - { - printingArgs = args; - } - - logger.info("Using " + className + " formatter"); - - Class clazz = Class.forName(className); - IPrintFormatter formatter = null; - - Class[] parameterTypes = new Class[] {String.class, String.class}; - Object[] parameters = new Object[] {printingArgs, trxName}; - - Constructor constructor = clazz.getConstructor(parameterTypes); - - // Construct a new instance for the formatter - formatter = (IPrintFormatter) constructor.newInstance(parameters); - - String data = formatter.format(ctx, C_Order_ID, (Object[]) null); - - // Print no of copies - int noOfCopies = re.getPrintInfo().getCopies(); - for(int i = 0; i < noOfCopies; i++) - { - printData = printData + data; - } - } - catch (Exception e) - { - logger.log(Level.SEVERE, e.getMessage(), e); - new OperationException(e); - } - return printData; - } - - public static void printClosedTillData(Properties ctx, String Data) throws OperationException - { - - } - public static String getOpenDrawerCmd() - { - byte [] printData= {10,27,112,48,55,1}; - return new String(printData); - } -} - diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ProcessManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/ProcessManager.java deleted file mode 100644 index e329164438..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/ProcessManager.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 27-Jul-2005 by alok - * - */ -package org.posterita.businesslogic; - -import java.util.Properties; - -import org.compiere.model.MProcess; -import org.compiere.process.ProcessInfo; -import org.compiere.process.SvrProcess; -import org.compiere.report.ReportStarter; -import org.compiere.util.Trx; -import org.posterita.exceptions.OperationException; -import org.posterita.util.PoManager; - - -public class ProcessManager -{ - - public static MProcess createProcess(Properties ctx, String className) throws Exception - { - Trx trx = Trx.get(Trx.createTrxName(),true); - trx.start(); - - MProcess mProcess = new MProcess(ctx,0, trx.getTrxName()); - - try{ - mProcess.setClassname(className); - mProcess.setDescription(className); - mProcess.setName(className); - mProcess.setValue(className); - - PoManager.save(mProcess); - - trx.commit(); - trx.close(); - - } - catch(OperationException e) - { - trx.rollback(); - trx.close(); - - } - - return mProcess; - - } - - public static int getProcessId(Class cl) throws OperationException - { - if(cl == null) - throw new OperationException("Class cannot be null"); - String whereClause = "ClassName='" + cl.getName() + "'"; - - int processIds[] = MProcess.getAllIDs(MProcess.Table_Name, whereClause, null); - - if(processIds.length == 0) - throw new OperationException("No process found with class name: " + cl.getName()); - else if(processIds.length > 1) - throw new OperationException(processIds.length + " Processes found with class name: " + cl.getName()); - else - return processIds[0]; - } - - public static int getProcessIdByValue(String processValue) throws OperationException - { - if(processValue == null) - throw new OperationException("Process Value cannot be null"); - - String whereClause = "value='" + processValue + "'"; - - int processIds[] = MProcess.getAllIDs(MProcess.Table_Name, whereClause, null); - - if(processIds.length == 0) - throw new OperationException("No process found with value: " + processValue); - - else if(processIds.length > 1) - throw new OperationException(processIds.length + " Processes found with value: " + processValue); - else - return processIds[0]; - } - - public static void startProcess(Properties ctx, String className, ProcessInfo pi, Trx trx) - throws InstantiationException, IllegalAccessException, ClassNotFoundException - { - if (className == null) - { - return; - } - Class cl = Class.forName(className); - - if (cl == ReportStarter.class) - { - ReportStarter reportStarter = (ReportStarter)cl.newInstance(); - reportStarter.startProcess(ctx, pi, trx); - return; - } - SvrProcess server = (SvrProcess)cl.newInstance(); - server.startProcess(ctx, pi, trx); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ProductAttributeSetManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/ProductAttributeSetManager.java deleted file mode 100644 index 3019011fe9..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/ProductAttributeSetManager.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * */ -package org.posterita.businesslogic; - -import java.util.Properties; - -import org.compiere.model.MAttributeSet; -import org.posterita.exceptions.OperationException; -import org.posterita.util.PoManager; - - -public class ProductAttributeSetManager -{ - public static MAttributeSet createAttributeSet(Properties ctx, String name) throws OperationException - { - MAttributeSet attributeSet = new MAttributeSet(ctx, 0, null); - attributeSet.setMandatoryType(MAttributeSet.MANDATORYTYPE_NotMandatary); - attributeSet.setIsSerNo(false); - attributeSet.setIsSerNoMandatory(false); - attributeSet.setIsInstanceAttribute(false); - attributeSet.setName(name); - - PoManager.save(attributeSet); - - return attributeSet; - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ProductCart.java b/posterita/posterita/src/main/org/posterita/businesslogic/ProductCart.java deleted file mode 100644 index 993e99612d..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/ProductCart.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 29-Sep-2006 16:23:25 by praveen - * - */ - -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.compiere.util.Env; -import org.posterita.beans.ProductDetailsBean; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.exceptions.OperationException; - -public class ProductCart -{ - private HashMap products = null; - private BigDecimal noOfProducts = Env.ZERO; - private Properties ctx = null; - - public ProductCart(Properties ctx) - { - this.ctx = ctx; - products = new HashMap(); - } - - public void addProduct(int product_id, BigDecimal qty) - { - noOfProducts = noOfProducts.add(Env.ONE); - - BigDecimal previousQty = products.get(Integer.valueOf(product_id)); - - if(previousQty == null) - { - products.put(Integer.valueOf(product_id),qty); - } - else - { - BigDecimal newQty = previousQty.add(qty); - products.put(Integer.valueOf(product_id), newQty); - } - } - - public void addProduct(int product_id) - { - addProduct(product_id, Env.ONE); - } - - public void removeProduct(int product_id, BigDecimal qty) - { - BigDecimal oldQty = products.get(Integer.valueOf(product_id)); - - if( oldQty == null ) - { - return; - } - else - { - if( oldQty.doubleValue() <= qty.doubleValue() ) - { - removeProduct( product_id ); - noOfProducts = noOfProducts.subtract(oldQty); - } - else - { - BigDecimal newQty = oldQty.subtract(qty); - products.put(Integer.valueOf(product_id),newQty); - noOfProducts = noOfProducts.subtract(qty); - } - } - } - - public void removeProduct(int product_id) - { - BigDecimal qty = products.remove(Integer.valueOf(product_id)); - - if( qty == null ) - { - return; - } - - noOfProducts = noOfProducts.subtract(qty); - } - - public void clear() - { - products.clear(); - noOfProducts = Env.ZERO; - } - - public BigDecimal getNoOfProducts() - { - return noOfProducts; - } - - public ArrayList getProducts() throws OperationException - { - ArrayList productList = new ArrayList(); - ProductDetailsBean bean = null; - Integer productId = null; - BigDecimal qty = null; - - Set> entrySet = products.entrySet(); - - for (Map.Entry entry : entrySet) - { - productId = entry.getKey(); - qty = entry.getValue(); - - bean = ProductManager.getProductDetailInfo(ctx, productId.intValue(), null); - bean.setQuantity(qty); - - productList.add(bean); - } - - return productList; - } - - - public Integer[] getProductIDs() - { - Set set = products.keySet(); - - if( set.isEmpty() ) - { - return new Integer[]{}; - } - - Integer[] ids = new Integer[]{}; - ids = set.toArray( ids ); - - return ids; - } - - public boolean hasProduct( int productId ) - { - return products.containsKey( Integer.valueOf(productId) ); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ProductImageUploader.java b/posterita/posterita/src/main/org/posterita/businesslogic/ProductImageUploader.java deleted file mode 100644 index ecc906ee97..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/ProductImageUploader.java +++ /dev/null @@ -1,241 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 14, 2006 by praveen - * - */ -package org.posterita.businesslogic; - -import java.io.BufferedInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Properties; - -import org.apache.struts.upload.FormFile; -import org.compiere.model.MAttachment; -import org.compiere.model.MAttachmentEntry; -import org.posterita.businesslogic.administration.ProductImageManager; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.businesslogic.core.AttachmentManager; -import org.posterita.core.ThumbnailGenerator; -import org.posterita.exceptions.AttachmentNotFoundException; -import org.posterita.exceptions.InvalidContentTypeException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - -public class ProductImageUploader -{ - public static void uploadImage(Properties ctx, Integer productIds[], FormFile file, String imageName, String trxName) throws OperationException,InvalidContentTypeException - { - for(int i = 0; i < productIds.length; i++) - { - uploadImage(ctx, productIds[i].intValue(), file, imageName, trxName); - } - } - - public static void uploadImage(Properties ctx, int product_id, FormFile file, String imageName, String trxName) throws OperationException,InvalidContentTypeException - { - if((file.getContentType() == null)||(!file.getContentType().startsWith("image/"))) - throw new InvalidContentTypeException("Invalid Content type! Expecting image"); - - try - { - uploadImage(ctx, product_id, file.getFileData(), imageName, trxName); - } - catch(IOException ex) - { - throw new OperationException("Could not read form file", ex); - } - - } - - public static void uploadDefaultImage(Properties ctx, int productId, File file, String trxName) throws OperationException - { - uploadImage(ctx, productId, file, UdiConstants.DEFAULT_IMAGE, trxName); - } - - public static void uploadImage(Properties ctx, int productId, File file, String imageName, String trxName) throws OperationException - { - if(file == null) - throw new OperationException("Image file cannot be null"); - - if(!file.exists()) - throw new OperationException("Image file does not exist"); - - if(file.isDirectory()) - throw new OperationException("File cannot be a directory"); - - try - { - FileInputStream fileInStream = new FileInputStream(file); - ByteArrayOutputStream byteArrStream = new ByteArrayOutputStream(); - BufferedInputStream bufferedInStream = new BufferedInputStream(fileInStream); - byte data[] = new byte[1024]; - int read = 0; - while((read = bufferedInStream.read(data)) != -1) - { - byteArrStream.write(data, 0, read); - } - byteArrStream.flush(); - byte fileData[] = byteArrStream.toByteArray(); - bufferedInStream.close(); - byteArrStream.close(); - fileInStream.close(); - - uploadImage(ctx, productId, fileData, imageName, trxName); - } - catch(IOException ex) - { - throw new OperationException("Could not read file: " + file.getAbsolutePath(), ex); - } - } - - - public static void uploadDefaultImage(Properties ctx, int productId, byte[] imageData, String trxName) throws OperationException - { - uploadImage(ctx, productId, imageData, UdiConstants.DEFAULT_IMAGE, trxName); - } - - public static void uploadImage(Properties ctx, int productId, byte[] imageData, String imageName, String trxName) throws OperationException - { - MAttachmentEntry attEntry = new MAttachmentEntry(imageName + ".jpg", imageData); -// MAttachmentEntry entries[] = new MAttachmentEntry[] {attEntry}; - - ProductManager.addUpdateAttachment(ctx, productId, attEntry, trxName); - - try - { - generateSubImages(ctx, productId, imageName, trxName); - } - catch(AttachmentNotFoundException ex) - { - throw new OperationException("Could not generate sub images for product with ID: " + productId, ex); - } - } - - - public static void generateAllSubImages(Properties ctx, int productId, String trxName) throws AttachmentNotFoundException, OperationException - { - MAttachment attachment = ProductManager.getAttachment(ctx, productId, trxName); - - if(attachment == null) - throw new AttachmentNotFoundException("No attachment found for product with id: " + productId); - - //deleteOldImages(ctx, attachment); - - MAttachmentEntry attachmentEntries[] = attachment.getEntries(); - - for(int i = 0; i < attachmentEntries.length; i++) - { - if(attachmentEntries[i].getContentType().startsWith("image/")) - { - String imageFileName = attachmentEntries[i].getName(); - if(!(imageFileName.startsWith(UdiConstants.FULL_IMAGE_PREFIX) - || imageFileName.startsWith(UdiConstants.THUMBNAIL_IMAGE_PREFIX) - || imageFileName.equalsIgnoreCase(UdiConstants.FULL_IMAGE + UdiConstants.IMAGE_EXTENSION) - || imageFileName.equalsIgnoreCase(UdiConstants.THUMBNAIL + UdiConstants.IMAGE_EXTENSION))) - { - String imageName = imageFileName.replaceAll(UdiConstants.IMAGE_EXTENSION, ""); - generateSubImages(ctx, productId, imageName, trxName); - } - } - } - } - -// private static void deleteOldImages(Properties ctx, MAttachment attachment) throws OperationException -// { -// String oldFullImageName = UdiConstants.FULL_IMAGE + UdiConstants.IMAGE_EXTENSION; -// int oldFullImageEntryId = FileAttachmentManager.getAttachmentEntryIndex(ctx, attachment, oldFullImageName); -// if(oldFullImageEntryId != -1) -// attachment.deleteEntry(oldFullImageEntryId); -// -// String oldThumbImageName = UdiConstants.THUMBNAIL + UdiConstants.IMAGE_EXTENSION; -// int oldThumbImageEntryId = FileAttachmentManager.getAttachmentEntryIndex(ctx, attachment, oldThumbImageName); -// if(oldThumbImageEntryId != -1) -// attachment.deleteEntry(oldThumbImageEntryId); -// -// UDIMAttachment udiAttachment = new UDIMAttachment(attachment); -// udiAttachment.save(); -// } - - public static void generateSubImages(Properties ctx, int productId, String imageName, String trxName) throws OperationException, AttachmentNotFoundException - { - String originalImageName = imageName + UdiConstants.IMAGE_EXTENSION; - - MAttachment attachment = ProductManager.getAttachment(ctx, productId, trxName); - - byte originalImageData[] = ProductManager.getAttachmentData(attachment, originalImageName); - - byte[] scaledImageData = ThumbnailGenerator.getSquareThumbnail(originalImageData, 380); - byte[] framedImageData = ProductImageManager.addImageSquareBorder(ctx,scaledImageData,7.0, trxName); - byte[] thumbImageData = ThumbnailGenerator.getSquareThumbnail(framedImageData, 180); - - String fullImageName = UdiConstants.FULL_IMAGE_PREFIX + imageName + UdiConstants.IMAGE_EXTENSION; - String thumbnailImageName = UdiConstants.THUMBNAIL_IMAGE_PREFIX + imageName + UdiConstants.IMAGE_EXTENSION; - - int fullImageEntryInd = AttachmentManager.getAttachmentEntryIndex(ctx, attachment, fullImageName); - if(fullImageEntryInd != -1) - attachment.deleteEntry(fullImageEntryInd); - - int thumbnailEntryInd = AttachmentManager.getAttachmentEntryIndex(ctx, attachment, thumbnailImageName); - if(thumbnailEntryInd != -1) - attachment.deleteEntry(thumbnailEntryInd); - - MAttachmentEntry attFullImageEntry = new MAttachmentEntry(fullImageName, framedImageData); - MAttachmentEntry attThumbImageEntry = new MAttachmentEntry(thumbnailImageName, thumbImageData); - - AttachmentManager.addAttachmentEntry(attachment, attFullImageEntry); - AttachmentManager.addAttachmentEntry(attachment, attThumbImageEntry); - - PoManager.save(attachment); - } - - public static ArrayList getRelatedProductImageNames(Properties ctx, int productId, String trxName) throws OperationException - { - MAttachment attachment = ProductManager.getAttachment(ctx, productId, trxName); - - MAttachmentEntry entries[] = attachment.getEntries(); - - ArrayList productImageNameList = new ArrayList(); - - for(int i = 0; i < entries.length; i++) - { - String productImageName = entries[i].getName(); - - if(!(productImageName.startsWith(UdiConstants.THUMBNAIL_IMAGE_PREFIX) - || productImageName.startsWith(UdiConstants.FULL_IMAGE_PREFIX))) - { - productImageName = productImageName.replaceAll(UdiConstants.IMAGE_EXTENSION, ""); - productImageNameList.add(productImageName); - } - } - Collections.sort(productImageNameList); - return productImageNameList; - } - - public static String getImageAttachmentName(String imageName) - { - return imageName + UdiConstants.IMAGE_EXTENSION; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/RegionManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/RegionManager.java deleted file mode 100644 index 206d9380d8..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/RegionManager.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 19-Jul-2005 by alok - * - */ -package org.posterita.businesslogic; - -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MRegion; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - - -public class RegionManager -{ - - public static MRegion createRegion(Properties ctx,String name, String trxName) throws OperationException - { - try - { - Properties newCtx = (Properties) ctx.clone(); - Env.setContext(newCtx, "#AD_Client_ID", 0); - Env.setContext(newCtx, "#AD_Org_ID", 0); - - - MRegion region = null; - int[] allRegion=MRegion.getAllIDs(MRegion.Table_Name,"upper(NAME) = upper('" + name + "')",trxName); - - if (allRegion.length > 0) - { - region = new MRegion(newCtx, allRegion[0], trxName); - return region; - } - - //create region only if it does not exist yet - // region does not belong client or org - //it belongs to the system - else if (allRegion.length == 0) - { - region = new MRegion(newCtx, 0, trxName); - region.setC_Country_ID(UdiConstants.COUNTRY_MAURITIUS); - region.setName(name); - - return region; - } - - - PoManager.save(region); - - return region; - - } - catch(OperationException e) - { - throw e; - } - - } - - public static MRegion getOrCreateRegion(Properties ctx, String name, String trxName) throws OperationException - { - Properties nCtx = (Properties)ctx.clone(); - Env.setContext(nCtx, "#AD_CLIENT_ID", 0); - Env.setContext(nCtx, "#AD_ORG_ID", 0); - int allRegion[] = MRegion.getAllIDs(MRegion.Table_Name," AD_Client_ID= " + Env.getAD_Client_ID(ctx) + " and upper(NAME) = upper('" + name + "')",trxName); - MRegion region; - if(allRegion.length != 0) - region = new MRegion(nCtx, allRegion[0], trxName); - else - region = createRegion(nCtx, name, trxName); - - return region; - } - - - public static ArrayList getCountryRegions(Properties ctx, int countryId) - { - ArrayList list = new ArrayList(); - MRegion[] regions = MRegion.getRegions(ctx, countryId); - - for (int i = 0; i < regions.length; i++) - { - MRegion region = regions[i]; - - KeyNamePair pair = new KeyNamePair(region.get_ID(), region.getName()); - list.add(pair); - } - - return list; - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/RoleMenuManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/RoleMenuManager.java deleted file mode 100644 index 3b572510fb..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/RoleMenuManager.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 27-Jul-2005 by alok - * - */ -package org.posterita.businesslogic; - -import java.util.Properties; - -import org.compiere.model.MRoleMenu; -import org.posterita.exceptions.OperationException; -import org.compiere.model.MWebMenu; -import org.posterita.util.PoManager; - - -public class RoleMenuManager -{ - - public static MRoleMenu createRoleMenu(Properties ctx,int roleId,int menuId, String trxName) throws OperationException - { - MRoleMenu roleMenu; - - MWebMenu menu = new MWebMenu(ctx, menuId, null); - - int parentMenuId = menu.getParentMenu_ID(); - - if(parentMenuId != 0) - { - int[] parentRoleMenuIds = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, " ad_role_id = " + roleId + " and u_webmenu_id = " + parentMenuId, trxName); - - if (parentRoleMenuIds.length == 0) - roleMenu = createRoleMenu(ctx,roleId,parentMenuId, trxName); - } - - roleMenu = new MRoleMenu(ctx, 0, trxName); - roleMenu.setAD_Role_ID(roleId); - roleMenu.setU_WebMenu_ID(menuId); - - PoManager.save(roleMenu); - - return roleMenu; - } - - public static void createRoleMenus(Properties ctx, int roleId, int menuIds[], String trxName) throws OperationException - { - for(int i = 0; i < menuIds.length; i++) - { - RoleMenuManager.createRoleMenu(ctx, roleId, menuIds[i], trxName); - } - } - - public static boolean isRoleMenuPresent(Properties ctx, int roleId, int menuId, String trxName) - { - String whereClause = "AD_Role_ID=" + roleId + " and U_WebMenu_ID=" + menuId; - - int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause, trxName); - - if(roleMenuIds == null || roleMenuIds.length == 0) - return false; - return true; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/SearchManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/SearchManager.java deleted file mode 100644 index 9fead40434..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/SearchManager.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 15, 2006 by ashley -* -*/ - -package org.posterita.businesslogic; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.posterita.beans.SearchBean; -import org.posterita.exceptions.OperationException; - -public class SearchManager -{ - - public static SearchBean getSearchParams(String searchText) throws OperationException - { - if(searchText == null) - throw new OperationException("Search text cannot be null"); - - - SearchBean searchBean = new SearchBean(searchText); - searchBean = parseExactSearch(searchBean); - searchBean = parseAndSearch(searchBean); - searchBean = parseOrSearch(searchBean); - - searchBean.setSearchText(searchText); - - return searchBean; - } - - private static SearchBean parseExactSearch(SearchBean searchBean) - { - String searchText = searchBean.getSearchText().trim(); - - int ind11 = searchText.indexOf("\""); - - if(ind11 == -1) - return searchBean; - - String lText1 = searchText.substring(0, ind11).trim(); - String rText1 = searchText.substring(ind11 + 1).trim(); - - int ind12 = rText1.indexOf("\""); - - if(ind12 == -1) - { - searchText = searchText.replaceAll("\"", ""); - searchBean.setSearchText(searchText); - return searchBean; - } - - String lText2 = rText1.substring(0, ind12); - String rText2 = rText1.substring(ind12 + 1); - - String exactSearchText = lText2; - String remSearchText = lText1.trim() + " " + rText2.trim(); - - searchBean.setSearchText(remSearchText); - searchBean.getAndCriteriasList().add(exactSearchText); - - return parseExactSearch(searchBean); - } - - private static SearchBean parseAndSearch(SearchBean searchBean) - { - String searchText = searchBean.getSearchText(); - if(searchText == null || searchText.length() == 0) - return searchBean; - - String regexStr = "\\+[\\w]+"; - - Pattern regex = Pattern.compile(regexStr); - Matcher regexMatcher = regex.matcher(searchText); - - if(regexMatcher.find()) - { - int startInd = regexMatcher.start(); - int endInd = regexMatcher.end(); - - String subStr = searchText.substring(startInd, endInd); - subStr = subStr.replaceAll("\\+", ""); - searchBean.getAndCriteriasList().add(subStr); - - searchText = searchText.substring(0, startInd) + searchText.substring(endInd); - searchBean.setSearchText(searchText); - - parseAndSearch(searchBean); - } - - return searchBean; - } - - private static SearchBean parseOrSearch(SearchBean searchBean) - { - String searchText = searchBean.getSearchText(); - if(searchText == null || searchText.length() == 0) - return searchBean; - - String regexStr = "[\\w]+"; - - Pattern regex = Pattern.compile(regexStr); - Matcher regexMatcher = regex.matcher(searchText); - - if(regexMatcher.find()) - { - int startInd = regexMatcher.start(); - int endInd = regexMatcher.end(); - - String subStr = searchText.substring(startInd, endInd); - subStr = subStr.replaceAll("\\+", ""); - searchBean.getOrCriteriasList().add(subStr); - - searchText = searchText.substring(0, startInd) + searchText.substring(endInd); - searchBean.setSearchText(searchText); - - parseOrSearch(searchBean); - } - - return searchBean; - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/ShoppingcartManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/ShoppingcartManager.java deleted file mode 100644 index 9c1c7c3669..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/ShoppingcartManager.java +++ /dev/null @@ -1,501 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * Mar 25, 2008 11:20:20 AM by praveen - * - */ - -package org.posterita.businesslogic; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.swing.text.NumberFormatter; - -import org.apache.ecs.xhtml.div; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.th; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.MOrder; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.TangoColors; -import org.posterita.beans.ItemBean; -import org.posterita.beans.PaymentDetailsBean; -import org.posterita.beans.ProductDetailsBean; -import org.posterita.beans.ShoppingCartBean; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; - -public class ShoppingcartManager -{ - - private static String getShoppingcartAsHTML(ArrayList itemList, String currency, BigDecimal discountedTotal, BigDecimal percentageDiscount, String orderType) throws ParseException - { - NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0.00")); - - BigDecimal totalQty = Env.ZERO; - BigDecimal grandTotal = Env.ZERO; - BigDecimal grandTotalWithoutDiscount = Env.ZERO; - BigDecimal totalWithoutDiscount = Env.ZERO; - BigDecimal discount = Env.ZERO; - BigDecimal totalDiscount = Env.ZERO; - String currencySymbol = currency; - - String[] headers = {"Name","Description","Qty","Uom","Unit Price","VAT","Incl Price","Total"}; - table tbl = new table("0", "0", "0", "100%", ""); - - - tr headerRow = new tr(); - headerRow.setClass("itemTitleList"); - - for(String header : headers) - { - th h = new th(header); - headerRow.addElement(h); - } - - tbl.addElement(headerRow); - - //add body - int count = 0; - - if(itemList != null) - for(ItemBean bean : itemList) - { - count ++; - - tr dataRow = new tr(); - - if(orderType != null) - { - if(count % 2 == 0) - { - if(orderType.equalsIgnoreCase("POS Order")) - { - dataRow.setClass("evenRow"); - //dataRow.setOnMouseOut("this.className='evenRow'"); - //dataRow.setOnMouseOver("this.className='highlight'"); - } - else if(orderType.equalsIgnoreCase("POS Goods Receive Note")) - { - //Keep same style for purchase sceen for time being - dataRow.setClass("evenRow"); - //dataRow.setOnMouseOut("this.className='evenRow'"); - //dataRow.setOnMouseOver("this.className='highlight'"); - } - } - else - { - dataRow.setClass("oddRow"); - //dataRow.setOnMouseOut("this.className='oddRow'"); - //dataRow.setOnMouseOver("this.className='highlight'"); - } - } - - dataRow.setID("row" + count); - dataRow.addAttribute("productId", bean.getProductId().toString()); - dataRow.addAttribute("qty", bean.getQty().toString()); - dataRow.addAttribute("priceLimit", bean.getPriceLimit().toString()); - dataRow.addAttribute("priceList", bean.getListPrice().toString()); - - - totalQty = totalQty.add(bean.getQty()); - grandTotal = grandTotal.add(bean.getPrice()); - BigDecimal unitPrice = bean.getUnitPrice()==null?Env.ZERO:bean.getUnitPrice(); - BigDecimal taxAmt = bean.getTaxAmt()==null?Env.ZERO:bean.getTaxAmt(); - dataRow.addAttribute("taxRate", bean.getTaxRate().toString()); - dataRow.addAttribute("isTaxIncluded", bean.getIsTaxIncluded().toString()); - BigDecimal inclPrice = bean.getInclPrice(); - BigDecimal listPrice = bean.getListPrice(); - - if(bean.getIsTaxIncluded()) - { - - totalWithoutDiscount = bean.getQty().multiply(listPrice); - grandTotalWithoutDiscount = grandTotalWithoutDiscount.add(totalWithoutDiscount); - } - else - { - totalWithoutDiscount = bean.getQty().multiply(listPrice.add(taxAmt)); - grandTotalWithoutDiscount = grandTotalWithoutDiscount.add(totalWithoutDiscount); - } - - String[] columnData = { - bean.getProductName(), - bean.getDescription(), - bean.getQty().toString(), - bean.getUom(), - formatter.valueToString(bean.getUnitPrice()), - formatter.valueToString(bean.getTaxAmt()), - formatter.valueToString(inclPrice), - formatter.valueToString(bean.getPrice()) - }; - - for(int i=0; i itemList = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - - String currency = (String) request.getSession().getAttribute(Constants.CURRENCY_SYMBOLE); - BigDecimal discountOnTotal = (BigDecimal)request.getSession().getAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL); - BigDecimal discountOnTotalPer = (BigDecimal)request.getSession().getAttribute(Constants.SHOPPING_CART_DISCOUNT_PERCENTAGE); - BigDecimal cartTotal = (BigDecimal) request.getSession().getAttribute(Constants.SHOPPING_CART_TOTAL); - - //When giving discount on total, recompute total discount if quantity is changed - if(cartTotal != null && discountOnTotal != null) - { - if(discountOnTotal.doubleValue() > 0) - { - cartTotal = cartTotal.multiply(((Env.ONEHUNDRED.subtract(discountOnTotal))).divide(Env.ONEHUNDRED, RoundingMode.HALF_EVEN)); - } - } - - return getShoppingcartAsHTML(itemList, currency, cartTotal, discountOnTotalPer, null); - } - - public static String getShoppingcartAsHTML(HttpServletRequest request, String orderType) throws ParseException - { - //add body - ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - - String currency = (String) request.getSession().getAttribute(Constants.CURRENCY_SYMBOLE); - Boolean isDiscOnTotal = (Boolean)request.getSession().getAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL); - Boolean isDiscOnTotalPer = (Boolean)request.getSession().getAttribute(Constants.DISCOUNT_ON_ORDER_TOTAL_PERCENT); - //BigDecimal cartTotal = (BigDecimal) request.getSession().getAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL); - BigDecimal discountPercentOnOrderTotal = null; - BigDecimal discountedOrderTotal = null; - if (isDiscOnTotal != null && isDiscOnTotal) - { - discountedOrderTotal =(BigDecimal)request.getSession().getAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL); - } - else if (isDiscOnTotalPer != null && isDiscOnTotalPer) - { - discountPercentOnOrderTotal = (BigDecimal) request.getSession().getAttribute(Constants.SHOPPING_CART_DISCOUNT_PERCENTAGE); - } - //When giving discount on total, recompute total discount if quantity is changed - if (discountedOrderTotal != null && discountPercentOnOrderTotal != null) - { - if (discountPercentOnOrderTotal.compareTo(Env.ZERO) == 1) - { - discountedOrderTotal = discountedOrderTotal.multiply(((Env.ONEHUNDRED.subtract(discountedOrderTotal))).divide(Env.ONEHUNDRED, RoundingMode.HALF_EVEN)); - } - } - - String shoppingCart = getShoppingcartAsHTML(itemList, currency, discountedOrderTotal, discountPercentOnOrderTotal, orderType); - return shoppingCart; - } - - public static void clearShoppingcart(HttpServletRequest request) - { - //bug fix - request.setAttribute("qtyTotal", null); - request.setAttribute("grandTotal", null); - - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - request.getSession().removeAttribute(Constants.SHOPPING_CART_TOTAL); - request.getSession().removeAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL); - request.getSession().removeAttribute(Constants.SHOPPING_CART_DISCOUNT_PERCENTAGE); - } - - public static String getShoppingCartFromOrder(Properties ctx, int c_order_id, String trxName) throws OperationException, ParseException - { - ShoppingCartBean shoppingcart = POSManager.getShoppingCartForOrder(ctx, c_order_id, trxName); - - MOrder order = new MOrder(ctx, c_order_id, trxName); - String orderType = order.getOrderType(); - - PaymentDetailsBean bean = PaymentManager.getPaymentDetails(ctx, c_order_id, trxName); - - if(MOrder.PAYMENTRULE_OnCredit.equals(order.getPaymentRule())) - { - bean.setPayAmt(order.getGrandTotal()); - } - - //weird logic! - - BigDecimal discountedTotal = bean.getPayAmt(); - /*if(bean.getDiscountAmt()!=null && bean.getDiscountAmt().compareTo(Env.ZERO)==0) - { - discountedTotal = null; - } */ - return getShoppingcartAsHTML(shoppingcart.getItems(), shoppingcart.getCurrency(), discountedTotal, Env.ZERO, orderType); - } - - //-----------------------------------------------------------------------// - // BARCODE INTEGRATION - - private static String getBarcodecartAsHTML(ArrayList itemList, Properties ctx) throws ParseException, OperationException - { - NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0.00")); - - int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - String currSymbol = PriceListManager.getCurrency(ctx, priceListId); - - BigDecimal totalQty = Env.ZERO; - - String[] headers = {"Barcode","Description","Sale Price (Inc VAT)","No Of Labels"}; - table tbl = new table("0", "0", "0", "100%", ""); - tbl.setID("cart"); - tbl.setBgColor(TangoColors.ALUMINIUM_2); - - BigDecimal qty = Env.ZERO; - - tr headerRow = new tr(); - headerRow.setClass("itemTitleList"); - - - for(String header : headers) - { - th h = new th(header); - headerRow.addElement(h); - } - - tbl.addElement(headerRow); - - //add body - int count = 0; - - if(itemList != null) - for(ItemBean bean : itemList) - { - count ++; - - tr dataRow = new tr(); - - if(count % 2 == 0) - { - dataRow.setClass("evenRow"); - } - else - { - dataRow.setClass("oddRow"); - } - dataRow.setID("row" + count); - dataRow.addAttribute("productId", bean.getProductId().toString()); - dataRow.addAttribute("qty", bean.getQty().toString()); - qty = bean.getQty(); - - BigDecimal stdPrice = bean.getUnitPrice()==null?Env.ZERO:bean.getUnitPrice(); - BigDecimal taxRate = bean.getTaxRate()==null?Env.ZERO:bean.getTaxRate(); - BigDecimal priceIncVat = stdPrice.multiply((taxRate.add(new BigDecimal(100))).divide(new BigDecimal(100))); - - totalQty = totalQty.add(bean.getQty()); - String[] columnData = { - bean.getBarCode(), - bean.getDescription(), - currSymbol + formatter.valueToString(priceIncVat), - bean.getQty().toString() - }; - - for(int i=0; iTotal labels to be printed ").setColSpan("3")); - footerRow.addElement(new td(new div(totalQty.toString()).setID("cartTotal"))); - - tbl.addElement(footerRow); - - - return tbl.toString(); - } - - public static String getBarcodecartAsHTML(HttpServletRequest request) throws ParseException, OperationException - { - //add body - ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.BARCODE_CART_ITEMS); - Properties ctx = TmkJSPEnv.getCtx(request); - return getBarcodecartAsHTML(itemList, ctx); - } - - public static String copyShoppingCartAsHTML(Properties ctx, ProductCart cart) throws ParseException, OperationException - { - - NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0.00")); - int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - String currSymbol = PriceListManager.getCurrency(ctx, priceListId); - ArrayList productList = cart.getProducts(); - - - BigDecimal totalQty = Env.ZERO; - - String[] headers = {"Barcode","Description","Sale Price (Inc VAT)","No Of Labels"}; - table tbl = new table("1", "0", "0", "100%", ""); - tbl.setID("cart"); - - BigDecimal qty = Env.ZERO; - - tr headerRow = new tr(); - for(String header : headers) - { - th h = new th(header); - headerRow.addElement(h); - } - - tbl.addElement(headerRow); - - //add body - int count = 0; - - if(productList != null) - for(ProductDetailsBean bean : productList) - { - count ++; - - String styleClass = "label"; - if ((count%2) != 0) - styleClass = "contentname"; - - tr dataRow = new tr(); - dataRow.setID("row" + count); - dataRow.addAttribute("productId", bean.getProductId().toString()); - dataRow.addAttribute("qty", bean.getQuantity().toString()); - qty = bean.getQuantity(); - totalQty = totalQty.add(bean.getQuantity()); - String[] columnData = { - bean.getBarCode(), - bean.getProductName(), - currSymbol + formatter.valueToString(bean.getStdSalesPrice()), - bean.getQuantity().toString() - }; - - for(int i=0; iTotal labels to be printed ").setAlign("right").setColSpan("3")); - footerRow.addElement(new td(new div(totalQty.toString()).setID("cartTotal")).setAlign("right")); - - tbl.addElement(footerRow); - - - return tbl.toString(); - } - - public static int getPriceList(HttpServletRequest request) - { - int priceListId = -1; - - ShoppingCartBean cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.SHOPPING_CART); - if(cart != null) - { - priceListId = cart.getPricelistId(); - } - - return priceListId; - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/StockInquiryManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/StockInquiryManager.java deleted file mode 100644 index 2b79ceb442..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/StockInquiryManager.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Aug 19, 2005 by alok -* -*/ - -package org.posterita.businesslogic; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.util.DB; -import org.compiere.util.Env; - -import org.posterita.beans.ProductBean; -import org.posterita.beans.ProductQuery; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.businesslogic.stock.StockManager; -import org.posterita.exceptions.OperationException; - -public class StockInquiryManager -{ - - - - public static ArrayList getAvailableTShirts(Properties ctx, ProductQuery query) throws OperationException - { - String sql = " SELECT " + - " s.AD_Org_ID," + - " s.M_LOCATOR_ID," + - " s.M_Product_ID," + - " p.name," + - " p.m_attributesetinstance_id," + - " s.QtyOnHand," + - " s.QtyReserved," + - " s.QtyOrdered," + - " p.m_product_category_id," + - " p.description" + - " FROM M_Storage s,m_product p,m_locator loc" + - " where s.M_PRODUCT_ID = p.M_PRODUCT_ID" + - " and s.m_locator_id = loc.m_locator_id" + - " and p.m_product_category_id=" + query.getProductCategoryId() + - " and p.isWebstoreFeatured='Y'" + - " AND s.AD_Client_ID = " + Env.getAD_Client_ID(ctx) + - " @ATTRIBUTE_SEARCH_SQL@" + - " and s.ad_org_id=" + Env.getAD_Org_ID(ctx); - - String attributeSearchSQL = ProductManager.getAttributeSearchSQL(ctx, query); - - - sql = sql.replaceAll("@ATTRIBUTE_SEARCH_SQL@",attributeSearchSQL); - sql = StockManager.setBackOrderFilter(ctx, sql, query.getBackOrder()); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - ResultSet rs = null; - - ProductBean bean; - ArrayList productList = new ArrayList(); - try - { - rs = pstmt.executeQuery(); - while (rs.next()) - { - bean = new ProductBean(); - bean.setOrgId(Integer.valueOf(rs.getInt(1))); - bean.setLocatorId(Integer.valueOf(rs.getInt(2))); - bean.setProductId(Integer.valueOf(rs.getInt(3))); - bean.setProductName(rs.getString(4)); - bean.setAttributeSetInstanceId(Integer.valueOf(rs.getInt(5))); - bean.setQtyOnHand(rs.getBigDecimal(6)); - bean.setQtyReserved(rs.getBigDecimal(7)); - bean.setQtyOrdered(rs.getBigDecimal(8)); - bean.setProductCategoryId(Integer.valueOf(rs.getInt(9))); - bean.setDescription(rs.getString(10)); - productList.add(bean); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return productList; - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/StoreManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/StoreManager.java deleted file mode 100644 index d7241e7d96..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/StoreManager.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * - * - */ - -/** - @author ashley - */ - -package org.posterita.businesslogic; - -import java.util.Properties; - -import org.compiere.model.MStore; -import org.compiere.util.Env; -import org.posterita.exceptions.DefaultStoreException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.StoreException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - -public class StoreManager -{ - - public static int getStoreIdByName(Properties ctx, String storeName, String trxName) throws StoreException - { - int adClientId = Env.getAD_Client_ID(ctx); - int adOrgId = Env.getAD_Org_ID(ctx); - - String whereClause = "AD_Client_ID=" + adClientId + " and AD_Org_ID=" + adOrgId + " and Name='" + storeName + "'"; - - int storeIds[] = MStore.getAllIDs(MStore.Table_Name, whereClause, trxName); - - if(storeIds.length == 0) - throw new StoreException("Could not find Store with name: " + storeName); - - else if(storeIds.length > 1) - throw new StoreException(storeIds.length + " Stores found with name: " + storeName); - - else - return storeIds[0]; - } - - public static MStore createStore(Properties ctx, String storeName, String webContext, int orgId, - int priceListId, int salesRepId, int warehouseId, String webParam6, String hostUrl, String trxName) throws OperationException - { - if(storeName == null || storeName.length() == 0) - throw new OperationException("Store name cannot be null"); - if(webContext == null || webContext.length() == 0) - throw new OperationException("Web context cannot be null"); - - MStore store = new MStore(ctx, 0, trxName); - store.setAD_Org_ID(orgId); - store.setName(storeName); - store.setWebContext(webContext); - store.setM_PriceList_ID(priceListId); - store.setSalesRep_ID(salesRepId); - store.setM_Warehouse_ID(warehouseId); - store.setWebParam6(webParam6); - store.setURL(hostUrl); - PoManager.save(store); - - return store; - } - - public static boolean isStorePresent(String webContext) - { - String whereClause = "WebContext='" + webContext + "'"; - int storeIds[] = MStore.getAllIDs(MStore.Table_Name, whereClause, null); - - return (storeIds.length > 0); - } - - public static MStore getDefaultStore(Properties ctx) throws DefaultStoreException - { - String whereClause = "IsDefault='Y'"; - int storeIds[] = MStore.getAllIDs(MStore.Table_Name, whereClause, null); - - if(storeIds.length == 0) - throw new DefaultStoreException("No Default store defined!!!"); - else if(storeIds.length > 1) - throw new DefaultStoreException("More than 1 default store defined!!!"); - else - return new MStore(ctx, storeIds[0], null); - } - - /** - * Retrieves the web store as per the context. - * @param ctx context - * @return web store - */ - public static MStore getStore(Properties ctx) - { - MStore store = MStore.get(ctx, Env.getContextAsInt(ctx, UdiConstants.WSTORE_CTX_PARAM)); - return store; - } - - /** - * Retrieves the price list id associated with the web store in context. - * This price list is a purchase price list. - * @param ctx context - * @return price list id - */ - public static int getPriceListId(Properties ctx) - { - MStore store = getStore(ctx); - return store.getM_PriceList_ID(); - } - - /** - * Updates the price list associated with the web store in context. - * @param ctx context - * @param priceListId id of the price list to set in the web store - */ - public static void setPriceListId(Properties ctx, int priceListId,String trxName) - { - MStore store = getStore(ctx); - store.setM_PriceList_ID(priceListId); - store.save(trxName); - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/UDIMessageManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/UDIMessageManager.java deleted file mode 100644 index fe028e8a1f..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/UDIMessageManager.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 1, 2005 by din - */ - -package org.posterita.businesslogic; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MMessage; -import org.compiere.model.MOrg; -import org.compiere.util.DB; -import org.compiere.util.Env; - -import org.posterita.Constants; -import org.posterita.beans.MessageBean; -import org.posterita.beans.UDIPair; -import org.posterita.exceptions.OperationException; - - -public class UDIMessageManager -{ - public static ArrayList getAllOrgMessagesReceived(Properties ctx) - { - String strOrgID = ctx.getProperty("#AD_Org_ID"); - - String sql; - - sql = "select U_Message_ID," + //1 - " subject," + //2 - " message," + //3 - " msg.created," + //4 - " org.name, " + //5 - " msg.AD_ORG_ID," + //6 - //" decode(msg.U_READ,'Y','true','false')" + //7 - " CASE WHEN msg.U_READ='Y' THEN 'true' ELSE 'false' END" + //7 - " from U_MESSAGE msg " + - " join AD_ORG org ON org.AD_ORG_ID = msg.AD_ORG_ID " + - " where msg.C_AD_ORG_ID =" + strOrgID + - " and MESSAGE_TYPE=" + "'" + Constants.RECEIVED_MESSAGE + "'" + - " and msg.IsActive=" + "'Y'" + - " order by msg.created desc"; - - PreparedStatement pstmt =null; - - System.out.println(sql); - - MessageBean message = null; - ArrayList messages = new ArrayList(); - try - { - pstmt = DB.prepareStatement(sql, null); - ResultSet rs = pstmt.executeQuery(); - - - while (rs.next()) - { - - message = new MessageBean(); - message.setMessageID(Integer.valueOf(rs.getInt(1))); - message.setSubject(rs.getString(2)); - message.setMessage(rs.getString(3)); - message.setDateCreated(rs.getTimestamp(4)); - message.setCounterOrgName(rs.getString(5)); - message.setOrgID(Integer.valueOf(rs.getInt(6))); - message.setRead(rs.getString(7)); - messages.add(message); - - } - - rs.close(); - - } - catch (SQLException e) - { - - } - finally - { - try - { - pstmt.close(); - } - catch (Exception ex) - { - } - pstmt = null; - } - - - return messages; - } - - public static ArrayList getOrgs(Properties ctx) - { - int[] orgIDs = MOrg.getAllIDs(MOrg.Table_Name,"AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + " and AD_Org_ID<>" + ctx.getProperty("#AD_Org_ID"),null); - ArrayList orgs = new ArrayList (); - for ( int i=0 ; i < orgIDs.length ; i++ ) - { - MOrg org = new MOrg(ctx, orgIDs[i],null); - UDIPair pair = new UDIPair(Integer.valueOf(orgIDs[i]), org.getName()); - orgs.add(pair); - - } - - return orgs; - } - - public static Integer getUnreadMessageCount(Properties ctx) - { - int[] ids = MMessage.getAllIDs("U_MESSAGE", "U_READ='N' and C_AD_ORG_ID=" + ctx.getProperty("#AD_Org_ID") + " and MESSAGE_TYPE=" + "'" + Constants.RECEIVED_MESSAGE + "'" + " and IsActive=" + "'Y'",null); - - return Integer.valueOf(ids.length); - } - - public static ArrayList getMySentMessages(Properties ctx) throws OperationException - { - String strOrgID = ctx.getProperty("#AD_Org_ID"); - - String sql; - - sql = "select U_Message_ID," + //1 - " subject," + //2 - " message," + //3 - " msg.created," + //4 - " org.name, " + //5 - " msg.AD_ORG_ID," + //6 - //" decode(msg.U_READ,'Y','true','false')" + //7 - " CASE WHEN msg.U_READ='Y' THEN 'true' ELSE 'false' END" + //7 - " from U_MESSAGE msg " + - " join AD_ORG org ON org.AD_ORG_ID = msg.C_AD_ORG_ID " + - " where msg.AD_ORG_ID =" + strOrgID + - " and msg.MESSAGE_TYPE=" + "'" + Constants.SENT_MESSAGE + "'" + - " and msg.IsActive=" + "'Y'" + - " order by msg.created desc"; - - - PreparedStatement pstmt =null; - - MessageBean message = null; - ArrayList messages = new ArrayList(); - try - { - pstmt = DB.prepareStatement(sql, null); - ResultSet rs = pstmt.executeQuery(); - - - while (rs.next()) - { - message = new MessageBean(); - message.setMessageID(Integer.valueOf(rs.getInt(1))); - message.setSubject(rs.getString(2)); - message.setMessage(rs.getString(3)); - message.setDateCreated(rs.getTimestamp(4)); - message.setCounterOrgName(rs.getString(5)); - message.setOrgID(Integer.valueOf(rs.getInt(6))); - message.setRead(rs.getString(7)); - messages.add(message); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch (Exception ex) - { - } - pstmt = null; - } - - - return messages; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/BPartnerManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/BPartnerManager.java deleted file mode 100644 index a3f8277810..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/BPartnerManager.java +++ /dev/null @@ -1,1120 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Alok Pathak - */ - -package org.posterita.businesslogic.administration; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MBPBankAccount; -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MCountry; -import org.compiere.model.MLocation; -import org.compiere.model.MOrg; -import org.compiere.model.MRegion; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.AddressBean; -import org.posterita.beans.BPartnerBean; -import org.posterita.beans.StatementOfAccountBean; -import org.posterita.businesslogic.LocationManager; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.NoAccessToEditObjectException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - - -public class BPartnerManager -{ - - - public static MBPartner activateBPartner(Properties ctx, int bpartnerId, boolean isActive,String trxName) throws OperationException - { - - MBPartner bpartner = new MBPartner(ctx,bpartnerId,trxName); - - if(bpartner == null) - throw new OperationException("Business Partner does not exist!"); - if(isActive == true) - { - bpartner.setIsActive(false); - } - else - { - bpartner.setIsActive(true); - } - - PoManager.save(bpartner); - - return bpartner; - - } - - public static MBPartner createBPartner(Properties ctx,int orgId, int parentBpId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1, String address2, String postalAddress1, Integer regionId, String city,String bpPhone, String fax,int countryId, boolean isShipTo, boolean isBillTo, String trxName) throws OperationException - { - return saveBPartner(ctx, orgId, 0, parentBpId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, address2, postalAddress1, regionId, city, bpPhone, "", fax, countryId, isShipTo, isBillTo, trxName); - } - - - public static MBPartner createBPartner(Properties ctx,int orgId, int parentBpId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1,String postalAddress1,String city,String bpPhone,int countryId, String trxName) throws OperationException - { - return saveBPartner( ctx, orgId, 0, parentBpId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, "", postalAddress1, null, city, bpPhone, "", "", countryId, true, true, trxName); - } - - public static MBPBankAccount createBPBankAcc(Properties ctx,int bPartnerId,String aName,String city,String street, String trxName) throws OperationException - { - MBPBankAccount bankAcc = new MBPBankAccount(ctx,0,trxName); - - try - { - bankAcc.setC_BPartner_ID(bPartnerId); - bankAcc.setA_Name(aName);//Name of Account holder - bankAcc.setA_Street(street); - bankAcc.setA_City(city);//city of bank account - - PoManager.save(bankAcc); - } - catch(OperationException e) - { - throw new OperationException("Cannot create BP Bank Account!"); - } - - - return bankAcc; - } - - public static MBPartner createLinkedBPartner(Properties ctx,int orgId, int parentBpId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1,String postalAddress1,String city,String bpPhone,int countryId, String trxName) throws OperationException - { - MBPartner bpartner = saveBPartner( ctx, orgId, 0, parentBpId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, "", postalAddress1, null, city, bpPhone, "", "",countryId, true, true, trxName); - - bpartner.setAD_OrgBP_ID(orgId); - - PoManager.save(bpartner); - return bpartner; - } - - - - public static MBPartner createShippingBPartner(Properties ctx,int orgId, int parentBpId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1,String postalAddress1,String city,String bpPhone,int countryId, boolean isShipTo, boolean isBillTo, String trxName) throws OperationException - { - return saveBPartner( ctx, orgId, 0, parentBpId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, "", postalAddress1, null, city, bpPhone, "", "", countryId, isShipTo, isBillTo, trxName); - - } - - public static MBPartner deactivateBPartner(Properties ctx, int bpartnerId, String trxName) throws OperationException - { - - MBPartner bpartner = new MBPartner(ctx,bpartnerId,trxName); - - if(bpartner == null)throw new OperationException("Business Partner does not exist!"); - - bpartner.setIsActive(false); - - PoManager.save(bpartner); - - return bpartner; - - } - - - public static ArrayList getAllBpartners(Properties ctx, String trxName) throws OperationException - { - - int adClientID = Env.getAD_Client_ID(ctx); - - - String sql; - - sql = " select bp.c_bpartner_id, " + //1 - " bp.name," + //2 - " bp.name2," + //3 - " bp.isactive,"+//4 - " bp.iscustomer," + //5 - " bp.isemployee," + //6 - " bp.isvendor, " + //7 - " bp.issalesrep," + //8 - " cl.address1," + //9 - " cl.address2," + //10 - " cl.city," + //11 - " cl.postal_add," + //12 - " bpl.c_bpartner_id," + //13 - " cl.c_location_id," + //14 - " bpl.phone," + //15 - " bpl.fax," + //16 - " cl.REGIONNAME " + //17 - " from C_BPARTNER bp left outer join (c_bpartner_location bpl left outer join c_location cl on cl.c_location_id=bpl.c_location_id) on bpl.c_bpartner_id = bp.c_bpartner_id, AD_ORG org " + - " where bp.ad_org_id = org.ad_org_id and " + - " bp.AD_CLIENT_ID = " + adClientID + - " order by bp.name"; - - PreparedStatement pstmt =null; - - System.out.println(sql); - - BPartnerBean bpartner = null; - ResultSet rs = null; - - ArrayList bpartners = new ArrayList(); - - try - { - pstmt = DB.prepareStatement(sql,trxName); - rs = pstmt.executeQuery(); - - - while (rs.next()) - { - - bpartner = new BPartnerBean(); - bpartner.setBpartnerId(Integer.valueOf(rs.getInt(1))); - bpartner.setPartnerName(rs.getString(2)); - bpartner.setName2(rs.getString(3)); - - if(rs.getString(4).equals("Y")) - { - bpartner.setIsActive(Boolean.valueOf(true)); - } - else - bpartner.setIsActive(Boolean.valueOf(false)); - - if(rs.getString(5).equals("Y")) - { - bpartner.setIsCustomer(Boolean.valueOf(true)); - } - else - bpartner.setIsCustomer(Boolean.valueOf(false)); - - if(rs.getString(6).equals("Y")) - { - bpartner.setIsEmployee(Boolean.valueOf(true)); - } - else - bpartner.setIsEmployee(Boolean.valueOf(false)); - - if(rs.getString(7).equals("Y")) - { - bpartner.setIsVendor(Boolean.valueOf(true)); - } - else - bpartner.setIsVendor(Boolean.valueOf(false)); - - if(rs.getString(8).equals("Y")) - { - bpartner.setIsSalesRep(Boolean.valueOf(true)); - } - else - bpartner.setIsSalesRep(Boolean.valueOf(false)); - - - - bpartner.setAddress1(rs.getString(9)); - bpartner.setAddress2(rs.getString(10)); - bpartner.setCity(rs.getString(11)); - bpartner.setPostalAddress(rs.getString(12)); - bpartner.setPhone(rs.getString(15)); - bpartner.setFax(rs.getString(16)); - - String regionName = rs.getString(17); - - int regionId = 0; - - int id[] = MRegion.getAllIDs(MRegion.Table_Name," name= '"+ regionName +"'",trxName); - - if(id.length != 0) - { - regionId = id[0]; - } - - bpartner.setRegionId(Integer.valueOf(regionId)); - - - bpartners.add(bpartner); - } - - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - finally - { - try - { - if(pstmt != null) - pstmt.close(); - } - catch(Exception ex) - {} - - pstmt = null; - } - - return bpartners; - - - } - - - public static BPartnerBean getBpartner(Properties ctx, int bPartnerId, String trxName) throws OperationException - { - MBPartner bpartner = loadBPartner(ctx, bPartnerId, trxName); - - MBPartnerLocation bplocations[] = bpartner.getLocations(false); - - BPartnerBean bpBean = new BPartnerBean(); - bpBean.setBpartnerId(bpartner.get_ID()); - bpBean.setPartnerName(bpartner.getName()); - bpBean.setName2(bpartner.getName2()); - bpBean.setIsActive(bpartner.isActive()); - bpBean.setIsCustomer(bpartner.isCustomer()); - bpBean.setIsEmployee(bpartner.isEmployee()); - bpBean.setIsVendor(bpartner.isVendor()); - bpBean.setIsSalesRep(bpartner.isSalesRep()); - bpBean.setOrgId(bpartner.getAD_Org_ID()); - if (bplocations.length == 0) - { - throw new OperationException("No location defined for BPartner"); - } - - MBPartnerLocation bplocation = bplocations[0]; - MLocation location = bplocation.getLocation(false); - - bpBean.setAddress1(location.getAddress1()); - bpBean.setAddress2(location.getAddress2()); - bpBean.setCity(location.getCity()); - bpBean.setPostalAddress(location.getPostal_Add()); - bpBean.setPhone(bplocation.getPhone()); - bpBean.setFax(bplocation.getFax()); - bpBean.setPostalCode(location.getPostal()); - MRegion region = location.getRegion(); - - if (region != null && region.get_ID() > 0) - { - bpBean.setRegionId(region.get_ID()); - } - - return bpBean; - } - - public static MBPartnerLocation getBPartnerSingleLocation(Properties ctx, int bpartnerId) throws OperationException - { - MBPartnerLocation bpartnerLocations[] = MBPartnerLocation.getForBPartner(ctx, bpartnerId); - - if(bpartnerLocations.length == 0) - throw new OperationException("No location found business partner with id: " + bpartnerId); - else if(bpartnerLocations.length > 1) - throw new OperationException("More than 1 location found for business partner with id: " + bpartnerId); - else - return bpartnerLocations[0]; - } - - - public static MBPartner getCreateLinkedBPartner(Properties ctx, MOrg org, String trxName) throws OperationException - { - MBPartner linkedBPartner; - if(org == null) - throw new OperationException("Organisation cannot be null"); - - int linkedBPId = org.getLinkedC_BPartner_ID(trxName); - if(linkedBPId != 0) - { - linkedBPartner = loadBPartner(ctx, linkedBPId, trxName); - return linkedBPartner; - } - else - { - - linkedBPartner = BPartnerManager.saveBPartner(ctx, org.get_ID(), 0, 0, org.getName(), "", false, false, false, false, " ", " ", " ", null, "", "", "", "", MCountry.getDefault(ctx).get_ID(), true, true, trxName); - - //saveBPartner(ctx, partnerId, parentBpId, name, name2, isCustomer, isVendor, isEmployee,isSalesRep, address1, address2, postalAddress1, regionId, city,bpPhone, String phone2, String fax,int countryId, boolean isShipTo, boolean isBillTo, String trxName) throws OperationException - - linkedBPartner.setAD_OrgBP_ID(org.get_ID()); - - PoManager.save(linkedBPartner, trxName); - - return linkedBPartner; - } - } - - - public static ArrayList getMyBPartners(Properties ctx, int partnerId, String trxName) throws OperationException - { - - ArrayList bpartnerList = new ArrayList (); - - if (partnerId == 0) - throw new OperationException("Parent business partner not present!"); - - MBPartner me = new MBPartner(ctx, partnerId, trxName); - AddressBean myAddressBean = populateAddressBean(ctx, me); - bpartnerList.add(myAddressBean); - - int[] partnerIds = MBPartner.getAllIDs(MBPartner.Table_Name, "BPARTNER_PARENT_ID=" + partnerId, null); - - for (int i = 0; i < partnerIds.length; i++) - { - MBPartner partner = new MBPartner(ctx, partnerIds[i], trxName); - - AddressBean bean = populateAddressBean(ctx, partner); - - bpartnerList.add(bean); - - } - - return bpartnerList; - } - - public static MBPartner getOrCreateBPartner(Properties ctx,int orgId, int parentBpId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1,String postalAddress1,String city,String bpPhone,int countryId, String trxName) throws OperationException - { - return getOrCreateBPartner( ctx, orgId, parentBpId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, "", postalAddress1, city, bpPhone, "",countryId, trxName); - } - - - public static MBPartner getOrCreateBPartner(Properties ctx, int orgId, int bPartnerParentId, String bPName, String name2, boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1,String address2, String postalAddress1,String city,String bpPhone, String fax, int countryId, String trxName) throws OperationException - { - String sqlQuery = " upper(Name)=upper('" + bPName + "') and AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx); - - int partners[] = MBPartner.getAllIDs(MBPartner.Table_Name, sqlQuery, trxName); - MBPartner partner; - if(partners.length != 0) - partner = new MBPartner(ctx, partners[0], trxName); - else - partner = saveBPartner(ctx, orgId, 0, bPartnerParentId, bPName, name2, isCustomer, isVendor, isEmployee, isSalesRep, address1, address2, postalAddress1, null, city, bpPhone,"", fax,countryId, true, true, trxName); - - return partner; - } - -/* public static int getOrgBPId(Properties ctx) throws OperationException - { - MOrg org = new MOrg(ctx, Env.getAD_Org_ID(ctx), null); - - int bpartnerId = org.getLinkedC_BPartner_ID(); - - if (bpartnerId == 0) - throw new OperationException("Organisation does not have Linked Business Partner"); - - return bpartnerId; - }*/ - - public static AddressBean getShipmentAddressBPartner(Properties ctx, int partnerId) throws OperationException - { - if (partnerId == 0) - throw new OperationException("Business partner not present!"); - - MBPartner partner = new MBPartner(ctx, partnerId, null); - - AddressBean bean = populateAddressBean(ctx, partner); - - return bean; - - } - -/* public static String getVehicleTypeWhereStatement(Properties ctx, String trxName) throws OperationException - { - MOrg org = OrganisationManager.getMyOrg(ctx, trxName); - - if (org.isAutomobile()) - { - return (" and o.isautomobile='Y' "); - } - else if(org.isMotorcycle()) - { - return (" and o.ismotorcycle='Y' "); - } - else if (org.isMotorcycle() && org.isAutomobile()) - { - return (" and (o.ismotorcycle='Y' or o.isautomobile='Y' "); - } - - return ""; - }*/ - - public static boolean isBPartnerPresent(Properties ctx, int c_bpartner_id, String trxName) - { - boolean isPresent = false; - - String sql = "SELECT C_BPARTNER_ID FROM C_BPARTNER WHERE ISACTIVE = 'Y' AND C_BPARTNER_ID = ?"; - int value = DB.getSQLValue(trxName, sql, c_bpartner_id); - if(value != -1) - { - isPresent = true; - } - - return isPresent; - } - - public static MBPartner loadBPartner(Properties ctx, int bpartnerID, String trxName) throws OperationException - { - MBPartner bPartner = new MBPartner(ctx, bpartnerID, trxName); - - if(bPartner.get_ID() == 0) - throw new OperationException("Cannot load Business Partner with id: " + bpartnerID); - - return bPartner; - } - - private static AddressBean populateAddressBean(Properties ctx, MBPartner partner) throws OperationException - { - MBPartnerLocation[] partnerLocations = MBPartnerLocation.getForBPartner(ctx, partner.get_ID()); - - if (partnerLocations.length == 0) - throw new OperationException("Partner " + partner.getName() + " " + partner.getName2() + " (" + partner.get_ID() + ") " + "does not have any location!"); - - MBPartnerLocation partnerLocation = partnerLocations[0];//We assume there is only 1 location for this partner - MLocation location = new MLocation(ctx, partnerLocation.getC_Location_ID(), partner.get_TrxName()); - - AddressBean bean = new AddressBean(); - bean.setBpartnerId(partner.get_ID()); - bean.setUsername(partner.getName()); - bean.setUserSurname(partner.getName2()); - bean.setAddress1(location.getAddress1()); - bean.setAddress2(location.getAddress2()); - bean.setPostalAddress(location.getPostal_Add()); - bean.setCity(location.getCity()); - bean.setCountryId(location.getC_Country_ID()); - bean.setCountryName(location.getCountryName()); - - return bean; - } - - public static ArrayList searchBpartners(Properties ctx, String name, String trxName) throws OperationException - { - int adClientID = Env.getAD_Client_ID(ctx); - - String sql; - - sql = " select bp.c_bpartner_id, " + //1 - " bp.name," + //2 - " bp.name2," + //3 - " bp.isactive,"+//4 - " bp.iscustomer," + //5 - " bp.isemployee," + //6 - " bp.isvendor, " + //7 - " bp.issalesrep," + //8 - " cl.address1," + //9 - " cl.address2," + //10 - " cl.city," + //11 - " cl.postal_add," + //12 - " bpl.c_bpartner_id," + //13 - " cl.c_location_id," + //14 - " bpl.phone," + //15 - " bpl.fax," + //16 - " cl.REGIONNAME " + //17 - " from C_BPARTNER bp left outer join (c_bpartner_location bpl left outer join c_location cl on cl.c_location_id=bpl.c_location_id) on bpl.c_bpartner_id = bp.c_bpartner_id " + - " where bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ - " and bp.AD_CLIENT_ID = " + adClientID + - " and (upper(bp.name) like upper('%" + name + "%')" + - " or upper(bp.name2) like upper('%" + name + "%'))" + - " order by bp.name"; - - PreparedStatement pstmt =null; - - BPartnerBean bpartner = null; - ResultSet rs = null; - - ArrayList bpartners = new ArrayList(); - - try - { - pstmt = DB.prepareStatement(sql,trxName); - rs = pstmt.executeQuery(); - - - while (rs.next()) - { - - bpartner = new BPartnerBean(); - bpartner.setBpartnerId(Integer.valueOf(rs.getInt(1))); - bpartner.setPartnerName(rs.getString(2)); - bpartner.setName2(rs.getString(3)); - - if(rs.getString(4).equals("Y")) - { - bpartner.setIsActive(Boolean.valueOf(true)); - } - else - bpartner.setIsActive(Boolean.valueOf(false)); - - if(rs.getString(5).equals("Y")) - { - bpartner.setIsCustomer(Boolean.valueOf(true)); - } - else - bpartner.setIsCustomer(Boolean.valueOf(false)); - - if(rs.getString(6).equals("Y")) - { - bpartner.setIsEmployee(Boolean.valueOf(true)); - } - else - bpartner.setIsEmployee(Boolean.valueOf(false)); - - if(rs.getString(7).equals("Y")) - { - bpartner.setIsVendor(Boolean.valueOf(true)); - } - else - bpartner.setIsVendor(Boolean.valueOf(false)); - - if(rs.getString(8).equals("Y")) - { - bpartner.setIsSalesRep(Boolean.valueOf(true)); - } - else - bpartner.setIsSalesRep(Boolean.valueOf(false)); - - - - bpartner.setAddress1(rs.getString(9)); - bpartner.setAddress2(rs.getString(10)); - bpartner.setCity(rs.getString(11)); - bpartner.setPostalAddress(rs.getString(12)); - bpartner.setPhone(rs.getString(15)); - bpartner.setFax(rs.getString(16)); - - String regionName = rs.getString(17); - - int regionId = 0; - - int id[] = MRegion.getAllIDs(MRegion.Table_Name," name= '"+ regionName +"'",trxName); - - if(id.length != 0) - { - regionId = id[0]; - } - - bpartner.setRegionId(Integer.valueOf(regionId)); - - - bpartners.add(bpartner); - } - - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - finally - { - try - { - if(pstmt != null) - pstmt.close(); - } - catch(Exception ex) - {} - - pstmt = null; - } - - return bpartners; - } - - public static MBPartner saveBPartner(Properties ctx, int orgId, int partnerId,int parentBpId, String name, String name2, - boolean isCustomer,boolean isVendor,boolean isEmployee,boolean isSalesRep,String address1, - String address2, String postalAddress1, Integer regionId, String city,String bpPhone, String phone2, - String fax,int countryId, boolean isShipTo, boolean isBillTo, String trxName) throws OperationException, NoAccessToEditObjectException - { - MBPartner bPartner; - int locationId; - - if (partnerId == 0) - { - bPartner = new MBPartner(ctx, -1, trxName); // Using Template BPartner - locationId = 0; - } - else - { - bPartner = loadBPartner(ctx, partnerId, trxName); - - Boolean isEditable = RoleManager.isEditable(ctx, bPartner.getAD_Org_ID()); - - if (!isEditable) - throw new NoAccessToEditObjectException("You do not have the right organisational access for editing"); - - MBPartnerLocation[] bplocations = MBPartnerLocation.getForBPartner(ctx, partnerId); - - if (bplocations.length > 1) - throw new OperationException("Error: Business Partner has more than 1 location!"); - else if (bplocations.length == 0) - locationId = 0; - else - { - MBPartnerLocation bpLocation = bplocations[0]; - locationId = bpLocation.getC_Location_ID(); - } - } - - - bPartner.setValue(name + "_" + name2 + "_" + TrxPrefix.getPrefix() ); - bPartner.setName(name); - - bPartner.setName2(name2); - bPartner.setIsCustomer(isCustomer); - bPartner.setIsVendor(isVendor); - bPartner.setIsEmployee(isEmployee); - bPartner.setIsSalesRep(isSalesRep); - bPartner.setBPartner_Parent_ID(parentBpId); -// bPartner.setDescription(Constants.WEBSTORE_CUSTOMER); - bPartner.setAD_Org_ID(orgId); - bPartner.setSalesRep_ID(Env.getAD_User_ID(ctx));//required for dunning possible bug in Compiere - - PoManager.save(bPartner); - - MLocation location = LocationManager.saveLocation(ctx, orgId, locationId, address1, address2, postalAddress1,regionId, city,countryId, trxName); - - //We need to make the link of the billing address to the business partner - MBPartnerLocation bplocation = null; - - if (bPartner.getPrimaryC_BPartner_Location_ID() == 0) - bplocation = new MBPartnerLocation(bPartner); - else - bplocation = new MBPartnerLocation(ctx, bPartner.getPrimaryC_BPartner_Location_ID(), trxName); - - bplocation.setPhone(bpPhone); - bplocation.setPhone2(phone2); - bplocation.setFax(fax); - bplocation.setC_Location_ID(location.get_ID()); - bplocation.setIsShipTo(isShipTo); - bplocation.setIsBillTo(isBillTo); - bplocation.setAD_Org_ID(orgId); - - //UDIMBPartnerLocation udiBpLocation = new UDIMBPartnerLocation(bplocation); - //udiBpLocation.save(); - - PoManager.save(bplocation); - - - //Set the default location for the business partner - bPartner.setPrimaryC_BPartner_Location_ID(bplocation.get_ID()); - - //UDIMBPartner udiBPartner_defaultLocation = new UDIMBPartner(bPartner); - //udiBPartner_defaultLocation.save(); - PoManager.save(bPartner); - - return bPartner; - - } - public static MBPartner editBPartner(Properties ctx, int orgId, int bpartnerId, String name, String name2, boolean isCustomer, boolean isVendor, boolean isEmployee, boolean isSalesRep, - String address1, String address2, String postalAddress, String city, String phoneNo,String phone2, String fax, int regionId,String trxName) throws OperationException - { - - MBPartner bPartner = new MBPartner(ctx,bpartnerId,trxName); - - bPartner.setName(name); - bPartner.setName2(name2); - bPartner.setIsVendor(isVendor); - bPartner.setIsCustomer(isCustomer); - bPartner.setIsEmployee(isEmployee); - bPartner.setIsSalesRep(isSalesRep); - bPartner.setAD_Org_ID(orgId); - - if(bPartner.getSalesRep_ID()==0) - { - bPartner.setSalesRep_ID(Env.getAD_User_ID(ctx)); - } - - - MBPartnerLocation bpLocation = editPhoneAndFax(ctx,bpartnerId,phoneNo,phone2,fax, trxName); - - LocationManager.editLocation(ctx, bpLocation.getC_Location_ID(), address1, postalAddress, regionId, city, trxName); - - PoManager.save(bpLocation); - - PoManager.save(bPartner); - - return bPartner; - - } - - public static MBPartnerLocation editPhoneAndFax(Properties ctx, int bpId, String phone,String phone2, String fax, String trxName) throws OperationException - { - - if(bpId<=0) - throw new OperationException("BPartner does not exist"); - - MBPartner bp = new MBPartner(ctx, bpId, trxName); - MBPartnerLocation bpLocation; - - try - { - bpLocation = new MBPartnerLocation(ctx, bp.getPrimaryC_BPartner_Location_ID(),trxName); - - if(bpLocation==null) - throw new OperationException("BPartner Location does not exist"); - - bpLocation.setPhone(phone); - bpLocation.setPhone2(phone2); - bpLocation.setFax(fax); - bpLocation.setAD_Org_ID(bp.getAD_Org_ID()); - - PoManager.save(bpLocation); - - - } - catch(OperationException e) - { - throw new OperationException("Error: Could not edit phone and fax!!"); - - } - - - return bpLocation; - - } - - - public static ArrayList getCreditorsDebtors(Properties ctx, boolean queryCreditors, String trxName) throws OperationException - { - ArrayList bpList = new ArrayList(); - - StringBuffer sql = new StringBuffer("SELECT C_BPARTNER_ID,NAME,NAME2,ISCUSTOMER,ISVENDOR,TOTALOPENBALANCE,ACTUALLIFETIMEVALUE,so_creditlimit,so_creditused " + - " FROM C_BPARTNER WHERE ISACTIVE = 'Y' AND AD_CLIENT_ID = ?"); - - if(queryCreditors) - sql.append(" AND ISVENDOR = 'Y' " ); - else - sql.append(" AND ISCUSTOMER = 'Y' "); - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sql.toString(), trxName); - pstmt.setInt(1, Env.getAD_Client_ID(ctx)); - - rs = pstmt.executeQuery(); - - while(rs.next()) - { - BPartnerBean bean = new BPartnerBean(); - bean.setBpartnerId(rs.getInt(1)); - bean.setPartnerName(rs.getString(2)); - bean.setName2(rs.getString(3)); - bean.setIsCustomer("Y".equals(rs.getString(4))); - bean.setIsVendor("Y".equals(rs.getString(5))); - bean.setActualLifetimeValue(rs.getBigDecimal(7)); - bean.setCreditLimit(rs.getBigDecimal(8)); - bean.setCreditUsed(rs.getBigDecimal(9)); - - BigDecimal openBalance = rs.getBigDecimal(6); - if(openBalance == null) - { - openBalance = Env.ZERO; - } - - if(queryCreditors) - { - openBalance = openBalance.negate(); - } - - bean.setOpenBalance(openBalance); - - bpList.add(bean); - } - - } - catch (Exception e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs); - DB.close(pstmt); - } - - return bpList; - - } - - public static ArrayList getCreditorsHistory(Properties ctx, int c_bpartner_id, Timestamp startDate, Timestamp endDate, String trxName) - { - StringBuffer sb = new StringBuffer( - " SELECT * FROM ( " + - " SELECT C_INVOICE.CREATED AS DATETRX,C_INVOICE.DOCUMENTNO AS REFERENCE,C_DOCTYPE.NAME AS DETAILS,C_INVOICE.GRANDTOTAL AS AMT, C_INVOICE.C_ORDER_ID AS ID " + - " FROM C_INVOICE " + - " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + - " WHERE C_INVOICE.C_BPARTNER_ID = ? " + - " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + - " AND C_DOCTYPE.NAME = 'AP Invoice' " + - " UNION " + - " SELECT C_INVOICE.CREATED AS DATETRX,C_INVOICE.DOCUMENTNO AS REFERENCE,C_DOCTYPE.NAME AS DETAILS,C_INVOICE.GRANDTOTAL AS AMT, C_INVOICE.C_ORDER_ID AS ID " + - " FROM C_INVOICE " + - " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + - " WHERE C_INVOICE.C_BPARTNER_ID = ? " + - " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + - " AND C_DOCTYPE.NAME = 'AP CreditMemo' " + - " UNION " + - " SELECT C_PAYMENT.CREATED,C_PAYMENT.C_PAYMENT_ID || '' AS REFERENCE ,C_DOCTYPE.NAME AS DETAILS,C_PAYMENT.PAYAMT + C_PAYMENT.DISCOUNTAMT + C_PAYMENT.WRITEOFFAMT AS AMT,C_PAYMENT.C_PAYMENT_ID AS ID " + - " FROM C_PAYMENT " + - " INNER JOIN C_DOCTYPE ON C_PAYMENT.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + - " WHERE C_PAYMENT.C_BPARTNER_ID = ? " + - " AND C_PAYMENT.DOCSTATUS IN ('CO','CL') " + - " AND C_DOCTYPE.NAME = 'AP Payment' " + - " UNION " + - " SELECT C_INVOICE.CREATED AS DATETRX,C_CASHLINE.C_CASHLINE_ID || '' AS REFERENCE,'AP Payment - Cash' AS DETAILS,0 - (C_CASHLINE.AMOUNT + C_CASHLINE.DISCOUNTAMT + C_CASHLINE.WRITEOFFAMT) AS AMT,C_CASHLINE.C_CASHLINE_ID AS ID " + - " FROM C_INVOICE " + - " INNER JOIN C_CASHLINE ON (C_CASHLINE.C_INVOICE_ID = C_INVOICE.C_INVOICE_ID) " + - " INNER JOIN C_CASH ON (C_CASH.C_CASH_ID = C_CASHLINE.C_CASH_ID AND C_CASH.DOCSTATUS IN ('CO','CL')) " + - " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + - " WHERE C_INVOICE.C_BPARTNER_ID = ? " + - " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + - " AND C_DOCTYPE.NAME = 'AP Invoice' " + - " ) AS HISTORY ORDER BY DATETRX ASC, DETAILS ASC"); - - PreparedStatement pstmt = null; - ResultSet rs = null; - - BigDecimal balance = Env.ZERO; - ArrayList reportData = new ArrayList(); - - try - { - pstmt = DB.prepareStatement(sb.toString(), trxName); - pstmt.setInt(1, c_bpartner_id); - pstmt.setInt(2, c_bpartner_id); - pstmt.setInt(3, c_bpartner_id); - pstmt.setInt(4, c_bpartner_id); - - rs = pstmt.executeQuery(); - - //int previousMonth = -2; // - - while(rs.next()) - { - Timestamp date = rs.getTimestamp(1); - String reference = rs.getString(2); - String docType = rs.getString(3); - BigDecimal amount = rs.getBigDecimal(4); - BigDecimal credit = Env.ZERO; - BigDecimal debit = Env.ZERO; - int docId = rs.getInt(5); - - - if(docType.startsWith("AP Payment") || docType.equalsIgnoreCase("AP CreditMemo")) - { - credit = amount; - balance = balance.subtract(amount); - } - else - { - debit = amount; - balance = balance.add(amount); - } - - String details = ""; - String table = "Order"; - - if(docType.equalsIgnoreCase("AP Payment")) - { - details = "PAYMENT"; - table = "Payment"; - } - else if(docType.equalsIgnoreCase("AP Payment - Cash")) - { - details = "PAYMENT"; - table = "CashLine"; - } - else if(docType.equalsIgnoreCase("AP CreditMemo")) - { - details = "Account Returns"; - } - else if(docType.equalsIgnoreCase("AP Invoice")) - { - details = "Account Purchases"; - } - else - { - details = docType; - } - - StatementOfAccountBean bean = new StatementOfAccountBean(); - bean.setDate(date); - bean.setReference(reference); - bean.setDocType(table); - bean.setDetails(details); - bean.setDebit(debit); - bean.setCredit(credit); - bean.setBalance(balance); - bean.setDocId(docId); - - reportData.add(bean); - } - - } - catch (SQLException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - finally - { - DB.close(rs, pstmt); - } - - return reportData; - } - - public static ArrayList getDebtorsHistory(Properties ctx, int c_bpartner_id, Timestamp startDate, Timestamp endDate, String trxName) - { - StringBuffer sb = new StringBuffer( - " SELECT * FROM ( " + - " SELECT C_INVOICE.CREATED AS DATETRX,C_INVOICE.DOCUMENTNO AS REFERENCE,C_DOCTYPE.NAME AS DETAILS,C_INVOICE.GRANDTOTAL AS AMT, C_INVOICE.C_ORDER_ID AS ID " + - " FROM C_INVOICE " + - " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + - " WHERE C_INVOICE.C_BPARTNER_ID = ? " + - " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + - " AND C_DOCTYPE.NAME = 'AR Invoice' " + - " UNION " + - " SELECT C_INVOICE.CREATED AS DATETRX,C_INVOICE.DOCUMENTNO AS REFERENCE,C_DOCTYPE.NAME AS DETAILS,C_INVOICE.GRANDTOTAL AS AMT, C_INVOICE.C_ORDER_ID AS ID " + - " FROM C_INVOICE " + - " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + - " WHERE C_INVOICE.C_BPARTNER_ID = ? " + - " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + - " AND C_DOCTYPE.NAME = 'AR Credit Memo' " + - " UNION " + - " SELECT C_PAYMENT.CREATED,C_PAYMENT.C_PAYMENT_ID || '' AS REFERENCE ,C_DOCTYPE.NAME AS DETAILS,C_PAYMENT.PAYAMT + C_PAYMENT.DISCOUNTAMT + C_PAYMENT.WRITEOFFAMT AS AMT,C_PAYMENT.C_PAYMENT_ID AS ID " + - " FROM C_PAYMENT " + - " INNER JOIN C_DOCTYPE ON C_PAYMENT.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + - " WHERE C_PAYMENT.C_BPARTNER_ID = ? " + - " AND C_PAYMENT.DOCSTATUS IN ('CO','CL') " + - " AND C_DOCTYPE.NAME = 'AR Receipt' " + - " UNION " + - " SELECT C_INVOICE.CREATED AS DATETRX,C_CASHLINE.C_CASHLINE_ID || '' AS REFERENCE,'AR Receipt - Cash' AS DETAILS,C_CASHLINE.AMOUNT + C_CASHLINE.DISCOUNTAMT + C_CASHLINE.WRITEOFFAMT AS AMT,C_CASHLINE.C_CASHLINE_ID AS ID " + - " FROM C_INVOICE " + - " INNER JOIN C_CASHLINE ON (C_CASHLINE.C_INVOICE_ID = C_INVOICE.C_INVOICE_ID) " + - " INNER JOIN C_CASH ON (C_CASH.C_CASH_ID = C_CASHLINE.C_CASH_ID AND C_CASH.DOCSTATUS IN ('CO','CL')) " + - " INNER JOIN C_DOCTYPE ON C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID " + - " WHERE C_INVOICE.C_BPARTNER_ID = ? " + - " AND C_INVOICE.DOCSTATUS IN ('CO','CL') " + - " AND C_DOCTYPE.NAME = 'AR Invoice' " + - " ) AS HISTORY ORDER BY DATETRX ASC, DETAILS ASC"); - - PreparedStatement pstmt = null; - ResultSet rs = null; - - BigDecimal balance = Env.ZERO; - ArrayList reportData = new ArrayList(); - - try - { - pstmt = DB.prepareStatement(sb.toString(), trxName); - pstmt.setInt(1, c_bpartner_id); - pstmt.setInt(2, c_bpartner_id); - pstmt.setInt(3, c_bpartner_id); - pstmt.setInt(4, c_bpartner_id); - - rs = pstmt.executeQuery(); - - //int previousMonth = -2; // - - while(rs.next()) - { - Timestamp date = rs.getTimestamp(1); - String reference = rs.getString(2); - String docType = rs.getString(3); - BigDecimal amount = rs.getBigDecimal(4); - BigDecimal credit = Env.ZERO; - BigDecimal debit = Env.ZERO; - int docId = rs.getInt(5); - - - if(docType.startsWith("AR Receipt") || docType.equalsIgnoreCase("AR Credit Memo")) - { - debit = amount; - balance = balance.subtract(amount); - } - else - { - credit = amount; - balance = balance.add(amount); - } - - String details = ""; - String table = "Order"; - - if(docType.equalsIgnoreCase("AR Receipt")) - { - details = "PAYMENT"; - table = "Payment"; - } - else if(docType.equalsIgnoreCase("AR Receipt - Cash")) - { - details = "PAYMENT"; - table = "CashLine"; - } - else if(docType.equalsIgnoreCase("AR Credit Memo")) - { - details = "Account Returns"; - } - else if(docType.equalsIgnoreCase("AR Invoice")) - { - details = "Account Sales"; - } - else - { - details = docType; - } - - StatementOfAccountBean bean = new StatementOfAccountBean(); - bean.setDate(date); - bean.setReference(reference); - bean.setDocType(table); - bean.setDetails(details); - bean.setDebit(debit); - bean.setCredit(credit); - bean.setBalance(balance); - bean.setDocId(docId); - - reportData.add(bean); - } - - } - catch (SQLException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - finally - { - DB.close(rs, pstmt); - } - - return reportData; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/BarcodeManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/BarcodeManager.java deleted file mode 100644 index 8ad63d3fcb..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/BarcodeManager.java +++ /dev/null @@ -1,471 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Praveen Beekoo - */ - -package org.posterita.businesslogic.administration; - -import java.awt.image.BufferedImage; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.model.MProduct; -import org.compiere.model.MSequence; -import org.compiere.util.Env; -import org.krysalis.barcode4j.impl.AbstractBarcodeBean; -import org.krysalis.barcode4j.impl.code128.Code128Bean; -import org.krysalis.barcode4j.output.bitmap.BitmapCanvasProvider; -import org.krysalis.barcode4j.tools.UnitConv; - -import org.posterita.Constants; -import org.posterita.beans.CustomerBean; -import org.posterita.beans.ItemBean; -import org.posterita.businesslogic.CustomerCart; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.RandomStringGenerator; -import org.posterita.exceptions.OperationException; - -public class BarcodeManager -{ - public static final String BARCODE_PREFIX = "609789"; - public static final String SEQUENCE_NAME = "Barcode Sequence"; - public static boolean showPrice = true; - public static boolean showTitle = true; - public static boolean showSubtitle = true; - - public static String saveBarcode(String barcode) throws OperationException - { - try - { - //Create the barcode bean - Code128Bean bean = new Code128Bean(); - - final int dpi = 400; - - //Configure the barcode generator - bean.setModuleWidth(UnitConv.in2mm(1.0f / dpi)); //makes the narrow bar - //width exactly one pixel - bean.doQuietZone(false); - bean.setBarHeight(1.5d); - bean.setFontSize(1); - bean.setFontName("Helvetica"); - - //Open output file - String filename = RandomStringGenerator.randomstring() + ".png"; - String filepath = ReportManager.getReportPath(filename); - - File outputFile = new File(filepath); - OutputStream out = new FileOutputStream(outputFile); - - //Set up the canvas provider for monochrome JPEG output - BitmapCanvasProvider canvas = new BitmapCanvasProvider( - out, "image/x-png", dpi, BufferedImage.TYPE_BYTE_BINARY, false); - - //Generate the barcode - bean.generateBarcode(canvas, barcode); - - //Signal end of generation - canvas.finish(); - - out.close(); - - return filename; - } - catch (Exception e) - { - throw new OperationException(e); - } - - } - - public static void writeBarcode(String barcode,HttpServletResponse response) throws OperationException - { - try - { - //Create the barcode bean - AbstractBarcodeBean bean = new Code128Bean(); - - final int dpi = 400; - - //Configure the barcode generator - bean.setModuleWidth(UnitConv.in2mm(1.0f / dpi)); //makes the narrow bar - //width exactly one pixel - bean.doQuietZone(false); - bean.setBarHeight(2.0d); - bean.setFontSize(1.0d); - bean.setFontName("Helvetica"); - - //writing the image to the response - OutputStream out = response.getOutputStream(); - response.setContentType("image/x-png"); - - //Set up the canvas provider for monochrome JPEG output - BitmapCanvasProvider canvas = new BitmapCanvasProvider( - out, "image/x-png", dpi, BufferedImage.TYPE_BYTE_BINARY, false); - - //Generate the barcode - bean.generateBarcode(canvas, barcode); - - //Signal end of generation - canvas.finish(); - - out.flush(); - out.close(); - } - catch (IOException e) - { - throw new OperationException(e); - } - - } - - public static byte[] getBarcodeAsByte(String barcode) throws OperationException - { - ByteArrayOutputStream baos= new ByteArrayOutputStream(); - - try - { - //Create the barcode bean - AbstractBarcodeBean bean = new Code128Bean(); - - final int dpi = 400; - - //Configure the barcode generator - bean.setModuleWidth(UnitConv.in2mm(1.0f / dpi)); //makes the narrow bar - //width exactly one pixel - bean.doQuietZone(false); - bean.setBarHeight(1.5d); - bean.setFontSize(1); - bean.setFontName("Helvetica"); - - //writing the image to outputstream - - //Set up the canvas provider for monochrome JPEG output - BitmapCanvasProvider canvas = new BitmapCanvasProvider( - baos, "image/x-png", dpi, BufferedImage.TYPE_BYTE_BINARY, false); - - //Generate the barcode - bean.generateBarcode(canvas, barcode); - - //Signal end of generation - canvas.finish(); - - baos.flush(); - baos.close(); - } - catch (IOException e) - { - throw new OperationException(e); - } - - - return baos.toByteArray(); - } - - public static MSequence getBarcodeSequence(Properties ctx, String trxName) throws OperationException - { - MSequence sequence = null; - - String whereClause = " name = '" + SEQUENCE_NAME + "'" + - " and ad_client_id =" + Env.getAD_Client_ID(ctx) + - " and ad_org_id =" + Env.getAD_Org_ID(ctx); - - int[] ids = MSequence.getAllIDs(MSequence.Table_Name, whereClause, trxName); - - if( ( ids ==null ) || ( ids.length == 0 ) ) - { - sequence = new MSequence(ctx, 0, trxName); - - sequence.setName(SEQUENCE_NAME); - sequence.setPrefix(BARCODE_PREFIX); - sequence.setIsAutoSequence(true); - sequence.setIncrementNo(1); - sequence.setIsTableID(false); - sequence.setCurrentNext(1000000); - - boolean isSaved = sequence.save(); - - if( !isSaved) - { - throw new OperationException("Unable to create barcode sequence"); - } - } - else - { - sequence = new MSequence(ctx, ids[0], trxName); - } - - return sequence; - } - - /** - * Print Product Barcode - * @param ctx - * @param request - * @param trxName - * @return - * @throws OperationException - */ - public static String printProductBarcode(Properties ctx, HttpServletRequest request, boolean isPrintProductName, boolean isPrintProductDescription, boolean isPrintPrices, String trxName) throws OperationException - { - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.BARCODE_CART_ITEMS); - StringBuffer barcodeData = new StringBuffer(); - int m_product_id = 0; - String productName = ""; - BigDecimal qty = Env.ZERO; - BigDecimal price = Env.ZERO; - BigDecimal unitSalePrice = Env.ZERO; - - - for(int i=0; i= 23) - { - - for(int j=0; j= 23) - { - for(int n=0; n customerList =null; - CustomerCart customerCart = cart; - - if(customerCart != null) - { - customerList = cart.getCustomers(); - - } - else - { - customerList = new ArrayList(); - } - - StringBuffer barcodeData = new StringBuffer(); - int bpartnerId = 0; - - - for(int i=0; i getAllBlackListed(Properties ctx) throws OperationException - { - ArrayList list= new ArrayList(); - String sql=getBlackListedsql(ctx); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - ResultSet rs = null; - BlackListedBean bean= null; - try - { - rs=pstmt.executeQuery(); - - while(rs.next()) - { - bean=new BlackListedBean(); - bean.setBlackListedBankName(rs.getString(1)); - bean.setBlackListedChequeNo(rs.getString(2)); - bean.setBlackListedId(rs.getInt(3)); - - list.add(bean); - } - rs.close(); - } - catch(SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - { - } - pstmt=null; - } - return list; - } - private static String getBlackListedsql(Properties ctx) - { - int ad_client_id = Env.getAD_Client_ID(ctx); - - StringBuffer strBufSQL = new StringBuffer(); - - strBufSQL.append("select bl.bankName, bl.chequeNo, bl.U_BLACKLISTCHEQUE_ID"); - strBufSQL.append(" from U_BLACKLISTCHEQUE bl"); - strBufSQL.append(" where ad_client_id = " + ad_client_id ); - strBufSQL.append(" and ad_ORG_ID in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"); - - - return strBufSQL.toString(); - } - - public static ArrayList searchChequeNo(Properties ctx, String chequeNo) throws OperationException - { - ArrayList list = new ArrayList(); - - int ad_client_id = Env.getAD_Client_ID(ctx); - - String sql = " select" + - " bl.bankName," + //1.BankName - " bl.chequeNo," +//2.ChequeNo - " bl.U_BLACKLISTCHEQUE_ID" +//3.ID - " from U_BLACKLISTCHEQUE bl" + - " where ad_client_id = " + ad_client_id + - "and bl.isActive = 'Y'"+ - " and ad_ORG_ID in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+") "; - - if(chequeNo != null && chequeNo.length() != 0) - sql += " and ( lower(bl.chequeNo) like lower('%" + chequeNo + "%')) "; - - sql += " order by bl.chequeNo" ; - - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs = null; - - BlackListedBean bean = null; - - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean = new BlackListedBean(); - - //set bean - bean.setBlackListedBankName(rs.getString(1)); - bean.setBlackListedChequeNo(rs.getString(2)); - bean.setBlackListedId(rs.getInt(3)); - - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception ex){} - - pstmt = null; - } - - return list; - - } - - public static BlackListedBean getBlackListedDetails(Properties ctx, int blackListedId) throws OperationException,BPartnerNotFoundException - { -// if (blackListedId == 0) -// throw new OperationException("BlackListed details not found. Please contact your administrator."); - - - int id[] = MBlackListCheque.getAllIDs(MBlackListCheque.Table_Name,"U_BLACKLISTCHEQUE_ID="+blackListedId,null); - - if((id==null)||(id.length==0)) - { - throw new BPartnerNotFoundException("Could not find Cheque with id :"+blackListedId); - } - - MBlackListCheque blacklisted = new MBlackListCheque(ctx, blackListedId, null); - BlackListedBean bean = new BlackListedBean(); - bean.setBlackListedBankName(blacklisted.getBankName()); - bean.setBlackListedChequeNo(blacklisted.getChequeNo()); - bean.setBlackListedId(blackListedId); - - -// MUser user=null; -// int userIds [] =MUser.getAllIDs(MUser.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_BPARTNER_ID="+partner.getID(),null); -// if(userIds.length==0) -// { -// user = new MUser(ctx,0,null); -// user.setName(partner.getName()); -// -// } -// else -// { -// user = new MUser(ctx,userIds[0],null); -// } - return bean; - } - - public static void deactivateBListedCheque(Properties ctx, int blackListedId, String trxName) throws OperationException - { - - MBlackListCheque blackListed = new MBlackListCheque(ctx, blackListedId, trxName); - - if(blackListed == null)throw new OperationException("Business Partner does not exist!"); - - blackListed.setIsActive(false); - - blackListed.save(); - - } - - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/CheckSequenceManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/CheckSequenceManager.java deleted file mode 100644 index a9c462d0dc..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/CheckSequenceManager.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Alok Pathak - */ - -package org.posterita.businesslogic.administration; - -import java.util.Properties; - -import org.compiere.process.ProcessInfo; -import org.compiere.process.SequenceCheck; - -import org.posterita.exceptions.SequenceUpdateException; - - -public class CheckSequenceManager { - -// private static final int TABLE_ID=115; - private static final int PROCESS_ID=258; - - public static void runProcess(Properties ctx) throws SequenceUpdateException - { - ProcessInfo poInfo = new ProcessInfo("Sequencecheck",PROCESS_ID); - SequenceCheck seqCheck = new SequenceCheck(); - boolean success= seqCheck.startProcess(ctx, poInfo,null); - - if(success==false) - throw new SequenceUpdateException("Sequence not updated"); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/CommissionManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/CommissionManager.java deleted file mode 100644 index dff6c3480f..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/CommissionManager.java +++ /dev/null @@ -1,348 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Alok Pathak - */ - -package org.posterita.businesslogic.administration; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MCharge; -import org.compiere.model.MCommission; -import org.compiere.model.MCommissionLine; -import org.compiere.model.MPInstance; -import org.compiere.process.CommissionCalc; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.CommissionBean; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.performanceanalysis.CSVReportManager; -import org.posterita.exceptions.InvalidDateTimeException; -import org.posterita.exceptions.OperationException; -import org.posterita.factory.SystemObjectsFactory; -import org.posterita.util.PoManager; - - -public class CommissionManager -{ - private static final int GENERATE_COMMISSION_PROCESS_ID=123; - private static final String CHARGE_NAME="Commission Charge"; - - public static void getCreateCommission(Properties ctx,String name,int partnerId,String docBasisType,BigDecimal amtMultiplier,String frequency,BigDecimal subtractAmt,String trxName) throws OperationException - { - int [] commissionIds = MCommission.getAllIDs(MCommission.Table_Name," AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_BPARTNER_ID="+partnerId+" and isActive='Y'",null); - if(commissionIds!=null && commissionIds.length>1) - throw new OperationException("Sales rep has more than one commission"+ commissionIds.length); - - MCommission com; - MCommissionLine comLine; - if(commissionIds==null || commissionIds.length<1) - { - com = new MCommission(ctx,0,trxName); - comLine = new MCommissionLine(ctx,0,trxName); - } - else - { - com = new MCommission(ctx,commissionIds[0],trxName); - MCommissionLine [] line =com.getLines(); - if(line.length!=1) - throw new OperationException("either No commissionLine or more than One commission Line has bean defined for this bPartner"); - comLine = new MCommissionLine(ctx,line[0].get_ID(),trxName); - } - com.setC_Charge_ID(getCreateCommissionCharge(ctx)); - com.setName(name); - com.setC_BPartner_ID(partnerId); - com.setFrequencyType(frequency); - com.setC_Currency_ID(POSTerminalManager.getCurrencyOfTerminalCashBook(ctx).get_ID()); - com.setDocBasisType(docBasisType); - com.setListDetails(true); - PoManager.save(com); - - - - comLine.setC_Commission_ID(com.get_ID()); - comLine.setAmtMultiplier(amtMultiplier.divide(new BigDecimal(100))); - comLine.setDescription(name); - comLine.setCommissionOrders(true); - comLine.setIsPositiveOnly(true); - if(subtractAmt!=null) - comLine.setAmtSubtract(subtractAmt); - PoManager.save(comLine); - - } - - private static int getCreateCommissionCharge(Properties ctx) throws OperationException - { - int chargeIds [] = MCharge.getAllIDs(MCharge.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and name='"+CHARGE_NAME+"'",null); - - if(chargeIds.length<1) - { - MCharge charge = new MCharge(ctx,0,null); - charge.setName(CHARGE_NAME); - charge.setChargeAmt(new BigDecimal(0)); - charge.setC_TaxCategory_ID(SystemObjectsFactory.getFactoryInstance().get(ctx,SystemObjectsFactory.TAX_CATEGORY_DEFAULT_ID).get_ID()); - - PoManager.save(charge); - - return charge.get_ID(); - } - else - { - return chargeIds[0]; - } - } - - public static void generateCommission(Properties ctx, Timestamp date) throws OperationException, InvalidDateTimeException - { -// deleteComAmtTableData(ctx); - int commissionIds [] = MCommission.getAllIDs(MCommission.Table_Name," AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and isActive='Y'",null); - if(commissionIds!=null && commissionIds.length>0) - for(int i=0;i getCommissionAmt(Properties ctx) throws OperationException - { - - String sql="select camt.C_COMMISSIONAMT_ID," +//1 - " camt.C_COMMISSIONRUN_ID," +//2 - "camt.C_COMMISSIONLINE_ID," +//3 - "camt.CONVERTEDAMT," +//4 - "camt.ACTUALQTY," +//5 - "camt.COMMISSIONAMT," +//6 - "cline.DESCRIPTION," +//7 - //"DECODE(com.FREQUENCYTYPE,'"+MCommission.FREQUENCYTYPE_Monthly+"','Monthly','"+ - "CASE WHEN com.FREQUENCYTYPE='"+MCommission.FREQUENCYTYPE_Monthly+"' THEN 'Monthly' "+ - //MCommission.FREQUENCYTYPE_Quarterly+"','Quarterly','"+ - " WHEN com.FREQUENCYTYPE='"+MCommission.FREQUENCYTYPE_Quarterly+"' THEN 'Quarterly' "+ - //MCommission.FREQUENCYTYPE_Weekly+"','Weekly','"+ - " WHEN com.FREQUENCYTYPE='"+MCommission.FREQUENCYTYPE_Weekly+"' THEN 'Weekly' "+ - //MCommission.FREQUENCYTYPE_Yearly+"','Yearly',com.FREQUENCYTYPE) frequency," +//8 - " WHEN com.FREQUENCYTYPE='"+MCommission.FREQUENCYTYPE_Yearly+"' THEN 'Yearly' ELSE com.FREQUENCYTYPE END AS frequency," +//8 - //"DECODE(com.DOCBASISTYPE,'"+MCommission.DOCBASISTYPE_Invoice+"','Invoice','"+ - "CASE WHEN com.DOCBASISTYPE ='"+MCommission.DOCBASISTYPE_Invoice+"' THEN 'Invoice' "+ - //MCommission.DOCBASISTYPE_Order+"','Order','"+ - " WHEN com.DOCBASISTYPE ='"+MCommission.DOCBASISTYPE_Order+"' THEN 'Order' "+ - //MCommission.DOCBASISTYPE_Receipt+"','Payment Receipt',com.DOCBASISTYPE) docbasis," +//9 - " WHEN com.DOCBASISTYPE ='"+MCommission.DOCBASISTYPE_Receipt+"' THEN 'Payment Receipt' ELSE com.DOCBASISTYPE END AS docbasis," +//9 - "cline.AMTMULTIPLIER*100, "+//10 - "crun.DESCRIPTION,"+//11 - //"nvl(cline.AMTSUBTRACT,0)"+//12 - "COALESCE(cline.AMTSUBTRACT,0)"+//12 - " from C_COMMISSIONAMT camt, C_COMMISSIONLINE cline,C_COMMISSION com,C_COMMISSIONRUN crun " + - " where camt.C_COMMISSIONLINE_ID=cline.C_COMMISSIONLINE_ID"+ - " and cline.C_COMMISSION_ID=com.C_COMMISSION_ID"+ - " and camt.C_COMMISSIONRUN_ID=crun.C_COMMISSIONRUN_ID"+ - " and camt.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - CommissionBean bean=null; - ArrayList list = new ArrayList(); - - - - - try - { - - ResultSet rs= pstmt.executeQuery(); - - if(rs.next()) - { - bean=new CommissionBean(); - bean.setCommissionAmtId(rs.getInt(1)); - bean.setCommissionRunId(rs.getInt(2)); - bean.setCommissionLineId(rs.getInt(3)); - bean.setConvertedAmt(rs.getBigDecimal(4)); - bean.setActualQty(rs.getBigDecimal(5)); - bean.setCommissionAmt(rs.getBigDecimal(6)); - bean.setCommissionLineName(rs.getString(7)); - bean.setFrequencyType(rs.getString(8)); - bean.setDocBasisType(rs.getString(9)); - bean.setAmtMultiplier(rs.getBigDecimal(10)); - bean.setPeriodAndCurrencyDesc(rs.getString(11)); - bean.setSubtractAmt(rs.getBigDecimal(12)); - list.add(bean); - - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch (SQLException e) - { - - - } - } - return list; - } - - - - public static ArrayList getCommissionDetails(Properties ctx, int commissionAmtId) throws OperationException - { - String sql=" select det.C_COMMISSIONDETAIL_ID," +//1 - "det.C_COMMISSIONAMT_ID," +//2 - " det.REFERENCE ," +//3 - " det.C_ORDERLINE_ID," +//4 - "det.C_INVOICELINE_ID," +//5 - " det.INFO," +//6 - "det.C_CURRENCY_ID," +//7 - "det.ACTUALAMT," +//8 - "det.CONVERTEDAMT," +//9 - " det.ACTUALQTY, " +//10 - "inv.C_INVOICE_ID,"+//11 - " ord.C_ORDER_ID"+//12 - " from c_invoiceLine inv left outer join (C_COMMISSIONDETAIL det left outer join c_orderLine ord on det.C_ORDERLINE_ID=ord.C_ORDERLINE_ID ) on det.C_INVOICELINE_ID=inv.C_INVOICELINE_ID "+ - " where det.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - //" and det.C_INVOICELINE_ID=inv.C_INVOICELINE_ID(+)"+ - //" and det.C_ORDERLINE_ID=ord.C_ORDERLINE_ID(+)"+ - " and det.C_COMMISSIONAMT_ID="+commissionAmtId; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - CommissionBean bean=null; - ArrayList list = new ArrayList(); - try - { - ResultSet rs= pstmt.executeQuery(); - - while(rs.next()) - { - bean=new CommissionBean(); - bean.setCommissionDetailId(rs.getInt(1)); - bean.setCommissionAmtId(rs.getInt(2)); - bean.setReference(rs.getString(3)); - bean.setOrderLineId(rs.getInt(4)); - bean.setInvoiceLineId(rs.getInt(5)); - bean.setInfo(rs.getString(6)); - bean.setCurrencyId(rs.getInt(7)); - bean.setActualAmt(rs.getBigDecimal(8)); - bean.setConvertedAmt(rs.getBigDecimal(9)); - bean.setActualQty(rs.getBigDecimal(10)); - bean.setInvoiceId(rs.getInt(11)); - bean.setOrderId(rs.getInt(12)); - - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch (SQLException e) - { - - - } - } - return list; - } - - public static String getCommissionAmtAsCSV(Properties ctx, ArrayList commissionList) throws OperationException - { - ArrayList reportData = new ArrayList(); - - // adding column header - Object[] headers = new Object[]{ - "Name", - "Calculation Period And Curr.", - "Total Amount", - "Substract Amount", - "Commission Amount", - "Qty", - "Frequency Type", - "Doc Basis Type", - "Rate %"}; - - reportData.add(headers); - - //adding data records - Object[] data = null; - - for(CommissionBean bean : commissionList) - { - data = new Object[]{ - bean.getCommissionLineName(), - bean.getPeriodAndCurrencyDesc(), - bean.getConvertedAmt(), - bean.getSubtractAmt(), - bean.getCommissionAmt(), - bean.getActualQty(), - bean.getFrequencyType(), - bean.getDocBasisType(), - bean.getAmtMultiplier() - }; - - reportData.add(data); - } - - //generate CSV - String reportName = CSVReportManager.generateCSVReport(ctx,reportData); - - return reportName; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/CustomerManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/CustomerManager.java deleted file mode 100644 index 895cff094f..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/CustomerManager.java +++ /dev/null @@ -1,1269 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Alok Pathak - */ - -package org.posterita.businesslogic.administration; - -import java.awt.Color; -import java.io.FileOutputStream; -import java.io.IOException; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.Properties; -import java.util.StringTokenizer; - -import org.compiere.model.MBPBankAccount; -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MBank; -import org.compiere.model.MCountry; -import org.compiere.model.MLocation; -import org.compiere.model.MOrg; -import org.compiere.model.MPaymentTerm; -import org.compiere.model.MRegion; -import org.compiere.model.MUser; -import org.compiere.model.X_I_BPartner; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.CustomerBean; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.RandomStringGenerator; -import org.posterita.core.TimestampConvertor; -import org.posterita.exceptions.BPartnerAlreadyExistException; -import org.posterita.exceptions.BPartnerNotFoundException; -import org.posterita.exceptions.InvalidDateTimeException; -import org.posterita.exceptions.NoCustomerFoundException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PathInfo; -import org.posterita.util.PoManager; - -import com.lowagie.text.Document; -import com.lowagie.text.DocumentException; -import com.lowagie.text.Element; -import com.lowagie.text.Font; -import com.lowagie.text.FontFactory; -import com.lowagie.text.Image; -import com.lowagie.text.PageSize; -import com.lowagie.text.Phrase; -import com.lowagie.text.pdf.PdfPCell; -import com.lowagie.text.pdf.PdfPTable; -import com.lowagie.text.pdf.PdfWriter; - -public class CustomerManager -{ - - public static MBPartner saveCustomer(Properties ctx, Integer partnerId, CustomerBean bean, String trxName) throws OperationException, InvalidDateTimeException - { - - int countryId = 0; - - if (bean.getCountryId() == null) - { - MCountry country = MCountry.getDefault(ctx); - countryId = country.get_ID(); - } - else - countryId = bean.getCountryId().intValue(); - - MOrg parentOrg = OrganisationManager.getMyOrg(ctx); - - MBPartner bPartner = BPartnerManager.saveBPartner(ctx, bean.getOrgId(), partnerId, parentOrg.getLinkedC_BPartner_ID(trxName), bean.getPartnerName(), bean.getSurname(), true, false, false, false, bean.getAddress1(), bean - .getAddress2(), bean.getPostalAddress(), bean.getRegionId(), bean.getCity(), bean.getPhone(), bean.getPhone2(), bean.getFax(), countryId, true, true, trxName); - - int customerkey = DB.getNextID(ctx, X_I_BPartner.Table_Name, null); - bPartner.setValue(String.valueOf(customerkey)); - // bPartner.setC_Dunning_ID(bean.getDunningId()); - if(bean.getCreditLimit()!=null) - { - bPartner.setSO_CreditLimit(bean.getCreditLimit()); - } - - Integer priceListId = bean.getPriceListId(); - - if (priceListId!=null && priceListId!=0) - { - bPartner.setM_PriceList_ID(priceListId); - } - bPartner.setSOCreditStatus(bean.getCreditStatus()); - bPartner.setName2(bean.getSurname()); - if(bean.getPaymentTermId()!=null) - { - bPartner.setC_PaymentTerm_ID(bean.getPaymentTermId()); - } - if(bean.getPaymentTermId()==null) - { - bPartner.setC_PaymentTerm_ID(0); - } - PoManager.save(bPartner); - - MUser user = null; - - if (bean.getUserId() == null || bean.getUserId() == 0) - { - user = new MUser(bPartner); - } - else - { - user = new MUser(ctx, bean.getUserId(), trxName); - } - - user.setEMail(bean.getEmail()); - user.setPhone(bean.getPhone()); - user.setAD_Org_ID(bean.getOrgId()); - - if (bean.getBirthdate() !=null ) - { - Timestamp timestamp = TimestampConvertor.getTimestamp(bean.getBirthdate().toString(), TimestampConvertor.BIRTH_DATE); - - user.setBirthday(timestamp); - } - - PoManager.save(user); - - return bPartner; - } - - public static CustomerBean editCustomer(Properties ctx,CustomerBean bean,String trxName) throws OperationException, InvalidDateTimeException - { - Integer bpartnerId = bean.getBpartnerId(); - if(bpartnerId==null) - { - throw new OperationException("Cannot edit business partner details. Cause bpartnerId cannot be null!"); - } - - int[] bpartnerIds = MBPartner.getAllIDs(MBPartner.Table_Name," C_bpartner_Id = "+bpartnerId, trxName); - if(bpartnerIds==null || bpartnerIds.length==0) - { - throw new OperationException("Cannot edit business partner details. Cause bpartnerId could not be found!"); - } - - MBPartnerLocation partnerLocation[] = MBPartnerLocation.getForBPartner(ctx,bpartnerIds[0]); - int region_id = 333; - if (partnerLocation.length >0) - { - - MLocation location = new MLocation(ctx, partnerLocation[0].getC_Location_ID(), trxName); - MRegion region = location.getRegion(); - - - if(region!=null) - { - region_id = region.get_ID(); - } - } - else - { - - MBPartner partner = new MBPartner(ctx,bpartnerId,null); - - MLocation location = new MLocation(ctx, 0, null); - location.setAddress1(bean.getAddress1()); - location.setAddress2(bean.getAddress2()); - location.setPostal_Add(bean.getPostalAddress()); - location.setCity(bean.getCity()); - location.save(); - MBPartnerLocation bpLocation = new MBPartnerLocation(partner); - bpLocation.setC_Location_ID(location.get_ID()); - bpLocation.setPhone(bean.getPhone()); - bpLocation.setPhone2(bean.getPhone2()); - bpLocation.setFax(bean.getFax()); - PoManager.save(bpLocation); - } - - MBPartner bPartner=BPartnerManager.editBPartner(ctx,bean.getOrgId(), bean.getBpartnerId(),bean.getPartnerName(),bean.getSurname(),true, - false,false,false,bean.getAddress1(),bean.getAddress2(),bean.getPostalAddress(),bean.getCity(),bean.getPhone(),bean.getPhone2(),bean.getFax(),region_id,trxName); - if(bean.getCreditLimit()!=null) - { - bPartner.setSO_CreditLimit(bean.getCreditLimit()); - } - bPartner.setSOCreditStatus(bean.getCreditStatus()); - if(bean.getPaymentTermId()!=null) - { - bPartner.setC_PaymentTerm_ID(bean.getPaymentTermId()); - } - if(bean.getPaymentTermId()==null) - { - bPartner.setC_PaymentTerm_ID(0); - } - - - PoManager.save(bPartner); - - MUser user; - int userIds [] =MUser.getAllIDs(MUser.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_BPARTNER_ID="+bpartnerId,trxName); - if(userIds.length==0) - { - user = new MUser(bPartner); - PoManager.save(user); - - } - else - { - user = new MUser(ctx,userIds[0],trxName); - } - - PoManager.save(user); - return bean; - } - - @SuppressWarnings("unchecked") - public static ArrayList getAllCustomers(Properties ctx, boolean isPOS) throws OperationException - { - int adOrgID = Env.getAD_Org_ID(ctx); - int adClientID = Env.getAD_Client_ID(ctx); - String sql; - - sql = " select bp.c_bpartner_id," + //1 - " bp.name," + //2 - " bp.name2," + //3 - " bp.customer_id_no," + //4 - " bp.phone," + //5 - " bp.cellno," + //6 - " cl.address1," + //7 - " cl.address1," + //8 - " cl.city," + //9 - " cl.postal_add," + //10 - " cl.birthday" + //11 - " from C_BPARTNER bp, c_bpartner_location bpl, c_location cl" + - " where bpl.c_bpartner_id = bp.c_bpartner_id" + - " and cl.c_location_id=bpl.c_location_id" + - " and bp.AD_CLIENT_ID = " + adClientID + - " and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ - " and bp.isActive = 'Y' " ; - - if(!isPOS) - sql=sql+ " and bp.name not in (select name from ad_org where ad_org_id = " + adOrgID + ")" + - " and bp.name not in (select name from ad_user where ad_client_id = "+ adClientID +" and ad_org_id = " + adOrgID + ")" ; - - sql=sql+" order by bp.name,bp.name2"; - - PreparedStatement pstmt =null; - - CustomerBean customer = null; - ArrayList customers = new ArrayList(); - - try - { - pstmt = DB.prepareStatement(sql,null); - ResultSet rs = pstmt.executeQuery(); - - - while (rs.next()) - { - - customer = new CustomerBean(); - customer.setBpartnerId(Integer.valueOf(rs.getInt(1))); - customer.setPartnerName(rs.getString(2)); - customer.setSurname(rs.getString(3)); - customer.setCustIdNumber(rs.getString(4)); - customer.setPhone(rs.getString(5)); - customer.setMobile(rs.getString(6)); - customer.setAddress1(rs.getString(7)); - customer.setAddress1(rs.getString(8)); - customer.setCity(rs.getString(9)); - customer.setPostalAddress1(rs.getString(10)); - customer.setBirthdate(rs.getString(11)); - - customers.add(customer); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception ex){} - - pstmt = null; - } - - Comparator c = new Comparator() - { - - public int compare(Object o1, Object o2) - { - CustomerBean bean1 = (CustomerBean) o1; - CustomerBean bean2 = (CustomerBean) o2; - - String customer1Name = bean1.getSurname() + "_" +bean1.getPartnerName(); - - - String customer2Name = bean2.getSurname() + "_" + bean2.getPartnerName(); - - return customer1Name.compareToIgnoreCase(customer2Name); - } - - }; - - Collections.sort(customers, c); - - return customers; - - } - - public static ArrayList getAllCustomersSortedByDateCreated(Properties ctx) throws OperationException - { - ArrayList allCustomers = getAllCustomers(ctx,false); - - Comparator c = new Comparator() - { - - public int compare(CustomerBean o1, CustomerBean o2) - { - CustomerBean bean1 = (CustomerBean) o1; - CustomerBean bean2 = (CustomerBean) o2; - return bean1.getBpartnerId().compareTo(bean2.getBpartnerId()); - - } - }; - - Collections.sort(allCustomers, c); - Collections.reverse(allCustomers); - - return allCustomers; - } - - - public static ArrayList getAllPosCustomer(Properties ctx) throws OperationException - { - - ArrayList list = new ArrayList(); - - int ad_client_id = Env.getAD_Client_ID(ctx); - //int ad_org_id = Env.getAD_Org_ID(ctx); - - String sql = " select" + - " bp.name as firstname," + //1.firstname - " bp.name2 as lastname," +//2.lastname - " loc.address1," +//3.address1 - " loc.address2," +//4.address2 - " bploc.phone," +//5.phone - " bploc.fax," +//6.fax - " bp.isactive, " +//7.isactive - " bp.c_bpartner_id " + //8.partnerid - " from c_bpartner bp left outer join (c_bpartner_location bploc left outer join c_location loc on bploc.C_LOCATION_ID = loc.C_LOCATION_ID)on bp.c_bpartner_id = bploc.c_bpartner_id" + - " where bp.ad_client_id = " + ad_client_id + - " and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ - //" and bp.c_bpartner_id = bploc.c_bpartner_id (+)" + - //" and bploc.C_LOCATION_ID = loc.C_LOCATION_ID (+)" + - " and bp.ISCUSTOMER = 'Y'" + - //" and bp.name not in (select name from ad_org where ad_org_id = " + ad_org_id + ")" + - " order by bp.name" ; - - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs = null; - - CustomerBean bean = null; - - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean = new CustomerBean(); - - //set bean - bean.setPartnerName(rs.getString(1)); - bean.setSurname(rs.getString(2)); - bean.setAddress1(rs.getString(3)); - bean.setAddress2(rs.getString(4)); - bean.setPhone(rs.getString(5)); - bean.setFax(rs.getString(6)); - - if(rs.getString(7).equalsIgnoreCase("Y")) - { - bean.setIsActive(Boolean.valueOf("True")); - } - else - { - bean.setIsActive(Boolean.valueOf("False")); - } - - bean.setBpartnerId(Integer.valueOf(rs.getInt(8))); - - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception ex){} - - pstmt = null; - } - - return list; - } - - - - public static CustomerBean getCustomerDetails(Properties ctx, int bpartnerId) throws OperationException,BPartnerNotFoundException, InvalidDateTimeException, Exception - { - if (bpartnerId == 0) - throw new OperationException("Customer details not found. Please contact your administrator."); - - int id[] = MBPartner.getAllIDs(MBPartner.Table_Name,"C_BPARTNER_ID="+bpartnerId,null); - - if((id==null)||(id.length==0)) - { - throw new BPartnerNotFoundException("Could not find customer with id :"+bpartnerId); - } - - MBPartner partner = new MBPartner(ctx, bpartnerId, null); - - - CustomerBean customer = new CustomerBean(); - customer.setBpartnerId(bpartnerId); - customer.setPartnerName(partner.getName()); - customer.setSurname(partner.getName2()); - customer.setPriceListId(partner.getM_PriceList_ID()); - customer.setCreditLimit(partner.getSO_CreditLimit()); - customer.setCreditStatus(partner.getSOCreditStatus()); - customer.setIsActive(partner.isActive()); - customer.setOrgId(partner.getAD_Org_ID()); - - if(partner.getC_PaymentTerm_ID()!=0) - { - customer.setPaymentTermId(partner.getC_PaymentTerm_ID()); - MPaymentTerm paymentTerm=new MPaymentTerm(ctx,partner.getC_PaymentTerm_ID(),null); - customer.setPaymentTermName(paymentTerm.getName()); - } - - MBPartnerLocation partnerLocation[] = MBPartnerLocation.getForBPartner(ctx,partner.get_ID()); - if (partnerLocation.length > 0) - { - MLocation location = new MLocation(ctx, partnerLocation[0].getC_Location_ID(), null); - customer.setAddress1(location.getAddress1()); - customer.setAddress2(location.getAddress2()); - customer.setCity(location.getCity()); - customer.setPostalAddress1(location.getPostal_Add()); - customer.setPostalCode(location.getPostal()); - customer.setPostalCity(location.getCityRegionPostal()); - customer.setPhone(partnerLocation[0].getPhone()); - customer.setPhone2(partnerLocation[0].getPhone2()); - customer.setFax(partnerLocation[0].getFax()); - - } - customer.setBpartnerId(bpartnerId); - - MUser user=null; - int userIds [] =MUser.getAllIDs(MUser.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_BPARTNER_ID="+partner.get_ID(),null); - if(userIds.length==0) - { - user = new MUser(ctx,0,null); - user.setName(partner.getName()); - - } - else - { - user = new MUser(ctx,userIds[0],null); // FIXME What about when having multiple users? - } - - customer.setUserId(user.get_ID()); - customer.setEmail(user.getEMail()); - customer.setMobile(user.getPhone()); - - Timestamp date = user.getBirthday(); - - if ((date != null)) - { - SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - SimpleDateFormat sdfOutput = new SimpleDateFormat ("dd/MM/yyyy"); - String textDate = date.toString(); - - customer.setBirthdate(textDate); - } - - - return customer; - } - - @SuppressWarnings("unchecked") - public static ArrayList getCustomers(Properties ctx, boolean isPOS, String name) throws OperationException - { - int adOrgID = Env.getAD_Org_ID(ctx); - int adClientID = Env.getAD_Client_ID(ctx); - String sql; - - sql = " select bp.c_bpartner_id," + //1 - " bp.name," + //2 - " bp.name2," + //3 - " bp.customer_id_no," + //4 - " bp.phone," + //5 - " bp.cellno," + //6 - " bp.aa_card_no," + //7 - " cl.address1," + //8 - " cl.city," + //9 - " cl.postal_add," + //10 - " from C_BPARTNER bp, c_bpartner_location bpl, c_location cl" + - " where bpl.c_bpartner_id = bp.c_bpartner_id" + - " and cl.c_location_id=bpl.c_location_id" + - " and bp.AD_CLIENT_ID = " + adClientID + - " and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ - " and bp.isActive = 'Y' " + - " and (lower(bp.name) like lower('%"+ name +"%')" + - " or lower(bp.name2) like lower('%"+ name +"%')" ; - - if(!isPOS) - sql=sql+ " and bp.name not in (select name from ad_org where ad_org_id = " + adOrgID + ")" + - " and bp.name not in (select name from ad_user where ad_client_id = "+ adClientID +" and ad_org_id = " + adOrgID + ")" ; - - sql=sql+" order by bp.name,bp.name2"; - - PreparedStatement pstmt =null; - - CustomerBean customer = null; - ArrayList customers = new ArrayList(); - - try - { - pstmt = DB.prepareStatement(sql,null); - ResultSet rs = pstmt.executeQuery(); - - - while (rs.next()) - { - customer = new CustomerBean(); - customer.setBpartnerId(Integer.valueOf(rs.getInt(1))); - customer.setPartnerName(rs.getString(2)); - customer.setSurname(rs.getString(3)); - customer.setCustIdNumber(rs.getString(4)); - customer.setPhone(rs.getString(5)); - customer.setMobile(rs.getString(6)); - customer.setAaCardnumber(rs.getString(7)); - customer.setAddress1(rs.getString(8)); - customer.setCity(rs.getString(9)); - customer.setPostalAddress1(rs.getString(10)); - - customers.add(customer); - } - - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception ex){} - - pstmt = null; - } - - Comparator c = new Comparator() - { - - public int compare(Object o1, Object o2) - { - CustomerBean bean1 = (CustomerBean) o1; - CustomerBean bean2 = (CustomerBean) o2; - - String customer1Name = bean1.getSurname() + "_" +bean1.getPartnerName(); - - - String customer2Name = bean2.getSurname() + "_" + bean2.getPartnerName(); - - return customer1Name.compareToIgnoreCase(customer2Name); - } - - }; - - Collections.sort(customers, c); - - return customers; - - } - - public static ArrayList searchCustomers(Properties ctx,String searchString, boolean isPOS) throws OperationException - { - searchString = (searchString==null)? "" : searchString; - - int adOrgID = Env.getAD_Org_ID(ctx); - int adClientID = Env.getAD_Client_ID(ctx); - String sql; - - StringTokenizer st = new StringTokenizer(searchString,"+ "); - String token = null; - - sql = " select bp.c_bpartner_id," + //1 - " bp.name," + //2 - " bp.name2," + //3 - " bp.m_pricelist_id," + //4 - " bp.so_creditlimit," + //5 - " bp.so_creditused," + //6 - " bp.totalopenbalance," + //7 - " bp.socreditstatus " + //8 - " from C_BPARTNER bp" + - " where bp.AD_CLIENT_ID = " + adClientID + - " and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"+ - " and bp.isActive = 'Y' "+ - " and bp.isCustomer='Y'"; - ArrayList params = new ArrayList(); - while(st.hasMoreTokens()) - { - token = st.nextToken().trim(); - token = "%" + token + "%"; - params.add(token); - params.add(token); - sql = sql + " and ( upper(bp.name) like upper(?) or upper(bp.name2) like upper(? ))"; - } - - if(!isPOS) - sql=sql+ " and bp.name not in (select name from ad_org where ad_org_id = " + adOrgID + ")" ; - - - sql=sql+" order by bp.name,bp.name2"; - - PreparedStatement pstmt =null; - - CustomerBean customer = null; - ArrayList customers = new ArrayList(); - - try - { - pstmt = DB.prepareStatement(sql,null); - int index = 1; - for (String s : params) - { - pstmt.setString(index, s); - index++; - } - ResultSet rs = pstmt.executeQuery(); - - - while (rs.next()) - { - customer = new CustomerBean(); - customer.setBpartnerId(Integer.valueOf(rs.getInt(1))); - customer.setPartnerName(rs.getString(2)); - customer.setSurname(rs.getString(3)); - customer.setPriceListId(rs.getInt(4)); - customer.setCreditStatus(rs.getString(8)); - - BigDecimal creditLimit = rs.getBigDecimal(5); - BigDecimal creditUsed = rs.getBigDecimal(6); - BigDecimal openBalance = rs.getBigDecimal(7); - - creditLimit = creditLimit == null ? Env.ZERO : creditLimit; - creditUsed = creditUsed == null ? Env.ZERO : creditUsed; - openBalance = openBalance == null ? Env.ZERO : openBalance; - - BigDecimal creditAvailable = Env.ZERO; - if(creditLimit.doubleValue() > 0.0d) - { - creditAvailable = creditLimit.subtract(creditUsed); - } - - customer.setTotalOpenBalance(openBalance); - customer.setCreditAvailable(creditAvailable); - customer.setCreditLimit(creditLimit); - customer.setCreditUsed(creditUsed); - - customers.add(customer); - } - - rs.close(); - - return customers; - - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception ex){} - - pstmt = null; - } - } - - public static ArrayList searchPOSCustomer(Properties ctx, String customerName, String day, String month, String year, String isActive) throws OperationException, Exception - { - - ArrayList list = new ArrayList(); - - int ad_client_id = Env.getAD_Client_ID(ctx); - int ad_org_id = Env.getAD_Org_ID(ctx); - - StringBuffer sql = new StringBuffer(); - sql.append("select bp.c_bpartner_id,"); //1. bpartner id - sql.append(" bp.name as firstname,"); //2.firstname - sql.append(" bp.name2 as lastname,");//3.lastname - sql.append(" loc.address1,");//4.address1 - sql.append(" loc.address2,");//5.address2 - sql.append(" loc.city,");//6. City - sql.append(" bploc.phone,");//7.phone - sql.append(" bploc.fax,");//8.fax - sql.append(" bp.isactive,");//9.isactive - sql.append(" au.birthday, "); //10. birthday - sql.append(" bp.ad_org_id "); //11. organisation - sql.append(" FROM C_BPARTNER BP "); - sql.append(" LEFT OUTER JOIN AD_USER AU ON AU.C_BPARTNER_ID = BP.C_BPARTNER_ID "); - sql.append(" LEFT OUTER JOIN C_BPARTNER_LOCATION BPLOC ON BP.C_BPARTNER_ID = BPLOC.C_BPARTNER_ID "); - sql.append(" LEFT OUTER JOIN C_LOCATION LOC ON BPLOC.C_LOCATION_ID = LOC.C_LOCATION_ID "); - sql.append(" where bp.ad_client_id = ").append(ad_client_id); - sql.append(" and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM)+")"); - sql.append(" and bp.ISCUSTOMER = 'Y'"); - - if( isActive.length() != 0) - { - sql.append("and bp.isActive='").append(isActive).append("'"); - } - - - sql.append(" and bp.name not in (select name from ad_org where ad_org_id = " + ad_org_id + ")" ); - sql.append(" and lower(bp.name||' ' ||"); - sql.append("bp.name2) like lower('%").append(customerName).append("%')"); - - if (day.length() != 0) - { - String dd = String.valueOf(day); - if (dd.length() == 1) - { - dd = "0" + dd; - } - - sql.append(" and to_char(bp.created, 'dd') = '").append(dd).append("'"); - } - - - if (month.length() != 0) - { - String mm = String.valueOf(month); - if (mm.length() == 1) - { - mm = "0" + mm; - } - - sql.append(" and to_char(bp.created, 'mm') = '").append(mm).append("'"); - } - - if (year.length() != 0) - { - sql.append(" and to_char(bp.created, 'yyyy') ='").append(year).append("'"); - } - - - sql.append(" order by bp.name"); - - - PreparedStatement pstmt = DB.prepareStatement(sql.toString(),null); - pstmt.execute(); - - ResultSet rs = null; - - CustomerBean bean = null; - - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean = new CustomerBean(); - - //set bean - bean.setPartnerName(rs.getString(2)); - bean.setSurname(rs.getString(3)); - bean.setAddress1(rs.getString(4)); - bean.setAddress2(rs.getString(5)); - bean.setCity(rs.getString(6)); - bean.setPhone(rs.getString(7)); - bean.setFax(rs.getString(8)); - bean.setIsEditable(RoleManager.isEditable(ctx, rs.getInt(11))); - - if(rs.getString(9).equalsIgnoreCase("Y")) - { - bean.setIsActive(Boolean.valueOf("True")); - } - else - { - bean.setIsActive(Boolean.valueOf("False")); - } - - bean.setBpartnerId(Integer.valueOf(rs.getInt(1))); - - if (rs.getString(10) != null) - { - Date textDate = rs.getDate(10); - bean.setBirthdate(textDate.toString()); - } - - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception ex){} - - pstmt = null; - } - - return list; - } - - /* - * - * param - * * return String name of the pdf file - */ - public static String fidelityCard (Properties ctx,ArrayList customerList) throws OperationException - { - String reportName =RandomStringGenerator.randomstring()+".pdf"; - String reportPath =ReportManager.getReportPath(reportName); - - boolean shouldPrintCard = false; - - for(CustomerBean b: customerList) - { - if(b.getIsActive()) - { - shouldPrintCard = true; - break; - } - } - - if(!shouldPrintCard) - { - throw new NoCustomerFoundException("Cannot print fidelity card. Cause no active customers were found."); - } - - Document document = new Document(PageSize.A4,3,3,2,4);//l,r,t,b - - try { -// step 2: - // we create a writer that listens to the document - // and directs a PDF-stream to a file - PdfWriter.getInstance(document, new FileOutputStream(reportPath)); - - // step 3: we open the document - document.open(); - - PdfPTable main = new PdfPTable(2); - main.setWidthPercentage(71.0f); - main.getDefaultCell().setBorderColor(Color.gray); - - PdfPCell cell = new PdfPCell(); - cell.setMinimumHeight(150.0f); - - Font smallFont = FontFactory.getFont(FontFactory.HELVETICA,7,Font.BOLD); - //Font spaceFont = FontFactory.getFont(FontFactory.HELVETICA,6,Font.BOLD); - //Font spaceFont2 = FontFactory.getFont(FontFactory.HELVETICA,15,Font.BOLD); - - //ResourceBundle rb = ResourceBundle.getBundle("MessageResources"); - - for(CustomerBean bean: customerList) - { - if(bean.getIsActive()) - { - String name =bean.getPartnerName(); - String name1=""; - String add2 =""; - String add1 =""; - String city =""; - - if (bean.getAddress1()!= null) - add1=bean.getAddress1(); - - if (bean.getAddress2()!= null) - add2=bean.getAddress2(); - - if (bean.getCity()!= null) - city =bean.getCity(); - - - String Address = " "+add1; - String Add2 = " " + add2; - String Add3 = " "+city; - - String BackPriv1Path = PathInfo.PROJECT_HOME + "/images/BackPriv1.jpg" ; - String backPriv2Path = PathInfo.PROJECT_HOME + "/images/backPriv2.jpg" ; - String frontImgPath = PathInfo.PROJECT_HOME + "/images/pc.png"; - - float WIDTH=205; - float HEIGHT= 135; - - - - Image Back1= Image.getInstance(BackPriv1Path); - Back1.scaleAbsolute(WIDTH-40,HEIGHT/3); - Image Back2=Image.getInstance(backPriv2Path); - Back2.scaleAbsolute(WIDTH,HEIGHT/3); - Image frontImg = Image.getInstance(frontImgPath); - frontImg.scaleAbsolute(WIDTH,HEIGHT); - - - - if(bean.getSurname() != null && bean.getSurname().trim().length() > 0) - name1 = " "+ name + " " + name1 + bean.getSurname(); - - byte[] barcode = BarcodeManager.getBarcodeAsByte(bean.getBpartnerId().toString()); - Image barcodeImg = Image.getInstance(barcode); - barcodeImg.setRotation(1.57f); - barcodeImg.scaleAbsolute(HEIGHT- 55f, WIDTH/5); - - //document.add(barcodeImg); - PdfPTable card = new PdfPTable(2); - card.getDefaultCell().setBorderWidth(0.0f); - - PdfPCell c =null; - card.setWidthPercentage(50.0f); - - PdfPTable t = new PdfPTable(1); - PdfPTable nametable = new PdfPTable(1); - - c = new PdfPCell(Back1); - c.setBorderWidth(0.0f); - nametable.addCell(c); - - - c = new PdfPCell(new Phrase(name1,smallFont)); - c.setHorizontalAlignment(Element.ALIGN_CENTER); - c.setVerticalAlignment(Element.ALIGN_CENTER); - c.setBorderWidth(0.0f); - nametable.addCell(c); - - c = new PdfPCell(new Phrase(Address,smallFont)); - c.setHorizontalAlignment(Element.ALIGN_CENTER); - c.setVerticalAlignment(Element.ALIGN_CENTER); - c.setBorderWidth(0.0f); - //c.setColspan(2); - nametable.addCell(c); - - c = new PdfPCell(new Phrase(Add2,smallFont)); - c.setHorizontalAlignment(Element.ALIGN_CENTER); - c.setVerticalAlignment(Element.ALIGN_CENTER); - c.setBorderWidth(0.0f); - //c.setColspan(2); - nametable.addCell(c); - - c = new PdfPCell(new Phrase(Add3,smallFont)); - c.setHorizontalAlignment(Element.ALIGN_CENTER); - c.setVerticalAlignment(Element.ALIGN_CENTER); - c.setBorderWidth(0.0f); - //c.setColspan(2); - nametable.addCell(c); - - //nametable.getDefaultCell(); - nametable.getDefaultCell().setBorderWidth(0.0f); - nametable.setHorizontalAlignment(Element.ALIGN_CENTER); - card.addCell(nametable); - - - c = new PdfPCell(barcodeImg); - c.setBorderWidth(0.0f); - //c.setColspan(2); - c.setHorizontalAlignment(Element.ALIGN_RIGHT); - c.setVerticalAlignment(Element.ALIGN_MIDDLE); - c.setPadding(5.0f); - card.addCell(c); - - - c = new PdfPCell(Back2); - c.setBorderWidth(0.0f); - c.setColspan(2); - card.addCell(c); - - - c = new PdfPCell(new Phrase(name1,smallFont)); - c.setBorderWidth(0.0f); - t.addCell(c); - - c = new PdfPCell(new Phrase(Address,smallFont)); - c.setBorderWidth(0.0f); - t.addCell(c); - - c = new PdfPCell(new Phrase(Add3,smallFont)); - c.setBorderWidth(0.0f); - t.addCell(c); - - - PdfPTable card1 = new PdfPTable(1); - card.getDefaultCell().setBorderWidth(0.0f); - - PdfPCell c1 =null; - card.setWidthPercentage(50.0f); - - c1 = new PdfPCell(frontImg); - c1.setBorderWidth(0.0f); - card1.addCell(c1); - - - - main.addCell(card); - main.addCell(card1); - } - - } - document.add(main); - - } - // TODO handle the following exception neatly - catch (DocumentException de) - { - System.err.println(de.getMessage()); - } - catch (IOException ioe) - { - System.err.println(ioe.getMessage()); - } - - // step 5: we close the document - document.close(); - return reportName; - } - - - public static CustomerBean createSingleCustomerForImport(Properties ctx, CustomerBean bean, String trxName) throws Exception, OperationException, InvalidDateTimeException - { - MBPartner customer = saveCustomer(ctx, 0, bean, trxName); - - /** SET ADDITIONAL DETAILS **/ - - customer.setReferenceNo(bean.getCustIdNumber()); - customer.setTaxID(bean.getTaxNo()); - PoManager.save(customer); - - - MBPartnerLocation[] partnerLocations = MBPartnerLocation.getForBPartner(ctx, customer.getC_BPartner_ID()); - - if(partnerLocations.length > 0) - { - partnerLocations[0].setPhone2(bean.getMobile()); - PoManager.save(partnerLocations[0]); - - //Set postal code and postal address for customer - MLocation location = new MLocation(ctx, partnerLocations[0].getC_Location_ID(), trxName); - - location.setPostal(bean.getPostalCode()); - location.setAddress3(bean.getPostalAddress()); - location.setAddress4(bean.getPostalAddress1()); - PoManager.save(location); - } - - - //Modify contact for new customer since contact name is same as customer name by default - if(bean.getUsername() != null && bean.getUsername().length() > 0) - { - MUser[] users = MUser.getOfBPartner(ctx, customer.getC_BPartner_ID()); - - if(users.length > 0) - { - users[0].setName(bean.getUsername()); - users[0].setFax(bean.getFax()); - users[0].setPhone2(bean.getMobile()); - PoManager.save(users[0]); - } - } - - //Set Bank account details for customer - - if(bean.getBankName() != null && bean.getBankName().length() > 0 - && bean.getAccountNo() != null && bean.getAccountNo().length() > 0) - { - MBPBankAccount bpBankAccount = new MBPBankAccount(ctx, 0, trxName); - bpBankAccount.setC_BPartner_ID(customer.getC_BPartner_ID()); - bpBankAccount.setAccountNo(bean.getAccountNo()); - bpBankAccount.setA_City(bean.getBranch()); // Set branch for bank - - String whereClause = " UPPER(name)='" + bean.getBankName().toUpperCase() + "' AND AD_Client_ID=" + Env.getAD_Client_ID(ctx) - + " AND AD_Org_ID=" + Env.getAD_Org_ID(ctx) + " AND isActive='Y'"; - - int[] bankIds = MBank.getAllIDs(MBank.Table_Name, whereClause, trxName); - MBank bank = null; - - if(bankIds.length == 0) - { - bank = new MBank(ctx, 0, trxName); - bank.setName(bean.getBankName()); - bank.setRoutingNo("123456789"); //Routing Number is mandatory - PoManager.save(bank); - } - else - { - bank = new MBank(ctx, bankIds[0], trxName); - } - - bpBankAccount.setC_Bank_ID(bank.getC_Bank_ID()); - bpBankAccount.setRoutingNo(bank.getRoutingNo()); - - PoManager.save(bpBankAccount); - - } - - CustomerBean customerBean= new CustomerBean(); - customerBean = CustomerManager.getCustomerDetails(ctx, customer.getC_BPartner_ID()); - return customerBean; - } - - public static void activateCustomer(Properties ctx, int bpartnerId, String trxName) throws OperationException - { - BPartnerManager.activateBPartner(ctx,bpartnerId, false,trxName); - - } - - public static void deactivateCustomer(Properties ctx, int bpartnerId, String trxName) throws OperationException - { - BPartnerManager.deactivateBPartner(ctx,bpartnerId, trxName); - - } - - - public static ArrayList updateCustomerListStatus(ArrayList list, Integer partnerId, Boolean status) - { - if (list == null) - return list; - - for (int i = 0; i < list.size(); i++) - { - CustomerBean bean = (CustomerBean) list.get(i); - - if (bean.getBpartnerId().equals(partnerId)) - { - bean.setIsActive(status); - - list.remove(i); - - list.add(i, bean); - - break; - } - } - - return list; - - } - - public static MBPartner getBPartner(Properties ctx, String name, String name2, boolean isCustomer, boolean isVendor, boolean isSalesRep, boolean isEmployee, String trxName) throws BPartnerAlreadyExistException, OperationException - { - MBPartner bpartner = null; - - if((name == null || name.length() == 0) && (name2 == null || name2.length() == 0)) - { - throw new OperationException("Name cannot be null or empty."); - } - - if(name != null && name.contains("'")) - { - name = name.replaceAll("'", "''"); - } - - if(name2 != null && name2.contains("'")) - { - name2 = name2.replaceAll("'", "''"); - } - - StringBuffer sql = new StringBuffer(); - - if(name != null && name.length() > 0) - { - name = name.toUpperCase(); - sql.append(" UPPER(name)='" + name + "'"); - } - - if(name2 != null && name2.length() > 0) - { - name2 = name2.toUpperCase(); - sql.append(" AND UPPER(name2)='" + name2 + "'"); - } - - if(isCustomer) - { - sql.append(" AND isCustomer='Y'"); - } - - if(isVendor) - { - sql.append(" AND isVendor='Y'"); - } - - if(isEmployee) - { - sql.append(" AND isEmployee='Y'"); - } - - if(isSalesRep) - { - sql.append(" AND isSalesRep='Y'"); - } - - sql.append(" AND AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " AND isActive='Y'"); - - int[] bpartnerIds = MBPartner.getAllIDs(MBPartner.Table_Name, sql.toString(), trxName); - - if(bpartnerIds.length != 0) - { - bpartner = new MBPartner(ctx, bpartnerIds[0], trxName); - } - - return bpartner; - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/DunningManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/DunningManager.java deleted file mode 100644 index 09fd777a10..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/DunningManager.java +++ /dev/null @@ -1,251 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Alok Pathak - */ - -package org.posterita.businesslogic.administration; - -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.Properties; - -import org.compiere.model.MDunning; -import org.compiere.model.MDunningLevel; -import org.compiere.model.MDunningRun; -import org.compiere.model.MPInstance; -import org.compiere.print.MPrintFormat; -import org.compiere.process.DunningPrint; -import org.compiere.process.DunningRunCreate; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.DunningBean; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.exceptions.OperationException; -import org.posterita.util.PoManager; - - -public class DunningManager -{ - private static final int DUNNING_CREATE_PROCESS_ID=289; - private static final int DUNNING_PRINT_PROCESS_ID=312; - - - public static MDunning createDunningAndLevel(Properties ctx,String dunningName,String desc,String dunningLevelName,String printText,String printNote,int daysAfterDue) throws OperationException - { - - MDunning dunning = new MDunning(ctx,0,null); - dunning.setIsDefault(true); - dunning.setSendDunningLetter(true); - dunning.setName(dunningName); - dunning.setDescription(desc); - - PoManager.save(dunning); - - MDunningLevel dunningLevel = new MDunningLevel(ctx,0,null); - dunningLevel.setC_Dunning_ID(dunning.get_ID()); - dunningLevel.setName(dunningLevelName); - dunningLevel.setDaysAfterDue(new BigDecimal(daysAfterDue)); - dunningLevel.setDaysBetweenDunning(0); - dunningLevel.setPrintName(printText); - dunningLevel.setNote(printNote); - - int [] allIds = MPrintFormat.getAllIDs(MPrintFormat.Table_Name,"AD_CLIENT_ID=0 and name='Dunning_Header ** TEMPLATE **'",null); - if(allIds.length==0) - throw new OperationException("no dunning print format for system"); - if(allIds.length > 1) - throw new OperationException("more than one dunning print format for system"); - dunningLevel.setDunning_PrintFormat_ID(allIds[0]); - - PoManager.save(dunningLevel); - return dunning; - } - - - - - public static void printDunningLetters(Properties ctx, DunningBean bean) throws OperationException - { - if(bean.getBpartnerIds()!=null && bean.getBpartnerIds().length>0) - { - for(int i=0;i importCustomer(Properties ctx, FormFile formFile,String trxName) throws BPartnerAlreadyExistException, OperationException, InvalidDateTimeException, Exception - { - ArrayList list=new ArrayList(); - - InputStream is = null; - BufferedInputStream bis = null; - BufferedReader reader = null; - - try - { - is = formFile.getInputStream(); - - bis = new BufferedInputStream(is); - - reader = new BufferedReader(new InputStreamReader(bis)); - - String s = null; - CustomerBean bean = null; - String accountNo = null; - String name = null; - String address1 = null; - String address2 = null; - String address3 = null; - String postalCode = null; - String strAddress1 = null; - String strAddress2 = null; - String contactName = null; - String phone = null; - String fax = null; - String paymentTerm = null; - String creditLimit = null; - String broughtForwardBalance = null; - String totalOwing = null; - String salesRep = null; - String priceList = null; - String taxNo = null; - String bank = null; - String branch = null; - String bankAccountNo = null; - String email = null; - String cell = null; - - String name2 = " "; // since name2 is compulsory in posterita - - int count = 0; - StringBuffer importCustomerExMsg = new StringBuffer(); - StringBuffer csv = new StringBuffer(); - boolean isCustomerImported = true; - - csv.append(reader.readLine()).append("\n"); - - while((s=reader.readLine()) != null && s.trim().length() > 0) - { - count ++; - - // set empty string for blank fields such that when doing st.nextToken(), empty string is returned rather than - // the next token which belongs to another field. - - while(s.contains(",,")) - { - s = s.replace(",,", ",\"\","); - } - - StringTokenizer st = new StringTokenizer(s,","); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - try - { - trx.start(); - accountNo = getElement(st); - name = getElement(st); - address1 = getElement(st); - address2 = getElement(st); - address3 = getElement(st); - postalCode = getElement(st); - strAddress1 = getElement(st); - strAddress2 = getElement(st); - - if(address3 == null || address3.length() == 0) - { - address3 = getElement(st); - - } - else - { - st.nextToken(); // skip empty string so that st.nextToken() gives contact name - } - - contactName = getElement(st); - phone = getElement(st); - fax = getElement(st); - paymentTerm = getElement(st); - creditLimit = getElement(st); - broughtForwardBalance = getElement(st); - totalOwing = getElement(st); - salesRep = getElement(st); - priceList = getElement(st); - taxNo = getElement(st); - bank = getElement(st); - branch = getElement(st); - bankAccountNo = getElement(st); - email = getElement(st); - cell = getElement(st); - - try - { - MBPartner customer = CustomerManager.getBPartner(ctx, name, name2, true, false, false, false, trxName); - - if(customer != null) - { - throw new BPartnerAlreadyExistException("Customer already exists!"); - } - - bean = new CustomerBean(); - - if(paymentTerm != null && paymentTerm.length() > 0) - { - String whereClause = " UPPER(name)='" + paymentTerm.toUpperCase() + "' AND AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " AND AD_Org_ID=" - + Env.getAD_Org_ID(ctx) + " AND isActive='Y'"; - - int[] paymentTermIds = MPaymentTerm.getAllIDs(MPaymentTerm.Table_Name, whereClause, trxName); - - if(paymentTermIds.length == 0) - { - throw new OperationException("Payment term " + paymentTerm + " not found!"); - } - else if(paymentTermIds.length > 1) - { - throw new OperationException("Duplicate payment term " + paymentTerm + " found. Payment Term should be unique."); - } - else - { - PaymentTermBean paymentTermBean = new PaymentTermBean(); - paymentTermBean = PaymentTermManager.getPaymentTerm(ctx, paymentTermIds[0]); - - bean.setPaymentTermName(paymentTermBean.getPaymentTermName()); - bean.setPaymentTermId(paymentTermBean.getPaymentTermId()); - } - - } - - if(creditLimit != null && creditLimit.length() > 0) - { - BigDecimal creditLmt = new BigDecimal(creditLimit); - bean.setCreditLimit(creditLmt); - } - - if(totalOwing != null && totalOwing.length() > 0 && broughtForwardBalance != null && broughtForwardBalance.length() > 0) - { - BigDecimal totalOwe = new BigDecimal(totalOwing); - BigDecimal BFBal = new BigDecimal(broughtForwardBalance); - - if(totalOwe != null && BFBal != null) - { - bean.setTotalOpenBalance(BFBal.subtract(totalOwe)); - } - else - { - bean.setTotalOpenBalance(Env.ZERO); - } - - } - - if(priceList != null && priceList.length() > 0) - { - String whereClause = " UPPER(name)='" + priceList.toUpperCase() + "' AND AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " AND AD_Org_ID=" + Env.getAD_Org_ID(ctx) - + " AND isSOPriceList='Y' AND isActive='Y'"; - - int[] priceListIds = MPriceList.getAllIDs(MPriceList.Table_Name, whereClause, trxName); - - if(priceListIds.length == 0) - { - throw new OperationException("Pricelist with name " + priceList + " not found."); - } - - else if(priceListIds.length > 1) - { - throw new OperationException("Duplicate pricelist with name " + priceList + " found. Pricelist name should be unique."); - } - else - { - MPriceList priceLst = new MPriceList(ctx, priceListIds[0], trxName); - bean.setPriceListId(priceListIds[0]); - bean.setPriceListName(priceLst.getName()); - } - - } - - if(salesRep != null && salesRep.length() > 0) - { - MBPartner rep = CustomerManager.getBPartner(ctx, salesRep, null, false, false, true, false, trxName); - - if(rep == null) - { - throw new BPartnerNotFoundException("Sales Rep with name " + salesRep + " not found!"); - } - - bean.setSaleRepName(rep.getName()); - bean.setSalesRepId(rep.getC_BPartner_ID()); - } - - bean.setCustIdNumber(accountNo); - bean.setAddress1(address1); - bean.setAddress2(address2); - bean.setCity(address3); - bean.setPostalCode(postalCode); - bean.setPostalAddress(strAddress1); - bean.setPostalAddress1(strAddress2); - bean.setPartnerName(name); - bean.setSurname(name2); - bean.setUsername(contactName); - bean.setEmail(email); - bean.setPhone(phone); - bean.setFax(fax); - bean.setMobile(cell); - bean.setIsActive(true); - bean.setOrgId(Env.getAD_Org_ID(ctx)); - bean.setBankName(bank); - bean.setBranch(branch); - bean.setAccountNo(bankAccountNo); - bean.setTaxNo(taxNo); - - CustomerManager.createSingleCustomerForImport(ctx,bean,trxName); - trx.commit(); - list.add(bean); - } - - catch(OperationException e) - { - trx.rollback(); - importCustomerExMsg.append("
Customer at line "+ count + " not imported. Cause: " + e.getMessage()); - isCustomerImported = false; - csv.append(s).append("\"\n"); - - } - - finally - { - trx.close(); - } - - } - catch (NoSuchElementException e) - { - trx.rollback(); - importCustomerExMsg.append("
Customer at line " + count + " not imported. Cause: Cannot pass data from file!"); - isCustomerImported = false; - csv.append(s).append("\"\n"); - } - - finally - { - trx.close(); - } - - }//while - - if (!isCustomerImported) - { - String filename = RandomStringGenerator.randomstring() + ".csv"; - String filepath = ReportManager.getReportPath(filename); - try - { - FileWriter writer = new FileWriter(filepath); - writer.write(csv.toString()); - writer.flush(); - writer.close(); - } - catch (IOException e1) - { - throw new OperationException(e1); - } - throw new CustomerNotImportedException(filename+importCustomerExMsg.toString()); - } - - } - - catch (FileNotFoundException e) - { - - e.printStackTrace(); - } - catch (IOException e) - { - - e.printStackTrace(); - } - - finally - { - if (is != null) - { - try - { - is.close(); - } - catch(Exception ex) - {} - } - - if (bis != null) - { - try - { - bis.close(); - } - catch(Exception ex) - {} - } - - if (reader != null) - { - try - { - reader.close(); - } - catch(Exception ex) - {} - } - } - return list; - } - - private static String getElement(StringTokenizer st) - { - String element = ""; - - if(st.hasMoreTokens()) - { - element = st.nextToken(); - element = element.replaceAll("\"", ""); - } - - return element; - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/PriceListManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/PriceListManager.java deleted file mode 100644 index ef13be684d..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/PriceListManager.java +++ /dev/null @@ -1,1107 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 19, 2005 by praveen - * - */ -package org.posterita.businesslogic.administration; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; -import java.util.TreeSet; - -import org.compiere.model.MColumn; -import org.compiere.model.MCurrency; -import org.compiere.model.MDiscountSchema; -import org.compiere.model.MOrg; -import org.compiere.model.MPInstance; -import org.compiere.model.MPriceList; -import org.compiere.model.MPriceListVersion; -import org.compiere.model.MProcess; -import org.compiere.model.MProcessPara; -import org.compiere.model.MProduct; -import org.compiere.model.MProductPrice; -import org.compiere.model.MTax; -import org.compiere.model.MTaxCategory; -import org.compiere.process.M_PriceList_Create; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.process.SvrProcess; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Trx; -import org.posterita.beans.AttributeValuesBean; -import org.posterita.beans.PriceListBean; -import org.posterita.beans.ProductBean; -import org.posterita.beans.ProductPriceBean; -import org.posterita.beans.SearchBean; -import org.posterita.beans.UDIPair; -import org.posterita.businesslogic.CurrencyManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.SearchManager; -import org.posterita.core.CheckDuplicateEntities; -import org.posterita.exceptions.MandatoryException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.PriceListAlreadyExistsException; -import org.posterita.exceptions.SystemException; -import org.posterita.exceptions.TerminalNotFoundException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - -public class PriceListManager -{ - public static ArrayList getProductPriceList(Properties ctx, int pricelistVersionId) throws OperationException - { - return getProductPriceList(ctx, pricelistVersionId, null, null, null); - } - - public static ArrayList getProductPriceList(Properties ctx, int pricelistVersionId, String searchText, Boolean isSelfService, String classification) throws OperationException - { - ArrayList productPriceList = new ArrayList(); - - int adClientId = Env.getAD_Client_ID(ctx); - int adOrgId = Env.getAD_Org_ID(ctx); - - String sql = "select distinct " + - " p.M_Product_ID," + - " p.name," + - " pp.pricelist," + - " pp.pricestd," + - " pl.name" + - " from M_product p, M_ProductPrice pp, M_PriceList pl, M_PriceList_Version plv" + - " where pp.M_product_id = p.M_product_id" + - " and pp.m_pricelist_version_id = plv.m_pricelist_version_id" + - " and plv.m_pricelist_id = pl.m_pricelist_id" + - " and p.AD_CLIENT_ID = " + adClientId + - " and p.ad_org_id = " + adOrgId + - " and pp.m_pricelist_version_id = " + pricelistVersionId + - " and p.isactive = 'Y' "; - - - if (isSelfService!= null && isSelfService) - sql = sql + " and p.isSelfService = 'Y' "; - if (isSelfService!= null && !isSelfService) - sql = sql + " and p.isSelfService = 'N' "; - - if (classification != null) - sql = sql + " and p.classification='" + classification + "' "; - - if(searchText != null && searchText.length() > 0) - { - SearchBean searchBean = SearchManager.getSearchParams(searchText); - ArrayList andSearchList = searchBean.getAndCriteriasList(); - Iterator andListIter = andSearchList.iterator(); - while(andListIter.hasNext()) - { - String andCriteria = andListIter.next(); - sql += " and ( Upper(p.name) like Upper('%" + andCriteria + "%') "; - sql += " or Upper(p.keyword) like Upper('%" + andCriteria + "%') "; - sql += " or Upper(p.keyword2) like Upper('%" + andCriteria + "%') "; - sql += " or Upper(p.keyword3) like Upper('%" + andCriteria + "%') "; - sql += " or Upper(p.keyword4) like Upper('%" + andCriteria + "%') ) "; - } - - ArrayList orSearchList = searchBean.getOrCriteriasList(); - Iterator orListIter = orSearchList.iterator(); - if(orListIter.hasNext()) - { - sql += " and ( "; - while(orListIter.hasNext()) - { - String orCriteria = orListIter.next(); - sql += " Upper(p.name) like Upper('%" + orCriteria + "%') "; - sql += " or Upper(p.keyword) like Upper('%" + orCriteria + "%') "; - sql += " or Upper(p.keyword2) like Upper('%" + orCriteria + "%') "; - sql += " or Upper(p.keyword3) like Upper('%" + orCriteria + "%') "; - sql += " or Upper(p.keyword4) like Upper('%" + orCriteria + "%') or"; - } - - sql = sql.substring(0, sql.length() - 3); - sql += " ) "; - } - } - - - sql += " Order by p.name"; - - PreparedStatement pstmt = null; - - try - { - pstmt = DB.prepareStatement(sql, null); - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - ProductPriceBean prodPriceBean = new ProductPriceBean(); - prodPriceBean.setProductId(Integer.valueOf(rs.getInt(1))); - prodPriceBean.setProductName(rs.getString(2)); - prodPriceBean.setPriceList(rs.getBigDecimal(3)); - prodPriceBean.setPriceStandard(rs.getBigDecimal(4)); - prodPriceBean.setPriceListName(rs.getString(5)); - prodPriceBean.setPriceListVersionId(Integer.valueOf(pricelistVersionId)); - productPriceList.add(prodPriceBean); - } - rs.close(); - - } - catch(SQLException ex) - { - throw new OperationException("Could not retrieve product price list with sql: " + sql, ex); - } - finally - { - try - { - pstmt.close(); - } - catch (Exception ex) - { - - } - - pstmt = null; - } - - return productPriceList; - } - - public static AttributeValuesBean getAttributeValues(ArrayList priceList) - { - AttributeValuesBean attrValues = new AttributeValuesBean(); - - TreeSet models = new TreeSet(); - TreeSet colour = new TreeSet(); - TreeSet trx = new TreeSet(); - TreeSet year = new TreeSet(); - - Iterator iter = priceList.iterator(); - UDIPair pair = null; - ProductPriceBean bean = null; - - - while(iter.hasNext()) - { - bean = (ProductPriceBean) iter.next(); - - pair = new UDIPair(bean.getAttrModel(),bean.getAttrModel()); - models.add(pair); - - pair = new UDIPair(bean.getAttrColour(),bean.getAttrColour()); - colour.add(pair); - - pair = new UDIPair(bean.getAttrTrx(),bean.getAttrTrx()); - trx.add(pair); - - pair = new UDIPair(bean.getAttrYear(),bean.getAttrYear()); - year.add(pair); - } - - ArrayList list = null; - - list = new ArrayList(); - - if(!models.isEmpty()) - list.addAll(models); - - attrValues.setModel(list); - - list = new ArrayList(); - - if(!colour.isEmpty()) - list.addAll(colour); - - attrValues.setColour(list); - - list = new ArrayList(); - - if(!trx.isEmpty()) - list.addAll(trx); - - attrValues.setTrx(list); - - list = new ArrayList(); - - if(!year.isEmpty()) - list.addAll(year); - - attrValues.setYears(list); - - return attrValues; - } - - public static void editProductPrices(Properties ctx, Integer[] productIds, int priceListVersionId, BigDecimal newPrice, String trxName) throws OperationException, SystemException - { - for (int i = 0; i < productIds.length; i++) - { - editProductPrice(ctx, productIds[i].intValue(), priceListVersionId, newPrice, trxName); - } - } - - public static void editProductPrice(Properties ctx, int productId, int priceListVersionId, BigDecimal newPrice, String trxName) throws OperationException, SystemException - { - int ad_client_id = Env.getAD_Client_ID(ctx); - int ad_org_id = Env.getAD_Org_ID(ctx); - int ad_user_id = Env.getAD_User_ID(ctx); - - BigDecimal priceList = newPrice; - BigDecimal priceStd = newPrice; - BigDecimal priceLimit = newPrice; - - String updateSql = "UPDATE M_PRODUCTPRICE set" + - " UPDATED = sysdate" + - ", UPDATEDBY = " + ad_user_id + - ", PRICELIST = " + priceList + - ", PRICESTD = " + priceStd + - ", PRICELIMIT = " + priceLimit + - ""; - - String whereClause = "" + - " where AD_CLIENT_ID =" + ad_client_id + - " and AD_ORG_ID =" + ad_org_id + - " and M_PRODUCT_ID =" + productId + - " and M_PRICELIST_VERSION_ID =" + priceListVersionId; - - String sqlStatement = updateSql + whereClause; - - System.out.println("Product Price update sql =====> " + sqlStatement); - - int i = DB.executeUpdate(sqlStatement, trxName); - - if(i<0) - { - throw new SystemException("Unable to update product price."); - } - } - - public static ProductPriceBean getProductPrice(Properties ctx, int productId, int priceListVersionId) throws SystemException - { - ProductPriceBean priceBean = null; - - int clientID = Env.getAD_Client_ID(ctx); - int orgID = Env.getAD_Org_ID(ctx); - - - StringBuffer sql = new StringBuffer("select " + - " v.M_product_id," + // 1.ProductID - " v.attr_model," + // 2.Model - " v.attr_colour," + // 3.Colour - " v.attr_trans," + // 4.Transmission - " v.attr_year," + // 5.Year - " pp.pricelist," + // 6.PriceList Price - " pp.pricestd," + // 7.Standard Price - " pl.name" + // 8.PriceList Name - " from U_VEHICLE_V v, M_product p, M_ProductPrice pp, M_PriceList pl, M_PriceList_Version plv" + - " where v.M_product_id = p.M_product_id" + - " and pp.M_product_id = p.M_product_id" + - " and pp.m_pricelist_version_id = plv.m_pricelist_version_id" + - " and plv.m_pricelist_id = pl.m_pricelist_id" + - " and p.AD_CLIENT_ID = " + clientID + - " and p.ad_org_id = " + orgID + - " and pp.m_pricelist_version_id = " + priceListVersionId + - " and v.M_product_id = " + productId + - ""); - - //System.out.println("Query for PriceListManager: " + sql); - - PreparedStatement pstmt = null; - - try - { - pstmt = DB.prepareStatement(sql.toString(),null); - ResultSet rs = pstmt.executeQuery(); - - if(rs.next()) - { - priceBean = new ProductPriceBean(); - - priceBean.setProductId(Integer.valueOf(rs.getInt(1))); - priceBean.setAttrModel(rs.getString(2)); - priceBean.setAttrColour(rs.getString(3)); - priceBean.setAttrTrx(rs.getString(4)); - priceBean.setAttrYear(rs.getString(5)); - priceBean.setPriceList(rs.getBigDecimal(6)); - priceBean.setPriceStandard(rs.getBigDecimal(7)); - priceBean.setPriceListName(rs.getString(8)); - priceBean.setPriceListVersionId(Integer.valueOf(priceListVersionId)); - - } - - rs.close(); - - } - catch (SQLException e) - { - throw new SystemException(e); - - } - finally - { - try - { - pstmt.close(); - } - catch (Exception ex) - { - - } - - pstmt = null; - } - - return priceBean; - } - - /** - * Retrieves the latest valid price list version id for this price list. - * @param ctx context - * @param priceListId id of the price list whose latest price list version id is to be returned - * @param trxName name of transaction if in transaction scope - * @return id of latest price list version or zero if none found - */ - public static int getPriceListVersionID(Properties ctx, int priceListId, String trxName) throws OperationException - { - return getPriceListVersionID(ctx, priceListId, null, trxName); - } - - - public static int getPriceListVersionID(Properties ctx, int priceListId, Timestamp date, String trxName) throws OperationException - { - MPriceList priceList = new MPriceList(ctx, priceListId, trxName); - MPriceListVersion priceListVersion = priceList.getPriceListVersion(date); - - if (priceListVersion == null) - { - throw new OperationException("No valid price list version present"); - } - - - return priceListVersion.get_ID(); - } - - public static String getCurrency(Properties ctx, int pricelistId) throws OperationException - { - MPriceList priceList = MPriceList.get(ctx, pricelistId, null); - - if (priceList == null) - throw new OperationException("Price list cannot be null!"); - - MCurrency mCurrency = new MCurrency(ctx, priceList.getC_Currency_ID(), null); - - return mCurrency.getCurSymbol(); - - } - - public static MPriceList createPriceList(Properties ctx, String name, int currencyId, int precision, - boolean isSOPriceList, String trxName) throws OperationException - { - MPriceList priceList = createOrUpdatePriceList(ctx, 0, name, true, true, true, true, isSOPriceList, false, - Env.getAD_Org_ID(ctx), currencyId, precision, trxName); - undefaultOtherPriceLists(ctx, priceList, trxName); - return priceList; - } - - private static MPriceList createOrUpdatePriceList(Properties ctx, int priceListId, String name, boolean isActive, - boolean isDefault, boolean isMandatory, boolean isPresentForProduct, boolean isSOPriceList, - boolean isTaxIncluded, int orgId, int currencyId, int precision, String trxName) throws OperationException - { - MPriceList priceList = new MPriceList(ctx, priceListId, trxName); - priceList.setName(name); - priceList.setIsActive(isActive); - priceList.setIsMandatory(isMandatory); - priceList.setisPresentForProduct(isPresentForProduct); - priceList.setAD_Org_ID(orgId); - priceList.setC_Currency_ID(currencyId); - priceList.setIsSOPriceList(isSOPriceList); - priceList.setPricePrecision(precision); - priceList.setIsDefault(isDefault); - priceList.setIsTaxIncluded(isTaxIncluded); - PoManager.save(priceList); - - return priceList; - } - - public static void createOrUpdatePriceList(Properties ctx, PriceListBean priceListBean, String trxName) throws OperationException, InstantiationException, IllegalAccessException - { - Integer priceListId = priceListBean.getPriceListId(); - String name = priceListBean.getName(); - Integer orgId = priceListBean.getOrgId(); - Boolean isSOPriceList = priceListBean.getIsSOPriceList(); - Boolean isMandatory = priceListBean.getIsMandatory(); - Boolean isDefault = priceListBean.getIsDefault(); - Boolean isPresentForProduct = priceListBean.getIsPresentForProduct(); - Boolean isActive = priceListBean.getIsActive(); - Integer basePriceListId = priceListBean.getBasePriceListId(); - Boolean isDeleteOldRecords = priceListBean.getIsDeleteOldRecords(); - Boolean isCreatePriceList = priceListBean.getIsCreatePriceList(); - Boolean isTaxIncluded = priceListBean.getIsTaxIncluded(); - priceListId = priceListId == null? 0:priceListId; - - if (name == null || "".equals(name)) - { - throw new OperationException("Price List Name is mandatory"); - } - - orgId = orgId == null? 0 : orgId; - - if (priceListId.equals(0)) // create new price list - check whether duplicate name - { - if (CheckDuplicateEntities.checkDuplicateName(ctx,name,"M_PriceList")) - { - throw new PriceListAlreadyExistsException("A price list with that name already exists"); - } - } - - MCurrency mCurrency = CurrencyManager.getCurrency(ctx); - int currencyId = mCurrency.getC_Currency_ID(); - int precision = mCurrency.getCostingPrecision(); - - - MPriceList priceList = createOrUpdatePriceList(ctx, priceListId, name, isActive, isDefault, - isMandatory, isPresentForProduct, isSOPriceList, isTaxIncluded, orgId, currencyId, precision, trxName); - setDefaultPriceList(ctx, priceList, isDefault, trxName); - MPriceListVersion plv = getPriceListVersion(ctx, priceList.getM_PriceList_ID(), null, trxName); - // - String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " and AD_Org_ID= 0"; - int discountSchemaIds[] = MDiscountSchema.getAllIDs(MDiscountSchema.Table_Name, whereClause, trxName); - if (discountSchemaIds == null || discountSchemaIds.length == 0) - { - throw new OperationException("No Discount schema defined"); - } - // - - if (plv == null) - { - plv = new MPriceListVersion(priceList); - plv.set_TrxName(trxName); - plv.setName(priceList.getName()+ " Version"); - plv.setM_DiscountSchema_ID(discountSchemaIds[0]); - if (basePriceListId != null && !basePriceListId.equals(0)) - { - MPriceListVersion basePlv = PriceListManager.getPriceListVersion(ctx, basePriceListId, null, trxName); - plv.setM_Pricelist_Version_Base_ID(basePlv.getM_PriceList_Version_ID()); - } - PoManager.save(plv); - } - if (isCreatePriceList) - { - if (basePriceListId != null && !basePriceListId.equals(0)) - { - SvrProcess priceListCreate = (SvrProcess)M_PriceList_Create.class.newInstance(); - - int columnId = MColumn.getColumn_ID(MPriceListVersion.Table_Name, MPriceListVersion.COLUMNNAME_ProcCreate); - MColumn column = MColumn.get(ctx, columnId); - int processId = column.getAD_Process_ID(); - MProcess process = MProcess.get(ctx, processId); - MPInstance pInstance = new MPInstance(process, 0); - pInstance.save(); - - MProcessPara[] params = process.getParameters(); - ProcessInfoParameter[] processParams = null; - for (MProcessPara para : params) - { - if ("DeleteOld".equals(para.getColumnName())) - { - String deleteOld = isDeleteOldRecords?"Y":"N"; - ProcessInfoParameter parameter = new ProcessInfoParameter(para.getColumnName(), deleteOld, null, null, null); - processParams = new ProcessInfoParameter[]{parameter}; - } - } - - ProcessInfo pi = new ProcessInfo(process.getName(), processId); - pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID()); - pi.setRecord_ID(plv.getM_PriceList_Version_ID()); - pi.setParameter(processParams); - - priceListCreate.startProcess(ctx, pi, Trx.get(trxName, false)); - } - } - - priceListBean.setPriceListId(priceList.getM_PriceList_ID()); - } - - public static void setDefaultPriceList(Properties ctx, MPriceList priceList, boolean isDefault, String trxName) throws OperationException - { - if (isDefault && priceList.isActive()) - { - // set this price list in terminal and set all other price lists as not default - priceList.setIsDefault(isDefault); - POSTerminalManager.setTerminalPriceListId(ctx, priceList.getM_PriceList_ID(), priceList.isSOPriceList(), trxName); - undefaultOtherPriceLists(ctx, priceList, trxName); - } - else // check whether this price list was set in terminal/web store before. Do not 'undefault' if that is the case - { - if (isPriceListOnTerminal(ctx, priceList)) - { - priceList.setIsDefault(true); - priceList.setIsActive(true); - } - else - { - priceList.setIsDefault(false); - } - } - priceList.save(trxName); - } - - private static boolean isPriceListOnTerminal(Properties ctx, MPriceList priceList) throws TerminalNotFoundException - { - int priceListId = priceList.getM_PriceList_ID(); - - int terminalPriceListId = POSTerminalManager.getPriceListId(ctx, priceList.isSOPriceList()); - - if (priceListId == terminalPriceListId) - { - return true; - } - else - { - return false; - } - } - - private static void undefaultOtherPriceLists(Properties ctx, MPriceList priceList, String trxName) throws OperationException - { - ArrayList list = new ArrayList(); - if (priceList.isSOPriceList()) - { - list = getPriceLists(ctx, 0, null, true, true, null, true, trxName); - } - else - { - list = getPriceLists(ctx, 0, null, true, true, null, false, trxName); - } - if (!list.isEmpty()) - { - Iterator iter = list.iterator(); - while (iter.hasNext()) - { - PriceListBean bean = iter.next(); - Integer id = bean.getPriceListId(); - if (id != null || id != 0) - { - MPriceList pl = MPriceList.get(ctx, id, trxName); - if (priceList.getM_PriceList_ID() != id) - { - pl.setIsDefault(false); - PoManager.save(pl); - } - } - } - } - } - - /** - * Loads a particular price list version for a price list as per valid from. - * - * @return price list version for a particular date - * @param ctx context - * @param priceListId id of price list whose version needs to be loaded - * @param validFrom valid from date - * @param trxName name of transaction if in transaction scope - * - */ - public static MPriceListVersion getPriceListVersion(Properties ctx, int priceListId, Timestamp validFrom, String trxName) - { - MPriceList priceList = new MPriceList(ctx, priceListId, trxName); - - return priceList.getPriceListVersion(validFrom); - } - - /** - * Retrieves all valid price lists for this product. - * @param ctx - * @param productId - * @param orgId - * @param trxName - * @return - * @throws OperationException - */ - public static ArrayList getProductPriceLists(Properties ctx, int productId, int orgId, String trxName) throws OperationException - { - Boolean isActive = true; - Boolean isDefault = null; - Boolean isPresentForProduct = true; - Boolean isSOPriceList = null; - - return getProductPriceLists(ctx, productId, orgId, isActive, isDefault, - isPresentForProduct, isSOPriceList, trxName); - } - - public static ArrayList getProductPriceLists(Properties ctx, int productId, int orgId, Boolean isActive, - Boolean isDefault, Boolean isPresentForProduct, Boolean isSOPriceList, String trxName) throws OperationException - { - MProduct product = MProduct.get(ctx, productId); - ArrayList list = getPriceLists(ctx, orgId, "", isActive, isDefault, - isPresentForProduct, isSOPriceList, trxName); - ArrayList productPriceList = new ArrayList(); - for (int i = 0; i< list.size(); i++) - { - PriceListBean priceListBean = list.get(i); - MPriceList pl = MPriceList.get(ctx, priceListBean.getPriceListId(), trxName); - MPriceListVersion plv = getPriceListVersion(ctx, priceListBean.getPriceListId(), null, trxName); - MProductPrice pp = MProductPrice.get(ctx, plv.getM_PriceList_Version_ID(), productId, trxName); - - BigDecimal stdPrice = Env.ZERO; - BigDecimal limitPrice = Env.ZERO; - BigDecimal listPrice = Env.ZERO; - BigDecimal stdPriceIncl = Env.ZERO; - BigDecimal limitPriceIncl = Env.ZERO; - BigDecimal listPriceIncl = Env.ZERO; - - if (pp != null) - { - stdPrice = pp.getPriceStd(); - limitPrice = pp.getPriceLimit(); - listPrice = pp.getPriceList(); - } - ProductBean productBean = new ProductBean(); - MOrg org = MOrg.get(ctx, plv.getAD_Org_ID()); - - productBean.setProductId(productId); - productBean.setPriceListName(priceListBean.getName()); - productBean.setIsSOPriceList(pl.isSOPriceList()); - productBean.setOrgId(org.get_ID()); - productBean.setOrgName(org.getName()); - productBean.setPriceListId(plv.getM_PriceList_ID()); - productBean.setPriceListVersionId(plv.getM_PriceList_Version_ID()); - productBean.setIsMandatory(pl.isMandatory()); - productBean.setIsActive(pl.isActive()); - productBean.setIsPresentForProduct(pl.isPresentForProduct()); - productBean.setIsDefault(pl.isDefault()); - productBean.setIsTaxIncluded(pl.isTaxIncluded()); - - if (!pl.isTaxIncluded()) - { - productBean.setStdPrice(stdPrice); - productBean.setLimitPrice(limitPrice); - productBean.setListPrice(listPrice); - - if (productId != 0) - { - MTaxCategory taxCategory = new MTaxCategory(ctx,product.getC_TaxCategory_ID(),trxName); - MTax tax = TaxManager.getTaxFromCategory(ctx, taxCategory.getC_TaxCategory_ID(), trxName); - - BigDecimal taxRate = tax.getRate().divide(Env.ONEHUNDRED); - - listPriceIncl = listPrice.multiply(taxRate).add(listPrice); - listPriceIncl = listPriceIncl.setScale(listPrice.scale(), RoundingMode.HALF_UP); - stdPriceIncl = stdPrice.multiply(taxRate).add(stdPrice); - stdPriceIncl = stdPriceIncl.setScale(stdPrice.scale(), RoundingMode.HALF_UP); - limitPriceIncl = limitPrice.multiply(taxRate).add(limitPrice); - limitPriceIncl = limitPriceIncl.setScale(limitPrice.scale(), RoundingMode.HALF_UP); - - productBean.setListPriceIncl(listPriceIncl); - productBean.setStdPriceIncl(stdPriceIncl); - productBean.setLimitPriceIncl(limitPriceIncl); - - } - else - { - productBean.setLimitPriceIncl(Env.ZERO); - productBean.setStdPriceIncl(Env.ZERO); - productBean.setListPriceIncl(Env.ZERO); - } - } - else - { - productBean.setStdPriceIncl(stdPrice); - productBean.setListPriceIncl(listPrice); - productBean.setLimitPriceIncl(limitPrice); - - if (productId != 0) - { - MTaxCategory taxCategory = new MTaxCategory(ctx,product.getC_TaxCategory_ID(),trxName); - MTax tax = TaxManager.getTaxFromCategory(ctx, taxCategory.getC_TaxCategory_ID(), trxName); - - BigDecimal taxRateFactor = (tax.getRate().divide(Env.ONEHUNDRED)).add(Env.ONE); - productBean.setStdPrice(stdPrice.divide(taxRateFactor, 2, RoundingMode.HALF_DOWN)); - productBean.setListPrice(listPrice.divide(taxRateFactor, 2, RoundingMode.HALF_DOWN)); - productBean.setLimitPrice(limitPrice.divide(taxRateFactor, 2, RoundingMode.HALF_DOWN)); - } - else - { - productBean.setLimitPrice(Env.ZERO); - productBean.setStdPrice(Env.ZERO); - productBean.setListPrice(Env.ZERO); - } - } - productPriceList.add(productBean); - } - - return productPriceList; - } - - - /** - * Retrieves all price lists under certain conditions - * @param ctx context - * @param isSOPriceList parameter to load sales/purchase price lists. Loads both if null. - * @param trxName name of transaction if in transaction scope - * @return an arraylist of PriceListBean (which is empty if no matching price lists are found). - */ - public static ArrayList getPriceLists(Properties ctx, int adOrgId, boolean isSOPriceList, String trxName) - { - return getPriceLists(ctx, adOrgId, null, Boolean.TRUE, null, null, isSOPriceList, trxName); - } - - /** - * Retrieves all price lists under certain conditions - * @param ctx context - * @param orgId id of the organisation (can be zero in case all orgs as per the role_org_access are to be queried). - * @param name name of the price list (case insensitive and matches any pricelist containing the specified string). Escaped if null. - * @param isActive parameter to load active or inactive price lists. Loads both if parameter is null. - * @param isDefault parameter to load that price list which is default. Typically only one price list can be default at a time. Escaped if null. - * @param isPresentForProduct parameter to load price lists which appear/do not appear on product screen. Loads both if parameter is null. - * @param isSOPriceList parameter to load sales/purchase price lists. Loads both if null. - * @param trxName name of transaction if in transaction scope - * @return an arraylist of PriceListBean (which is empty if no matching price lists are found). - */ - public static ArrayList getPriceLists(Properties ctx, int orgId, String name, - Boolean isActive, Boolean isDefault, Boolean isPresentForProduct, Boolean isSOPriceList, String trxName) - { - StringBuffer whereClause = new StringBuffer(); - - whereClause.append("AD_Client_ID = "+ Env.getAD_Client_ID(ctx)); - - if (orgId == 0) - { - whereClause.append(" AND AD_Org_ID IN (0, " + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+ ")"); - } - else - { - whereClause.append(" AND AD_Org_ID IN ("+ orgId+")"); - } - - if (name!= null && !name.equals("")) - { - whereClause.append(" AND UPPER(name) LIKE UPPER('%"+name+"%')"); - } - - if (isActive !=null) - { - String is_Active = isActive?"'Y'":"'N'"; - whereClause.append(" AND isActive = " + is_Active); - } - - if (isDefault != null) - { - String is_Default = isDefault?"'Y'":"'N'"; - whereClause.append(" AND isDefault = " + is_Default); - } - - if (isPresentForProduct !=null) - { - String is_PresentForProduct = isPresentForProduct?"'Y'":"'N'"; - whereClause.append(" AND isPresentForProduct = " + is_PresentForProduct); - } - - if (isSOPriceList!=null) - { - String is_SOPriceList = isSOPriceList?"'Y'":"'N'"; - whereClause.append(" AND isSOPriceList = " + is_SOPriceList); - } - int[] priceListIds = MPriceList.getAllIDs(MPriceList.Table_Name, whereClause.toString(), trxName); - - ArrayList list = new ArrayList(); - - if (priceListIds == null || priceListIds.length == 0) - { - return list; - } - - for (int id : priceListIds) - { - MPriceList priceList = new MPriceList(ctx, id, trxName); - MOrg org = MOrg.get(ctx, priceList.getAD_Org_ID()); - - PriceListBean bean = new PriceListBean(); - bean.setName(priceList.getName()); - bean.setIsMandatory(priceList.isMandatory()); - bean.setIsDefault(priceList.isDefault()); - bean.setIsPresentForProduct(priceList.isPresentForProduct()); - bean.setPriceListId(priceList.getM_PriceList_ID()); - bean.setOrgName(org.getName()); - bean.setOrgId(priceList.getAD_Org_ID()); - bean.setIsActive(priceList.isActive()); - bean.setIsSOPriceList(priceList.isSOPriceList()); - list.add(bean); - } - - return list; - } - - - public static PriceListBean getPriceList(Properties ctx, - Integer priceListId, String trxName) - { - MPriceList priceList = MPriceList.get(ctx, priceListId, trxName); - MOrg org = MOrg.get(ctx, priceList.getAD_Org_ID()); - - PriceListBean bean = new PriceListBean(); - bean.setName(priceList.getName()); - bean.setIsMandatory(priceList.isMandatory()); - bean.setIsDefault(priceList.isDefault()); - bean.setIsPresentForProduct(priceList.isPresentForProduct()); - bean.setPriceListId(priceList.getM_PriceList_ID()); - bean.setOrgName(org.getName()); - bean.setOrgId(priceList.getAD_Org_ID()); - bean.setIsActive(priceList.isActive()); - bean.setIsSOPriceList(priceList.isSOPriceList()); - bean.setIsTaxIncluded(priceList.isTaxIncluded()); - return bean; - } - - /** - * Updates product price. - * The product and price list are obtained from the product bean. The latest price list version is used. - * @param ctx context - * @param productBean product bean - * @param trxName name of transaction if in transaction scope - * @throws OperationException Exception thrown if price list is mandatory but no prices entered for product. - */ - public static void updatePriceLists(Properties ctx, ProductBean productBean, - String trxName) throws OperationException - { - ArrayList list = productBean.getProductBeanList(); - - if (list!=null) - { - int productId = productBean.getProductId(); - Iterator iter = list.iterator(); - while (iter.hasNext()) - { - ProductBean bean = iter.next(); - - int priceListId = bean.getPriceListId(); - - BigDecimal stdPrice = bean.getStdPrice(); - BigDecimal listPrice = bean.getListPrice(); - BigDecimal limitPrice = bean.getLimitPrice(); - - MPriceList priceList = MPriceList.get(ctx, priceListId, trxName); - - if (priceList.isTaxIncluded()) - { - stdPrice = bean.getStdPriceIncl(); - listPrice = bean.getListPriceIncl(); - limitPrice = bean.getLimitPriceIncl(); - } - updatePriceLists(ctx, productId, priceListId, stdPrice, listPrice, limitPrice, trxName); - } - } - } - - public static void updatePriceLists(Properties ctx, int productId, int priceListId, - BigDecimal stdPrice, BigDecimal listPrice, BigDecimal limitPrice, - String trxName) throws OperationException - { - MPriceList priceList = MPriceList.get(ctx, priceListId, trxName); - - double price_Std = stdPrice == null? 0f: stdPrice.doubleValue(); - double price_List = listPrice == null? 0f:listPrice.doubleValue(); - double price_Limit = limitPrice == null? 0f: limitPrice.doubleValue(); - - int priceListVersionId = getPriceListVersionID(ctx, priceListId, trxName); - MProductPrice productPrice = MProductPrice.get(ctx, priceListVersionId, productId, trxName); - - if (productPrice == null) - { - productPrice = new MProductPrice(ctx, priceListVersionId, productId, trxName); - } - if (priceList.isMandatory()) - { - StringBuffer ex = new StringBuffer(priceList.getName() + " is mandatory"); - int length = ex.length(); - - if (price_Std == 0f) - { - ex.append(", standard price"); - } - if (priceList.isSOPriceList()) - { - if (price_List == 0f) - { - ex.append(", list price"); - } - if (price_Limit == 0f) - { - ex.append(", limit price"); - } - } - if (ex.length() > length) - { - throw new MandatoryException(ex.toString() + " cannot be zero"); - } - } - - if (priceList.isSOPriceList()) - { - productPrice.setPriceLimit(limitPrice); - productPrice.setPriceList(listPrice); - productPrice.setPriceStd(stdPrice); - } - else - { - productPrice.setPriceStd(stdPrice); - productPrice.setPriceLimit(stdPrice); - productPrice.setPriceList(stdPrice); - } - - PoManager.save(productPrice); - } - - /** - * Constructs and returns an Arraylist of Key-Name pair for price lists. - * @param ctx context - * @param priceLists arraylist of pricelists (each price list bean will have its id and name mapped) - * @return arraylist of KeyNamePair - */ - public static ArrayList getKeyNamePair(Properties ctx, - ArrayList priceLists) - { - ArrayList knp = new ArrayList(); - knp.add(new KeyNamePair(0,"")); - if (priceLists != null) - { - - Iterator iter = priceLists.iterator(); - while (iter.hasNext()) - { - PriceListBean bean = iter.next(); - - KeyNamePair keyNamePair = new KeyNamePair(bean.getPriceListId(), bean.getName()); - knp.add(keyNamePair); - } - } - return knp; - } - - public static PriceListBean getPriceListBean(Properties ctx, - ArrayList list, Integer priceListId, Boolean isNext) throws OperationException - { - int index = -1; - - if (priceListId == null || priceListId == 0) - { - PriceListBean priceListBean = new PriceListBean(); - priceListBean.setPriceListId(0); - priceListBean.setOrgId(0); - return priceListBean; - } - else - { - if (list != null) - { - Iterator iter = list.iterator(); - - while (iter.hasNext()) - { - PriceListBean currBean = iter.next(); - if (currBean.getPriceListId().equals(priceListId)) - { - index = list.indexOf(currBean); - } - } - if (index != -1) - { - if (isNext!=null) - { - if (isNext) - { - int nextIndex = (index + 1)%list.size(); - index = nextIndex; - } - else - { - int previousIndex = (index-1)%list.size(); - if (previousIndex < 0) - { - previousIndex += list.size(); - } - index = previousIndex; - } - } - return getPriceList(ctx, list.get(index).getPriceListId(), null); - } - else - { - throw new OperationException("no pricelist not found in search list"); - } - } - else - { - return getPriceList(ctx, priceListId, null); - } - } - } - - /** - * Load Price Lists as HTML with Select Tag - * @param ctx - * @param bean - * @return - */ - public static String loadPriceListAsHTMLSelect(Properties ctx, ArrayList bean) - { - StringBuffer selectHTML = new StringBuffer(); - - int m_pricelist_id = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - - selectHTML.append(""); - - return selectHTML.toString(); - } - - - public static Integer getDefaultPriceListId(Properties ctx, boolean isSOTrx) throws OperationException - { - return POSTerminalManager.getPriceListId(ctx, isSOTrx); - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductAttributeManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductAttributeManager.java deleted file mode 100644 index 02f0830d45..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductAttributeManager.java +++ /dev/null @@ -1,193 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 28, 2005 by praveen - * - */ -package org.posterita.businesslogic.administration; - -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MAttribute; -import org.compiere.model.MAttributeSet; -import org.compiere.model.MAttributeUse; -import org.compiere.model.MAttributeValue; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.posterita.beans.AttributeValueDetailBean; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductInStockException; -import org.posterita.exceptions.SystemException; -import org.posterita.util.PoManager; - - -public class ProductAttributeManager -{ - public static ArrayList getProductAttributes(Properties ctx, int attributeSetId) throws OperationException, SystemException - { - MAttributeSet attributeSet = new MAttributeSet(ctx, attributeSetId, null); - - MAttribute[] attributes = attributeSet.getMAttributes(false); - - KeyNamePair pair; - ArrayList list = new ArrayList(); - for (int i = 0; i< attributes.length; i++) - { - pair = new KeyNamePair(attributes[i].get_ID(), attributes[i].getName()); - list.add(pair); - - } - - return list; - } - - public static ArrayList getProductAttributeValues(Properties ctx, int attributeId, int productCategoryId) - { - MAttribute attribute = new MAttribute(ctx, attributeId, null); - MAttributeValue attributeValue[] = attribute.getMAttributeValues(); - - int[] attributeValueIds = MAttributeValue.getAllIDs(MAttributeValue.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and m_attribute_id=" + attributeId + " and m_product_category_id=" + productCategoryId+" and isActive='Y' order by name", null); - - ArrayList attributeValues = new ArrayList(); - - if (attributeValue == null) - return attributeValues; - - MAttributeValue value; - for(int i=0;i getProductAttributeValuesDescription(Properties ctx, int attributeId, int productCategoryId, boolean showActiveOnly) - { - MAttribute attribute = new MAttribute(ctx, attributeId, null); - MAttributeValue attributeValue[] = attribute.getMAttributeValues(); - - String isActiveSQL = " "; - - if(showActiveOnly) - { - isActiveSQL = " and isActive = 'Y' "; - } - - int[] attributeValueIds = MAttributeValue.getAllIDs(MAttributeValue.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and m_attribute_id=" + attributeId + " and m_product_category_id=" + productCategoryId+ isActiveSQL +" order by name", null); - - ArrayList attributeValues = new ArrayList(); - - if (attributeValue == null) - return attributeValues; - - MAttributeValue value; - for(int i=0;i 0) - { - throw new ProductInStockException("Unable to perform action. There are some products that use the attribute value."); - } - - MAttributeValue attrValue = new MAttributeValue(ctx,attributeValueId,trxName); - - if(attrValue.isActive()) - { - attrValue.setIsActive(false); - } - else - { - attrValue.setIsActive(true); - } - - PoManager.save(attrValue); - - } - - public static MAttribute createAttribute(Properties ctx, String name) throws OperationException - { - MAttribute attribute = new MAttribute(ctx, 0, null); - attribute.setName(name); - attribute.setAttributeValueType(MAttribute.ATTRIBUTEVALUETYPE_List); - attribute.setIsMandatory(true); - PoManager.save(attribute); - return attribute; - - } - - /*public static void createAttributeUse(Properties ctx, MAttributeSet attributeSet, String attributeKey) throws OperationException - { - MAttribute attribute = ( MAttribute) GenericProductAttributeFactory.getFactoryInstance().get(ctx, attributeKey); - - int attributeUseIds[] = MAttributeUse.getAllIDs(MAttributeUse.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and m_attribute_id=" + attribute.get_ID() + " and m_attributeSet_id=" + attributeSet.get_ID(), null); - - if (attributeUseIds.length!=0) - return; - - MAttributeUse attributeUse = new MAttributeUse(ctx, 0 , null); - attributeUse.setM_AttributeSet_ID(attributeSet.get_ID()); - attributeUse.setM_Attribute_ID(attribute.get_ID()); - attributeUse.setSeqNo(10); - PoManager.save(attributeUse); - - }*/ - - public static void createAttributeUse(Properties ctx, MAttributeSet attributeSet, MAttribute attribute) throws OperationException - { - int attributeUseIds[] = MAttributeUse.getAllIDs(MAttributeUse.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and m_attribute_id=" + attribute.get_ID() + " and m_attributeSet_id=" + attributeSet.get_ID(), null); - - if (attributeUseIds.length!=0) - return; - - MAttributeUse attributeUse = new MAttributeUse(ctx, 0 , null); - attributeUse.setM_AttributeSet_ID(attributeSet.get_ID()); - attributeUse.setM_Attribute_ID(attribute.get_ID()); - attributeUse.setSeqNo(10); - PoManager.save(attributeUse); - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductImageManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductImageManager.java deleted file mode 100644 index 135844866c..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductImageManager.java +++ /dev/null @@ -1,484 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on Apr 25, 2006 by praveen - * - */ - -package org.posterita.businesslogic.administration; - -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.font.FontRenderContext; -import java.awt.geom.Rectangle2D; -import java.awt.image.BufferedImage; -import java.io.BufferedInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Calendar; -import java.util.Iterator; -import java.util.Properties; - -import javax.imageio.IIOImage; -import javax.imageio.ImageIO; -import javax.imageio.ImageWriteParam; -import javax.imageio.ImageWriter; -import javax.imageio.stream.MemoryCacheImageOutputStream; -import javax.swing.ImageIcon; - -import org.compiere.model.MAttachment; -import org.compiere.model.MProduct; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Trx; - -import org.posterita.businesslogic.ProductImageUploader; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.OperationException; -import org.posterita.util.PathInfo; - - -public class ProductImageManager -{ - private static transient byte[] backgroundImageData = null; - public static final String backImageFileName = "/images/pos/ImageBack.jpg"; - - public static byte[] getBackImageData() throws OperationException - { - if(backgroundImageData != null) - return backgroundImageData; - - try - { - String homePath = PathInfo.PROJECT_HOME; - File imgFile = new File(homePath + backImageFileName); - FileInputStream fileInStream = new FileInputStream(imgFile); - ByteArrayOutputStream byteArrStream = new ByteArrayOutputStream(); - BufferedInputStream bufferedInStream = new BufferedInputStream(fileInStream); - byte data[] = new byte[1024]; - int read = 0; - while((read = bufferedInStream.read(data)) != -1) - { - byteArrStream.write(data, 0, read); - } - byteArrStream.flush(); - backgroundImageData = byteArrStream.toByteArray(); - bufferedInStream.close(); - byteArrStream.close(); - fileInStream.close(); - return backgroundImageData; - } - catch(IOException ex) - { - throw new OperationException("Could not read backgroud image", ex); - } - } - - - /** - * Adds a border round the given image - * @param ctx - * @param m_product_id - * @param borderWidth - the border width - * @return a new Image - * @throws OperationException - */ - public static byte[] addImageBorder(Properties ctx,int m_product_id,byte[] imageData,double borderWidth, String trxName) throws OperationException - { - String sql = "select " + - " ATTR_MODEL," + //1.model - " ATTR_COLOUR," + //2.colour - " ATTR_DESIGN," + //3.design - " ATTR_SIZE" + //4.size - " from U_TShirt_V where M_Product_ID =" + m_product_id; - - PreparedStatement pstmt = null; - ResultSet rs = null; - - String design = null; - - try - { - pstmt = DB.prepareStatement(sql,trxName); - rs = pstmt.executeQuery(); - - if(rs.next()) - { - design = rs.getString(3); - } - else - { - throw new OperationException("Unable to get product's attributes!"); - } - - //------------------------------------------------------------------------------------------- - - Color borderColor = Color.DARK_GRAY; - - char copyrightSign = 169; - - String copyright_notice = copyrightSign + " " + Calendar.getInstance().get(Calendar.YEAR) + " Tamak"; - - Image image = new ImageIcon(imageData).getImage(); - - int width = image.getWidth(null); - int height = image.getHeight(null); - - double frameWidth = (double)width + 2*borderWidth; - double frameHeight = (double)height + borderWidth; - - Rectangle2D nameRect = new Rectangle2D.Double(0.0,frameHeight,frameWidth,80); - - BufferedImage bufferedImage = new BufferedImage((int)frameWidth,(int)(frameHeight + nameRect.getHeight()),BufferedImage.TYPE_USHORT_565_RGB); - Graphics2D g = (Graphics2D) bufferedImage.getGraphics(); - - g.drawImage(image,(int)borderWidth,(int)borderWidth,null); - - Rectangle2D topBorder = new Rectangle2D.Double(0.0,0.0,frameWidth,borderWidth); - //Rectangle2D bottomBorder = new Rectangle2D.Double(0.0,frameHeight-borderWidth,frameWidth,borderWidth); - Rectangle2D leftBorder = new Rectangle2D.Double(0.0,0.0,borderWidth,frameWidth); - Rectangle2D rightBorder = new Rectangle2D.Double(frameWidth-borderWidth,0.0,borderWidth,frameWidth); - - g.setColor(borderColor); - - g.fill(topBorder); - //g.fill(bottomBorder); - g.fill(leftBorder); - g.fill(rightBorder); - - - g.fill(nameRect); - g.setColor(Color.LIGHT_GRAY); - - //drawing smaill squares - double rXcoor = nameRect.getMinX(); - double rYcoor = nameRect.getMinY(); - - double h = nameRect.getHeight() - 2*borderWidth; - double w = h * 1.5; - - - - Rectangle2D rLeft = new Rectangle2D.Double(rXcoor + borderWidth, rYcoor + borderWidth, w,h); - g.fill(rLeft); - - Rectangle2D rRight = new Rectangle2D.Double(nameRect.getMaxX() - w - borderWidth, rYcoor + borderWidth, w,h); - g.fill(rRight); - - w = (rRight.getMinX() - borderWidth) - (rLeft.getMaxX() + borderWidth); - Rectangle2D rCenter = new Rectangle2D.Double(rLeft.getMaxX() + borderWidth, rYcoor + borderWidth, w, h); - g.fill(rCenter); - - - Font font = new Font("Arial", Font.PLAIN, 22); - g.setFont(font); - g.setColor(Color.WHITE); - - FontRenderContext fc = g.getFontRenderContext(); - Rectangle2D bounds = font.getStringBounds(design,fc); - - g.setFont(font); - g.drawString(design,(float)(rCenter.getMinX() + borderWidth),(float)(rCenter.getMinY() + borderWidth + bounds.getHeight())); - - //put copyright notice - g.setColor(Color.BLACK); - g.setFont(new Font("Arial", Font.PLAIN, 10)); - g.drawString(copyright_notice, (float)(2*borderWidth), (float)(frameHeight-borderWidth)); - - //get a writer and set compression - Iterator iter = ImageIO.getImageWritersByFormatName("JPG"); - - if(iter.hasNext()) - { - ImageWriter writer = (ImageWriter) iter.next(); - ImageWriteParam iwp = writer.getDefaultWriteParam(); - iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); - iwp.setCompressionQuality(0.75f); - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - MemoryCacheImageOutputStream mos = new MemoryCacheImageOutputStream(bos); - - writer.setOutput(mos); - - - - IIOImage iIOimage = new IIOImage(bufferedImage,null,null); - writer.write(null,iIOimage,iwp); - - byte retData[] = bos.toByteArray(); - mos.close(); - bos.close(); - return retData; - } - - rs.close(); - - } - catch (Exception e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - pstmt = null; - } - - return null; - } - - /** - * Removes the image's background - * @param img - * @param offset - range of color - * @return - */ - - public static Image removeBgColor(Image img, int offset) - { - return null; - } - - /** - * Clips the given image - * @param imageData - * @param width - * @param height - * @return - * @throws IOException - */ - public static byte[] clipImage(byte[] imageData,int width,int height) throws IOException - { - Image image = new ImageIcon(imageData).getImage(); - - BufferedImage bufferedImage = new BufferedImage(image.getWidth(null),image.getHeight(null),BufferedImage.TYPE_INT_RGB); - - Graphics graphics = bufferedImage.getGraphics(); - graphics.drawImage(image,0,0,null); - - int actualWidth = image.getWidth(null); - int actualHeight = image.getHeight(null); - - width = (actualWidth < width) ? actualWidth : width; - height = (actualHeight < height) ? actualHeight : height; - - //int x = 0, y = 250, w = 400, h = 380; - - // Clip the central part of the image - int x = (actualWidth - width)/2; - int y = (actualHeight - height)/2; - - bufferedImage = bufferedImage.getSubimage(x,y,width,height); - - //get a writer and set compression - Iterator iter = ImageIO.getImageWritersByFormatName("JPG"); - - if(iter.hasNext()) - { - ImageWriter writer = (ImageWriter) iter.next(); - ImageWriteParam iwp = writer.getDefaultWriteParam(); - iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); - iwp.setCompressionQuality(0.75f); - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - MemoryCacheImageOutputStream mos = new MemoryCacheImageOutputStream(bos); - - writer.setOutput(mos); - - IIOImage iIOimage = new IIOImage(bufferedImage,null,null); - writer.write(null,iIOimage,iwp); - - return bos.toByteArray(); - } - - return null; - - } - - - public static byte[] addImageSquareBorder(Properties ctx, byte[] imageData,double borderWidth, String trxName) throws OperationException - { - - - char copyrightSign = 169; - String copyright_notice = copyrightSign + " " + Calendar.getInstance().get(Calendar.YEAR) + " Tamak"; - - Image image = new ImageIcon(imageData).getImage(); - Image backImage = new ImageIcon(getBackImageData()).getImage(); - - - int width = image.getWidth(null); - int height = image.getHeight(null); - - int frameWidth = backImage.getWidth(null); - int frameHeight = backImage.getHeight(null); - - - BufferedImage bufferedImage = new BufferedImage((int)frameWidth,(int)(frameHeight),BufferedImage.TYPE_USHORT_565_RGB); - Graphics2D g = (Graphics2D) bufferedImage.getGraphics(); - - // Draw back image - g.drawImage(backImage, 0, 0, null); - - - // Draw Image in the center of the background - double imagePosX = (frameWidth - (double)width)/2; - double imagePosY = (frameHeight - (double)height)/2; - g.drawImage(image, (int)imagePosX, (int)imagePosY, null); - - // Put Copyright Notice - g.setColor(Color.BLACK); - g.setFont(new Font("Arial", Font.PLAIN, 10)); - g.drawString(copyright_notice, 10.0F, (float)(frameHeight - 5)); - - //get a writer and set compression - Iterator iter = ImageIO.getImageWritersByFormatName("JPG"); - - if(iter.hasNext()) - { - ImageWriter writer = (ImageWriter) iter.next(); - ImageWriteParam iwp = writer.getDefaultWriteParam(); - iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); - iwp.setCompressionQuality(0.75f); - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - MemoryCacheImageOutputStream mos = new MemoryCacheImageOutputStream(bos); - - writer.setOutput(mos); - - try - { - IIOImage iIOimage = new IIOImage(bufferedImage,null,null); - writer.write(null,iIOimage,iwp); - - byte retData[] = bos.toByteArray(); - mos.close(); - bos.close(); - return retData; - } - catch(IOException ex) - { - throw new OperationException("Could not write image", ex); - } - } - - throw new OperationException("JPG Image format is not supported!!!"); - - } - - public static void reprocessAllProductImages(Properties ctx) throws OperationException - { - int adClientID = Env.getAD_Client_ID(ctx); - - String sqlStmt = "Select M_Product_ID from M_Product where AD_Client_ID=" + adClientID - + " and AD_Org_ID=" + Env.getAD_Org_ID(ctx); - - PreparedStatement pstmt = null; - - try - { - pstmt = DB.prepareStatement(sqlStmt, null); - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - int productId = rs.getInt(1); -// System.out.println(productId); - reprocessImage(ctx, productId); - } - - rs.close(); - } - catch(SQLException ex) - { - throw new OperationException("Could not execute query for products: " + sqlStmt, ex); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - } - - public static void reprocessImages(Properties ctx, int productIds[], String trxName) throws OperationException - { - for(int i = 0; i < productIds.length; i++) - { - reprocessImage(ctx, productIds[i]); - } - } - - public static void reprocessImages(Properties ctx, Integer productIds[]) throws OperationException - { - for(int i = 0; i < productIds.length; i++) - { - reprocessImage(ctx, productIds[i].intValue()); - } - } - - public static void reprocessImage(Properties ctx, int productId) - { - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - - try - { - trx.start(); - ProductImageUploader.generateAllSubImages(ctx, productId, trx.getTrxName()); - trx.commit(); - } - catch(OperationException ex) - { - trx.rollback(); - } - finally - { - trx.close(); - } - } - - public static void clearImages(Properties ctx, int product_id, String trxName) - { - MAttachment attachment = MAttachment.get(ctx,MProduct.Table_ID,product_id); - if(attachment != null) - { - attachment.delete(true); - } - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductManager.java deleted file mode 100644 index 9944cda1f1..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/ProductManager.java +++ /dev/null @@ -1,1056 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 19, 2005 by alok - * - */ -package org.posterita.businesslogic.administration; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Properties; -import java.util.StringTokenizer; - -import org.compiere.model.MAttachment; -import org.compiere.model.MAttachmentEntry; -import org.compiere.model.MAttributeValue; -import org.compiere.model.MPriceList; -import org.compiere.model.MProduct; -import org.compiere.model.MProductPrice; -import org.compiere.model.MRevenueRecognition; -import org.compiere.model.MSequence; -import org.compiere.model.MTax; -import org.compiere.model.MTaxCategory; -import org.compiere.model.MUOM; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.ProductBean; -import org.posterita.beans.ProductDetailsBean; -import org.posterita.beans.ProductImageBean; -import org.posterita.beans.ProductImageInfo; -import org.posterita.beans.ProductQuery; -import org.posterita.beans.ProductStatusBean; -import org.posterita.beans.SearchBean; -import org.posterita.businesslogic.POSProductManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.SearchManager; -import org.posterita.businesslogic.StoreManager; -import org.posterita.businesslogic.core.AttachmentManager; -import org.posterita.businesslogic.product.GenericProductImpl; -import org.posterita.businesslogic.product.IProduct; -import org.posterita.exceptions.AttachmentNotFoundException; -import org.posterita.exceptions.BarcodeAlreadyExistsException; -import org.posterita.exceptions.CannotInactivateProductException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.exceptions.SystemException; -import org.posterita.lib.UdiConstants; -import org.posterita.model.MMAttachment; -import org.posterita.util.PoManager; - -public class ProductManager -{ - public static final String PRODUCT_ATTRIBUTES_DELIMETER = "~"; - - private static IProduct getProductInterface(Properties ctx, int productId, String trxName) throws OperationException - { - return new GenericProductImpl(); - } - - public static int getSimilarProduct(Properties ctx, String productName, String trxName) - { - productName=productName.replaceAll("'","''"); - String whereClause = "AD_Client_id="+Env.getAD_Client_ID(ctx)+ - " and Upper(name) =Upper('"+productName + "')"; - - int productIds[] = MProduct.getAllIDs(MProduct.Table_Name, whereClause, trxName); - - if(productIds.length == 0) - return 0; - else - return productIds[0]; - } - - public static boolean isBarCodePresent(Properties ctx,String barCode, String trxName) - { - String whereClause = "AD_Client_id="+Env.getAD_Client_ID(ctx)+ - " and UPC ='"+barCode + "'"; - - int productIds[] = MProduct.getAllIDs(MProduct.Table_Name, whereClause, trxName); - - if(productIds.length == 0) - return false; - else - return true; - } - public static int getUOMPrecision(Properties ctx, Integer productId) - { - MProduct product = MProduct.get(ctx, productId); - int uomId = product.getC_UOM_ID(); - int precision = MUOM.getPrecision(ctx, uomId); - - return precision; - } - - - public static String getAttributeSearchSQL(Properties ctx, ProductQuery query) throws OperationException - { - int[] attributeValues = query.getAttributeValueIds(); - - String attributeSearchSQL = ""; - - MAttributeValue attributeValue; - for (int i = 0; i < attributeValues.length; i++) - { - if (attributeValues[i]!= 0) - { - attributeValue = new MAttributeValue(ctx, attributeValues[i], null ); - attributeSearchSQL = attributeSearchSQL + generateAttributeSearchSQL(ctx, attributeValue.getM_Attribute_ID(), attributeValue.getM_AttributeValue_ID()); - } - } - - return attributeSearchSQL; - } - - private static String generateAttributeSearchSQL(Properties ctx, int attributeId, int attributeValueId) throws OperationException - { - - String sql = " AND p.M_AttributeSetInstance_ID IN" + - " (SELECT M_AttributeSetInstance_ID FROM M_AttributeInstance WHERE M_Attribute_ID=@M_ATTRIBUTE_ID@ AND M_AttributeValue_ID=@M_ATTRIBUTEVALUE_ID@ and AD_CLIENT_ID = " + Env.getAD_Client_ID(ctx) + " and AD_ORG_ID = " + Env.getAD_Org_ID(ctx) + " )"; - - sql = sql.replaceAll("@M_ATTRIBUTE_ID@", "" + attributeId); - sql = sql.replaceAll("@M_ATTRIBUTEVALUE_ID@", "" + attributeValueId); - - return sql; - } - - public static void sortProducts(Properties ctx, ArrayList products) - { - Comparator productNameComparator = new Comparator() - { - public int compare(ProductBean o1, ProductBean o2) - { - ProductBean bean1 = (ProductBean) o1; - ProductBean bean2 = (ProductBean) o2; - - if (bean1.getProductName() == null) - return -1; - - if (bean2.getProductName() == null) - return -1; - - return (bean1.getProductName().compareToIgnoreCase(bean2.getProductName())); - - } - }; - Collections.sort(products, productNameComparator); - } - - public static BigDecimal getStdPrice(Properties ctx, int priceListVersionId, int productId, boolean isSales, String trxName) throws OperationException - { - - MProductPrice pp = MProductPrice.get(ctx, priceListVersionId, productId, trxName); - BigDecimal price = Env.ZERO; - if (pp!=null) - { - price = pp.getPriceStd(); - } - - if (price == null || price.doubleValue() == 0f) - { - pp = getTerminalOrStoreProductPrice(ctx, productId, isSales, trxName); - if (pp!=null) - { - price = pp.getPriceStd(); - } - } - return price; - } - - public static BigDecimal getListPrice(Properties ctx, int priceListVersionId, int productId, boolean isSales, String trxName) throws OperationException - { - - MProductPrice pp = MProductPrice.get(ctx, priceListVersionId, productId, trxName); - BigDecimal price = Env.ZERO; - if (pp!=null) - { - price = pp.getPriceList(); - } - - if (price == null || price.doubleValue() == 0f) - { - pp = getTerminalOrStoreProductPrice(ctx, productId, isSales, trxName); - - if (pp!=null) - { - price = pp.getPriceList(); - } - } - return price; - } - - private static MProductPrice getTerminalOrStoreProductPrice(Properties ctx, int productId, boolean isSales, String trxName) throws OperationException - { - int priceListId = 0; - - if (isSales) - { - priceListId = POSTerminalManager.getSOPriceListId(ctx); - } - else - { - priceListId = StoreManager.getPriceListId(ctx); - } - - int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, trxName); - MProductPrice pp = MProductPrice.get(ctx, priceListVersionId, productId, trxName); - return pp; - } - - public static BigDecimal getLimitPrice(Properties ctx, int priceListVersionId, int productId, boolean isSales, String trxName) throws OperationException - { - - MProductPrice pp = MProductPrice.get(ctx, priceListVersionId, productId, trxName); - BigDecimal price = Env.ZERO; - if (pp!=null) - { - price = pp.getPriceLimit(); - } - if (price == null || price.doubleValue() == 0f) - { - pp = getTerminalOrStoreProductPrice(ctx, productId, isSales, trxName); - if (pp!=null) - { - price = pp.getPriceLimit(); - } - } - return price; - } - - public static ArrayList getProductsToAttachImage(Properties ctx, String prodNameLike, boolean isActive, boolean isWebstoreFeatured) throws OperationException - { - ArrayList productList = getProductList(ctx, prodNameLike, isActive, isWebstoreFeatured); - - Iterator iter = productList.iterator(); - - ProductStatusBean bean; - ProductImageInfo info; - - while (iter.hasNext()) - { - bean = (ProductStatusBean) iter.next(); - info = getProductImageInfo(ctx, bean.getProductId()); - bean.setHasAttachment(info.getHasAttachment()); - } - - return productList; - } - - public static ArrayList getProductList(Properties ctx, String prodNameLike, boolean isActive, boolean isWebstoreFeatured) throws OperationException - { - String sql = "select distinct m_product_id, name, isWebstoreFeatured " + - ", keyword, keyword2, keyword3, keyword4, upc,CLASSIFICATION, isSelfService " + - " from m_product where ad_org_id=" + Env.getAD_Org_ID(ctx) + - " and ad_client_id=" + Env.getAD_Client_ID(ctx); - - if(prodNameLike != null && prodNameLike.length() > 0) - { - SearchBean searchBean = SearchManager.getSearchParams(prodNameLike); - ArrayList andSearchList = searchBean.getAndCriteriasList(); - Iterator andListIter = andSearchList.iterator(); - while(andListIter.hasNext()) - { - String andCriteria = andListIter.next(); - sql += " and ( Upper(name) like Upper('%" + andCriteria + "%') "; - sql += " or Upper(keyword) like Upper('%" + andCriteria + "%') "; - sql += " or Upper(keyword2) like Upper('%" + andCriteria + "%') "; - sql += " or Upper(keyword3) like Upper('%" + andCriteria + "%') "; - sql += " or Upper(keyword4) like Upper('%" + andCriteria + "%') ) "; - } - - ArrayList orSearchList = searchBean.getOrCriteriasList(); - Iterator orListIter = orSearchList.iterator(); - if(orListIter.hasNext()) - { - sql += " and ( "; - while(orListIter.hasNext()) - { - String orCriteria = orListIter.next(); - sql += " Upper(name) like Upper('%" + orCriteria + "%') "; - sql += " or Upper(keyword) like Upper('%" + orCriteria + "%') "; - sql += " or Upper(keyword2) like Upper('%" + orCriteria + "%') "; - sql += " or Upper(keyword3) like Upper('%" + orCriteria + "%') "; - sql += " or Upper(keyword4) like Upper('%" + orCriteria + "%') or"; - } - - sql = sql.substring(0, sql.length() -3 ); - sql += " ) "; - } - } - - if(isActive) - sql += " and IsActive='Y' "; - else - sql += " and IsActive='N' "; - - if(isWebstoreFeatured) - sql += " and IsWebstoreFeatured='Y' "; - else - sql += " and IsWebstoreFeatured='N' "; - - sql += " order by name"; - - PreparedStatement ps = DB.prepareStatement(sql, null); - - ResultSet rs = null; - ProductStatusBean bean; - ArrayList productStatusList = new ArrayList(); - try - { - rs = ps.executeQuery(); - - while (rs.next()) - { - bean = new ProductStatusBean(); - bean.setProductId(Integer.valueOf(rs.getInt(1))); - bean.setProductName(rs.getString(2)); - bean.setKeyword1(rs.getString(4)); - bean.setKeyword2(rs.getString(5)); - bean.setKeyword3(rs.getString(6)); - bean.setKeyword4(rs.getString(7)); - bean.setBarCode(rs.getString(8)); - bean.setProductClassification(rs.getString(9)); - - - boolean isSelfService = false; - String selfServiceStr = rs.getString(10); - if(selfServiceStr != null) - isSelfService = "Y".equals(selfServiceStr); - - bean.setIsSelfService(isSelfService); - - boolean isWebstoredFeatured = false; - String isWStoreFeatured = rs.getString(3); - if(isWStoreFeatured != null) - isWebstoredFeatured = "Y".equals(isWStoreFeatured); - - bean.setIsWebstoreFeatured(Boolean.valueOf(isWebstoredFeatured)); - productStatusList.add(bean); - } - - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - ps.close(); - } - catch (SQLException e1) - {} - - ps = null; - } - - return productStatusList; - } - - /** - * Search product by Name and/or Description - * Ability to Search by using + concatenation - * Picks Price List and Warehouse from Terminal - * @param ctx Context - * @param nameSearch Name like search - * @param descSearch Description like search - * @param trxName Transaction - * @return List of Product Status - * @throws OperationException if error occurred in search - */ - public static ArrayList searchProducts(Properties ctx, int adOrgId, - String nameSearch, String descSearch, String trxName) throws OperationException - { - int priceListId = POSTerminalManager.getSOPriceListId(ctx); - int warehouseId = POSTerminalManager.getWarehouseId(ctx); - - return searchProducts(ctx, adOrgId, nameSearch, descSearch, priceListId, warehouseId, trxName); - } - - /** - * Search product by Name and/or Description - * Ability to Search by using + concatenation - * @param ctx Context - * @param adOrgId Organisation on which to look up for stock - * @param nameSearch Name like search - * @param descSearch Description like search - * @param priceListId Price List on which to search product prices - * @param trxName Transaction - * @return List of Product Status - * @throws OperationException if error occurred in search - */ - public static ArrayList searchProducts(Properties ctx, int adOrgId, - String nameSearch, String descSearch, - int priceListId, int warehouseId, String trxName) throws OperationException - { - if (adOrgId <= 0) - { - throw new IllegalArgumentException("Organisation mandatory"); - } - - if (warehouseId <= 0) - { - throw new IllegalArgumentException("Warehouse mandatory"); - } - - if (priceListId <= 0) - { - throw new IllegalArgumentException("Price List mandatory"); - } - - nameSearch = (nameSearch == null) ? "" : nameSearch; - descSearch = (descSearch == null) ? "" : descSearch; - - int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null, null); - - StringTokenizer stName = new StringTokenizer(nameSearch, "+"); - StringTokenizer stDesc = new StringTokenizer(descSearch, "+"); - - StringBuffer sqlStmt = new StringBuffer(); - sqlStmt.append("SELECT p.Name, "); // 1 - sqlStmt.append("p.M_Product_ID, p.UPC, p.Description, "); // 2,3,4 - sqlStmt.append("SUM(s.QtyOnHand), pp.PriceList "); // 5,6 - sqlStmt.append("FROM M_Product p INNER JOIN (M_Storage s INNER JOIN M_ProductPrice pp ON "); - sqlStmt.append("s.M_Product_ID=pp.M_Product_ID) ON p.M_Product_ID=s.M_Product_ID "); - sqlStmt.append("WHERE p.AD_Client_ID=? "); - sqlStmt.append("AND pp.M_PriceList_Version_ID=? "); - sqlStmt.append("AND s.AD_Org_ID=? "); - sqlStmt.append("AND s.M_Locator_ID IN (SELECT M_Locator_ID FROM M_Locator WHERE M_Warehouse_ID=?) "); - sqlStmt.append("AND p.AD_Org_ID IN (").append(Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)).append(") "); - - ArrayList params = new ArrayList(); - String token = null; - while(stName.hasMoreTokens()) - { - token = stName.nextToken().trim(); - token = "%" + token + "%"; - params.add(token); - - sqlStmt.append("AND UPPER(p.Name) LIKE UPPER(?)"); - } - - while(stDesc.hasMoreTokens()) - { - token = stDesc.nextToken().trim(); - token = "%" + token + "%"; - params.add(token); - - sqlStmt.append("AND UPPER(p.Description) LIKE UPPER(?)"); - } - - sqlStmt.append("AND p.IsActive='Y' AND s.IsActive= 'Y' AND pp.IsActive='Y' "); - sqlStmt.append("GROUP BY p.Name, p.M_Product_ID, p.UPC, p.Description, pp.PriceList "); - sqlStmt.append("ORDER BY p.name"); - - MPriceList spriceList = new MPriceList(ctx, priceListId, null); - - PreparedStatement pstmt = null; - ResultSet rs = null; - ProductStatusBean bean; - ArrayList productStatusList = new ArrayList(); - try - { - pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); - pstmt.setInt(1, Env.getAD_Client_ID(ctx)); - pstmt.setInt(2, priceListVersionId); - pstmt.setInt(3, adOrgId); - pstmt.setInt(4, warehouseId); - - int index = 5; - - for(String s : params) - { - pstmt.setString(index, s); - index ++; - } - - rs = pstmt.executeQuery(); - - while (rs.next()) - { - String productName = rs.getString(1); - Integer productId = Integer.valueOf(rs.getInt(2)); - - MProduct product = MProduct.get(ctx, productId); - int taxCategoryId = product.getC_TaxCategory_ID(); - MTax tax = TaxManager.getTaxFromCategory(ctx, taxCategoryId, null); - - String barcode = rs.getString(3); - String description = rs.getString(4); - BigDecimal qtyOnHand = rs.getBigDecimal(5); - - - BigDecimal priceList = Env.ZERO; - if(spriceList.isTaxIncluded()) - { - priceList = rs.getBigDecimal(6); - } - else - { - priceList = rs.getBigDecimal(6).multiply((tax.getRate().divide(Env.ONEHUNDRED)).add(Env.ONE)); - } - priceList = priceList.setScale(2, RoundingMode.HALF_DOWN); - bean = new ProductStatusBean(); - bean.setProductName(productName = productName==null?"":productName); - bean.setProductId(productId); - bean.setBarCode(barcode = barcode==null?"":barcode); - bean.setDescription(description = description==null?"":description); - bean.setQtyOnHand(qtyOnHand = qtyOnHand==null?Env.ZERO:qtyOnHand); - bean.setPriceStandard(priceList = priceList==null?Env.ZERO:priceList); - productStatusList.add(bean); - } - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs, pstmt); - } - - return productStatusList; - } - - /** - * Search for product by name that is present in stock for an organisation - * @param ctx Context - * @param orgId Organisation - * @param searchString search - * @param trxName Transaction - * @return List of Product Status - * @throws OperationException if error in query execution - */ - public static ArrayList searchProductsFromStock(Properties ctx, int orgId, - String searchString, String trxName) throws OperationException - { - searchString = (searchString == null) ? "" : searchString; - - StringTokenizer st = new StringTokenizer(searchString,"+"); - StringBuffer sqlStmt = new StringBuffer(); - sqlStmt.append("SELECT DISTINCT p.Name, s.M_Product_ID, p.UPC FROM M_Product p "); - sqlStmt.append("INNER JOIN M_Storage s ON p.M_Product_ID=s.M_Product_ID "); - sqlStmt.append("WHERE p.AD_Client_ID=? "); - sqlStmt.append("AND s.AD_Org_ID=? "); - - String token = null; - while(st.hasMoreTokens()) - { - token = st.nextToken().trim(); - sqlStmt.append("AND UPPER(p.Name) LIKE UPPER('%"+token+"%' ) "); - } - - sqlStmt.append("AND p.IsActive='Y' ORDER BY p.name, s.M_Product_ID, p.UPC"); - - PreparedStatement pstmt = null; - ResultSet rs = null; - ProductStatusBean bean; - ArrayList productStatusList = new ArrayList(); - try - { - pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); - pstmt.setInt(1, Env.getAD_Client_ID(ctx)); - pstmt.setInt(2, orgId); - rs = pstmt.executeQuery(); - - while (rs.next()) - { - bean = new ProductStatusBean(); - bean.setProductId(Integer.valueOf(rs.getInt(2))); - bean.setProductName(rs.getString(1)); - bean.setBarCode(rs.getString(3)); - productStatusList.add(bean); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs, pstmt); - } - - return productStatusList; - } - - public static int[] getProducts(Properties ctx, String productName, String trxName) - { - int adClientId = Env.getAD_Client_ID(ctx); - int adOrgId = Env.getAD_Org_ID(ctx); - String whereClause = "AD_Client_ID=" + adClientId + " and AD_Org_ID=" + adOrgId; - whereClause += " and upper(Name) like upper('" + productName + "')"; - - int productIds[] = MProduct.getAllIDs(MProduct.Table_Name, whereClause, trxName); - - return productIds; - } - - public static int[] getProducts(Properties ctx, String name, String description, String barCode, String trxName) throws OperationException - { - String orgIds = Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); - int productIds[] = getProducts(ctx, name, orgIds, description, barCode, trxName); - - return productIds; - } - public static int[] getProducts(Properties ctx, String name, String orgIds, String description, String barCode, String trxName) throws OperationException - { - int adClientId = Env.getAD_Client_ID(ctx); - - if (orgIds == null) - { - throw new OperationException("orgIds cannot be null"); - } - - StringBuffer whereClause = new StringBuffer("AD_Client_ID=" + adClientId + " AND AD_Org_ID IN (" + orgIds +")"); - - if (name != null && !"".equals(name)) - { - whereClause.append(" AND UPPER(name) LIKE UPPER('%" + name + "%')"); - - } - if (description != null && !"".equals(description)) - { - whereClause.append(" AND UPPER(description) LIKE UPPER('%" + description + "%')"); - } - if (barCode != null && !"".equals(barCode)) - { - whereClause.append(" AND UPPER(upc) = UPPER('" + barCode + "')"); - } - - int productIds[] = MProduct.getAllIDs(MProduct.Table_Name, whereClause.toString(), trxName); - - return productIds; - } - - - public static Integer[] getAllProductsHavingAttributeValue(Properties ctx, int attributeValueId) throws SystemException - { - String sql = "select prod.M_PRODUCT_ID " + - "from M_PRODUCT prod,M_ATTRIBUTEINSTANCE attrIns ,M_attribute attr,M_attributeValue attrVal " + - "where prod.M_ATTRIBUTESETINSTANCE_id = attrIns.M_ATTRIBUTESETINSTANCE_id " + - "and prod.isActive = 'Y' " + - "and attr.m_attribute_id = attrIns.M_ATTRIBUTE_ID " + - "and attrIns.m_attributevalue_id = attrVal.m_attributevalue_id " + - "and attrVal.m_attributevalue_id = " + attributeValueId ; - - - PreparedStatement pstmt = null; - ResultSet rs = null; - Integer[] productIds = null; - - try - { - pstmt = DB.prepareStatement(sql, null); - - - - rs = pstmt.executeQuery(); - ArrayList productList = new ArrayList(); - - while(rs.next()) - { - productList.add(Integer.valueOf(rs.getInt(1))); - } - - productIds = new Integer[productList.size()]; - - for(int i=0;i 1) - throw new OperationException("More than one product found with Name: " + productName); - - MProduct product = new MProduct(ctx, productIds[0], trxName); - - return product; - } - - public static MProduct loadProduct(Properties ctx, int productId, String trxName) throws ProductNotFoundException - { - MProduct product = new MProduct(ctx, productId, trxName); - if(product.get_ID() == 0) - throw new ProductNotFoundException("Could not load product with id: " + productId); - return product; - } - - public static String getDistinctFieldSQL(Properties ctx, String fieldName) - { - String sql = "select distinct(" + fieldName + ") from m_product " + - " where ad_client_id=" + Env.getAD_Client_ID(ctx) + - " and AD_Org_ID=" + Env.getAD_Org_ID(ctx) + - " and isActive='Y'" + - " and IsWebstoreFeatured='Y'" + - " and " + fieldName + " is not null"; - - return sql; - } - - - public static void activateProducts(Properties ctx, Integer[] productIds, String trxName) throws OperationException - { - setProductsActive(ctx, productIds, true, trxName); - } - - public static void inactivateProducts(Properties ctx, Integer[] productIds, String trxName) throws OperationException - { - setProductsActive(ctx, productIds, false, trxName); - } - - protected static void setProductsActive(Properties ctx, Integer[] productIds, boolean active, String trxName) throws OperationException - { - if(productIds == null) - throw new OperationException("Product Ids cannot be null"); - - for(int i = 0; i < productIds.length; i++) - { - MProduct product = new MProduct(ctx, productIds[i].intValue(), trxName); - if(product.get_ID() == 0) - throw new OperationException("Could not load product with id: " + productIds[i]); - - if(active == false) - { - String errorMsg=POSProductManager.checkQty(ctx,product.get_ID(),trxName); - if(errorMsg!=null) - throw new CannotInactivateProductException(errorMsg); - - } - product.setIsActive(active); - PoManager.save(product); - } - } - - public static void updateProductsBarcode(Properties ctx, ArrayList productList, String trxName) throws OperationException - { - Iterator iter = productList.iterator(); - - while(iter.hasNext()) - { - ProductImageBean prodImageBean = (ProductImageBean)iter.next(); - if(prodImageBean.getBarCode() != null && prodImageBean.getBarCode().length() > 0) - updateProductBarcode(ctx, prodImageBean.getProductId().intValue(), prodImageBean.getBarCode(), trxName); - } - } - - public static void updateProductBarcode(Properties ctx, int productId, String barCode, String trxName) throws BarcodeAlreadyExistsException, OperationException - { - if(isBarCodePresent(ctx, barCode, trxName)) - throw new BarcodeAlreadyExistsException("Barcode " + barCode + " has already been assigned to another product"); - MProduct product = new MProduct(ctx, productId, trxName); - if(product.get_ID() == 0) - throw new OperationException("Could not load product with id: " + productId); - - - product.setUPC(barCode); - - PoManager.save(product); - } - - - public static int[] getProductsFromAttributeValue(Properties ctx, int attributeId, int attributeValueId, String trxName) - { - int adClientId = Env.getAD_Client_ID(ctx); - int adOrgId = Env.getAD_Org_ID(ctx); - - String whereClause = "AD_Client_ID=" + adClientId + " and AD_Org_ID=" + adOrgId + " and IsActive='Y'"; - whereClause += " and M_AttributeSetInstance_ID in "; - whereClause += " (select M_AttributeSetInstance_ID from M_AttributeInstance where M_Attribute_ID=" + attributeId + " and M_AttributeValue_ID=" + attributeValueId + ")"; - - return MProduct.getAllIDs(MProduct.Table_Name, whereClause, trxName); - } - - public static boolean isProductImagePresent(Properties ctx, int productId, String trxName) - { - MAttachment attachment = MAttachment.get(ctx, MProduct.Table_ID, productId); - - if(attachment == null) - return false; - - ArrayList attachmentEntryList = AttachmentManager.getAttachmentEntriesWithSuffix(ctx, attachment, UdiConstants.IMAGE_EXTENSION, trxName); - - return (attachmentEntryList.size() > 0); - } - - public static ProductDetailsBean getProductDetailInfo(Properties ctx, int productId, String trxName) throws OperationException - { - ProductDetailsBean prodDetailsBean = new ProductDetailsBean(); - MProduct product = loadProduct(ctx, productId, trxName); - - prodDetailsBean.setProductId(productId); - prodDetailsBean.setProductName(product.getName()); - prodDetailsBean.setDescription(product.getDescription()); - prodDetailsBean.setBarCode(product.getUPC()); - prodDetailsBean.setIsActive(product.isActive()); - - int taxCategoryId = product.getC_TaxCategory_ID(); - MTaxCategory taxCategory = new MTaxCategory(ctx, taxCategoryId, trxName); - prodDetailsBean.setTaxCategoryName(taxCategory.getName()); - - int revenueRecognitionId = product.getC_RevenueRecognition_ID(); - MRevenueRecognition revenueRecognition = new MRevenueRecognition(ctx, revenueRecognitionId, trxName); - prodDetailsBean.setRevenueRecognition(revenueRecognition.getName()); - //prodDetailsBean.setStdSalesPrice() - - prodDetailsBean.setHasImage(isProductImagePresent(ctx, productId, trxName)); - - return prodDetailsBean; - } - - public static String getBarcode(Properties ctx, int productId, String trxName) throws OperationException - { - String barcode = getBarcodeForSimilarProducts(ctx, productId, trxName); - - if( barcode == null) - { - barcode = createBarcode(ctx, productId, trxName); - } - - return barcode; - } - - public static String getBarcodeForSimilarProducts(Properties ctx, int productId, String trxName) throws OperationException - { - IProduct iProd = getProductInterface(ctx, productId, trxName); - - return iProd.getBarcodeForSimilarProducts(ctx, productId, trxName); - } - - public MProduct[] getAllOrgsProducts(Properties ctx, String productName, String trxName) - { - int adClientID = Env.getAD_Client_ID(ctx); - int adOrgID = Env.getAD_Org_ID(ctx); - - String whereClause = "AD_Client_ID=" + adClientID + " and AD_Org_ID=" + adOrgID; - whereClause += " and Name like'" + productName + "'"; - - return MProduct.get(ctx, whereClause, trxName); - } - - private static String createBarcode(Properties ctx, int productId, String trxName) throws OperationException - { - MSequence sequence = BarcodeManager.getBarcodeSequence(ctx, trxName); - - int nextID = sequence.getCurrentNext() + sequence.getIncrementNo(); - sequence.setCurrentNext(nextID); - - PoManager.save(sequence); - - StringBuffer barcode = new StringBuffer(); - - barcode.append(sequence.getPrefix()); - barcode.append(nextID); - - return barcode.toString(); - } - - public static Timestamp getProductLastUpdatedTime(Properties ctx, int productId, String trxName) throws OperationException - { - String sql = "Select updated from M_Product where M_Product_ID=" + productId; - - PreparedStatement pstmt = null; - Timestamp retVal = null; - try - { - pstmt = DB.prepareStatement(sql, trxName); - ResultSet rs = pstmt.executeQuery(); - if(rs.next()) - retVal = rs.getTimestamp(1); - - rs.close(); - } - catch(SQLException ex) - { - throw new OperationException("Could not get Product Last update time with sql: " + sql); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - if(retVal == null) - throw new OperationException("Could not retrieve product updated time with productId: " + productId); - - return retVal; - } - - public static HashMap getAllImages(Properties ctx, int productId, String trxName) throws OperationException - { - IProduct iProd = getProductInterface(ctx, productId, trxName); - - return iProd.getAllImages(ctx, productId, trxName); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/RoleManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/RoleManager.java deleted file mode 100644 index e1a15d7098..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/RoleManager.java +++ /dev/null @@ -1,825 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 27-Jul-2005 by alok - * - */ -package org.posterita.businesslogic.administration; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MOrg; -import org.compiere.model.MRole; -import org.compiere.model.MRoleMenu; -import org.compiere.model.MRoleOrgAccess; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.posterita.Constants; -import org.posterita.beans.RoleBean; -import org.posterita.businesslogic.MenuManager; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.RoleMenuManager; -import org.posterita.core.MenuItem; -import org.posterita.exceptions.DuplicateRoleException; -import org.posterita.exceptions.NoAccessToEditObjectException; -import org.posterita.exceptions.NoCheckBoxSelectedException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.RoleAlreadyExistsException; -import org.posterita.exceptions.SystemException; -import org.posterita.lib.UdiConstants; -import org.compiere.model.MWebMenu; -import org.posterita.util.PoManager; - - -public class RoleManager -{ - - - - public static MRole createRole(Properties ctx, int orgId, String roleName, boolean isAccessAllOrgs, BigDecimal userDiscount, boolean overwritePriceLimit, boolean isDiscountAllowedOnTotal, boolean isDiscountUptoLimitPrice, boolean canCreateOrder, boolean canAlterOrder, boolean canViewOrder, String trxName) throws OperationException, RoleAlreadyExistsException - { - - String whereClause = "ad_client_id = " + Env.getAD_Client_ID(ctx) +" and ad_org_id in ("+Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM) + ") and name = '"+ roleName +"'"; - - int id[] = MRole.getAllIDs(MRole.Table_Name,whereClause,trxName); - - if(id.length > 0) - { - throw new RoleAlreadyExistsException("Please enter another name for the role. Role " + roleName + "already exists."); - } - - Properties newCtx = (Properties) ctx.clone(); - - Env.setContext(newCtx, "#AD_User_ID", 100); - MRole role = new MRole(newCtx, 0, trxName); - - role.setName(roleName); - role.setUserDiscount(BigDecimal.valueOf(0.00)); - role.setIsPersonalAccess(true); - role.setIsAccessAllOrgs(isAccessAllOrgs); - role.setUserDiscount(userDiscount); - role.setOverwritePriceLimit(overwritePriceLimit); - role.setIsDiscountAllowedOnTotal(isDiscountAllowedOnTotal); - role.setIsDiscountUptoLimitPrice(isDiscountUptoLimitPrice); - role.setAD_Org_ID(orgId); - role.setIsAccessAllOrgs(isAccessAllOrgs); - - - role.setUserLevel(MRole.USERLEVEL_Organization); - - PoManager.save(role); - - - MRoleOrgAccess orgAccess = new MRoleOrgAccess(role,orgId); - PoManager.save(orgAccess); - - return role; - } - - - - - public static MRole createRole(Properties ctx, int orgId, String roleName,Boolean isAccessAllOrgs, Integer[] menuId, BigDecimal userDiscount, Boolean overwriteLimitPrice, Boolean isDiscountAllowedOnTotal, Boolean isDiscountUptoLimitPrice, Boolean canCreateOrder, Boolean canAlterOrder, Boolean canViewOrder, String trxName) throws Exception - { - MRole role = createRole(ctx, orgId, roleName, isAccessAllOrgs.booleanValue(), userDiscount, overwriteLimitPrice.booleanValue(), overwriteLimitPrice.booleanValue(), isDiscountAllowedOnTotal.booleanValue(), canCreateOrder.booleanValue(), canAlterOrder.booleanValue(), canViewOrder.booleanValue(), trxName); - - if(menuId!=null) - { - for(int i=0; i Add default menus e.g. LogOut - int defMenuIds[] = MenuManager.getDefaultMenus(ctx); - for(int i = 0; i < defMenuIds.length; i++) - { - if(!RoleMenuManager.isRoleMenuPresent(ctx, role.get_ID(), defMenuIds[i], trxName)) - RoleMenuManager.createRoleMenu(ctx, role.get_ID(), defMenuIds[i], trxName); - } - - - - return role; - } - - public static RoleBean getRole(Properties ctx, int roleId) throws OperationException - { - RoleBean bean = new RoleBean(); - - MRole role = loadRole(ctx, roleId, null); - - bean.setRoleId(roleId); - bean.setName(role.getName()); - bean.setIsActive(Boolean.valueOf(role.isActive())); - bean.setIsAccessAllOrgs(Boolean.valueOf(role.isAccessAllOrgs())); - bean.setUserDiscount(role.getUserDiscount()); - bean.setIsOverwritePriceLimit(Boolean.valueOf(role.isOverwritePriceLimit())); - bean.setIsDiscountUptoLimitPrice(Boolean.valueOf(role.isDiscountUptoLimitPrice())); - bean.setIsDiscountAllowedOnTotal(role.isDiscountAllowedOnTotal()); - bean.setOrgId(role.getAD_Org_ID()); - - return bean; - } - - public static ArrayList getRoles(Properties ctx, String searchText) - { - ArrayList list = new ArrayList(); - int clientId = Env.getAD_Client_ID(ctx); - - String roleName = ""; - - if (searchText != null) - roleName = searchText; - - int id[] = MRole.getAllIDs(MRole.Table_Name,"upper(name) like '%" + roleName.toUpperCase() + "%' and ad_client_id ="+ clientId +" and isActive = 'Y'"+" and AD_ORG_ID in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+") order by name",null); - - if (id == null || id.length == 0) - { - return list; - } - - RoleBean bean; - - for(int i=0;i getAllRoles(Properties ctx) - { - ArrayList list = new ArrayList(); - int clientId = Env.getAD_Client_ID(ctx); - - - int id[] = MRole.getAllIDs(MRole.Table_Name," ad_client_id ="+ clientId +" and isActive = 'Y'"+" and AD_ORG_ID in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+") order by name",null); - - if (id == null || id.length == 0) - { - return list; - } - - RoleBean bean; - - for(int i=0;i 0) - { - MRole role = new MRole(ctx, roleIds[0], null); - return role; - } - else - return createRole(ctx, orgId, roleName, isAccessAllOrgs, userDiscount, overwriteLimitPrice, isDiscountAllowedOnTotal, isDicountUptoLimitPrice ,canCreateOrder, canAlterOrder, canViewOrder, trxName); - } - catch(Exception ex) - { - throw new OperationException("Cannot create role for: " + roleName); - } - } - - public static MRole getOrCreateRole(Properties ctx, int orgId, String roleName,Boolean isAccessAllOrgs, Integer[] menuId, BigDecimal userDiscount, Boolean overwriteLimitPrice, Boolean isDiscountAllowedOnTotal, Boolean isDicountUptoLimitPrice, Boolean canCreateOrder, Boolean canAlterOrder, Boolean canViewOrder, String trxName) throws OperationException - { - int clientId = Env.getAD_Client_ID(ctx); - int adOrgId = Env.getAD_Org_ID(ctx); - try - { - String sqlStatement = " AD_Client_ID=" + clientId + " and AD_Org_ID=" + adOrgId + " and Name='" + roleName + "'"; - int roleIds[] = MRole.getAllIDs(MRole.Table_Name, sqlStatement, null); - - if (roleIds!=null && roleIds.length > 0) - { - MRole role = new MRole(ctx, roleIds[0], null); - return role; - } - else - return createRole(ctx, orgId, roleName, isAccessAllOrgs, menuId, userDiscount, overwriteLimitPrice, isDiscountAllowedOnTotal, isDicountUptoLimitPrice, canCreateOrder, canAlterOrder, canViewOrder, trxName); - } - catch(Exception ex) - { - throw new OperationException("Cannot create role for: " + roleName); - } - - } - - /** - * Gets all the roles assigned to the user - * @param ctx - * @return an arraylist of keynamepairs - * @throws OperationException - */ - public static ArrayList getMyRoles(Properties ctx) throws OperationException - { - int ad_user_id = Env.getAD_User_ID(ctx); - int ad_client_id = Env.getAD_Client_ID(ctx); - - String sql = "select role.AD_ROLE_ID, role.NAME " + - " from AD_USER_ROLES usrRole, AD_USER usr, AD_ROLE role, AD_ORG org " + - " where org.AD_ORG_ID = role.AD_ORG_ID " + - " and usrRole.AD_USER_ID = usr.AD_USER_ID " + - " and usrRole.AD_ROLE_ID = role.AD_ROLE_ID " + - " and role.AD_CLIENT_ID = ? " + - " and usrRole.AD_USER_ID = ? " + - " order by role.NAME"; - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - ResultSet rs = null; - ArrayList roleList = new ArrayList(); - - try - { - pstmt.setInt(1,ad_client_id); - pstmt.setInt(2,ad_user_id); - - rs = pstmt.executeQuery(); - - while(rs.next()) - { - KeyNamePair pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); - - roleList.add(pair); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return roleList; - - } - - public static String getWhereClauseOnUserRolesAccess(Properties ctx, String tableAlias) - { - int roleId = Env.getAD_Role_ID(ctx); - Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); - //#User_Org=0,11,12, - MRole userRole = new MRole(ctx,roleId,null); - String whereClause= " and " + tableAlias+"AD_CLIENT_ID"; - - if(userRole.getUserLevel().equals(MRole.USERLEVEL_Client) || userRole.getUserLevel().equals(MRole.USERLEVEL_ClientPlusOrganization)) - { - return whereClause = whereClause +" and isActive='Y'"; - } - - else - { - return whereClause= whereClause +" and "+tableAlias+"AD_ORG_ID="+Env.getAD_Org_ID(ctx); - } - - } - - private static boolean hasMenu(int menuId, ArrayList menus) - { - boolean menuAvailable = false; - for(MWebMenu menu : menus) - { - if(menu.get_ID() == menuId) - { - menuAvailable = true; - break; - } - } - return menuAvailable; - } - - private static void setRoleMenus(MenuItem menuItem, ArrayList menus) - { - ArrayList children = menuItem.getAllChildren(); - for(MenuItem mItem : children) - { - if(mItem.hasSubMenu()) - setRoleMenus(mItem, menus); - else - { - if(hasMenu(mItem.getMenuId(), menus)) - mItem.setAvailable(true); - } - } - } - - public static MenuItem getAvailableMenus(Properties ctx, int roleId) throws SystemException, OperationException - { - ArrayList roleMenus = MenuManager.getMenus(ctx, roleId); - - ArrayList appMenus = MenuManager.getMenusForOrganisationType(ctx); - MenuItem rootItem = MenuManager.buildMenuTree(ctx, appMenus); - - setRoleMenus(rootItem, roleMenus); - - return rootItem; - } - - public static void editRole(Properties ctx, int roleId, String roleName, boolean isAccessAllOrgs, Integer[] menuId, BigDecimal userDiscount, boolean overwritePriceLimit, boolean isDiscountUptoLimitPrice, boolean isDiscountAllowedOnTotal, String trxName) throws OperationException, RoleAlreadyExistsException - { - if(menuId==null) - { - throw new NoCheckBoxSelectedException("Please select a role"); - } - String nameClause = "AD_Client_ID = " + Env.getAD_Client_ID(ctx) + " and Upper(name)='" + roleName.toUpperCase() + "' and AD_Role_ID <> " + roleId; - - int roleIds[] = MRole.getAllIDs(MRole.Table_Name, nameClause, null); - - if (roleIds!=null && roleIds.length > 0) - throw new RoleAlreadyExistsException("Role with name: " + roleName + " already exists"); - - MRole role = loadRole(ctx, roleId, trxName); - - Boolean isEditable = RoleManager.isEditable(ctx, role.getAD_Org_ID()); - - if (!isEditable) - throw new NoAccessToEditObjectException("You do not have the right organisational access for editing"); - - if(userDiscount == null) - { - userDiscount = Env.ZERO; - } - - role.setName(roleName); - role.setIsAccessAllOrgs(isAccessAllOrgs); - role.setUserDiscount(userDiscount); - role.setOverwritePriceLimit(overwritePriceLimit); - role.setIsDiscountUptoLimitPrice(isDiscountUptoLimitPrice); - role.setIsDiscountAllowedOnTotal(isDiscountAllowedOnTotal); - - PoManager.save(role); - - String whereClause = " AD_Role_ID=" + roleId; - int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause, trxName); - - // Delete all associated role menus - for(int i = 0; i < roleMenuIds.length; i++) - { - MRoleMenu roleMenu = new MRoleMenu(ctx, roleMenuIds[i], trxName); - roleMenu.delete(true); - } - - // Create role menus assigned - for(int i = 0; i < menuId.length; i++) - { - MRoleMenu roleMenu = new MRoleMenu(ctx, 0, trxName); - roleMenu.setAD_Role_ID(role.get_ID()); - roleMenu.setU_WebMenu_ID(menuId[i]); - PoManager.save(roleMenu); - } - - // Create role menus for all default menus - int defMenuIds[] = MenuManager.getDefaultMenus(ctx); - for(int i = 0; i < defMenuIds.length; i++) - { - MRoleMenu roleMenu = new MRoleMenu(ctx, 0, trxName); - roleMenu.setAD_Role_ID(role.get_ID()); - roleMenu.setU_WebMenu_ID(defMenuIds[i]); - PoManager.save(roleMenu); - } - } - - public static BigDecimal getDiscountAllowed(Properties ctx, int AD_Role_ID, String trxName) throws OperationException - { - BigDecimal discount = BigDecimal.ZERO; - MRole role = MRole.get(ctx, AD_Role_ID); - - if (role != null) - { - discount = role.getUserDiscount(); - } - - return discount; - } - - public static boolean isOverridePriceLimitAllowed(Properties ctx, int AD_Role_ID, String trxName) throws OperationException - { - MRole role = MRole.get(ctx, AD_Role_ID); - - return role.isOverwritePriceLimit(); - } - - public static boolean isDiscountUptoPriceLimit(Properties ctx, int AD_Role_ID, String trxName) throws OperationException - { - MRole role = MRole.get(ctx, AD_Role_ID); - - return role.isDiscountUptoLimitPrice(); - } - - public static boolean isDiscountAllowedOnTotal(Properties ctx, int AD_Role_ID, String trxName) throws OperationException - { - MRole role = MRole.get(ctx, AD_Role_ID); - - return role.isDiscountAllowedOnTotal(); - } - - public static ArrayList getRoleOrgPairs(Properties ctx, String trxName) throws OperationException - { - int roleId = Env.getAD_Role_ID(ctx); - - RoleBean roleBean = getRole(ctx, roleId); - - ArrayList orgPairs = new ArrayList(); - - if (roleBean.getIsAccessAllOrgs()) - { - orgPairs = OrganisationManager.getAllOrgPairs(ctx, trxName); - } - else - { - MOrg org = MOrg.get(ctx, roleBean.getOrgId()); - KeyNamePair pair = org.getKeyNamePair(); - - orgPairs.add(pair); - } - - - return orgPairs; - - } - - - public static ArrayList getRoleOrgAccess(Properties ctx, int roleId) throws OperationException - { - - MRoleOrgAccess[] orgAccessArr = MRoleOrgAccess.getOfRole(ctx, Env.getAD_Role_ID(ctx)); - MRole role = new MRole(ctx, roleId, null); //trxName can be null here as we are just retrieving data that was previously committed and not doing any update - - ArrayList list = new ArrayList(); - - for (int i = 0; i < orgAccessArr.length; i++) - { - MRoleOrgAccess orgAccess = orgAccessArr[i]; - - MOrg org = MOrg.get(ctx, orgAccess.getAD_Org_ID()); - - RoleBean roleBean = new RoleBean(); - roleBean.setRoleId(orgAccess.getAD_Role_ID()); - roleBean.setName(role.getName()); - - if (orgAccess.getAD_Org_ID() == 0) - roleBean.setOrgName(Constants.ALL_ORGANISATIONS); - else - roleBean.setOrgName(org.getName()); - - roleBean.setOrgId(orgAccess.getAD_Org_ID()); - - - String roleOrgAccessSQL = getRoleOrgAccessSQL(); - - PreparedStatement pstmt = DB.prepareStatement(roleOrgAccessSQL, null); - - ResultSet rs = null; - int count = 0; - Boolean isActive = false; - - try - { - pstmt.setInt(1,Env.getAD_Client_ID(ctx)); - pstmt.setInt(2,org.get_ID()); - pstmt.setInt(3,role.get_ID()); - - rs = pstmt.executeQuery(); - - - - while(rs.next()) - { - if (rs.getString(4).equals("Y")) - isActive = true; - - count++; - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - if (count > 1) - throw new DuplicateRoleException("Duplicate Role Organisation Access"); - else - if (count == 1) - { - roleBean.setIsChecked(isActive); - } - else - { - roleBean.setIsChecked(isActive); - } - - list.add(roleBean); - - - } - - return list; - - } - - - - - public static void editRoleOrgAccess(Properties ctx, ArrayList roleBeanList, String trxName) throws OperationException - { - for (int i = 0; i < roleBeanList.size(); i++) - { - RoleBean bean = roleBeanList.get(i); - - MRole role = new MRole(ctx, bean.getRoleId(), trxName); - - String isChecked = "Y"; - - if (bean.getIsChecked() == null) - isChecked = "N"; - - String roleOrgAccessSQL = getRoleOrgAccessSQL(); - - PreparedStatement pstmt = DB.prepareStatement(roleOrgAccessSQL, trxName); - - ResultSet rs = null; - int count = 0; - - try - { - pstmt.setInt(1,Env.getAD_Client_ID(ctx)); - pstmt.setInt(2, bean.getOrgId()); - pstmt.setInt(3, bean.getRoleId()); - - rs = pstmt.executeQuery(); - - - - while(rs.next()) - { - count++; - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - if (count > 1) - throw new DuplicateRoleException("Duplicate Role Organisation Access"); - else - if (count == 1) - { - StringBuffer strBuff = new StringBuffer(); - - strBuff.append("UPDATE ").append(MRoleOrgAccess.Table_Name); - strBuff.append(" SET isActive='").append(isChecked).append("'"); - strBuff.append(" WHERE ad_client_id=").append(Env.getAD_Client_ID(ctx)); - strBuff.append(" AND ad_org_id=").append(bean.getOrgId()); - strBuff.append(" AND ad_role_id=").append(bean.getRoleId()); - - PreparedStatement pstmt1 = DB.prepareStatement(strBuff.toString(), trxName); - - try - { - pstmt1.executeUpdate(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt1.close(); - } - catch(Exception e) - {} - - pstmt1 = null; - } - - } - else - { - MRoleOrgAccess roleOrgAccess = new MRoleOrgAccess(role, bean.getOrgId()); - PoManager.save(roleOrgAccess); - - } - } - - - } - - private static String getRoleOrgAccessSQL() - { - StringBuffer strBuff = new StringBuffer(); - strBuff.append("select ad_role_id, ad_org_id, ad_client_id, isactive from "); - strBuff.append(MRoleOrgAccess.Table_Name); - strBuff.append(" where ad_client_id=?"); - strBuff.append(" and ad_org_id=?"); - strBuff.append(" and ad_role_id=?"); - //strBuff.append(" and isActive='Y'"); - - return strBuff.toString(); - } - - public static String getRoleEditableOrgAccess(Properties ctx) - { - StringBuffer orgIdsStr = new StringBuffer(); - - int roleId = Env.getAD_Role_ID(ctx); - - MRoleOrgAccess[] roleOrgAccessArr = MRoleOrgAccess.getOfRole(ctx, roleId); - - int count = 0; - - if (roleOrgAccessArr==null || roleOrgAccessArr.length==0) - { - return orgIdsStr.toString(); - } - - for (int i = 0; i < roleOrgAccessArr.length; i++) - { - MRoleOrgAccess roleOrgAccess = roleOrgAccessArr[i]; - - if (roleOrgAccess.isActive() == true) - { - - if (roleOrgAccess.getAD_Org_ID() == 0) - { - int[] orgIds = MOrg.getAllIDs(MOrg.Table_Name, "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and isActive='Y' order by name", null); - - StringBuffer allOrgIds = new StringBuffer(); - - allOrgIds.append("0"); - - for (int j = 0; j < orgIds.length; j++) - { - allOrgIds.append(","); - allOrgIds.append(orgIds[j]); - } - - return allOrgIds.toString(); - } - - else - { - orgIdsStr.append(roleOrgAccess.getAD_Org_ID()); - orgIdsStr.append(","); - } - } - } - - orgIdsStr.replace(orgIdsStr.length()-1, orgIdsStr.length()-1, ""); - return orgIdsStr.toString(); - - } - - public static String getRoleViewableOrgAccess(Properties ctx) - { - String roleEditableOrgAccess = getRoleEditableOrgAccess(ctx); - - if (roleEditableOrgAccess.length() == 0) - return "0"; - - if (roleEditableOrgAccess.indexOf(",0") == -1) - return roleEditableOrgAccess + ",0"; - else - return roleEditableOrgAccess; - - } - - - public static Boolean isEditable(Properties ctx, int orgId) - { - int roleId = Env.getAD_Role_ID(ctx); - - MRoleOrgAccess[] roleOrgAccessArr = MRoleOrgAccess.getOfRole(ctx, roleId); - - if (roleOrgAccessArr!=null && roleOrgAccessArr.length >0) - { - for (int i = 0; i < roleOrgAccessArr.length; i++) - { - MRoleOrgAccess roleOrgAccess = roleOrgAccessArr[i]; - - if (roleOrgAccess.getAD_Org_ID() == 0) - return true; - - if (roleOrgAccess.getAD_Org_ID() == orgId) - return true; - } - } - return false; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/TaxManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/TaxManager.java deleted file mode 100644 index 9900550bdc..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/TaxManager.java +++ /dev/null @@ -1,415 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * - *Created on Aug 19, 2006 by alok - * - */ - - -package org.posterita.businesslogic.administration; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MLocation; -import org.compiere.model.MOrg; -import org.compiere.model.MTax; -import org.compiere.model.MTaxCategory; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.TaxBean; -import org.posterita.exceptions.CannotInactivateTaxException; -import org.posterita.exceptions.InvalidNetDaysException; -import org.posterita.exceptions.MandatoryException; -import org.posterita.exceptions.MandatoryNameException; -import org.posterita.exceptions.NoAccessToEditObjectException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.TaxNameAlreadyExistsException; -import org.posterita.exceptions.TaxRateAlreadyExistsException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - -public class TaxManager -{ - - public static MTaxCategory createTaxCategory(Properties ctx, String taxCategoryName, String trxName) throws OperationException - { - MTaxCategory taxCategory = new MTaxCategory(ctx, 0, trxName); - taxCategory.setName(taxCategoryName); - PoManager.save(taxCategory); - return taxCategory; - } - - private static MTaxCategory editTaxCategory(Properties ctx,int orgId, int taxCategoryId, String taxCategoryName, String trxName) throws OperationException - { - MTaxCategory taxCategory = new MTaxCategory(ctx, taxCategoryId, trxName); - taxCategory.setName(taxCategoryName); - taxCategory.setAD_Org_ID(orgId); - PoManager.save(taxCategory); - return taxCategory; - } - - public static MTax createTax(Properties ctx, int orgId, String name, int taxCategoryId, int countryId, BigDecimal rate,String description,boolean isTaxExempt ,String trxName) throws OperationException - { - return createTax(ctx, orgId, name, taxCategoryId, countryId, new Timestamp(System.currentTimeMillis()), rate,description,isTaxExempt, trxName); - } - - - - public static MTax createTax(Properties ctx, int orgId, String name, int taxCategoryId, int countryId, Timestamp validFrom, BigDecimal rate,String description,boolean isTaxExempt, String trxName) throws OperationException - { - MTax tax = new MTax(ctx, 0, trxName); - - tax.setAD_Org_ID(orgId); - tax.setName(name); - tax.setC_TaxCategory_ID(taxCategoryId); - tax.setC_Country_ID(countryId); - tax.setSOPOType(MTax.SOPOTYPE_Both); - tax.setValidFrom(validFrom); - tax.setIsTaxExempt(isTaxExempt); - tax.setIsDocumentLevel(false); - if(isTaxExempt==true) - tax.setRate(new BigDecimal(0)); - else - tax.setRate(rate); - - if(description!=null) - tax.setDescription(description); - PoManager.save(tax); - - return tax; - } - - private static MTax editTax(Properties ctx, int orgId, MTax tax,String name, int countryId, BigDecimal rate,String desc,boolean isTaxExempt, String trxName) throws OperationException - { - tax.setAD_Org_ID(orgId); - tax.setName(name); - tax.setC_Country_ID(countryId); - tax.setSOPOType(MTax.SOPOTYPE_Both); - tax.setIsTaxExempt(isTaxExempt); - tax.setIsDocumentLevel(false); - if(isTaxExempt==true) - tax.setRate(new BigDecimal(0)); - else - tax.setRate(rate); - if(desc!=null) - tax.setDescription(desc); - PoManager.save(tax); - - return tax; - } - - public static BigDecimal getPriceWithTax(Properties ctx,BigDecimal price,BigDecimal rate) - { - return new BigDecimal (price.doubleValue()+((rate.doubleValue()/(100))*price.doubleValue())); - } - - - public static void createEditTaxCategoryAndTax(Properties ctx,TaxBean bean,String trxName) throws MandatoryException,MandatoryNameException,InvalidNetDaysException, OperationException - { - - if(bean.getTaxName()==null) - throw new MandatoryNameException("Name is Mandatory"); - - if(bean.getTaxRate()==null) - throw new MandatoryException("rate"); - if(bean.getTaxRate().intValue()<0) - { - throw new InvalidNetDaysException(" tax rate cannot be negative"); - } - - MOrg org = new MOrg(ctx,Env.getAD_Org_ID(ctx),null); - MBPartner partner = new MBPartner(ctx,org.getLinkedC_BPartner_ID(trxName),null); - MBPartnerLocation bpLocation = new MBPartnerLocation(partner); - MLocation location = new MLocation(ctx,bpLocation.getC_Location_ID(),null); - - String whereClause = "AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " and name='" + bean.getTaxName() + "'"; - int taxId1[] = MTax.getAllIDs(MTax.Table_Name, whereClause, trxName); - - - String whereClause2=" AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and RATE="+bean.getTaxRate(); - int taxId []= MTax.getAllIDs(MTax.Table_Name,whereClause2,trxName); - - - MTaxCategory taxCategory=null; - MTax tax=null; - - if(bean.getTaxId()==null) - { - if(taxId1.length > 0) - throw new TaxNameAlreadyExistsException("tax Name already exists"); - if(taxId.length>0) - throw new TaxRateAlreadyExistsException("The tax rate is already defined"); - taxCategory=createTaxCategory(ctx,bean.getTaxName(),trxName); - tax = createTax(ctx, bean.getOrgId(), bean.getTaxName(),taxCategory.get_ID(),location.getC_Country_ID(),bean.getTaxRate(),bean.getDescription(),bean.getIsTaxExempted(),trxName); - } - - else - { - - MTax mTax = new MTax(ctx,bean.getTaxId().intValue(),null); - - Boolean isEditable = RoleManager.isEditable(ctx, mTax.getAD_Org_ID()); - - if (!isEditable) - throw new NoAccessToEditObjectException("You do not have the right organisational access for editing"); - - - if(taxId1.length>0 && !mTax.getName().equalsIgnoreCase(bean.getTaxName())) - throw new TaxNameAlreadyExistsException("tax Name already exists"); - - if(taxId.length>0 && mTax.getRate().compareTo(bean.getTaxRate()) != 0) - throw new TaxRateAlreadyExistsException("The tax rate is already defined"); - - - - tax=editTax(ctx,bean.getOrgId(), mTax,bean.getTaxName(),location.getC_Country_ID(),bean.getTaxRate(),bean.getDescription(),bean.getIsTaxExempted(),trxName); - taxCategory=editTaxCategory(ctx, bean.getOrgId(), tax.getC_TaxCategory_ID(),bean.getTaxName(),trxName); - } - - - } - - public static MTaxCategory loadTaxCategory(Properties ctx, int taxCategoryId, String trxName) throws OperationException - { - MTaxCategory taxCategory = new MTaxCategory(ctx, taxCategoryId, trxName); - - if(taxCategory.get_ID() == 0) - throw new OperationException("Could not load tax category with id: " + taxCategoryId); - - return taxCategory; - } - - - public static int getTaxCategoryIdByName(Properties ctx, String name, String trxName) throws OperationException - { - int adClientId = Env.getAD_Client_ID(ctx); - - String whereClause = "AD_Client_ID=" + adClientId + " and name='" + name + "'"; - - int taxCategoryIds[] = MTaxCategory.getAllIDs(MTaxCategory.Table_Name, whereClause, trxName); - - if(taxCategoryIds.length == 0) - throw new OperationException("No tax category found with name: " + name); - else if(taxCategoryIds.length > 1) - throw new OperationException(taxCategoryIds.length + " Tax categories found with name: " + name); - else - return taxCategoryIds[0]; - } - - public static MTax loadTax(Properties ctx, int taxId, String trxName) throws OperationException - { - MTax tax = new MTax(ctx, taxId, trxName); - if(tax.get_ID() == 0) - throw new OperationException("Could not load tax with id: " + taxId); - return tax; - } - - public static MTax getTaxFromCategory(Properties ctx, int taxCategoryId, String trxName) throws OperationException - { - int taxIds[] = MTax.getAllIDs(MTax.Table_Name,"AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - +" and C_TAXCATEGORY_ID="+ taxCategoryId + " and IsActive='Y'",trxName); - - if(taxIds.length == 0) - throw new OperationException("No tax found with tax category id: " + taxCategoryId); - else if(taxIds.length > 1) - throw new OperationException(taxIds.length + " Tax found with same tax category with id: " + taxCategoryId); - else - return loadTax(ctx, taxIds[0], trxName); - } - - - public static ArrayList getAllTaxRates(Properties ctx,boolean isActive) throws OperationException - { - String userOrg = Env.getContext(ctx, UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM); - - String sql="select C_TAX_ID,NAME,DESCRIPTION,RATE,ISTAXEXEMPT," + - //" DECODE(isActive,'Y','true','false') active"+ - " CASE WHEN isActive='Y' THEN 'true' ELSE 'false' END AS active"+ - " from C_Tax" + - " where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " and AD_ORG_ID in ("+ userOrg + ")" ; - - if(isActive==true) - sql=sql+" and isActive='Y'"; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ArrayList list = new ArrayList(); - TaxBean bean=null; - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - bean = new TaxBean(); - bean.setTaxId(rs.getInt(1)); - bean.setTaxName(rs.getString(2)); - bean.setDescription(rs.getString(3)); - bean.setTaxRate(rs.getBigDecimal(4)); - bean.setIsTaxExempted(Boolean.parseBoolean(rs.getString(5))); - bean.setIsActive(Boolean.parseBoolean(rs.getString(6))); - list.add(bean); - } - rs.close(); - - } catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } catch (SQLException e) - { - - } - } - - return list; - } - - public static TaxBean getTaxRate(Properties ctx,int taxId) throws OperationException - { - String userOrg = Env.getContext(ctx, UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM); - - String sql="select C_TAX_ID, NAME,DESCRIPTION,RATE,ISTAXEXEMPT," + - //" DECODE(isActive,'Y','true','false') active"+ - " CASE WHEN isActive='Y' THEN 'true' ELSE 'false' END AS active,"+ - " AD_ORG_ID" + - " from C_Tax" + - " where AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " and AD_ORG_ID in ("+ userOrg + ")" + - " and c_TAX_ID="+taxId; - - - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - TaxBean bean=null; - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - bean = new TaxBean(); - bean.setTaxId(rs.getInt(1)); - bean.setTaxName(rs.getString(2)); - bean.setDescription(rs.getString(3)); - bean.setTaxRate(rs.getBigDecimal(4)); - bean.setIsTaxExempted(Boolean.parseBoolean(rs.getString(5))); - bean.setIsActive(Boolean.parseBoolean(rs.getString(6))); - bean.setOrgId(rs.getInt(7)); - - } - rs.close(); - - } catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } catch (SQLException e) - { - - } - } - - return bean; - } - - - public static MTax activateTax(Properties ctx,int taxId, boolean activate) throws OperationException - { - MTax tax = new MTax(ctx,taxId,null); - if(activate==true) - { - tax.setIsActive(true); - } - - else - { - if(isTaxUsed(ctx,taxId)==true) - { - throw new CannotInactivateTaxException("The tax can not be set incative, there are product with this tax"); - } - tax.setIsActive(false); - } - - - PoManager.save(tax); - return tax; - } - - - public static boolean isTaxUsed(Properties ctx,int taxId) throws OperationException - { - String sql="select pr.m_product_id " + - "from M_PRODUCT pr,C_TAX t,C_TAXCATEGORY tc" + - " where pr.C_TAXCATEGORY_ID=tc.C_TAXCATEGORY_ID " + - "and tc.C_TAXCATEGORY_ID=t.C_TAXCATEGORY_ID " + - "and t.C_TAX_ID=" +taxId+ - " and t.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - boolean present=false; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - present=true; - - } - rs.close(); - - } catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } catch (SQLException e) - { - - } - } - - return present; - } - -} - diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserManager.java deleted file mode 100644 index 8ac132daf8..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserManager.java +++ /dev/null @@ -1,641 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 27-Jul-2005 by alok - * - */ -package org.posterita.businesslogic.administration; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; -import java.util.Vector; - -import javax.management.relation.RoleNotFoundException; - -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MCommission; -import org.compiere.model.MCommissionLine; -import org.compiere.model.MCountry; -import org.compiere.model.MLocation; -import org.compiere.model.MOrg; -import org.compiere.model.MRole; -import org.compiere.model.MRoleOrgAccess; -import org.compiere.model.MUser; -import org.compiere.model.MUserRoles; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.posterita.beans.AddressBean; -import org.posterita.beans.UserBean; -import org.posterita.beans.WebstoreUserBean; -import org.posterita.businesslogic.LocationManager; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.core.KeyNamePairUtil; -import org.posterita.exceptions.DuplicateUserPinException; -import org.posterita.exceptions.NoAccessToEditObjectException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.UserAlreadyExistsException; -import org.posterita.exceptions.UserNotFoundException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - - -public class UserManager -{ - - public static MUser createUser(Properties ctx,Integer orgId, String userName,String userSurname,boolean isSalesRep,String address,String postalAddress,String city,String password,String email,boolean isActive,String phone,int regionId,int roleId,int countryId, String userPIN, BigDecimal userDiscount,String docBasisType,BigDecimal amtMultiplier,String frequency,BigDecimal subtractAmt,boolean isFullAccess,String trxName) throws DuplicateUserPinException,OperationException - { - int [] userId = MUser.getAllIDs("AD_USER","AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx),trxName); - - for(int i=0;i0) - throw new DuplicateUserPinException("User Pin Already exists"); - else - user.setUserPIN(userPIN); - } - user.setPassword(password); - user.setEMail(email); - user.setIsActive(isActive); - user.setPhone(phone); - - PoManager.save(user); - - if(isSalesRep==true && docBasisType!=null && amtMultiplier!=null) - { - CommissionManager.getCreateCommission(ctx,bpartner.getName(),bpartner.get_ID(),docBasisType,amtMultiplier,frequency,subtractAmt,trxName); - } - - MUserRoles userRoles = new MUserRoles(ctx, user.get_ID(), roleId, trxName); - userRoles.save(); - - MOrg org = new MOrg(ctx, orgId, trxName); - MRoleOrgAccess roleOrgAccess = new MRoleOrgAccess(org, roleId); - - return user; - } - - - public static Vector getAllOrgUsers(Properties ctx, int orgID) - { - int ids[] = MUser.getAllIDs(MUser.Table_Name, " AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx)+" and AD_Org_ID=" + orgID + " and ISACTIVE='Y' order by name",null); - - MUser user; - - Vector thisOrgUsers = new Vector(); - for (int i = 0; i0) - { - MCommission commission=new MCommission(ctx,commissionIds[0],null); - bean.setDocBasisType(commission.getDocBasisType()); - bean.setFrequencyType(commission.getFrequencyType()); - - MCommissionLine [] line =commission.getLines(); - if(line.length!=1) - throw new OperationException("either No commissionLine or more than One commission Line has bean defined for this bPartner"); - bean.setAmtMultiplier(line[0].getAmtMultiplier().multiply(new BigDecimal(100))); - bean.setSubtractAmt(line[0].getAmtSubtract()); - - } - if(userRole.length>0) - { - bean.setRoleName(role.getName()); - bean.setRoleId(Integer.valueOf(role.get_ID())); - } - - return bean; - - } - - - public static ArrayList getUsers(Properties ctx, String searchText) throws OperationException - { - ArrayList usersList = new ArrayList(); - - int clientId = Env.getAD_Client_ID(ctx); - int orgId = Env.getAD_Org_ID(ctx); - String userOrg = Env.getContext(ctx, UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM); - - String sql = "select u.AD_User_ID from AD_User u, AD_User_Roles ur " + - " where u.AD_Client_ID= " + clientId + - " and u.AD_Org_ID in (" + userOrg + ")" + - " and (Select bp.IsEmployee from C_BPartner bp where u.C_BPartner_ID=bp.C_BPartner_ID) = 'Y'" + - " and ur.ad_user_id= u.ad_user_id" + - " and ur.ad_role_id is not null"; - - if (searchText != null) - sql = sql + " and upper(u.name) like '%" + searchText.toUpperCase() + "%'"; - - PreparedStatement pstmt = null; - try - { - pstmt = DB.prepareStatement(sql, null); - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - int userId = rs.getInt(1); - UserBean bean = getUser(ctx, userId); - - usersList.add(bean); - } - rs.close(); - } - catch(SQLException ex) - { - throw new OperationException("Could not retrieve employees list with sql: " + sql, ex); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception ex) - {} - } - return usersList; - } - - - public static ArrayList getAllEmployees(Properties ctx) throws OperationException - { - ArrayList usersList = new ArrayList(); - - int clientId = Env.getAD_Client_ID(ctx); - int orgId = Env.getAD_Org_ID(ctx); - - String sql = "select AD_User_ID from AD_User u " + - " where u.AD_Client_ID= " + clientId + - " and u.AD_Org_ID=" + orgId + - " and (Select bp.IsEmployee from C_BPartner bp where u.C_BPartner_ID=bp.C_BPartner_ID) = 'Y'"; - - PreparedStatement pstmt = null; - try - { - pstmt = DB.prepareStatement(sql, null); - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - int userId = rs.getInt(1); - UserBean bean = getUser(ctx, userId); - usersList.add(bean); - } - rs.close(); - } - catch(SQLException ex) - { - throw new OperationException("Could not retrieve employees list with sql: " + sql, ex); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception ex) - {} - } - return usersList; - } - - public static ArrayList getAllUsers(Properties ctx) throws OperationException - { - ArrayList list = new ArrayList(); - - int clientId = Env.getAD_Client_ID(ctx); - int orgId = Env.getAD_Org_ID(ctx); - - int id[] = MUser.getAllIDs(MUser.Table_Name," ad_client_id = "+clientId+" and ad_org_id = "+orgId,null); - // int id[] = MUser.getAllIDs(MUser.Table_Name," ad_client_id = "+clientId+" and ad_org_id = "+orgId+" and isactive = 'Y'",null); - //int id[] = MUser.getAllIDs(MUser.Table_Name," ad_client_id = "+clientId+" and isactive = 'Y'",null); - - for(int i=0;i0) - { - for(int i=0;i 0) - user = new MUser(ctx, userId[0], trxName); - else - user = createUser(ctx, orgId, userName,null, isSalesRep, address, postalAddress, city, password, email, isActive, phone, regionId, roleId,countryId,userPin,null,commDocbaseType,commRate,frequency,subtractAmt,isFullAccess,trxName); - - return user; - } - - public static MUser loadUser(Properties ctx, int adUserID, String trxName) throws OperationException - { - MUser user = new MUser(ctx, adUserID, trxName); - if(user.get_ID() == 0) - throw new OperationException("Could not load user with id: " + adUserID); - - return user; - } - - public static ArrayList getSalesReps(Properties ctx, String trxName) throws OperationException - { - int adClientId = Env.getAD_Client_ID(ctx); - int adOrgId = Env.getAD_Org_ID(ctx); - - String whereClause = "IsActive='Y' and AD_Client_ID=" + adClientId + " and AD_Org_ID=" + adOrgId; - whereClause += " and C_BPartner_ID in (select C_BPartner_ID from C_BPartner where IsActive='Y' and IsSalesRep='Y')"; - - try - { - return KeyNamePairUtil.getData(ctx, MUser.Table_Name, whereClause); - } - catch(SQLException ex) - { - throw new OperationException("Could not retrieve sales rep with whereClause: " + whereClause, ex); - } - } - - - public static ArrayList updateUserListStatus(ArrayList list, Integer userId, Boolean status) - { - if (list == null) - return list; - - for (int i = 0; i < list.size(); i++) - { - UserBean bean = (UserBean) list.get(i); - - if (bean.getUserId().equals(userId)) - { - bean.setIsActive(status); - - list.remove(i); - - list.add(i, bean); - - break; - } - } - - return list; - - } - - public static Integer getRoleId(Properties ctx, String userPIN, String trxName) throws UserNotFoundException, RoleNotFoundException, OperationException - { - int ids[] = MUser.getAllIDs(MUser.Table_Name, "IsActive = 'Y' AND AD_Client_ID=" + Env.getAD_Client_ID(ctx) + " AND userPin='"+userPIN + "'", trxName); - if(ids == null || ids.length == 0) - { - throw new UserNotFoundException(); - } - - MUserRoles[] userRoles = MUserRoles.getOfUser(ctx, ids[0]); - if(userRoles == null || userRoles.length == 0) - { - throw new RoleNotFoundException(); - } - - MUserRoles userRole = userRoles[0]; - int ad_role_id = userRole.getAD_Role_ID(); - - return ad_role_id; - } - - public static BigDecimal getDiscountAllowed(Properties ctx, String userPIN, String trxName) throws UserNotFoundException, RoleNotFoundException, OperationException - { - - int ad_role_id = getRoleId(ctx, userPIN, trxName); - BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, ad_role_id, trxName); - - return discountAllowed; - } - - public static boolean isOverridePriceLimitAllowed(Properties ctx, String userPIN, String trxName) throws UserNotFoundException, RoleNotFoundException, OperationException - { - int ad_role_id = getRoleId(ctx, userPIN, trxName); - boolean isOverrideAllowed = RoleManager.isOverridePriceLimitAllowed(ctx, ad_role_id, trxName); - - return isOverrideAllowed; - } - - public static boolean isDiscountAllowedOnTotal(Properties ctx, String userPIN, String trxName) throws UserNotFoundException, RoleNotFoundException, OperationException - { - int ad_role_id = getRoleId(ctx, userPIN, trxName); - boolean isDisountAllowedOnTotal = RoleManager.isDiscountAllowedOnTotal(ctx, ad_role_id, trxName); - - return isDisountAllowedOnTotal; - } - - public static boolean isDiscountUptoPriceLimit(Properties ctx, String userPIN, String trxName) throws UserNotFoundException, RoleNotFoundException, OperationException - { - int ad_role_id = getRoleId(ctx, userPIN, trxName); - boolean isDiscountUptoPriceLimit = RoleManager.isDiscountUptoPriceLimit(ctx, ad_role_id, trxName); - - return isDiscountUptoPriceLimit; - } - -} - - - - diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserRoleManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserRoleManager.java deleted file mode 100644 index bea2ae60dd..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/UserRoleManager.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 27-Jul-2005 by alok - * - */ -package org.posterita.businesslogic.administration; - -import java.util.Properties; - -import org.compiere.model.MUserRoles; -import org.compiere.util.Trx; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.OperationException; -import org.posterita.util.PoManager; - - -public class UserRoleManager -{ - - - public static MUserRoles createUserRoles(Properties ctx,int roleId,int userId) throws OperationException - { - Trx trx = Trx.get(Trx.createTrxName(TrxPrefix.getPrefix()), true); - trx.start(); - MUserRoles userRoles; - try - { - userRoles = new MUserRoles(ctx,userId,roleId,trx.getTrxName()); - PoManager.save(userRoles); - trx.commit(); - trx.close(); - } - catch(OperationException e) - { - trx.rollback(); - trx.close(); - throw e; - } - - return userRoles; - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/VendorManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/VendorManager.java deleted file mode 100644 index 28163e300c..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/VendorManager.java +++ /dev/null @@ -1,473 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 02-Sep-2005 by alok - * - */ -package org.posterita.businesslogic.administration; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; -import java.util.StringTokenizer; - -import org.compiere.model.MBPartner; -import org.compiere.model.MCountry; -import org.compiere.model.MUser; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.CustomerBean; -import org.posterita.beans.VendorBean; -import org.posterita.exceptions.BPartnerNotFoundException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - -public class VendorManager -{ - - public static MBPartner saveVendor(Properties ctx, int partnerId, VendorBean bean, String trxName) throws OperationException - { - - if (bean.getOrgId() == null) - throw new OperationException("Organisation is not set! Please select an organisation or contact the administrator."); - - int countryId = 0; - - if (bean.getCountryId() == null) - { - MCountry country = MCountry.getDefault(ctx); - countryId = country.get_ID(); - } - else - countryId = bean.getCountryId().intValue(); - - MBPartner bPartner = BPartnerManager.saveBPartner(ctx, bean.getOrgId(), partnerId, 0, bean.getPartnerName(), bean.getSurname(), false, true, false, false, bean.getAddress1(), bean.getAddress2(), "", null, bean.getCity(), bean.getPhone(), bean.getPhone2(), bean.getFax(), countryId, true, true, trxName); - - Integer priceListId = bean.getPriceListId(); - - if (priceListId != null) - { - bPartner.setM_PriceList_ID(priceListId); - bPartner.save(); - } - - MUser user; - - int[] userIds = MUser.getAllIDs(MUser.Table_Name,"AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) + " and C_BPARTNER_ID=" + partnerId,trxName); - - if(userIds.length==0) - user = new MUser(bPartner); - else if (userIds.length > 1) - throw new OperationException("Found more than 1 user for the partner."); - else - user = new MUser(ctx,userIds[0],trxName); - - user.setEMail(bean.getEmail()); - user.setIsActive(false); - PoManager.save(user); - - return bPartner; - } - - - public static ArrayList searchVendors(Properties ctx,String searchString, boolean isPOS) throws OperationException - { - searchString = (searchString==null)? "" : searchString; - - int adOrgID = Env.getAD_Org_ID(ctx); - int adClientID = Env.getAD_Client_ID(ctx); - StringBuffer sql = new StringBuffer(); - - StringTokenizer st = new StringTokenizer(searchString,"+ "); - String token = null; - - sql.append(" select bp.c_bpartner_id,");//1 - sql.append(" bp.name,");//2 - sql.append(" bp.name2,");//3 - sql.append(" bp.m_pricelist_id,");//4 - sql.append(" bp.so_creditlimit,"); //5 - sql.append(" bp.so_creditused,"); //6 - sql.append(" bp.totalopenbalance"); //7 - sql.append(" from C_BPARTNER bp"); - sql.append(" where bp.AD_CLIENT_ID = ? "); - sql.append(" and bp.ad_org_id in (" + Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM)+")"); - sql.append(" and bp.isActive = 'Y' "); - sql.append(" and bp.isVendor='Y'"); - - while(st.hasMoreTokens()) - { - token = st.nextToken().trim(); - sql.append(" and (upper(bp.name) like upper('%"+ token +"%' ) or upper(bp.name2) like upper('%"+ token +"%' ))"); - } - - - if(!isPOS) - sql.append(" and bp.name not in (select name from ad_org where ad_org_id = " + adOrgID + ")") ; - - - sql.append(" order by bp.name,bp.name2"); - - PreparedStatement pstmt =null; - - CustomerBean customer = null; - ArrayList customers = new ArrayList(); - - try - { - pstmt = DB.prepareStatement(sql.toString(),null); - pstmt.setInt(1, adClientID); - ResultSet rs = pstmt.executeQuery(); - - - while (rs.next()) - { - customer = new CustomerBean(); - customer.setBpartnerId(Integer.valueOf(rs.getInt(1))); - customer.setPartnerName(rs.getString(2)); - customer.setSurname(rs.getString(3)); - customer.setPriceListId(rs.getInt(4)); - customer.setCreditStatus(MBPartner.SOCREDITSTATUS_CreditOK); //no limit for purchase - - BigDecimal creditLimit = rs.getBigDecimal(5); - BigDecimal creditUsed = rs.getBigDecimal(6); - BigDecimal openBalance = rs.getBigDecimal(7); - - creditLimit = creditLimit == null ? Env.ZERO : creditLimit; - creditUsed = creditUsed == null ? Env.ZERO : creditUsed; - openBalance = openBalance == null ? Env.ZERO : openBalance; - - BigDecimal creditAvailable = Env.ZERO; - if(creditLimit.doubleValue() > 0.0d) - { - creditAvailable = creditLimit.subtract(creditUsed); - } - - customer.setTotalOpenBalance(openBalance); - customer.setCreditAvailable(creditAvailable); - customer.setCreditLimit(creditLimit); - customer.setCreditUsed(creditUsed); - - customers.add(customer); - } - - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException("Sql used:" + sql,e); - } - finally - { - try - { - pstmt.close(); - } - catch (Exception ex) - { - } - pstmt = null; - } - - return customers; - - } - - private static String getVendorSQL(Properties ctx) - { - int ad_client_id = Env.getAD_Client_ID(ctx); - String sql = " select" + - " bp.name as firstname," + //1.firstname - " bp.name2 as lastname," +//2.lastname - " loc.address1," +//3.address1 - " loc.address2," +//4.address2 - " bploc.phone," +//5.phone - " bploc.fax," +//6.fax - " bp.isactive, " +//7.isactive - " bp.c_bpartner_id, " + //8.partnerid - " loc.city," + //9.city - " bploc.phone2, " +//10.phone - " bp.ad_org_id, " + //11.orgId - " bp.M_PriceList_ID"+ //12.priceListId - " from c_bpartner bp left outer join (c_bpartner_location bploc left outer join c_location loc on bploc.C_LOCATION_ID = loc.C_LOCATION_ID) on bp.c_bpartner_id = bploc.c_bpartner_id"+ - " where bp.ad_client_id = " + ad_client_id + - " and bp.ad_ORG_ID in (" + Env.getContext(ctx,UdiConstants.ROLE_VIEWABLE_ORGS_CTX_PARAM)+")"+ - " and bp.ISVENDOR = 'Y'"; - - - return sql; - } - - - public static ArrayList searchVendors(Properties ctx, String searchText) throws OperationException - { - - ArrayList list = new ArrayList(); - - - String sql = getVendorSQL(ctx); - - if (searchText != null) - sql = sql + " and (upper(bp.name) like '%" + searchText.toUpperCase() + "%')"; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs = null; - - VendorBean bean = null; - - try - { - rs =pstmt.executeQuery(); - - while(rs.next()) - { - bean = new VendorBean(); - - //set bean - bean.setPartnerName(rs.getString(1)); - bean.setSurname(rs.getString(2)); - bean.setAddress1(rs.getString(3)); - bean.setAddress2(rs.getString(4)); - bean.setPhone(rs.getString(5)); - bean.setFax(rs.getString(6)); - bean.setPhone2(rs.getString(10)); - bean.setOrgId(rs.getInt(11)); - - - Boolean isActive = Boolean.valueOf(false); - - if(rs.getString(7).equalsIgnoreCase("Y")) - { - isActive = Boolean.valueOf(true); - } - bean.setIsActive(isActive); - bean.setBpartnerId(rs.getInt(8)); - - list.add(bean); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return list; - } - - - - public static ArrayList getAllVendors(Properties ctx) throws OperationException - { - - ArrayList list = new ArrayList(); - - - String sql = getVendorSQL(ctx); - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs = null; - - VendorBean bean = null; - - try - { - rs =pstmt.executeQuery(); - - while(rs.next()) - { - bean = new VendorBean(); - - //set bean - bean.setPartnerName(rs.getString(1)); - bean.setSurname(rs.getString(2)); - bean.setAddress1(rs.getString(3)); - bean.setAddress2(rs.getString(4)); - bean.setPhone(rs.getString(5)); - bean.setFax(rs.getString(6)); - bean.setPhone2(rs.getString(10)); - bean.setOrgId(rs.getInt(11)); - - - Boolean isActive = Boolean.valueOf(false); - - if(rs.getString(7).equalsIgnoreCase("Y")) - { - isActive = Boolean.valueOf(true); - } - bean.setIsActive(isActive); - bean.setBpartnerId(rs.getInt(8)); - - list.add(bean); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return list; - } - - - public static VendorBean getVendor(Properties ctx,int vendorId) throws OperationException - { - String sql = getVendorSQL(ctx); - sql += " and bp.c_bpartner_id=" + vendorId+ - " order by upper(bp.name)"; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs = null; - VendorBean bean = new VendorBean(); - - try - { - rs =pstmt.executeQuery(); - - if(rs.next()) - { - - - //set bean - bean.setPartnerName(rs.getString(1)); - bean.setSurname(rs.getString(2)); - bean.setAddress1(rs.getString(3)); - bean.setAddress2(rs.getString(4)); - bean.setPhone(rs.getString(5)); - bean.setFax(rs.getString(6)); - bean.setCity(rs.getString(9)); - bean.setPhone2(rs.getString(10)); - bean.setOrgId(rs.getInt(11)); - bean.setPriceListId(rs.getInt(12)); - - Boolean isActive = Boolean.valueOf(false); - - if(rs.getString(7).equalsIgnoreCase("Y")) - { - isActive = Boolean.valueOf(true); - } - bean.setIsActive(isActive); - bean.setBpartnerId(rs.getInt(8)); - - MUser user=null; - int userIds [] =MUser.getAllIDs(MUser.Table_Name,"AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) + " and C_BPARTNER_ID="+ vendorId ,null); - if(userIds.length==0) - { - user = new MUser(ctx,0,null); - user.setName(bean.getPartnerName()); - } - else - { - user = new MUser(ctx,userIds[0],null); - } - - bean.setEmail(user.getEMail()); - - } - else - throw new BPartnerNotFoundException("No Business Partner found with id: " + vendorId); - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return bean; - } - - - public static void activateVendor(Properties ctx, int bpartnerId, String trxName) throws OperationException - { - BPartnerManager.activateBPartner(ctx,bpartnerId,false, trxName); - - } - - public static void deactivateVendor(Properties ctx, int bpartnerId, String trxName) throws OperationException - { - BPartnerManager.deactivateBPartner(ctx,bpartnerId, trxName); - - } - - public static ArrayList updateVendorListStatus(ArrayList list, Integer partnerId, Boolean status) - { - if (list == null) - return list; - - for (int i = 0; i < list.size(); i++) - { - VendorBean bean = (VendorBean) list.get(i); - - if (bean.getBpartnerId().equals(partnerId)) - { - bean.setIsActive(status); - - list.remove(i); - - list.add(i, bean); - - break; - } - - } - - return list; - - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/administration/WarehouseManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/administration/WarehouseManager.java deleted file mode 100644 index 700e236912..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/administration/WarehouseManager.java +++ /dev/null @@ -1,385 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 22-Jul-2005 by alok - * - */ -package org.posterita.businesslogic.administration; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; -import java.util.logging.Level; - -import org.compiere.model.MLocation; -import org.compiere.model.MLocator; -import org.compiere.model.MWarehouse; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.ProductBean; -import org.posterita.beans.WarehouseBean; -import org.posterita.businesslogic.LocationManager; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.core.CheckDuplicateEntities; -import org.posterita.exceptions.CanNotMoveStockException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.WarehouseAlreadyExistsException; -import org.posterita.keyname.LocatorKeyNamePair; -import org.posterita.keyname.WarehouseKeyNamePair; -import org.posterita.lib.UdiConstants; -import org.posterita.order.UDIOrderType; -import org.posterita.util.PoManager; - -public class WarehouseManager -{ - private static final CLogger log = CLogger.getCLogger(WarehouseManager.class); - - public static MWarehouse createWarehouse(Properties ctx, int orgId, String warehouseName, String address1,String postalAddress1,String city,int regionId, int countryId,String trxName) throws OperationException, WarehouseAlreadyExistsException - { - MWarehouse warehouse; - - if (CheckDuplicateEntities.checkDuplicateName(ctx, warehouseName, MWarehouse.Table_Name)) - throw new WarehouseAlreadyExistsException("Warehouse already exists"); - - try - { - MLocation location = LocationManager.createLocation(ctx, orgId, address1, "", postalAddress1, city, regionId, countryId, trxName); - warehouse = createWarehouse(ctx, orgId, warehouseName, location.getC_Location_ID(), trxName); - } - catch(OperationException e) - { - throw e; - } - - return warehouse; - - } - - public static MWarehouse createWarehouse(Properties ctx, int orgId, String warehouseName, int c_location_id, String trxName) throws OperationException, WarehouseAlreadyExistsException - { - MWarehouse warehouse; - - if (CheckDuplicateEntities.checkDuplicateName(ctx, warehouseName, MWarehouse.Table_Name)) - throw new WarehouseAlreadyExistsException("Warehouse already exists"); - - try - { - warehouse = new MWarehouse(ctx,0,trxName); - warehouse.setName(warehouseName); - warehouse.setC_Location_ID(c_location_id); - warehouse.setAD_Org_ID(orgId); - PoManager.save(warehouse); - - createLocator(ctx, orgId, warehouse.get_ID(), true,"0","0","0", trxName); - } - catch(OperationException e) - { - throw e; - } - - return warehouse; - - } - - public static MLocator createLocator(Properties ctx,int orgId, int warehouseId,boolean isDefault, String aisle,String bin,String level, String trxName) throws OperationException - { - - MLocator locator = new MLocator(ctx,0,trxName); - - try - { - locator.setAD_Org_ID(orgId); - locator.setM_Warehouse_ID(warehouseId); - locator.setXYZ(aisle,bin,level); - locator.setIsDefault(isDefault); - - PoManager.save(locator); - } - catch(OperationException e) - { - throw new OperationException("Could not create locator!!"); - } - - return locator; - - } - - /** - * Returns all the warehouse present and viewable by the user - * @param ctx context - * @return List of Warehouses - * @throws OperationException if problem with sql or DB - */ - public static ArrayList getAllWarehouses(Properties ctx) throws OperationException - { - int viewableOrgs[] = OrganisationManager.getUserViewableOrganisations(ctx); - return getAllWarehouses(ctx, viewableOrgs); - } - - /** - * Returns all warehouses that is present for the organisation provided. - * @param ctx Context - * @param adOrgId Organisation - * @return List of Warehouses - * @throws OperationException if problem with sql or DB - */ - public static ArrayList getAllWarehouses(Properties ctx, int adOrgId) throws OperationException - { - int orgs[] = new int[] {adOrgId}; - return getAllWarehouses(ctx, orgs); - } - - /** - * Returns all the warehouse present for the organisations - * @param ctx context - * @param adOrgId organisation - * @return List of warehouses - * @throws OperationException if problem with sql or DB - */ - public static ArrayList getAllWarehouses(Properties ctx, int[] adOrgIds) throws OperationException - { - if (adOrgIds.length == 0) - { - throw new IllegalArgumentException("At least one organisation should be provided"); - } - - int adClientID = Env.getAD_Client_ID(ctx); - StringBuffer sqlStmt = new StringBuffer(); - - sqlStmt.append(" SELECT w.M_Warehouse_ID,"); //1 - sqlStmt.append(" w.Name,"); //2 - sqlStmt.append(" l.Address1,"); //3 - sqlStmt.append(" l.City,"); //4 - sqlStmt.append(" l.Postal_Add,");//5 - sqlStmt.append(" l.RegionName,"); //6 - sqlStmt.append(" w.Description,");//7 - sqlStmt.append(" w.IsActive"); //8 - sqlStmt.append(" FROM M_Warehouse w, C_Location l "); - sqlStmt.append(" WHERE l.C_Location_ID=W.C_Location_ID "); - sqlStmt.append(" AND w.AD_Org_ID IN ( "); - - int i; - for (i = 0; i < adOrgIds.length - 1; i++) - { - sqlStmt.append(adOrgIds[i]).append(","); - } - sqlStmt.append(adOrgIds[i]).append(")"); - - sqlStmt.append(" AND w.AD_Client_ID = ? "); - sqlStmt.append(" ORDER BY w.Name"); - - WarehouseBean warehouse=null; - ArrayList warehouses = new ArrayList(); - - String isActive; - PreparedStatement pstmt =null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sqlStmt.toString(), null); - pstmt.setInt(1, adClientID); - rs = pstmt.executeQuery(); - - while (rs.next()) - { - warehouse = new WarehouseBean(); - warehouse.setWarehouseId(Integer.valueOf(rs.getInt(1))); - warehouse.setWarehouseName(rs.getString(2)); - - warehouse.setAddress1(rs.getString(3)); - warehouse.setCity(rs.getString(4)); - warehouse.setPostalAddress(rs.getString(5)); - warehouse.setRegionName(rs.getString(6)); - warehouse.setDescription(rs.getString(7)); - isActive = rs.getString(8); - warehouse.setIsActive("Y".equals(isActive)); - warehouses.add(warehouse); - } - } - catch(SQLException e) - { - throw new OperationException(e.getMessage()); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - return warehouses; - } - - public static WarehouseBean getWarehouse(Properties ctx, Integer warehouseId, ArrayList warehouses) - { - Iterator iter = (warehouses.iterator()); - - while (iter.hasNext()) - { - WarehouseBean warehouseBean = (WarehouseBean) iter.next(); - - if (warehouseBean.getWarehouseId().equals(warehouseId)) - return warehouseBean; - } - - return new WarehouseBean(); - } - - - - - public static ArrayList getOrganisationWarehouses(Properties ctx) throws OperationException - { - ArrayList warehouses; - - warehouses = WarehouseKeyNamePair.getKeyNamePair(ctx); - - return warehouses; - } - - public static ArrayList getOrganisationWarehouses(Properties ctx,ArrayList products) throws OperationException - { - ArrayList warehouses; - - Iterator prodIter = products.iterator(); - - ProductBean prodBean = null; - int warehouseId=0; - - while(prodIter.hasNext()) - { - prodBean = (ProductBean)prodIter.next(); - if(warehouseId==0 || warehouseId==prodBean.getWarehouseId().intValue()) - { - warehouseId=prodBean.getWarehouseId().intValue(); - } - else - { - throw new CanNotMoveStockException("Please select the products form single warehouse"); - } - } - warehouses = WarehouseKeyNamePair.getKeyNamePair(ctx,warehouseId); - - return warehouses; - } - - - - public static ArrayList getOrganisationLocators(Properties ctx) throws OperationException - { - ArrayList locators; - - locators = LocatorKeyNamePair.getKeyNamePair(ctx); - - return locators; - } - - public static MWarehouse getStorageWarehouse(Properties ctx, UDIOrderType type) throws OperationException - { - return getDefaultWarehouse(ctx); - - } - - public static MWarehouse getDefaultWarehouse(Properties ctx) throws OperationException - { - int warehouseID = Env.getContextAsInt(ctx, "#M_Warehouse_ID"); - MWarehouse warehouse = new MWarehouse(ctx, warehouseID, null); - if(warehouse.get_ID() != 0) - return warehouse; - throw new OperationException(" Cannot find default warehouse for organisation"); - } - - public static MWarehouse editWarehouse(Properties ctx, WarehouseBean bean) throws OperationException - { - MWarehouse warehouse = new MWarehouse(ctx, bean.getWarehouseId().intValue(), null); - - warehouse.setName(bean.getWarehouseName()); - - warehouse.setIsActive(bean.getIsActive().booleanValue()); - - PoManager.save(warehouse); - - return warehouse; - } - - - public static int getOrganisationWarehouse(Properties ctx, int adOrgId, String trxName) throws OperationException - { - int warehouseId = -1; - String sqlStmt = "SELECT M_Warehouse_ID FROM AD_OrgInfo WHERE AD_Org_ID=?"; - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sqlStmt, trxName); - pstmt.setInt(1, adOrgId); - - rs = pstmt.executeQuery(); - if (rs.next()) - { - warehouseId = rs.getInt(1); - } - } - catch (Exception ex) - { - log.log(Level.SEVERE, "Could not get organisation warehouse", ex); - throw new OperationException("Could not get organisation warehouse", ex); - } - finally - { - DB.close(rs, pstmt); - } - - return warehouseId; - } - - public static String getLocatorIds(Properties ctx, Integer orgId) throws OperationException - { - String orgIds = orgId.toString(); - - if (orgId == 0) - { - orgIds = Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM).toString(); - } - - int[] locatorIds = MLocator.getAllIDs(MLocator.Table_Name, "AD_Client_ID = " + Env.getAD_Client_ID(ctx)+ " AND AD_Org_ID IN (" + orgIds + ")", null); - - StringBuffer locIds = new StringBuffer(); - if (locatorIds != null && locatorIds.length>0) - { - for (int i = 0; i 0) - { - return elementValueId; - } - - int acctSchemaId = Env.getContextAsInt(ctx, "$C_AcctSchema_ID"); - - String sqlStmt = "SELECT C_Element_ID FROM C_AcctSchema_Element WHERE C_AcctSchema_ID=? AND ElementType=?"; - - int elementId = DB.getSQLValue(trxName, sqlStmt, acctSchemaId, MAcctSchemaElement.ELEMENTTYPE_Account); - - if (elementId <= 0) - { - throw new OperationException("Could not get Element of type Account from the accounting schema!!!"); - } - - MElementValue elementValue = new MElementValue(ctx, 0, trxName); - elementValue.setAD_Org_ID(0); - elementValue.setC_Element_ID(elementId); - elementValue.setValue(ELEMENT_DUMMY_CASH); - elementValue.setName("Dummy Cash"); - elementValue.setAccountType(MElementValue.ACCOUNTTYPE_Asset); - elementValue.setAccountSign(MElementValue.ACCOUNTSIGN_Natural); - elementValue.setPostActual(true); - elementValue.setPostBudget(true); - elementValue.setPostStatistical(true); - elementValue.setIsDocControlled(false); - elementValue.setIsBankAccount(false); - - PoManager.save(elementValue); - - elementValueId = elementValue.get_ID(); - - return elementValueId; - } - - - /** - * Returns the first accounting schema defined for the client - * @param ctx Context - * @param adClientId Client - * @param trxName Transaction - * @return Accouting Schema Id - */ - public static int getAcctSchemaId(Properties ctx, int adClientId, String trxName) - { - String sql = "SELECT C_AcctSchema_ID " - + "FROM C_AcctSchema a, AD_ClientInfo c " - + "WHERE a.C_AcctSchema_ID=c.C_AcctSchema1_ID " - + "AND c.AD_Client_ID=?"; - - int acctSchemaId = DB.getSQLValue(trxName, sql, adClientId); - return acctSchemaId; - } - - /** - * Returns the currency of the accounting schema - * @param ctx Context - * @param clientId Client - * @param trxName Transaction - * @return Currency Id - */ - public static int getCurrencyId(Properties ctx, int clientId, String trxName) - { - int acctSchemaId = getAcctSchemaId(ctx, clientId, trxName); - MAcctSchema acctSchema = MAcctSchema.get(ctx, acctSchemaId); - return acctSchema.getC_Currency_ID(); - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/core/ApplicationManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/core/ApplicationManager.java deleted file mode 100644 index c040369311..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/core/ApplicationManager.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - - -package org.posterita.businesslogic.core; - -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MStore; -import org.compiere.util.Env; -import org.posterita.beans.ApplicationParametersBean; -import org.posterita.lib.UdiConstants; - - /** - * @author Ashley - */ - -public class ApplicationManager -{ - public static void setApplicationParametersInContext(Properties tmkCtx, int storeId) - { - Env.setContext(tmkCtx, "#AD_Client_ID", 0); - Env.setContext(tmkCtx, "#AD_Org_ID", 0); - MStore store = new MStore(tmkCtx, storeId, null); - - if(store.get_ID() == 0) - throw new RuntimeException("No store found for application with ID: " + storeId); - Env.setContext(tmkCtx, UdiConstants.CLIENT_ID_CTX_PARAM, store.getAD_Client_ID()); - Env.setContext(tmkCtx, UdiConstants.ORG_ID_CTX_PARAM, store.getAD_Org_ID()); - Env.setContext(tmkCtx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM, store.getAD_Org_ID()); - Env.setContext(tmkCtx, UdiConstants.CSS, store.getWebParam5()); - Env.setContext(tmkCtx, UdiConstants.FORWARD, store.getWebParam6()); - Env.setContext(tmkCtx, UdiConstants.WSTORE_CTX_PARAM, store.get_ID()); - - String language = store.getWebParam4(); - if (language != null && language != "") - { - Env.setContext(tmkCtx, UdiConstants.LANGUAGE_CTX_PARAM, language); - } - - int acctSchemaId = AccountingManager.getAcctSchemaId(tmkCtx, store.getAD_Client_ID(), null); - Env.setContext(tmkCtx, "$C_AcctSchema_ID", acctSchemaId); - } - - //TODO Refactor, work with store id instead of context - public static ArrayList getAvailableApplications() - { - String whereClause = "IsActive='Y' order by Name"; - int storeIds[] = MStore.getAllIDs(MStore.Table_Name, whereClause, null); - - ArrayList appList = new ArrayList(); - Properties ctx = Env.getCtx(); - - for(int i = 0; i < storeIds.length; i++) - { - MStore store = new MStore(ctx, storeIds[i], null); - String appContextPath = store.getWebContext(); - appContextPath = appContextPath.replaceAll("/", ""); - - ApplicationParametersBean appParamBean = new ApplicationParametersBean(); - appParamBean.setApplicationName(store.getName()); - appParamBean.setApplicationWebContext(appContextPath); - appParamBean.setStoreId(store.get_ID()); - appList.add(appParamBean); - } - - return appList; - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/core/AttachmentManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/core/AttachmentManager.java deleted file mode 100644 index 41aa019fa9..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/core/AttachmentManager.java +++ /dev/null @@ -1,310 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Praveen - */ - -package org.posterita.businesslogic.core; - -import java.io.FileNotFoundException; -import java.util.ArrayList; -import java.util.Properties; - -import org.apache.struts.upload.FormFile; -import org.compiere.model.MAttachment; -import org.compiere.model.MAttachmentEntry; -import org.compiere.util.Env; -import org.posterita.core.UDIPropertiesManager; -import org.posterita.exceptions.AttachmentNotFoundException; -import org.posterita.exceptions.DeleteAttachmentException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.PropertiesConstant; -import org.posterita.util.ListUtil; -import org.posterita.util.PoManager; - - - -public class AttachmentManager -{ - - public static void attachImage(Properties ctx,FormFile file,String name) throws OperationException, FileNotFoundException - { - /*X_U_UDI_LOGO attach = new X_U_UDI_LOGO(ctx,0,null); - - attach.setName(name); - - UDIMAttachment udiAttachment = new UDIMAttachment(attach); - - try - { - saveLogo(ctx,file); - udiAttachment.save(); - } - catch (OperationException e) - { - throw new OperationException("Error occurred on saving file!!"); - } - catch (FileNotFoundException e) - { - throw new FileNotFoundException("File to save not found!!"); - }*/ - } - - - - public static String getImage(Properties ctx,String name) throws OperationException - { - int orgId = Env.getAD_Org_ID(ctx); - String path = UDIPropertiesManager.getProperty().get(ctx, PropertiesConstant.LOGO_HOME)+orgId+"/"+name; - return path; - } - - public static ArrayList getAttachmentEntriesWithPrefix(Properties ctx, MAttachment attachment, String prefix, String trxName) - { - if(attachment == null) - throw new IllegalArgumentException("Attachment cannot be null"); - - - ArrayList attachmentEntryList = new ArrayList(); - - MAttachmentEntry entries[] = attachment.getEntries(); - if (prefix!=null) - prefix = prefix.toUpperCase(); - - for(int i = 0; i < entries.length; i++) - { - String attachmentName = entries[i].getName(); - attachmentName = attachmentName.toUpperCase(); - if(prefix ==null || attachmentName.startsWith(prefix)) - attachmentEntryList.add(entries[i]); - } - - return attachmentEntryList; - } - - public static ArrayList getAttachmentEntriesWithSuffix(Properties ctx, MAttachment attachment, String suffix, String trxName) - { - if(attachment == null) - throw new IllegalArgumentException("Attachment cannot be null"); - - - - ArrayList attachmentEntryList = new ArrayList(); - - MAttachmentEntry entries[] = attachment.getEntries(); - if (suffix!=null) - suffix = suffix.toUpperCase(); - - for(int i = 0; i < entries.length; i++) - { - String attachmentName = entries[i].getName(); - attachmentName = attachmentName.toUpperCase(); - if(suffix ==null || attachmentName.endsWith(suffix)) - attachmentEntryList.add(entries[i]); - } - - return attachmentEntryList; - } - - public static void addAttachment(Properties ctx, int ad_table_id, int record_id, MAttachmentEntry[] entries, String trxName) throws OperationException - { - MAttachment attachment; - if(!AttachmentManager.hasAttachment(ctx, ad_table_id, record_id, trxName)) - attachment = new MAttachment(ctx,0,trxName); - else - { - attachment = loadAttachment(ctx, ad_table_id, record_id); - attachment.set_TrxName(trxName); - } - - attachment.setAD_Table_ID(ad_table_id); - attachment.setRecord_ID(record_id); - - for(int i = 0; i < entries.length; i++) - { - attachment.addEntry(entries[i]); - } - - PoManager.save(attachment); - } - - public static void addAttachmentEntry(Properties ctx, MAttachment attachment, String fileName, byte data[], String trxName) throws OperationException - { - MAttachmentEntry attachmentEntry = new MAttachmentEntry(fileName, data); - - addAttachmentEntries(ctx, attachment, new MAttachmentEntry[]{attachmentEntry}, trxName); - } - - public static void addAttachmentEntries(Properties ctx, MAttachment attachment, MAttachmentEntry[] entries, String trxName) throws OperationException - { - for(int i = 0; i < entries.length; i++) - { - attachment.addEntry(entries[i]); - } - - PoManager.save(attachment); - } - - public static void addAttachment(Properties ctx, int adTableId, int recordId, String fileName, byte data[], String trxName) throws OperationException - { - MAttachmentEntry attachmentEntry = new MAttachmentEntry(fileName, data); - - addAttachment(ctx, adTableId, recordId, new MAttachmentEntry[]{attachmentEntry}, trxName); - } - - public static boolean hasAttachment(Properties ctx, int ad_table_id, int record_id, String trxName) - { - String whereClause = "AD_Table_ID=" + ad_table_id + " and Record_ID=" + record_id; - int mAttachmentIDs[] = MAttachment.getAllIDs(MAttachment.Table_Name, whereClause, trxName); - - if(mAttachmentIDs.length == 0) - return false; - return true; - } - - public static boolean hasAttachment(Properties ctx, int ad_table_id, int record_id, String attachmentName, String trxName) - { - String whereClause = "AD_Table_ID=" + ad_table_id + " and Record_ID=" + record_id; - int mAttachmentIDs[] = MAttachment.getAllIDs(MAttachment.Table_Name, whereClause, trxName); - - if(mAttachmentIDs.length == 0) - return false; - - for(int i = 0; i < mAttachmentIDs.length; i++) - { - MAttachment attachment = MAttachment.get(ctx, ad_table_id, record_id); - if(getAttachmentEntryIndex(ctx, attachment, attachmentName) != -1) - return true; - } - return false; - } - - public static int getAttachmentEntryIndex(Properties ctx, MAttachment attachment, String attachmentName) - { - int retIndex = -1; - - MAttachmentEntry entries[] = attachment.getEntries(); - - for(int i = 0; i < entries.length; i++) - { - MAttachmentEntry entry = entries[i]; - - if(entry.getName().equalsIgnoreCase(attachmentName)) - { - retIndex = i; - break; - } - } - return retIndex; - } - - public static void addAttachmentEntry(MAttachment attachment, MAttachmentEntry entry) throws OperationException - { - if(!attachment.addEntry(entry)) - { - throw new OperationException("Could not add Attachment Entry with name: " + entry.getName() + - " to attachment with table id: " + attachment.get_Table_ID() + " and record id: " + attachment.getRecord_ID()); - } - } - - public static void deleteAttachmentEntry(MAttachment attachment, int index) throws OperationException - { - if(!attachment.deleteEntry(index)) - { - throw new OperationException("Could not add Attachment Entry with index: " + index + - " to attachment with table id: " + attachment.get_Table_ID() + " and record id: " + attachment.getRecord_ID()); - } - } - - public static void deleteAvailableAttachment(Properties ctx, int adTableId, int recordId, String trxName) - { - if(hasAttachment(ctx, adTableId, recordId, trxName)) - { - MAttachment attachment = MAttachment.get(ctx, adTableId, recordId); - attachment.set_TrxName(trxName); - attachment.delete(true); - } - } - - public static ArrayList getAllAttachmentEntries(Properties ctx, int adTableId, int recordId) - { - ArrayList entryList = new ArrayList(); - - if(hasAttachment(ctx, adTableId, recordId, null)) - { - MAttachment attachment = MAttachment.get(ctx, adTableId, recordId); - return ListUtil.getListFromArray(attachment.getEntries()); - } - return entryList; - } - - public static ArrayList getAllImagesAttachmentEntries(Properties ctx, int adTableId, int recordId, String trxName) - { - ArrayList entryList = new ArrayList(); - - if(hasAttachment(ctx, adTableId, recordId, trxName)) - { - MAttachment attachment = MAttachment.get(ctx, adTableId, recordId); - - MAttachmentEntry attachmentEntries[] = attachment.getEntries(); - for(MAttachmentEntry entry : attachmentEntries) - { - if(entry.isGraphic()) - entryList.add(entry); - } - } - return entryList; - } - - public static MAttachment loadAttachment(Properties ctx, int adTableId, int recordId) throws AttachmentNotFoundException - { - MAttachment attachment = MAttachment.get(ctx, adTableId, recordId); - - if(attachment == null) - throw new AttachmentNotFoundException("Could not load attachment for table with id: " + adTableId + " and record: " + recordId); - - return attachment; - } - - public static MAttachment deleteAvailableAttachmentEntry(Properties ctx, int adTableId, int recordId, String attachmentName, String trxName) throws OperationException, AttachmentNotFoundException, DeleteAttachmentException - { - MAttachment retAttachment = null; - if(hasAttachment(ctx, adTableId, recordId, trxName)) - { - MAttachment attachment = loadAttachment(ctx, adTableId, recordId); - attachment.set_TrxName(trxName); - - int index = getAttachmentEntryIndex(ctx, attachment, attachmentName); - - if(index != -1) - { - boolean deleted = attachment.deleteEntry(index); - - if(!deleted) - throw new DeleteAttachmentException("Could not delete attachment for Table with id: " + adTableId + ", Record ID: " + recordId + " and attachment Name" + attachmentName); - - PoManager.save(attachment); - } - retAttachment = attachment; - } - return retAttachment; - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/core/AttributeManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/core/AttributeManager.java deleted file mode 100644 index fac9b8ca5a..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/core/AttributeManager.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author ashley - */ - -package org.posterita.businesslogic.core; - -import java.util.Properties; - -import org.compiere.model.MAttributeInstance; -import org.compiere.model.MAttributeValue; -import org.posterita.exceptions.OperationException; -import org.posterita.util.PoManager; - -public class AttributeManager -{ - public static void createAttributeInstance(Properties ctx, int attributeSetInstanceId, int attributeId, MAttributeValue attributeValue, String trxName) throws OperationException - { - MAttributeInstance attInst = new MAttributeInstance(ctx, 0, trxName); - attInst.setM_AttributeSetInstance_ID(attributeSetInstanceId); - attInst.setM_Attribute_ID(attributeId); - attInst.setM_AttributeValue_ID(attributeValue.get_ID()); - - attInst.setValue(attributeValue.getName()); - - PoManager.save(attInst); - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/core/ChargeManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/core/ChargeManager.java deleted file mode 100644 index f0f5f1c3fc..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/core/ChargeManager.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Ashley - */ - -package org.posterita.businesslogic.core; - -import java.util.Properties; - -import org.compiere.model.MCharge; - -import org.posterita.exceptions.OperationException; - -public class ChargeManager -{ - - public static MCharge loadCharge(Properties ctx, int chargeId, String trxName) throws OperationException - { - MCharge charge = new MCharge(ctx, chargeId, trxName); - if(charge.get_ID() == 0) - throw new OperationException("Could not load charge with id: " + chargeId); - - return charge; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/creditsales/CreditOrderManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/creditsales/CreditOrderManager.java deleted file mode 100644 index f034c6e452..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/creditsales/CreditOrderManager.java +++ /dev/null @@ -1,906 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Alok Pathak - */ - -package org.posterita.businesslogic.creditsales; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; - -import org.compiere.model.MBPartner; -import org.compiere.model.MCashLine; -import org.compiere.model.MInOut; -import org.compiere.model.MInvoice; -import org.compiere.model.MOrder; -import org.compiere.model.MPInstance; -import org.compiere.model.MPayment; -import org.compiere.process.Aging; -import org.compiere.process.DocumentEngine; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.AgingBean; -import org.posterita.beans.CheckoutBean; -import org.posterita.beans.CreditPaymentDetailsBean; -import org.posterita.beans.OpenItemBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.PaymentAllocationBean; -import org.posterita.beans.PaymentTypeBean; -import org.posterita.beans.ShoppingCartBean; -import org.posterita.businesslogic.InvoiceManager; -import org.posterita.businesslogic.MinOutManager; -import org.posterita.businesslogic.OrderManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.PaymentManager; -import org.posterita.exceptions.BPartnerNotFoundException; -import org.posterita.exceptions.BPartnerOverCreditLimitException; -import org.posterita.exceptions.DiscountLimitException; -import org.posterita.exceptions.MandatoryException; -import org.posterita.exceptions.NoPaymentAmountException; -import org.posterita.exceptions.OperationException; -import org.posterita.util.PoManager; - - -public class CreditOrderManager -{ - private static final int PROCESS_ID=238; - - public static int createCreditOrder(Properties ctx, CheckoutBean checkoutBean, HttpServletRequest request, String trxName) - throws DiscountLimitException,BPartnerOverCreditLimitException,OperationException - { - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); - OrderLineBean orderBean = new OrderLineBean(); - - //populate orderlineBean - orderBean.setBpartnerId(checkoutBean.getBpartnerId()); - orderBean.setToBeShipped(checkoutBean.getToBeShipped().toString()); - orderBean.setUserDiscount(null); - orderBean.setActualPrice(null); - orderBean.setTrxType(MOrder.PAYMENTRULE_OnCredit); - orderBean.setPaymentTermId(null); - - MOrder order = createCreditOrder(ctx, orderBean, cartBean.getItems(), trxName); - - return order.get_ID(); - } - - - public static MOrder createCreditOrder(Properties ctx,OrderLineBean bean,ArrayList cartBeanItems, String trxName) throws DiscountLimitException,BPartnerOverCreditLimitException,OperationException - { - bean.setTrxType(MOrder.PAYMENTRULE_OnCredit); - MBPartner bPartner = new MBPartner(ctx,bean.getBpartnerId(),trxName); - if(bPartner.getC_PaymentTerm_ID()==0) - throw new MandatoryException("Customer does not has a Payment Term,Please create one"); - MOrder creditOrder=null; - if(Boolean.parseBoolean(bean.getToBeShipped())==true) - { - creditOrder= POSManager.createCreditOrder(ctx,bean,cartBeanItems,trxName); - completeCreditOrder(ctx, creditOrder, trxName); - } - else - { - creditOrder= POSManager.createPOSOrder(ctx,bean,cartBeanItems,trxName); - } - - return creditOrder; - - } - - - public static MOrder completeCreditOrder(Properties ctx,int orderId, String trxName) throws BPartnerOverCreditLimitException,OperationException - { - - MOrder order = new MOrder(ctx,orderId,trxName); - - if(order.getC_DocTypeTarget_ID()==OrderManager.getDocTypeIDForStandardOrder(ctx)) - { - return completeCreditOrderWithOutShipment(ctx,order,trxName); - } - - else - { - return completeCreditOrder(ctx,order, trxName); - } - - } - - public static MOrder completeCreditOrderWithOutShipment(Properties ctx,MOrder order, String trxName) throws BPartnerOverCreditLimitException, OperationException - { - MOrder completedOrder = OrderManager.completeOrder(ctx,order); - MInvoice customerInvoice = POSManager.createCustomerInvoice(ctx, order); - customerInvoice.processIt(DocumentEngine.ACTION_Complete); - return completedOrder; - } - - - - - public static PaymentTypeBean createPayment(Properties ctx,OpenItemBean bean,String trxName) throws NoPaymentAmountException,OperationException - { - MInvoice invoice = new MInvoice(ctx,bean.getInvoiceId(),trxName); - MPayment payment=null; - MCashLine cashLine=null; - PaymentTypeBean pBean = null; - if(bean.getPaymentAmt()==null) - throw new NoPaymentAmountException("Payment amount can not be null"); - - - /* - if(bean.getTrxType().equals(MInvoice.PAYMENTRULE_Cash)) - { - cashLine=CashManager.createCashLineForInvoice(ctx,bean,trxName); - } - else - { - payment = PaymentManager.createARReceiptForCreditOrder(ctx,invoice,bean,trxName); - PoManager.save(payment); - } - */ - - payment = PaymentManager.createPaymentForCreditOrder(ctx,invoice,bean,trxName); - PoManager.save(payment); - - - if(cashLine != null) - { - pBean = new PaymentTypeBean(); - pBean.setPaymentType("cash"); - pBean.setId(cashLine.get_ID()); - - } - else - { - pBean = new PaymentTypeBean(); - pBean.setPaymentType("Card_Cheque"); - pBean.setId(payment.get_ID()); - } - - return pBean; - - } - - - public static ArrayList getOpenItems(Properties ctx,Integer C_BPartner_ID) throws OperationException - { - MBPartner bpartner = MBPartner.get(ctx, C_BPartner_ID); - - if(bpartner == null) - { - throw new BPartnerNotFoundException("customer not found"); - } - - String sql="select op.DOCUMENTNO," +//1 - "op.C_INVOICE_ID," +//2 - "op.C_ORDER_ID," +//3 - "op.ISSOTRX," +//4 - "op.DATEINVOICED," +//5 - "op.NETDAYS," +//6 - "op.DUEDATE," +//7 - "op.DAYSDUE," +//8 - "op.DISCOUNTDATE," +//9 - "op.DISCOUNTAMT ," +//10 - "ord.GRANDTOTAL ," +//11 - "op.PAIDAMT," +//12 - "op.OPENAMT," +//13 - "op.C_CURRENCY_ID," +//14 - "op.C_PAYMENTTERM_ID ," +//15 - "op.C_INVOICEPAYSCHEDULE_ID," +//16 - "ord.DOCUMENTNO,"+ //17 - "cr.ISO_CODE,"+ //18 - "pt.NAME,"+//19 - "bp.name|| ' ' || bp.name2,"+//20 - "op.C_BPARTNER_ID,"+//21 - //"DECODE(ord.GRANDTOTAL-nvl(sum(cl.AMOUNT),0),0,'"+Constants.PAID+"',ord.GRANDTOTAL,'"+Constants.UNPAID+"','"+Constants.PARTIALLY_PAID+"') status,"+//22 - " CASE WHEN ord.GRANDTOTAL-COALESCE(sum(cl.AMOUNT),0) = 0 THEN '"+Constants.PAID+"' WHEN ord.GRANDTOTAL-COALESCE(sum(cl.AMOUNT),0) = ord.GRANDTOTAL THEN '"+Constants.UNPAID+"' ELSE '"+Constants.PARTIALLY_PAID+"' END AS status,"+//22 - //" DECODE(sign(op.OPENAMT),-1,'"+Constants.OVER_PAID+"','NULL') sign"+//23 - " CASE WHEN sign(op.OPENAMT) = -1 THEN '"+Constants.OVER_PAID+"' ELSE 'NULL' END AS sign"+//23 - " from RV_OPENITEM op left outer join c_cashline cl on op.C_INVOICE_ID=cl.C_INVOICE_ID,C_ORDER ord,C_CURRENCY cr,C_PAYMENTTERM pt,c_bpartner bp " + - " where op.C_ORDER_ID=ord.C_ORDER_ID"+ - " and op.C_CURRENCY_ID=cr.C_CURRENCY_ID"+ - " and ord.C_PAYMENTTERM_ID=pt.C_PAYMENTTERM_ID"+ - " and op.C_BPARTNER_ID=bp.C_BPARTNER_ID"+ - " and op.C_BPARTNER_ID="+ C_BPartner_ID + - " and op.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - sql=sql+" group by"+ - " op.DOCUMENTNO," +//1 - "op.C_INVOICE_ID," +//2 - "op.C_ORDER_ID," +//3 - "op.ISSOTRX," +//4 - "op.DATEINVOICED," +//5 - "op.NETDAYS," +//6 - "op.DUEDATE," +//7 - "op.DAYSDUE," +//8 - "op.DISCOUNTDATE," +//9 - "op.DISCOUNTAMT ," +//10 - "ord.GRANDTOTAL ," +//11 - "op.PAIDAMT," +//12 - "op.OPENAMT," +//13 - "op.C_CURRENCY_ID," +//14 - "op.C_PAYMENTTERM_ID ," +//15 - "op.C_INVOICEPAYSCHEDULE_ID," +//16 - "ord.DOCUMENTNO,"+ //17 - "cr.ISO_CODE,"+ //18 - "pt.NAME,"+//19 - "bp.name|| ' ' || bp.name2,"+//20 - "op.C_BPARTNER_ID"+ - " order by op.DATEINVOICED desc "; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - OpenItemBean bean=null; - BigDecimal amt = BigDecimal.valueOf(0.0); - - ArrayList list=new ArrayList(); - try - { - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean=new OpenItemBean(); - - bean.setInvoiceNo(rs.getString(1)); - bean.setInvoiceId(rs.getInt(2)); - bean.setOrderId(rs.getInt(3)); - boolean isSoTrx = "Y".equals(rs.getString(4)); - bean.setIsSoTrx(isSoTrx); - bean.setInvoiceDate(rs.getString(5)); - bean.setNetDays(rs.getInt(6)); - bean.setDueDate(rs.getTimestamp(7)); - bean.setDaysDue(rs.getInt(8)); - bean.setDiscountDate(rs.getString(9)); - bean.setDiscountAmt(rs.getBigDecimal(10)); - bean.setInvoiceGrandTotal(rs.getBigDecimal(11)); - amt = getNonProcessedCashAmt(ctx,rs.getInt(2)); - - BigDecimal paidAmt = rs.getBigDecimal(12).add(amt); - if(!isSoTrx) - { - paidAmt = paidAmt.negate(); - } - - bean.setPaidAmt(paidAmt); - bean.setOpenAmt(rs.getBigDecimal(13).subtract(amt)); - bean.setCurrencyId(rs.getInt(14)); - bean.setPaymentTermId(rs.getInt(15)); - bean.setInvoiceScheduleId(rs.getInt(16)); - bean.setDocumentNo(rs.getString(17)); - bean.setCurrencySymbole(rs.getString(18)); - bean.setPaymentTermName(rs.getString(19)); - bean.setPartnerName(rs.getString(20)); - bean.setBpartnerId(rs.getInt(21)); - if(rs.getString(23)==null) - { - bean.setAllocationStatus(rs.getString(22)); - } - else - { - bean.setAllocationStatus(rs.getString(23)); - } - - if (rs.getBigDecimal(12).doubleValue()>0) - { - bean.setAllocationStatus(Constants.PARTIALLY_PAID); - } - list.add(bean); - } - rs.close(); - - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - - pstmt.close(); - } - catch (SQLException e) - { - - } - - } - return list; - } - - - - - - - public static ArrayList getUnallocatedPayments(Properties ctx,int bPartnerId) throws OperationException - { - String sql="select C_PAYMENT_ID ," +//1 - "DOCUMENTNO," +//2 - " CREATED," +//3 - "C_BPARTNER_ID," +//4 - "C_INVOICE_ID," +//5 - //"DECODE(TENDERTYPE,'K','Cheque','C','Card','Cash') tenderType," +//6 - "CASE WHEN TENDERTYPE='K' THEN 'Cheque' WHEN TENDERTYPE= 'C' THEN 'Card' ELSE 'Cash' END AS tenderType," +//6 - "PAYAMT," +//7 - "DISCOUNTAMT,"+//8 - "WRITEOFFAMT," +//9 - "TAXAMT, " +//10 - "OVERUNDERAMT," +//11 - "ALLOCATEDAMT," +//12 - "AVAILABLEAMT," + //13 - "ISRECEIPT " + //14 - " from RV_payment " + - " where C_BPARTNER_ID="+bPartnerId+ - " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " AND DocStatus IN ('CO','CL') " + - " and AVAILABLEAMT <> 0"; - - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs=null; - OpenItemBean bean=null; - - ArrayList list=new ArrayList(); - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean=new OpenItemBean(); - - bean.setPaymentId(rs.getInt(1)); - bean.setPaymentNo(rs.getString(2)); - bean.setTrxDate(rs.getString(3)); - bean.setBpartnerId(rs.getInt(4)); - bean.setInvoiceId(rs.getInt(5)); - bean.setTenderType(rs.getString(6)); - - boolean isReceipt = "Y".equalsIgnoreCase(rs.getString(14)); - BigDecimal paymentAmt = rs.getBigDecimal(7); - BigDecimal discountAmt = rs.getBigDecimal(8); - BigDecimal writeOffAmt = rs.getBigDecimal(9); - BigDecimal taxedAmt = rs.getBigDecimal(10); - BigDecimal overUnderPayment = rs.getBigDecimal(11); - BigDecimal paymentAllocatedAmt = rs.getBigDecimal(12); - BigDecimal availableAmt = rs.getBigDecimal(13); - - bean.setPaymentAmt(isReceipt ? paymentAmt : paymentAmt.negate()); - bean.setDiscountAmt(isReceipt ? discountAmt : discountAmt.negate()); - bean.setWriteOffAmt(isReceipt ? writeOffAmt : writeOffAmt.negate()); - bean.setTaxedAmt(isReceipt ? taxedAmt : taxedAmt.negate()); - bean.setOverUnderPayment(isReceipt ? overUnderPayment : overUnderPayment.negate()); - bean.setPaymentAllocatedAmt(isReceipt ? paymentAllocatedAmt : paymentAllocatedAmt.negate()); - bean.setAvailableAmt(isReceipt ? availableAmt : availableAmt.negate()); - - list.add(bean); - } - - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - - } - - } - return list; - - - } - - - public static ArrayList getAging(Properties ctx,int bPartnerId) throws OperationException - { - ProcessInfoParameter param[]={ - new ProcessInfoParameter("C_BPartner_ID",new BigDecimal(bPartnerId),null,null,null), - new ProcessInfoParameter("IsSOTrx","Y",null,null,null) - }; - - MPInstance instance = new MPInstance(ctx,PROCESS_ID,bPartnerId); - instance.save(); - - ProcessInfo poInfo = new ProcessInfo("Aging",PROCESS_ID); - poInfo.setParameter(param); - poInfo.setAD_Process_ID(PROCESS_ID); - poInfo.setAD_PInstance_ID(instance.get_ID()); - Aging aging = new Aging(); - boolean success= aging.startProcess(ctx, poInfo,null); - ArrayList list = new ArrayList(); - if(success) - { - String sql="select C_CURRENCY_ID," +//1 - " DUEDATE ," +//2 - " C_BP_GROUP_ID," +//3 - " INVOICEDAMT," +//4 - " OPENAMT," +//5 - " PASTDUE91_PLUS," +//6 - " PASTDUE61_90," +//7 - " PASTDUE31_60," +//8 - " PASTDUE1_30 ," +//9 - " PASTDUE8_30," +//10 - " PASTDUE1_7," +//11 - " PASTDUEAMT," +//12 - " DUEAMT," +//13 - " DUE0," +//14 - " DUE1_7," +//15 - " DUE8_30," +//16 - " DUE0_30," +//17 - " DUE31_60," +//18 - " DUE61_90," +//19 - " DUE91_PLUS, " +//20 - " C_INVOICE_ID"+//21 - " from T_AGING"+ - " where C_BPARTNER_ID="+bPartnerId+ - " and AD_PINSTANCE_ID="+instance.get_ID(); - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs=null; - - AgingBean bean=null; - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - bean=new AgingBean(); - bean.setCurrencyId(rs.getInt(1)); - bean.setDueDate(rs.getTimestamp(2)); - bean.setInvoicedAmt(rs.getBigDecimal(4)); - bean.setOpenAmt(rs.getBigDecimal(5)); - bean.setPastDue91_plus(rs.getBigDecimal(6)); - bean.setPastDue61_90(rs.getBigDecimal(7)); - bean.setPastDue31_60(rs.getBigDecimal(8)); - bean.setPastDue1_30(rs.getBigDecimal(9)); - bean.setPastDue8_30(rs.getBigDecimal(10)); - bean.setPastDue1_7(rs.getBigDecimal(11)); - bean.setPastDueAmt(rs.getBigDecimal(12)); - bean.setDueAmt(rs.getBigDecimal(13)); - bean.setDue0(rs.getBigDecimal(14)); - bean.setDue1_7(rs.getBigDecimal(15)); - bean.setDue8_30(rs.getBigDecimal(16)); - bean.setDue0_30(rs.getBigDecimal(17)); - bean.setDue31_60(rs.getBigDecimal(18)); - bean.setDue61_90(rs.getBigDecimal(19)); - bean.setDue91_PLUS(rs.getBigDecimal(20)); - bean.setInvoiceId(rs.getInt(21)); - - list.add(bean); - } - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - } - } - return list; - } - - - public static ArrayList getAllCashPaymentForInvoice(Properties ctx,Integer invoiceId) throws OperationException - { - String sql="select " + - " C_CASHLINE_ID ," + //1 - " CREATED," + //2 - " CREATEDBY," + //3 - " C_CASH_ID," + //4 - " DESCRIPTION," + //5 - " CASHTYPE," + //6 - " C_INVOICE_ID," + //7 - " C_CURRENCY_ID," + //8 - " AMOUNT," +//9 - " DISCOUNTAMT," +//10 - " WRITEOFFAMT" +//11 - " from C_CASHLINE" + - " where C_INVOICE_ID="+invoiceId+ - " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " order by CREATED"; - - ArrayList list = new ArrayList(); - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs=null; - - CreditPaymentDetailsBean bean=null; - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - bean=new CreditPaymentDetailsBean(); - bean.setCashLineId(rs.getInt(1)); - bean.setDateCreated(rs.getTimestamp(2)); - bean.setUserID(rs.getInt(3)); - bean.setCashId(rs.getInt(4)); - bean.setDescription(rs.getString(5)); - bean.setCashType(rs.getString(6)); - bean.setInvoiceId(rs.getInt(7)); - bean.setCurrencyId(rs.getInt(8)); - bean.setPaidAmt(rs.getBigDecimal(9)); - bean.setDiscountAmt(rs.getBigDecimal(10)); - bean.setWriteOffAmt(rs.getBigDecimal(11)); - bean.setTenderType("Cash"); - - list.add(bean); - } - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - } - - return list; - } - - public static ArrayList getAllPaymentForInvoice(Properties ctx,Integer invoiceId) throws OperationException - { - String sql="select C_PAYMENT_ID," + //1 - "CREATED," +//2 - "CREATEDBY," +//3 - "DOCUMENTNO," +//4 - "C_INVOICE_ID," +//5 - //"decode(TENDERTYPE,'"+MPayment.TENDERTYPE_Check+"','Cheque','" + - "CASE WHEN TENDERTYPE='"+MPayment.TENDERTYPE_Check+"' THEN 'Cheque' " + - //MPayment.TENDERTYPE_CreditCard+"','Card')," +//6 - " WHEN TENDERTYPE='"+MPayment.TENDERTYPE_CreditCard+"' THEN 'Card' END ," +//6 - "CREDITCARDNUMBER," +//7 - "CHECKNO," +//8 - "PAYAMT," +//9 - "DISCOUNTAMT," +//110 - "WRITEOFFAMT," +//11 - "C_CURRENCY_ID" + //12 - " from c_payment"+ - " where C_INVOICE_ID="+invoiceId+ - " and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " order by CREATED"; - - ArrayList list = new ArrayList(); - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs=null; - - CreditPaymentDetailsBean bean=null; - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - bean=new CreditPaymentDetailsBean(); - bean.setPaymentId(rs.getInt(1)); - bean.setDateCreated(rs.getTimestamp(2)); - bean.setUserID(rs.getInt(3)); - bean.setDocumentNo(rs.getString(4)); - bean.setInvoiceId(rs.getInt(5)); - bean.setTenderType(rs.getString(6)); - bean.setCreditCardNumber(rs.getString(7)); - bean.setChequeNo(rs.getString(8)); - bean.setPaidAmt(rs.getBigDecimal(9)); - bean.setDiscountAmt(rs.getBigDecimal(10)); - bean.setWriteOffAmt(rs.getBigDecimal(11)); - bean.setCurrencyId(rs.getInt(12)); - - list.add(bean); - } - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - - { - if(rs!=null) - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - - } - } - - return list; - } - - public static MInOut createAndCompleteShipment(Properties ctx,int invoiceId) throws OperationException - { - return createAndCompleteShipment(ctx, invoiceId, null); - } - - public static MInOut createAndCompleteShipment(Properties ctx, int invoiceId, String trxName) throws OperationException - { - MInvoice invoice = new MInvoice(ctx,invoiceId,trxName); - MOrder order = new MOrder(ctx,invoice.getC_Order_ID(),trxName); - MInOut shipment=MinOutManager.createMInOut(ctx,invoice,order.getM_Warehouse_ID()); - MInOut completedShipment= MinOutManager.completeShipment(ctx, shipment); - order.setIsDelivered(true); - PoManager.save(order); - return completedShipment; - } - - public static ArrayList viewAllocation(Properties ctx,String bpartnerName, String invoiceNumber, boolean isCustomer, boolean isVendor) throws OperationException - { - String sql="select al.C_INVOICE_ID," +//1 - "inv.documentNo," +//2 - "al.C_BPARTNER_ID," +//3 - "al.C_ORDER_ID," +//4 - "ord.documentno," +//5 - "al.C_PAYMENT_ID," +//6 - "al.C_CASHLINE_ID," +//7 - "al.AMOUNT," +//8 - "al.DISCOUNTAMT," +//9 - "al.WRITEOFFAMT," +//10 - "bp.name||' ' ||bp.name2 ," +//11 - "al.OVERUNDERAMT, " +//12 - "al.C_ALLOCATIONHDR_ID"+//13 - " from C_ALLOCATIONLINE al,c_invoice inv,c_order ord,c_bpartner bp" + - " where al.c_invoice_id = inv.c_invoice_id" + - " and al.C_ORDER_ID=ord.C_ORDER_ID"+ - " and al.C_BPARTNER_ID=bp.C_BPARTNER_ID "; - - if(isCustomer) - sql=sql+ " and bp.isCustomer='Y'"; - - if(isVendor) - sql=sql+ " and bp.isVendor='Y'"; - - if(bpartnerName!=null) - sql=sql+ " and lower(bp.name||' ' ||bp.name2) like lower('%"+bpartnerName+"%')"; - - if(invoiceNumber!=null) - sql=sql+" and inv.documentNo='"+invoiceNumber+"'"; - - ArrayList list = new ArrayList(); - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs=null; - - String invoiceNo=null; - String documentNo=null; - String partnerName=null; - - PaymentAllocationBean bean=null; - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - - bean=new PaymentAllocationBean(); - bean.setInvoiceId(rs.getInt(1)); - if(invoiceNo==null || !invoiceNo.equals(rs.getString(2))) - { - bean.setInvoiceNo(rs.getString(2)); - invoiceNo=rs.getString(2); - } - bean.setBpartnerId(rs.getInt(3)); - bean.setOrderId(rs.getInt(4)); - if(documentNo==null || !documentNo.equals(rs.getString(5))) - { - bean.setDocumentNo(rs.getString(5)); - documentNo=rs.getString(5); - } - - if(rs.getInt(6)!=0) - { - bean.setPaymentId(rs.getInt(6)); - } - - if(rs.getInt(7)!=0) - { - bean.setCashLineId(rs.getInt(7)); - } - if(rs.getInt(6)==0 && rs.getInt(7)==0) - { - getReturnedInvoice(ctx,bean,rs.getInt(1),rs.getInt(13),rs.getBigDecimal(8)); - } - - bean.setAmount(rs.getBigDecimal(8)); - bean.setDiscountAmt(rs.getBigDecimal(9)); - bean.setWriteOffAmt(rs.getBigDecimal(10)); - - if(partnerName==null || !partnerName.equals(rs.getString(11))) - { - bean.setPartnerName(rs.getString(11)); - partnerName=rs.getString(11); - } - bean.setOverUnderPayment(rs.getBigDecimal(12)); - list.add(bean); - } - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - if(rs!=null) - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - - } - } - - return list; - - } - - - private static void getReturnedInvoice(Properties ctx,PaymentAllocationBean bean,int invoiceId, int C_ALLOCATIONHDR_ID,BigDecimal amt) throws OperationException - { - String sql="select al.C_INVOICE_ID,inv.documentNo" + - " from C_ALLOCATIONLINE al,c_invoice inv " + - " where al.c_invoice_id = inv.c_invoice_id"+ - " and al.C_ALLOCATIONHDR_ID= "+C_ALLOCATIONHDR_ID+ - " and al.C_INVOICE_ID<>"+invoiceId+ - " and al.AMOUNT="+amt.negate(); - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs=null; - - - try - { - rs = pstmt.executeQuery(); - while(rs.next()) - { - bean.setCreditMemoId(rs.getInt(1)); - bean.setCreditMemoNumber(rs.getString(2)); - } - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - - { - if(rs!=null) - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - - } - } - - - } - - - - - private static MOrder completeCreditOrder(Properties ctx,MOrder order, String trxName) throws BPartnerOverCreditLimitException,OperationException - { - // POSManager.completePOSOrder2() - MOrder completedOrder = OrderManager.completeOrder(ctx,order); - int [] invoiceIds=InvoiceManager.getInvoiceIdsForOrder(ctx,order.get_ID(),trxName); - if(invoiceIds.length<1) - throw new OperationException("No invoice generated"); - if(invoiceIds.length>1) - throw new OperationException("More than one invoice for the order has been generated"); - //MInvoice invoice = new MInvoice(ctx,invoiceIds[0],trxName); - //InvoiceManager.printInvoice(ctx,invoice); - - return completedOrder; - } - - private static BigDecimal getNonProcessedCashAmt(Properties ctx, int invoiceId) throws OperationException - { - String sql = "select nvl(sum(cl.AMOUNT),0)" + - " from c_cashline cl,C_CASH ca" + - " where cl.c_cash_id = ca.c_cash_id " + - " and cl.c_invoice_id = " +invoiceId+ - " and cl.AD_CLIENT_ID = " +Env.getAD_Client_ID(ctx)+ - " and ca.docstatus = '"+DocumentEngine.STATUS_Drafted+"'"; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - ResultSet rs=null; - BigDecimal amt = new BigDecimal(0); - - - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - amt=rs.getBigDecimal(1); - } - - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - - } - - } - return amt; - - - } - -} - - diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CSVReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CSVReportManager.java deleted file mode 100644 index d30a559f85..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CSVReportManager.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Praveen Beekoo - */ -package org.posterita.businesslogic.performanceanalysis; - -import java.io.FileWriter; -import java.io.IOException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import org.compiere.util.DB; - -import org.posterita.core.RandomStringGenerator; -import org.posterita.exceptions.OperationException; - -public class CSVReportManager -{ - public static String generateCSVReport(Properties ctx, String sql) throws OperationException - { - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - return generateCSVReport(ctx, pstmt); - } - public static String generateCSVReport(Properties ctx, PreparedStatement pstmt) throws OperationException - { - ResultSet rs; - StringBuffer sb = new StringBuffer(); - -// int count=0; - try - { - rs = pstmt.executeQuery(); - - int columnCount = rs.getMetaData().getColumnCount(); - for(int i = 1; i <= columnCount; i++) - { - if(i == 1) - sb.append("\""); - else - sb.append(",\""); - - sb.append(rs.getMetaData().getColumnName(i)); - sb.append("\""); - } - - sb.append("\n"); - - while(rs.next()) - { - for(int i = 1; i <= columnCount; i++) - { - if(i == 1) - sb.append("\""); - else - sb.append(",\""); - - sb.append(rs.getObject(i)); - sb.append("\""); - } - - sb.append("\n"); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception ex){} - - pstmt = null; - } - - String filename = RandomStringGenerator.randomstring() + ".csv"; - String filepath = ReportManager.getReportPath(filename); - - try - { - FileWriter writer = new FileWriter(filepath); - writer.write(sb.toString()); - writer.flush(); - writer.close(); - } - catch (IOException e1) - { - throw new OperationException(e1); - } - - return filename; - } - - public static String generateCSVReport(Properties ctx, ArrayList reportDataSource) throws OperationException - { -// ResultSet rs; - StringBuffer sb = new StringBuffer(); - - Iterator iter = reportDataSource.iterator(); - - while(iter.hasNext()) - { - Object[] obj = (Object[]) iter.next(); - - for(int i = 0; i < obj.length; i++) - { - if(i == 0) - sb.append("\""); - else - sb.append(",\""); - - sb.append(obj[i]); - sb.append("\""); - } - - sb.append("\n"); - } - - String filename = RandomStringGenerator.randomstring() + ".csv"; - String filepath = ReportManager.getReportPath(filename); - - try - { - FileWriter writer = new FileWriter(filepath); - writer.write(sb.toString()); - writer.flush(); - writer.close(); - } - catch (IOException e1) - { - throw new OperationException(e1); - } - - return filename; - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CustomPOSReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CustomPOSReportManager.java deleted file mode 100644 index 64c2d21933..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/CustomPOSReportManager.java +++ /dev/null @@ -1,553 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author Praveen Beekoo - */ -package org.posterita.businesslogic.performanceanalysis; - -import java.awt.Color; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; -import java.util.Properties; -import java.util.TreeMap; - -import org.compiere.util.Env; -import org.jfree.chart.axis.DateAxis; -import org.jfree.chart.labels.StandardPieSectionLabelGenerator; -import org.jfree.chart.plot.PiePlot; -import org.jfree.chart.plot.XYPlot; -import org.jfree.data.category.DefaultCategoryDataset; -import org.jfree.data.general.DefaultPieDataset; -import org.jfree.data.time.Day; -import org.jfree.data.time.TimeSeries; -import org.jfree.data.time.TimeSeriesCollection; -import org.posterita.Constants; -import org.posterita.beans.ReportBean; -import org.posterita.beans.TabularReportRecordBean; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.core.BarChart; -import org.posterita.core.PieChart; -import org.posterita.core.TabularReport; -import org.posterita.core.TimeSeriesChart; -import org.posterita.core.TimestampConvertor; -import org.posterita.exceptions.OperationException; - -public class CustomPOSReportManager -{ - public static PieChart generatePieChart(Properties ctx,String title,String subtitle,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup,String priceQtyFilter) throws OperationException - { - PieChart pieChart = new PieChart(); - pieChart.setTitle(title); - pieChart.setSubtitle(subtitle); - - String pieChartSQL = SalesAnalysisReportManager.getPieChartDataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); - ArrayList list = ReportManager.getReportData(ctx,pieChartSQL,false); - DefaultPieDataset pieDataset = new DefaultPieDataset(); - StandardPieSectionLabelGenerator labelGenerator = null; - - - if(priceQtyFilter.equalsIgnoreCase(Constants.PRICE)) - { - //against price - for(Object[] obj:list) - { - String name = (String) obj[0]; - BigDecimal price = (BigDecimal) obj[1]; - - pieDataset.setValue(name,price); - } - - String currency = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); - labelGenerator = new StandardPieSectionLabelGenerator("{0} = "+ currency +"{1}"); - } - else - { - //against qty - for(Object[] obj:list) - { - String name = (String) obj[0]; - BigDecimal qty = (BigDecimal) obj[2]; - - pieDataset.setValue(name,qty); - } - - labelGenerator = new StandardPieSectionLabelGenerator(); - } - - - pieChart.setDataset(pieDataset); - PiePlot p = (PiePlot) pieChart.getChart().getPlot(); - p.setLegendLabelGenerator(labelGenerator); - pieChart.getChart().setBackgroundPaint(Color.white); - - return pieChart; - } - - public static BarChart generateBarChart(Properties ctx,String title,String subtitle,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup,String priceQtyFilter) throws OperationException - { - BarChart barChart = new BarChart(); - barChart.setTitle(title); - barChart.setSubtitle(subtitle); - //barChart.getDataSetFromSQL(barChartSQL); - - String barChartSQL = SalesAnalysisReportManager.getBarChartDataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); - ArrayList list = ReportManager.getReportData(ctx,barChartSQL,true); - DefaultCategoryDataset categoryDataset = new DefaultCategoryDataset(); - - Object[] header = list.remove(0); - String grouping = header[0]+""; - String yLabel = null; - - - if(priceQtyFilter.equalsIgnoreCase(Constants.PRICE)) - { - String currency = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); - - //against price - for(Object[] obj:list) - { - String name = (String) obj[0]; - BigDecimal price = (BigDecimal) obj[1]; - - categoryDataset.setValue(price,grouping,name); - yLabel = "Value (" + currency + ")"; - } - } - else - { - //against qty - for(Object[] obj:list) - { - String name = (String) obj[0]; - BigDecimal qty = (BigDecimal) obj[2]; - - categoryDataset.setValue(qty,grouping,name); - yLabel = "Quantity"; - } - } - - //xLabel = grouping; - - //--------------------------------------------------------------------------------- - barChart.setDataset(categoryDataset); - barChart.setIntegerTickUnits(true); - - //CategoryItemRenderer itemRender = barChart.getChart().getPlot(); - //itemRender.setItemLabelGenerator(new StandardCategoryItemLabelGenerator()); - - barChart.setYLabel(yLabel); - //barChart.setXLabel(xLabel); - barChart.setShowLabels(true); - barChart.getChart().setBackgroundPaint(Color.white); - - - return barChart; - } - - public static TimeSeriesChart generateTimeSeriesChart(Properties ctx,String title,String subtitle,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup,String priceQtyFilter) throws OperationException - { - TimeSeriesChart timeSeriesChart = new TimeSeriesChart(); - timeSeriesChart.setTitle(title); - timeSeriesChart.setSubtitle(subtitle); - timeSeriesChart.setShowShapes(true); - //timeSeriesChart.getDataSetFromSQL(timeSeriesChartSQL); - - String timeSeriesChartSQL = SalesAnalysisReportManager.getTimeSeriesDataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); - ArrayList list = ReportManager.getReportData(ctx,timeSeriesChartSQL,false); - - TimeSeriesCollection dataset = new TimeSeriesCollection(); - TimeSeries series = null; - String yLabel = null; - - String seriesName = null; - String date = null; - BigDecimal price = null; - String[] s = null; - int day,month,year; - - for (Object[] data : list) - { - seriesName = (String)data[0]; - date = (String)data[1]; - price = (BigDecimal) data[2]; - s = date.split("-"); - - if(s.length!=3) - throw new OperationException("Unable to generate timeseries. " + - "Cause:Invalid date format, the date returned should have the following format 'DD-MM-YYYY'"); - - SimpleDateFormat sdf = new SimpleDateFormat(); - Calendar cal = Calendar.getInstance(); - Date d = null; - - try - { - sdf.applyPattern("dd-MM-yyyy"); - d = sdf.parse(date); - } - catch (ParseException e1) - { - try - { - sdf.applyPattern("dd-MMM-yyyy"); - d = sdf.parse(date); - } - catch (ParseException e) - { - throw new OperationException("Unable to generate timeseries. " + - "Cause:Invalid date format, the date returned should have one of the following formats 'DD-MM-YYYY' or 'DD-MMM-YYYY'",e); - } - } - - - cal.setTime(d); - - day = cal.get(Calendar.DATE); - month = cal.get(Calendar.MONTH) + 1; - year = cal.get(Calendar.YEAR); - - series = dataset.getSeries(seriesName); - - if(series == null) - { - series = new TimeSeries(seriesName,Day.class); - series.add(new Day(day,month,year),price); - - dataset.addSeries(series); - } - else - { - series.add(new Day(day,month,year),price); - }//if - - }//for - - if(priceQtyFilter.equalsIgnoreCase(Constants.PRICE)) - { - //against price - String currency = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); - yLabel = "Value (" + currency + ")"; - } - else - { - yLabel = "Quantity"; - } - - timeSeriesChart.setYLabel(yLabel); - timeSeriesChart.setDataset(dataset); - XYPlot plot = (XYPlot) timeSeriesChart.getChart().getPlot(); - DateAxis axis = (DateAxis) plot.getDomainAxis(); - - SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - - axis.setRange(fromDate, toDate); - //axis.setTickUnit(new DateTickUnit(DateTickUnit.MONTH,1,new SimpleDateFormat("MMM-yyyy"))); - timeSeriesChart.getChart().setBackgroundPaint(Color.white); - - return timeSeriesChart; - } - - public static TabularReport generateTabularReport(Properties ctx,String title,String subtitle,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup,String priceQtyFilter) throws OperationException - { - String sql = SalesAnalysisReportManager.getTabularDataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); - ArrayList tmpData = ReportManager.getReportData(ctx,sql,true); - String currency = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); - - ArrayList reportData = new ArrayList(); - //copying data from tmpData to reportData - - NumberFormat formatter = new DecimalFormat("###,###,##0.00"); - - Iterator iter = tmpData.iterator(); - - Object[] data = null; - Object[] headers = null; - BigDecimal b,c = null; - - boolean isTaxDue = (account_id == Constants.TAX_DUE.intValue() ); - boolean isTaxCredit = (account_id == Constants.TAX_CREDIT.intValue() ); - - if(isTaxCredit || isTaxDue) - { - //copying header - headers = iter.next(); - - reportData.add( new Object[]{ - headers[0] +"("+ currency +")", - }); - - while(iter.hasNext()) - { - data = iter.next(); - - if(data.length == 1) - { - b = (BigDecimal)data[0]; - data[0] = formatter.format(b.doubleValue()); - } - - reportData.add(data); - } - } - else - { - //copying header - headers = iter.next(); - - reportData.add( new Object[]{ - headers[0], - headers[1], - headers[2] +"("+ currency +")", - headers[3] - }); - - double totalAmt = 0.0d; - BigDecimal totalQty = Env.ZERO; - - while(iter.hasNext()) - { - data = iter.next(); - - - if(data.length > 2) - { - b = (BigDecimal)data[2]; - c = (BigDecimal)data[3]; - - data[2] = formatter.format(b.doubleValue()); - - totalAmt += b.doubleValue(); - totalQty = totalQty.add(c); - - } - - reportData.add(data); - } - - reportData.add(new Object[]{"Total","", formatter.format(totalAmt)+"", totalQty+""}); - - } - - - //style for table - String tableStyle = "display"; - //style for columns - String[] styles = new String[]{"string","date","currency","numeric"}; - - if(isTaxCredit || isTaxDue) - { - styles = new String[]{"numeric"}; - } - - //constructing the table - TabularReport tReport = new TabularReport(reportData); - //tReport.setSortable(true); - tReport.setHeaderStyle(styles); - tReport.setStyle(tableStyle); - tReport.setTitle(title); - tReport.setSubtitle(subtitle); - tReport.createReport(); - - return tReport; - } - - public static TabularReport generateTabularReportGroupByDate(Properties ctx,String title,String subtitle,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup,String priceQtyFilter) throws OperationException - { - boolean isTaxDue = (account_id == Constants.TAX_DUE.intValue() ); - boolean isTaxCredit = (account_id == Constants.TAX_CREDIT.intValue() ); - - NumberFormat formatter = new DecimalFormat("###,###,##0.00"); - - String sql = SalesAnalysisReportManager.getTabularDataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); - ArrayList tmpData = ReportManager.getReportData(ctx,sql,true); - String currency = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); - - - ArrayList reportData = new ArrayList(); - Object[] data = null; - BigDecimal b = null; - - if(isTaxCredit || isTaxDue) - { - reportData.add( tmpData.remove(0) ); - Iterator iter = tmpData.iterator(); - - while(iter.hasNext()) - { - data = iter.next(); - - if(data.length == 1) - { - b = (BigDecimal)data[0]; - data[0] = formatter.format(b.doubleValue()); - } - - reportData.add(data); - } - } - else - { - //---------------------------------------------------------------------------------------------------------------------------------------------------------- - TreeMap map = new TreeMap(); - - String productName = null; - BigDecimal price = null; - BigDecimal qty = null; - - TabularReportRecordBean bean = null; - - ArrayList reportData2 = new ArrayList(); - Object[] headers = tmpData.remove( 0 ); - - //adding headers - reportData2.add( new Object[]{ - headers[0], - //headers[1], - headers[2] +"("+ currency +")", - headers[3] - } ); - - double totalAmt = 0.0d; - int totalQty = 0; - - for( Object[] record : tmpData) - { - productName = (String) record[0]; - price = (BigDecimal) record[2]; - qty = (BigDecimal) record[3]; - - totalAmt += price.doubleValue(); - totalQty += qty.intValue(); - - bean = map.get( productName ); - - if( bean == null ) - { - bean = new TabularReportRecordBean(); - - bean.setProductName( productName ); - bean.setDate(""); - bean.setPrice( price ); - bean.setQty( qty ); - } - else - { - bean.setPrice( bean.getPrice().add( price ) ); - bean.setQty( bean.getQty().add( qty ) ); - } - - map.put( productName, bean ); - - }//for - - - Collection c = map.values(); - - for( TabularReportRecordBean tbean : c ) - { - Object[] obj = new Object[]{ - tbean.getProductName(), - tbean.getPrice(), - tbean.getQty() - }; - - reportData2.add( obj ); - } - - reportData.add( reportData2.remove(0) ); - - Iterator iter = reportData2.iterator(); - - while(iter.hasNext()) - { - data = iter.next(); - - if(data.length > 2) - { - b = (BigDecimal)data[1]; - data[1] = formatter.format(b.doubleValue()); - } - - reportData.add(data); - } - - reportData.add(new Object[]{"Total","" + formatter.format(totalAmt), totalQty + ""}); - - } - - - //style for table - String tableStyle = "display"; - //style for columns - String[] styles = new String[]{"string","currency","numeric"}; - - if(isTaxCredit || isTaxDue) - { - styles = new String[]{"numeric"}; - } - - //constructing the table - TabularReport tReport = new TabularReport(reportData); - //tReport.setSortable(true); - tReport.setHeaderStyle(styles); - tReport.setStyle(tableStyle); - tReport.setTitle(title); - tReport.setSubtitle(subtitle); - tReport.createReport(); - - return tReport; - } - - /** - * Generates the title of the custom report - * @param ctx - * @param title - * @param bean - * @return true is returned if set - */ - public static boolean setTitle(Properties ctx, String title, ReportBean bean) - { - return true; - } - - /** - * Generates the subtitle of the custom report - * @param ctx - * @param subtitle - * @param bean - * @return true is returned if set - */ - public static String setSubTitle(Properties ctx, String subtitle, ReportBean bean) - { - return null; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSReportManager.java deleted file mode 100644 index ddf8897523..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSReportManager.java +++ /dev/null @@ -1,3961 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 9, 2006 by alok - */ - -package org.posterita.businesslogic.performanceanalysis; - -import java.awt.Color; -import java.io.FileOutputStream; -import java.io.PrintWriter; -import java.io.Writer; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.text.DateFormatSymbols; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import org.apache.ecs.XhtmlDocument; -import org.apache.ecs.xhtml.head; -import org.compiere.db.Database; -import org.compiere.model.I_AD_ReportView; -import org.compiere.model.Lookup; -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MDocType; -import org.compiere.model.MInOut; -import org.compiere.model.MInvoice; -import org.compiere.model.MLocation; -import org.compiere.model.MOrder; -import org.compiere.model.MOrg; -import org.compiere.model.MPInstance; -import org.compiere.model.MPInstancePara; -import org.compiere.model.MProcess; -import org.compiere.model.MProcessPara; -import org.compiere.model.MProduct; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MTable; -import org.compiere.model.MTransaction; -import org.compiere.model.MUOM; -import org.compiere.model.MUser; -import org.compiere.model.MWarehouse; -import org.compiere.model.PrintInfo; -import org.compiere.print.DataEngine; -import org.compiere.print.MPrintFormat; -import org.compiere.print.MPrintFormatItem; -import org.compiere.print.PrintData; -import org.compiere.print.PrintDataElement; -import org.compiere.print.ReportEngine; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.report.ReportStarter; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Language; -import org.compiere.util.Util; -import org.posterita.Constants; -import org.posterita.beans.BPartnerBean; -import org.posterita.beans.CloseTillBean; -import org.posterita.beans.POSHistoryBean; -import org.posterita.beans.POSReportBean; -import org.posterita.beans.ProductBean; -import org.posterita.beans.WebMinOutLineBean; -import org.posterita.beans.WebOrderLineBean; -import org.posterita.businesslogic.MinOutManager; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.POSStockManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.core.RandomStringGenerator; -import org.posterita.core.TimestampConvertor; -import org.posterita.exceptions.LogoException; -import org.posterita.exceptions.MandatoryException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.UnsupportedDatabaseException; -import org.posterita.lib.UdiConstants; -import org.posterita.order.UDIOrderTypes; -import org.posterita.util.PathInfo; -import org.posterita.util.TmkPrinterConstants; - -import com.lowagie.text.Chunk; -import com.lowagie.text.Document; -import com.lowagie.text.Element; -import com.lowagie.text.Font; -import com.lowagie.text.Image; -import com.lowagie.text.PageSize; -import com.lowagie.text.Paragraph; -import com.lowagie.text.Phrase; -import com.lowagie.text.pdf.PdfPCell; -import com.lowagie.text.pdf.PdfPTable; -import com.lowagie.text.pdf.PdfWriter; - -public class POSReportManager { - - private static final String ASCENDING_SORT = "asc"; - - private static String getMaxMinSoldProductsSQL(Properties ctx, - String reportType, Timestamp fromDate, Timestamp toDate) { - String sql = ""; - if (DB.getDatabase().getName().equals(Database.DB_POSTGRESQL) || DB.getDatabase().getName().equals(Database.DB_ORACLE)) - { - sql = "select qty,name,COALESCE(upc, ' ') as barcode,M_PRODUCT_ID from " - + "(select sum(ol.QTYENTERED) as qty,pr.NAME, pr.UPC,ol.M_PRODUCT_ID," - //+ "DENSE_RANK() OVER (ORDER BY sum(ol.QTYENTERED) " - //+ reportType - //+ " NULLS LAST) AS Drank" - + " max(ol.QTYENTERED) AS Drank" - + " from C_ORDERLINE ol,C_ORDER ord,M_product pr" - + " where ol.C_ORDER_ID=ord.c_order_id" - + " and ol.M_PRODUCT_ID=pr.M_PRODUCT_ID" - + " and ol.AD_ORG_ID=" - + Env.getAD_Org_ID(ctx) - + " and ol.AD_CLIENT_ID=" - + Env.getAD_Client_ID(ctx) - + " and ord.ISACTIVE='Y'" - + " and ol.CREATED between " + DB.TO_DATE(fromDate, false) - + " and " + DB.TO_DATE(toDate, false) - + " and ord.ORDERTYPE='"+ UDIOrderTypes.POS_ORDER.getOrderType() +"'" - + " and ord.DOCSTATUS='CO' group by pr.NAME,pr.UPC,ol.M_PRODUCT_ID) fastStockMovement" - + " where drank <26 order by qty " + reportType; - } - - else - throw new UnsupportedDatabaseException( - "Operation GetMaxMinSoldProducts not supported on Database: " - + DB.getDatabase().getName()); - - return sql; - } - - public static ArrayList getMaxMinSoldProducts(Properties ctx, - String reportType, Timestamp fromDate, Timestamp todate) - throws OperationException { - String sql = getMaxMinSoldProductsSQL(ctx, reportType, fromDate, todate); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - ProductBean bean = null; - ArrayList list = new ArrayList(); - - // TreeMap tree = new - // TreeMap(); - try { - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) { - bean = new ProductBean(); - BigDecimal qty = getQtyReturnedFromCustomer(ctx, rs.getInt(4), - fromDate, todate); - bean.setProductName(rs.getString(2).replaceAll("~", " ")); - bean.setBarCode(rs.getString(3)); - BigDecimal qty1 = rs.getBigDecimal(1); - int productId = rs.getInt(4); - MProduct product = new MProduct(ctx, productId, null); - String uom = product.getUOMSymbol(); - bean.setUom(uom); - if (qty1 == null) - { - qty1 = BigDecimal.ZERO; - } - if (qty == null) - { - qty = BigDecimal.ZERO; - } - - BigDecimal quantity = qty1.subtract(qty); - bean.setQuantity(quantity); - - list.add(bean); - } - rs.close(); - - Collections.sort(list, getSortingComparator(reportType)); - return list; - - } catch (SQLException e) { - throw new OperationException(e); - } finally { - try { - pstmt.close(); - } catch (Exception e) { - } - - pstmt = null; - } - - } - - private static Comparator getSortingComparator( - final String order) { - Comparator comp = new Comparator() { - - public int compare(ProductBean o1, ProductBean o2) { - if (o1.getQuantity().intValue() < o2.getQuantity().intValue()) - return (order.equals(ASCENDING_SORT) ? -1 : 1); - else if (o1.getQuantity().intValue() > o2.getQuantity() - .intValue()) - return (order.equals(ASCENDING_SORT) ? 1 : -1); - else - return 0; - } - - }; - return comp; - } - - private static BigDecimal getQtyReturnedFromCustomer(Properties ctx, - int productId, Timestamp fromDate, Timestamp toDate) - throws OperationException { - BigDecimal qty = Env.ZERO; - - String sql = "select" + " sum(ol.qtyordered)" - + " from C_ORDER ord,C_ORDERLINE ol" - + " where ord.C_ORDER_ID=ol.c_order_id " - + " and ord.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " and ol.M_PRODUCT_ID=" + productId + " and ord.orderType='" - + UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType() + "'" - + " and ol.CREATED between "+ DB.TO_DATE(fromDate, false) + " and " + DB.TO_DATE(toDate, false); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - try { - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) { - qty = rs.getBigDecimal(1); - } - - rs.close(); - } catch (SQLException e) { - throw new OperationException(e); - } finally { - try { - pstmt.close(); - } catch (Exception e) { - } - - pstmt = null; - } - - return qty; - } - - public static ArrayList getStockMovementReport( - Properties ctx, Timestamp fromDate, Timestamp toDate) - throws OperationException { - - String sql = "select distinct v.m_product_id," + " pr.name" - + " from M_TRANSACTION_V v,m_product pr" - + " where v.m_product_id=pr.m_product_id" - + " and v.CREATED between "+DB.TO_DATE(fromDate, false) - + " and "+ DB.TO_DATE(toDate, false) - + " and v.AD_CLIENT_ID=" - + Env.getAD_Client_ID(ctx) + " and v.AD_ORG_ID=" - + Env.getAD_Org_ID(ctx) + " order by pr.name"; - - MWarehouse warehouse = POSTerminalManager.getWarehouse(ctx); - /* - * String sql = "select" + " distinct M_PRODUCT_ID " + //3 " from - * M_STORAGE st" + " where st.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ " - * and st.AD_ORG_ID=" +Env.getAD_Org_ID(ctx)+ " and st.M_LOCATOR_ID=" - * +warehouse.getDefaultLocator().getID(); - */ - - // String whereClause = "AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and - // AD_ORG_ID="+Env.getAD_Org_ID(ctx); - - POSReportBean bean; - ArrayList list = new ArrayList(); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - ResultSet rs; - try { - rs = pstmt.executeQuery(); - while (rs.next()) { - BigDecimal qtyOfSales; - BigDecimal qtyOfReceipts; - BigDecimal qtyOfReturn; - BigDecimal qtyOfCustReturn; - BigDecimal openingBal; - BigDecimal closingBal; - BigDecimal qtyofSalesByCredit; - BigDecimal qtyInventoryIn; - // int qtyInventoryOut; - - /* - * if(!isProductPresentInOrder(ctx,rs.getInt(1),fromDate,todate)) - * continue; - */ - MProduct product = MProduct.get(ctx, rs.getInt(1)); - int uomPrecision = MUOM.getPrecision(ctx, product.getC_UOM_ID()); - String uom = product.getUOMSymbol(); - openingBal = getQtyOfOrders(ctx, null, rs.getInt(1), fromDate, - toDate, "opening", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); - // closingBal=getQtyOfOrders(ctx,null,rs.getInt(1),fromDate,todate,"closing",warehouse); - qtyOfSales = getQtyOfOrders(ctx, UDIOrderTypes.POS_ORDER - .getOrderType(), rs.getInt(1), fromDate, toDate, - "none", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); - qtyofSalesByCredit = getQtyOfOrders(ctx, - UDIOrderTypes.CREDIT_ORDER.getOrderType(), - rs.getInt(1), fromDate, toDate, "none", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); - qtyOfReceipts = getQtyOfOrders(ctx, - UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType(), rs - .getInt(1), fromDate, toDate, "none", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); - qtyOfReturn = getQtyOfOrders(ctx, - UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType(), rs - .getInt(1), fromDate, toDate, "none", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); - qtyOfCustReturn = getQtyOfOrders(ctx, - UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType(), rs - .getInt(1), fromDate, toDate, "none", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); - qtyInventoryIn = getQtyOfOrders(ctx, null, rs.getInt(1), - fromDate, toDate, "inventortIn", warehouse).setScale(uomPrecision, RoundingMode.HALF_UP); - // qtyInventoryOut - // =getQtyOfOrders(ctx,null,rs.getInt(1),fromDate,todate,"inventoryOut",warehouse); - closingBal = openingBal.subtract( - (qtyOfSales.add(qtyOfReturn).add(qtyofSalesByCredit). - add(qtyOfReceipts).add(qtyOfCustReturn).add(qtyInventoryIn))); - bean = new POSReportBean(); - try - { - bean.setProductName(ProductManager.getProductName(ctx, rs.getInt(1))); - bean.setProductId(rs.getInt(1)); - } - - catch (Exception e) - { - throw new OperationException(e); - } - - bean.setOpeningBalanceQty(openingBal); - bean.setQtyOfGoodsSold(qtyOfSales.add(qtyofSalesByCredit)); - bean.setQtyOfGoodsReceived(qtyOfReceipts); - bean.setQtyOfGoodsReturned(qtyOfReturn); - bean.setCloseingBalanceQty(closingBal); - bean.setQtyInventoryIn(qtyInventoryIn); - // bean.setQtyInventoryOut(Integer.valueOf(qtyInventoryOut)); - bean.setQtyReturnedByCustomer(qtyOfCustReturn); - bean.setUom(uom); - list.add(bean); - } - - rs.close(); - - } - - catch (SQLException e) { - throw new OperationException(e); - } finally { - try { - pstmt.close(); - } catch (Exception e) { - } - - pstmt = null; - } - - return list; - - } - - public static ArrayList getStockMovementReportData( - Properties ctx, Timestamp fromDate, Timestamp todate) - throws OperationException { - - ArrayList list = getStockMovementReport(ctx, fromDate, - todate); - ArrayList reportData = new ArrayList(); - - Object[] headers = new Object[] { "Product Name", "Uom","Opening Balance", - "Inventory In / Out", "Qty Received", "Qty Sold", - "Qty Returned to Supplier", "Qty Returned by Customer", - "Closing Balance" }; - - Object[] data = null; - - reportData.add(headers); - - for (POSReportBean bean : list) { - data = new Object[9]; - - data[0] = bean.getProductName(); - data[1] = bean.getUom(); - data[2] = bean.getOpeningBalanceQty(); - data[3] = bean.getQtyInventoryIn(); - data[4] = bean.getQtyOfGoodsReceived(); - data[5] = bean.getQtyOfGoodsSold(); - data[6] = bean.getQtyOfGoodsReturned(); - data[7] = bean.getQtyReturnedByCustomer(); - data[8] = bean.getCloseingBalanceQty(); - - reportData.add(data); - } - - return reportData; - } - - private static BigDecimal getQtyOfOrders(Properties ctx, String orderType, - int productId, Timestamp fromDate, Timestamp toDate, String queryType, - MWarehouse warehouse) throws OperationException { - - String sql = null; - String whereClause = "ol.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " and ol.AD_ORG_ID=" + Env.getAD_Org_ID(ctx); - - // SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy"); - // String date = sdf.format(toDate); - - if (queryType.equalsIgnoreCase("none")) - - sql = "select sum(ol.qtyInvoiced)" - + " from c_orderLine ol,C_ORDER ord" - + " where ol.C_ORDER_ID=ord.C_ORDER_ID and " + whereClause - + " and M_PRODUCT_ID=" + productId - + " and ol.CREATED BETWEEN "+DB.TO_DATE(fromDate, false) - + " and "+DB.TO_DATE(toDate, false) - + " and ord.ORDERTYPE='" - + orderType + "'" + " and ord.DOCSTATUS in ('CO','CL')" - + " and ord.M_WAREHOUSE_ID=" + warehouse.get_ID() - + " and ord.ISACTIVE='Y'"; - - else if (queryType.equalsIgnoreCase("opening")) - - sql = "select sum(MOVEMENTQTY)" + " from M_TRANSACTION_V " - + " where M_PRODUCT_ID=" + productId + " and M_LOCATOR_ID=" - + warehouse.getDefaultLocator().get_ID() - + " and AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) - + " and created< "+DB.TO_DATE(fromDate, false); - - else if (queryType.equalsIgnoreCase("inventortIn")) - sql = "select sum(MOVEMENTQTY)" + " from M_TRANSACTION_V " - + " where M_PRODUCT_ID=" + productId + " and M_LOCATOR_ID=" - + warehouse.getDefaultLocator().get_ID() - + " and AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) - + " and created> "+DB.TO_DATE(fromDate, false) + " and MOVEMENTTYPE='" - + MTransaction.MOVEMENTTYPE_InventoryIn + "'"; - - else if (queryType.equalsIgnoreCase("inventoryOut")) - - sql = "select sum(MOVEMENTQTY)" + " from M_TRANSACTION_V " - + " where M_PRODUCT_ID=" + productId + " and M_LOCATOR_ID=" - + warehouse.getDefaultLocator().get_ID() - + " and AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) - + " and created> "+DB.TO_DATE(fromDate, false) + " and MOVEMENTTYPE='" - + MTransaction.MOVEMENTTYPE_InventoryOut + "'"; - - else if (queryType.equalsIgnoreCase("closing")) - - sql = "select sum(MOVEMENTQTY)" + " from M_TRANSACTION_V " - + " where M_PRODUCT_ID=" + productId + " and M_LOCATOR_ID=" - + warehouse.getDefaultLocator().get_ID() - + " and AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " and AD_ORG_ID=" + Env.getAD_Org_ID(ctx) - + " and created< "+DB.TO_DATE(toDate, true); - /* - * sql = "select" + " sum(st.QTYONHAND)" + //3 " from M_STORAGE st" + " - * where st.M_PRODUCT_ID=" +productId+ " and - * st.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ " and st.AD_ORG_ID=" - * +Env.getAD_Org_ID(ctx)+ " and st.M_LOCATOR_ID=" - * +warehouse.getDefaultLocator().getID()+ " and created getOrderHistory(Properties ctx, - String orderType, String docStatus, Integer month, Integer year, - String paymentRule, String trxName) throws OperationException - { - StringBuffer payAmtSql = new StringBuffer(); - payAmtSql.append(" (SELECT SUM(p.Amount) FROM"); - payAmtSql.append(" ((SELECT payAmt as Amount FROM C_Payment p") - .append(" WHERE p.C_Invoice_ID=i.C_Invoice_ID AND p.DocStatus IN ('CO', 'CL'))"); - payAmtSql.append(" UNION"); - payAmtSql.append(" (SELECT Amount FROM C_CashLine cl") - .append(" WHERE (cl.c_Invoice_ID=i.C_Invoice_ID))) as p)"); - - StringBuffer sqlStmt = new StringBuffer(); - sqlStmt.append(" SELECT o.C_Order_ID, o.DateOrdered, o.DateAcct, o.DocumentNo, o.GrandTotal, o.OrderType, o.PaymentRule, o.DocStatus,"); - sqlStmt.append(" bp.C_BPartner_ID, bp.Name, bp.IsCustomer,"); - sqlStmt.append(" i.C_Invoice_ID, i.DocumentNo, (CASE WHEN i.C_Invoice_ID IS NULL THEN 0 ELSE "); - sqlStmt.append(payAmtSql.toString()).append(" END) as PayAmt"); - sqlStmt.append(" FROM C_Order o"); - sqlStmt.append(" INNER JOIN C_BPartner bp ON bp.C_BPartner_ID=o.C_BPartner_ID"); - sqlStmt.append(" LEFT JOIN C_Invoice i ON (i.C_Order_ID=o.C_Order_ID AND i.DocStatus IN ('CO', 'CL'))"); - - sqlStmt.append(" WHERE o.AD_Client_ID=?"); - sqlStmt.append(" AND o.IsActive='Y'"); - - if (orderType != null) - { - sqlStmt = sqlStmt.append(" AND o.OrderType='").append(orderType).append("'"); - } - - if (paymentRule != null) - { - sqlStmt = sqlStmt.append(" AND o.PaymentRule='").append(paymentRule).append("'"); - } - - if (docStatus != null) - { - sqlStmt = sqlStmt.append(" AND o.DocStatus='").append(docStatus).append("'"); - } - - if (month != null) - { - String mm = String.valueOf(month); - if (mm.length() == 1) - { - mm = "0" + mm; - } - - sqlStmt = sqlStmt.append( " AND TO_CHAR(o.DateOrdered, 'mm')= '").append(mm).append("'"); - } - - if (year != null) - { - sqlStmt = sqlStmt.append(" AND TO_CHAR(o.DateOrdered, 'yyyy') ='").append(year).append("'"); - } - sqlStmt = sqlStmt.append(" ORDER BY o.DateOrdered DESC"); - - - PreparedStatement pstmt = null; - ResultSet rs = null; - ArrayList list = new ArrayList(); - - try - { - pstmt = DB.prepareStatement(sqlStmt.toString(), trxName); - pstmt.setInt(1, Env.getAD_Client_ID(ctx)); - rs = pstmt.executeQuery(); - - while (rs.next()) - { - POSHistoryBean bean = new POSHistoryBean(); - bean.setOrderId(Integer.valueOf(rs.getInt(1))); - bean.setDateOrdered(rs.getTimestamp(2)); - bean.setDateAcct(rs.getTimestamp(3)); - bean.setDocumentNo(rs.getString(4)); - bean.setOrderGrandTotal(rs.getBigDecimal(5)); - bean.setOrderType(rs.getString(6)); - bean.setPaymentRule(rs.getString(7)); - bean.setDocStatus(rs.getString(8)); - bean.setBpartnerId(rs.getInt(9)); - bean.setPartnerName(rs.getString(10)); - bean.setIsCustomer("Y".equals(rs.getString(11)) ? true : false); - bean.setInvoiceDocumentNo(rs.getString(13)); - bean.setAmountPaid(rs.getBigDecimal(14)); - list.add(bean); - } - } - catch (SQLException e) - { - throw new OperationException("Could not retrieve order history with sql: " + sqlStmt.toString(), e); - } - finally - { - DB.close(rs, pstmt); - pstmt = null; - pstmt = null; - } - - return list; - - } - - public static ArrayList getDraftedOrderHistory( - Properties ctx, String orderType, Integer month, Integer year) - throws OperationException { - String sql = "select ord.C_ORDER_ID," + - // "inv.c_invoice_id," + - "ord.created," + "ord.grandtotal," + "ord.DOCUMENTNO," - + "bp.name" + " from c_order ord,C_BPARTNER bp" - + " where ord.C_BPARTNER_ID=bp.C_BPARTNER_ID" - + " and ord.DOCSTATUS = 'DR'" + " and ord.AD_ORG_ID=" - + Env.getAD_Org_ID(ctx) + " and ord.AD_CLIENT_ID=" - + Env.getAD_Client_ID(ctx); - - if (orderType != null) - sql = sql + " and ord.ORDERTYPE='" + orderType + "'"; - - if (month != null) - sql = sql + " and to_char(ord.created, 'mm') = " + month; - - if (year != null) - sql = sql + " and to_char(ord.created, 'yyyy') = " + year; - - sql = sql + " order by ord.created desc"; - - System.out.println(sql); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - POSHistoryBean bean = null; - ArrayList list = new ArrayList(); - - try { - ResultSet rs = pstmt.executeQuery(); - - while (rs.next()) { - bean = new POSHistoryBean(); - bean.setOrderId(Integer.valueOf(rs.getInt(1))); - - bean.setDateAcct(rs.getTimestamp(2)); - bean.setOrderGrandTotal(rs.getBigDecimal(3)); - bean.setDocumentNo(rs.getString(4)); - bean.setPartnerName(rs.getString(5)); - - list.add(bean); - - } - - rs.close(); - } catch (SQLException e) { - throw new OperationException(e); - } finally { - try { - pstmt.close(); - } catch (Exception e) { - } - - pstmt = null; - } - return list; - - } - - public static ArrayList getPartialOrderHistory( - Properties ctx, String orderType, Integer month, Integer year) - throws OperationException { - String sql = "select ord.C_ORDER_ID," + - // "inv.c_invoice_id," + - "ord.created," + "ord.grandtotal," + "ord.DOCUMENTNO," - + "bp.name" + " from c_order ord,C_BPARTNER bp" - + " where ord.C_BPARTNER_ID=bp.C_BPARTNER_ID" - + " and ord.DOCSTATUS = 'IP'" + " and ord.AD_ORG_ID=" - + Env.getAD_Org_ID(ctx) + " and ord.AD_CLIENT_ID=" - + Env.getAD_Client_ID(ctx); - - if (orderType != null) - sql = sql + " and ord.ORDERTYPE='" + orderType + "'"; - - if (month != null) - { - String mm = String.valueOf(month); - if (mm.length() == 1) - { - mm = "0" + mm; - } - sql = sql + " and to_char(ord.created, 'mm') = '" + mm + "' " ; - } - - if (year != null) - sql = sql + " and to_char(ord.created, 'yyyy') = " + year; - - sql = sql + " order by ord.created desc"; - - System.out.println(sql); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - POSHistoryBean bean = null; - ArrayList list = new ArrayList(); - - try { - ResultSet rs = pstmt.executeQuery(); - - while (rs.next()) { - bean = new POSHistoryBean(); - bean.setOrderId(Integer.valueOf(rs.getInt(1))); - - bean.setDateAcct(rs.getTimestamp(2)); - bean.setOrderGrandTotal(rs.getBigDecimal(3)); - bean.setDocumentNo(rs.getString(4)); - bean.setPartnerName(rs.getString(5)); - - list.add(bean); - - } - - rs.close(); - } catch (SQLException e) { - throw new OperationException(e); - } finally { - try { - pstmt.close(); - } catch (Exception e) { - } - - pstmt = null; - } - return list; - - } - - public static ArrayList getAllOrderTypes(Properties ctx) - throws OperationException { - String sql = "select distinct orderType from c_order where AD_CLIENT_ID=" - + Env.getAD_Client_ID(ctx) - + " and AD_ORG_ID=" - + Env.getAD_Org_ID(ctx) - + " and isActive='Y' and ORDERTYPE is not null"; - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - POSHistoryBean bean = null; - ArrayList list = new ArrayList(); - - try { - ResultSet rs = pstmt.executeQuery(); - - while (rs.next()) { - bean = new POSHistoryBean(); - bean.setOrderType(rs.getString(1)); - - list.add(bean); - - } - - rs.close(); - } catch (SQLException e) { - throw new OperationException(e); - } finally { - try { - pstmt.close(); - } catch (Exception e) { - } - - pstmt = null; - } - - return list; - - } - - public static ArrayList getAllPaymentRule(Properties ctx) - throws OperationException { - String sql = "select distinct paymentRule from c_order where AD_CLIENT_ID=" - + Env.getAD_Client_ID(ctx) - + " and AD_ORG_ID=" - + Env.getAD_Org_ID(ctx) + " and isActive='Y'"; - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - POSHistoryBean bean = null; - ArrayList list = new ArrayList(); - - try { - ResultSet rs = pstmt.executeQuery(); - - while (rs.next()) { - bean = new POSHistoryBean(); - bean.setPaymentRule(rs.getString(1)); - - list.add(bean); - - } - - rs.close(); - } catch (SQLException e) { - throw new OperationException(e); - } finally { - try { - pstmt.close(); - } catch (Exception e) { - } - - pstmt = null; - } - - return list; - - } - - public static ArrayList getMaxMinSoldProductReportData( - Properties ctx, String reportType, Timestamp fromDate, Timestamp todate) - throws OperationException { - ArrayList list = getMaxMinSoldProducts(ctx, reportType, - fromDate, todate); - ArrayList reportData = new ArrayList(); - - reportData.add(new Object[] { "Name", "Uom","Barcode", " Net Qty Sold" }); - - String name = null; - String barcode = null; - BigDecimal qty = null; - String uom = null; - for (ProductBean bean : list) { - name = bean.getProductName(); - name = name.replaceAll("~", " "); - qty = bean.getQuantity(); - barcode = bean.getBarCode(); - uom = bean.getUom(); - reportData.add(new Object[] { name, uom, barcode, qty }); - } - - return reportData; - } - - public static String getCompleteOrderPDFReport(Properties ctx, int orderId, - String trxName) throws OperationException { - String docStatus = null; - String dateOrdered = null; - String orderType = null; - String orgName = null; - String orgAddress = null; - String salesRep = null; - String paymentBy = null; - String customerName = null; - String customerAddress = null; - String documentNo = null; - String currency = "Rs "; - NumberFormat formatter = new DecimalFormat("###,###,##0.00"); - - currency = POSTerminalManager.getDefaultSalesCurrency(ctx) - .getCurSymbol() - + " "; - MOrder order = new MOrder(ctx, orderId, trxName); - - // getting payment info - int[] invoiceIds = MInvoice.getAllIDs(MInvoice.Table_Name, - "AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) + " and C_ORDER_ID=" - + order.get_ID(), null); - double paymentByCash = 0.0; - double paymentByCard = 0.0; - double paymentByCheque = 0.0; - - MInvoice invoice = null; - String paymentRule = null; - boolean isMixed = false; - - for (int i = 0; i < invoiceIds.length; i++) { - invoice = new MInvoice(ctx, invoiceIds[i], trxName); - - if (i == 0) { - paymentRule = invoice.getPaymentRule(); - } else { - if (!paymentRule.equalsIgnoreCase(invoice.getPaymentRule())) { - isMixed = true; - } - } - - if (invoice.getPaymentRule().equals(MOrder.PAYMENTRULE_Cash)) { - paymentByCash += invoice.getGrandTotal().doubleValue(); - paymentBy = Constants.PAYMENT_RULE_CASH; - } - - if (invoice.getPaymentRule().equals(MOrder.PAYMENTRULE_CreditCard)) { - paymentByCard += invoice.getGrandTotal().doubleValue(); - paymentBy = Constants.PAYMENT_RULE_CARD; - } - - if (invoice.getPaymentRule().equals(MOrder.PAYMENTRULE_DirectDebit)) { - paymentByCard += invoice.getGrandTotal().doubleValue(); - paymentBy = Constants.PAYMENT_RULE_CARD; - } - - if (invoice.getPaymentRule().equals(MOrder.PAYMENTRULE_Check)) { - paymentByCheque += invoice.getGrandTotal().doubleValue(); - paymentBy = Constants.PAYMENT_RULE_CHEQUE; - } - - }// for - - if (isMixed) { - paymentBy = "Mixed (Cash:" + formatter.format(paymentByCash) - + " Card:" + formatter.format(paymentByCard) + " Cheque:" - + formatter.format(paymentByCheque) + ")"; - } - - // getting orgInfo - MOrg org = new MOrg(ctx, order.getAD_Org_ID(), trxName); - int location_id = org.getInfo().getC_Location_ID(); - MLocation location = new MLocation(ctx, location_id, trxName); - - orgName = org.getName(); - - String address1 = (location.getAddress1() == null) ? " " : location - .getAddress1(); - String address2 = (location.getAddress2() == null) ? " " : location - .getAddress2(); - orgAddress = (address1 + " " + address2).trim(); - - // getting order type - orderType = order.getOrderType(); - - // getting orderInfo - docStatus = order.getDocStatusName(); - documentNo = order.getDocumentNo(); - - Date d = new Date(order.getCreated().getTime()); - SimpleDateFormat s = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - dateOrdered = s.format(d); - - // getting salesrep - int saleRep_id = order.getSalesRep_ID(); - MUser user = new MUser(ctx, saleRep_id, trxName); - salesRep = user.getName(); - - // getting customer info - int bpartner_id = order.getBill_BPartner_ID(); - BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartner_id, - trxName); - - String name1 = (bean.getPartnerName() == null) ? " " : bean - .getPartnerName(); - String name2 = (bean.getName2() == null) ? " " : bean.getName2(); - customerName = (name1 + " " + name2).trim(); - - address1 = (bean.getAddress1() == null) ? " " : bean.getAddress1(); - address2 = (bean.getAddress2() == null) ? " " : bean.getAddress2(); - customerAddress = (address1 + " " + address2).trim(); - - ArrayList orderLineList = POSManager - .populateOrderLines(ctx, order); - - // ----------------------------------- generating pdf - // -------------------------------------- - String reportName = RandomStringGenerator.randomstring() + ".pdf"; - String reportPath = ReportManager.getReportPath(reportName); - - Font titleFont = new Font(Font.TIMES_ROMAN, 18, Font.BOLD); - Font subtitleFont = new Font(Font.TIMES_ROMAN, 14, Font.BOLD); - - Font headerFont = new Font(Font.TIMES_ROMAN, 11, Font.BOLD); - Font simpleFont = new Font(Font.TIMES_ROMAN, 10); - - float cellBorderWidth = 0.0f; - - // step 1: creation of a document-object - Document document = new Document(PageSize.A4, 30, 30, 20, 40);// l,r,t,b - // document.getPageSize().set; - - System.out.println(document.leftMargin()); - - try { - // step 2: - // we create a writer that listens to the document - // and directs a PDF-stream to a file - PdfWriter.getInstance(document, new FileOutputStream(reportPath)); - - // step 3: we open the document - document.open(); - // step 4: we add a paragraph to the document - - Image logo = null; - - String imageURI = PathInfo.PROJECT_HOME + "images/logo.gif"; - // "images/pos/openBLUE_POS_Logo.gif"; - - try { - byte logoData[] = OrganisationManager.getLogo(ctx, null); - logo = Image.getInstance(logoData); - } catch (LogoException ex) { - logo = Image.getInstance(imageURI); - } - - logo.setAbsolutePosition(document.left(), document.top() - - logo.getHeight()); - document.add(logo); - - PdfPTable table = new PdfPTable(2); - PdfPCell cell = null; - - // - table.getDefaultCell().setPadding(5.0f); - table.setWidthPercentage(100.0f); - - // header cell - Paragraph title = new Paragraph(); - title.add(new Chunk(orgName, subtitleFont)); - title.add(new Chunk("\n")); - title.add(new Chunk(orgAddress, subtitleFont)); - - // cell = new PdfPCell(new Paragraph(new - // Chunk("Title1",titleFont))); - cell = new PdfPCell(title); - - cell.setColspan(2); - cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); - cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); - cell.setFixedHeight(logo.getHeight()); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - cell = new PdfPCell(new Paragraph("")); - cell.setBorderWidth(cellBorderWidth); - cell.setFixedHeight(10); - cell.setColspan(2); - table.addCell(cell); - - // doc type - cell = new PdfPCell(new Paragraph(new Chunk(orderType, titleFont))); - - cell.setColspan(2); - cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); - cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // spacing - cell = new PdfPCell(new Paragraph("")); - cell.setBorderWidth(cellBorderWidth); - cell.setFixedHeight(10); - cell.setColspan(2); - table.addCell(cell); - - // row 1 - cell = new PdfPCell(new Paragraph(new Chunk(customerName, - headerFont))); - cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - cell = new PdfPCell(new Paragraph(new Chunk("Sales Rep: " - + salesRep, headerFont))); - cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // row 2 - cell = new PdfPCell(new Paragraph(new Chunk(customerAddress, - headerFont))); - cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // spacing - cell = new PdfPCell(new Paragraph("")); - cell.setBorderWidth(cellBorderWidth); - cell.setFixedHeight(10); - cell.setColspan(2); - table.addCell(cell); - - // row 3 - cell = new PdfPCell(new Paragraph(new Chunk( - "Ref No: " + documentNo, headerFont))); - cell.setColspan(2); - cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // row 4 - cell = new PdfPCell(new Paragraph(new Chunk("Doc Status: " - + docStatus, headerFont))); - cell.setColspan(2); - cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // row 5 - cell = new PdfPCell(new Paragraph(new Chunk("Payment By: " - + paymentBy, headerFont))); - cell.setColspan(2); - cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // row 6 - cell = new PdfPCell(new Paragraph(new Chunk("Date: " + dateOrdered, - headerFont))); - cell.setColspan(2); - cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // spacing - cell = new PdfPCell(new Paragraph("")); - cell.setColspan(2); - cell.setFixedHeight(10); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // spacing - cell = new PdfPCell(new Paragraph("")); - cell.setColspan(2); - cell.setFixedHeight(10); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // ------------------------------------------------------ - cell = new PdfPCell(); - cell.setColspan(2); - cell.setBorderWidth(cellBorderWidth); - - PdfPTable t = new PdfPTable(6); - t.getDefaultCell().setPadding(3.0f); - t.setWidthPercentage(100.0f); - - int[] widths = { 1, 4, 1, 2, 2, 2 }; - t.setWidths(widths); - - // setting headers - t.addCell(new Paragraph(new Chunk("SerNo", headerFont))); - t.addCell(new Paragraph(new Chunk("Name", headerFont))); - t.addCell(new Paragraph(new Chunk("Qty", headerFont))); - t.addCell(new Paragraph(new Chunk("Price", headerFont))); - t.addCell(new Paragraph(new Chunk("VAT", headerFont))); - t.addCell(new Paragraph(new Chunk("Total", headerFont))); - - // setting table data - // --------------------------------writing table - // data------------------------------ - int serNo = 0; - int totalQty = 0; - double totalAmt = 0.0; - double totalTaxAmt = 0.0; - double grandTotal = 0.0; - - BigDecimal qty = null; - BigDecimal lineAmt = null; - BigDecimal taxAmt = null; - BigDecimal lineTotalAmt = null; - - for (WebOrderLineBean orderlineBean : orderLineList) { - serNo++; - qty = orderlineBean.getQtyOrdered(); - lineAmt = orderlineBean.getLineNetAmt(); - taxAmt = orderlineBean.getTaxAmt(); - lineTotalAmt = orderlineBean.getLineTotalAmt(); - - totalQty += qty.intValue(); - totalAmt += lineAmt.doubleValue(); - totalTaxAmt += taxAmt.doubleValue(); - grandTotal += lineTotalAmt.doubleValue(); - - t.addCell(new Paragraph(new Chunk(serNo + "", simpleFont))); - t.addCell(new Paragraph(new Chunk(orderlineBean - .getProductName(), simpleFont))); - t.addCell(new Paragraph(new Chunk(qty.intValue() + "", - simpleFont))); - t.addCell(new Paragraph(new Chunk(formatter.format(lineAmt - .doubleValue()), simpleFont))); - t.addCell(new Paragraph(new Chunk(formatter.format(taxAmt - .doubleValue()), simpleFont))); - t.addCell(new Paragraph(new Chunk(formatter.format(lineTotalAmt - .doubleValue()), simpleFont))); - } - // ----------------------------------------------------------------------------------- - - // setting table footer - t.getDefaultCell().setBackgroundColor(new Color(240, 240, 240)); - - PdfPCell c = new PdfPCell(new Paragraph(new Chunk("ORDER TOTAL", - headerFont))); - c.setColspan(2); - c.setBackgroundColor(new Color(240, 240, 240)); - t.addCell(c); - - t.addCell(new Paragraph(new Chunk(totalQty + "", simpleFont))); - t.addCell(new Paragraph(new Chunk(currency - + formatter.format(totalAmt), simpleFont))); - t.addCell(new Paragraph(new Chunk(currency - + formatter.format(totalTaxAmt), simpleFont))); - t.addCell(new Paragraph(new Chunk(currency - + formatter.format(grandTotal), simpleFont))); - - t.setSplitRows(true); - cell.addElement(t); - // ------------------------------------------------------ - - // table.addCell(cell); - table.setSplitRows(true); - - document.add(table); - document.add(t); - - } catch (Exception e) { - throw new OperationException(e); - } - - // step 5: we close the document - document.close(); - - return reportName; - } - - /* - * public static String getInvoiceFromOrderPDFReport(Properties ctx, int - * orderId, String trxName) throws OperationException { int invoiceIds[] = - * InvoiceManager.getInvoiceIdsForOrder(ctx, orderId, trxName); - * - * if(invoiceIds.length == 0) throw new OperationException("No invoice found - * for Order with id: " + orderId); else if(invoiceIds.length == 1) return - * getInvoicePDFReport(ctx, invoiceIds[0], trxName); else return - * getCompleteOrderPDFReport(ctx, orderId, trxName); } - */ - - /* - * public static String getInvoicePDFReport(Properties ctx, int invoiceId, - * String trxName) throws OperationException { String docStatus = null; - * String dateOrdered = null; String docType = null; String orgName = null; - * String orgAddress = null; String salesRep = null; String phone = " "; - * String fax = " "; - * - * String customerName = null; String customerAddress = null; String - * documentNo = null; String currency = "Rs "; NumberFormat formatter = new - * DecimalFormat("###,###,##0.00"); - * - * currency = - * POSTerminalManager.getPOSDefaultSellCurrency(ctx).getCurSymbol()+ " "; - * - * MInvoice invoice = InvoiceManager.loadInvoice(ctx, invoiceId, trxName); - * - * //getting orgInfo MOrg org = new - * MOrg(ctx,invoice.getAD_Org_ID(),trxName); int location_id = - * org.getInfo().getC_Location_ID(); MLocation location = new - * MLocation(ctx,location_id,trxName); MBPartner orgPartner = new - * MBPartner(ctx, org.getLinkedC_BPartner_ID(), trxName); MBPartnerLocation - * meLocation[] = MBPartnerLocation.getForBPartner(ctx,orgPartner.getID()); - * - * if (meLocation.length != 1) throw new OperationException("Should have - * only 1 location for organisation business partner!!"); - * - * MBPartnerLocation orgLocation = meLocation[0]; - * - * if (orgLocation.getPhone() != null); phone = orgLocation.getPhone(); - * - * if (orgLocation.getFax() != null) fax = orgLocation.getFax(); - * - * orgName = org.getName(); - * - * String address1 = (location.getAddress1() == null)? " " : - * location.getAddress1(); String address2 = (location.getAddress2() == - * null)? " " : location.getAddress2(); orgAddress = (address1 + " " + - * address2).trim(); - * - * //getting order type MDocType doctype = MDocType.get(ctx, - * invoice.getC_DocType_ID()); docType = doctype.getName(); - * - * //getting orderInfo docStatus = invoice.getDocStatusName(); documentNo = - * invoice.getDocumentNo(); - * - * Date d = new Date(invoice.getCreated().getTime()); SimpleDateFormat s = - * new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss"); dateOrdered = s.format(d); - * - * //getting salesrep int saleRep_id = invoice.getSalesRep_ID(); MUser user = - * new MUser(ctx,saleRep_id,trxName); salesRep = user.getName(); - * - * //getting customer info int bpartner_id = invoice.getC_BPartner_ID(); - * BPartnerBean bean = BPartnerManager.getBpartner(ctx,bpartner_id, - * trxName); - * - * String name1 = (bean.getPartnerName() == null)? " " : - * bean.getPartnerName(); String name2 = (bean.getName2() == null)? " " : - * bean.getName2(); customerName = (name1 + " " + name2).trim(); - * - * address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); - * address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); - * customerAddress = (address1 + " " + address2).trim(); - * - * - * ArrayList orderLineList = - * InvoiceManager.populateInvoiceLines(ctx,invoice, false); - * - * //----------------------------------- generating pdf - * -------------------------------------- String reportName = - * RandomStringGenerator.randomstring() + ".pdf"; String reportPath = - * ReportManager.getReportPath(reportName); - * - * - * Font titleFont = new Font(Font.TIMES_ROMAN, 18,Font.BOLD); Font - * subtitleFont = new Font(Font.TIMES_ROMAN, 14,Font.BOLD); - * - * Font headerFont = new Font(Font.TIMES_ROMAN, 11,Font.BOLD); Font - * simpleFont = new Font(Font.TIMES_ROMAN, 10); - * - * float cellBorderWidth = 0.0f; - * // step 1: creation of a document-object Document document = new - * Document(PageSize.A4,30,30,20,40);//l,r,t,b //document.getPageSize().set; - * - * System.out.println(document.leftMargin()); - * - * try { // step 2: // we create a writer that listens to the document // - * and directs a PDF-stream to a file PdfWriter.getInstance(document,new - * FileOutputStream(reportPath)); - * // step 3: we open the document document.open(); // step 4: we add a - * paragraph to the document - * - * Image logo = null; - * - * //TODO: make this part dynamic <------------------------------ IMPORTANT - * !!!!!!!!!!!!!!!!!!!!!!!!!!! String imageURI = PathInfo.PROJECT_HOME + - * "images/pos/openBLUE_POS_Logo.gif"; logo = Image.getInstance(imageURI); - * - * //MAttachment attachment = new - * MAttachment(ctx,MOrg.Table_ID,org.getID(),null); //logo = - * Image.getInstance(attachment.getEntries()[0].getData()); - * - * try { byte logoData[] = OrganisationManager.getLogo(ctx, null); logo = - * Image.getInstance(logoData); } catch(LogoException ex) { logo = - * Image.getInstance(imageURI); } - * - * logo.setAbsolutePosition(document.left(),document.top()-logo.height()); - * document.add(logo); - * - * PdfPTable table = new PdfPTable(2); PdfPCell cell = null; - * // table.getDefaultCell().setPadding(5.0f); - * table.setWidthPercentage(100.0f); - * - * //header cell Paragraph title = new Paragraph(); title.add(new - * Chunk(orgName,subtitleFont)); title.add(new Chunk("\n")); title.add(new - * Chunk(orgAddress,subtitleFont)); title.add(new Chunk("\n")); - * title.add(new Chunk("Phone: " + phone,subtitleFont)); title.add(new - * Chunk("\n")); title.add(new Chunk("Fax: " + fax,subtitleFont)); - * - * - * //cell = new PdfPCell(new Paragraph(new Chunk("Title1",titleFont))); cell = - * new PdfPCell(title); - * - * cell.setColspan(2); cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); - * cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); - * cell.setFixedHeight(logo.height()); cell.setBorderWidth(cellBorderWidth); - * table.addCell(cell); - * - * cell = new PdfPCell(new Paragraph("")); - * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); - * cell.setColspan(2); table.addCell(cell); - * - * //doc type cell = new PdfPCell(new Paragraph(new - * Chunk(docType,titleFont))); - * - * cell.setColspan(2); cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); - * cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * //spacing cell = new PdfPCell(new Paragraph("")); - * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); - * cell.setColspan(2); table.addCell(cell); - * - * - * //row 1 cell = new PdfPCell(new Paragraph(new - * Chunk(customerName,headerFont))); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * - * cell = new PdfPCell(new Paragraph(new Chunk("Sales Rep: - * "+salesRep,headerFont))); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * //row 2 cell = new PdfPCell(new Paragraph(new - * Chunk(customerAddress,headerFont))); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * //spacing cell = new PdfPCell(new Paragraph("")); - * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); - * cell.setColspan(2); table.addCell(cell); - * - * //row 3 cell = new PdfPCell(new Paragraph(new Chunk("No: " + documentNo, - * headerFont))); cell.setColspan(2); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * //row 4 cell = new PdfPCell(new Paragraph(new Chunk("Doc Status: - * "+docStatus,headerFont))); cell.setColspan(2); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * - * //row 5 cell = new PdfPCell(new Paragraph(new Chunk("Payment By: - * "+paymentBy,headerFont))); cell.setColspan(2); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * - * //row 6 cell = new PdfPCell(new Paragraph(new Chunk("Date: - * "+dateOrdered,headerFont))); cell.setColspan(2); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * //spacing cell = new PdfPCell(new Paragraph("")); cell.setColspan(2); - * cell.setFixedHeight(10); cell.setBorderWidth(cellBorderWidth); - * table.addCell(cell); - * - * //spacing cell = new PdfPCell(new Paragraph("")); cell.setColspan(2); - * cell.setFixedHeight(10); cell.setBorderWidth(cellBorderWidth); - * table.addCell(cell); - * - * - * //------------------------------------------------------ cell = new - * PdfPCell(); cell.setColspan(2); cell.setBorderWidth(cellBorderWidth); - * - * PdfPTable t = new PdfPTable(6); t.getDefaultCell().setPadding(3.0f); - * t.setWidthPercentage(100.0f); - * - * int[] widths = {1,4,1,2,2,2}; t.setWidths(widths); - * - * //setting headers t.addCell(new Paragraph(new - * Chunk("SerNo",headerFont))); t.addCell(new Paragraph(new - * Chunk("Name",headerFont))); t.addCell(new Paragraph(new - * Chunk("Qty",headerFont))); t.addCell(new Paragraph(new - * Chunk("Price",headerFont))); t.addCell(new Paragraph(new - * Chunk("VAT",headerFont))); t.addCell(new Paragraph(new - * Chunk("Total",headerFont))); - * - * //setting table data //--------------------------------writing table - * data------------------------------ int serNo = 0; int totalQty = 0; - * double totalAmt = 0.0; double totalTaxAmt = 0.0; double grandTotal = 0.0; - * - * BigDecimal qty = null; BigDecimal lineAmt = null; BigDecimal taxAmt = - * null; BigDecimal lineTotalAmt = null; - * - * for (WebOrderLineBean orderlineBean : orderLineList) { serNo++; qty = - * orderlineBean.getQtyOrdered(); lineAmt = orderlineBean.getLineNetAmt(); - * taxAmt = orderlineBean.getTaxAmt(); lineTotalAmt = - * orderlineBean.getLineTotalAmt(); - * - * totalQty += qty.intValue(); totalAmt += lineAmt.doubleValue(); - * totalTaxAmt += taxAmt.doubleValue(); grandTotal += - * lineTotalAmt.doubleValue(); - * - * t.addCell(new Paragraph(new Chunk(serNo+"",simpleFont))); t.addCell(new - * Paragraph(new Chunk(orderlineBean.getProductName(),simpleFont))); - * t.addCell(new Paragraph(new Chunk(qty.intValue()+"",simpleFont))); - * t.addCell(new Paragraph(new - * Chunk(formatter.format(lineAmt.doubleValue()),simpleFont))); - * t.addCell(new Paragraph(new - * Chunk(formatter.format(taxAmt.doubleValue()),simpleFont))); t.addCell(new - * Paragraph(new - * Chunk(formatter.format(lineTotalAmt.doubleValue()),simpleFont))); } - * //----------------------------------------------------------------------------------- - * - * //setting table footer t.getDefaultCell().setBackgroundColor(new - * Color(240,240,240)); - * - * PdfPCell c = new PdfPCell(new Paragraph(new Chunk("ORDER - * TOTAL",headerFont))); c.setColspan(2); c.setBackgroundColor(new - * Color(240,240,240)); t.addCell(c); - * - * t.addCell(new Paragraph(new Chunk(totalQty + "",simpleFont))); - * t.addCell(new Paragraph(new Chunk(currency + - * formatter.format(totalAmt),simpleFont))); t.addCell(new Paragraph(new - * Chunk(currency + formatter.format(totalTaxAmt),simpleFont))); - * t.addCell(new Paragraph(new Chunk(currency + - * formatter.format(grandTotal),simpleFont))); - * - * t.setSplitRows(true); cell.addElement(t); - * //------------------------------------------------------ - * - * //table.addCell(cell); table.setSplitRows(true); - * - * - * document.add(table); document.add(t); - * } catch (Exception e) { throw new OperationException(e); } - * // step 5: we close the document document.close(); - * - * - * return reportName; } - */ - - /* - * public static String getPaymentPDFReport(Properties ctx, int paymentId, - * String trxName) throws OperationException { String docStatus = null; - * String dateOrdered = null; String docType = null; String orgName = null; - * String orgAddress = null; String salesRep = null; String phone = " "; - * String fax = " "; - * - * String customerName = null; String customerAddress = null; String - * documentNo = null; String currency = "Rs "; NumberFormat formatter = new - * DecimalFormat("###,###,##0.00"); - * - * currency = - * POSTerminalManager.getPOSDefaultSellCurrency(ctx).getCurSymbol()+ " "; - * - * MPayment payment = PaymentManager.loadPayment(ctx, paymentId, trxName); - * - * //getting orgInfo MOrg org = new - * MOrg(ctx,payment.getAD_Org_ID(),trxName); int location_id = - * org.getInfo().getC_Location_ID(); MLocation location = new - * MLocation(ctx,location_id,trxName); MBPartner orgPartner = new - * MBPartner(ctx, org.getLinkedC_BPartner_ID(), trxName); MBPartnerLocation - * meLocation[] = MBPartnerLocation.getForBPartner(ctx,orgPartner.getID()); - * - * if (meLocation.length != 1) throw new OperationException("Should have - * only 1 location for organisation business partner!!"); - * - * MBPartnerLocation orgLocation = meLocation[0]; - * - * if (orgLocation.getPhone() != null); phone = orgLocation.getPhone(); - * - * if (orgLocation.getFax() != null) fax = orgLocation.getFax(); - * - * orgName = org.getName(); - * - * String address1 = (location.getAddress1() == null)? " " : - * location.getAddress1(); String address2 = (location.getAddress2() == - * null)? " " : location.getAddress2(); orgAddress = (address1 + " " + - * address2).trim(); - * - * //getting order type MDocType doctype = MDocType.get(ctx, - * payment.getC_DocType_ID()); docType = doctype.getName(); - * - * //getting orderInfo docStatus = payment.getDocStatusName(); documentNo = - * payment.getDocumentNo(); - * - * Date d = new Date(payment.getCreated().getTime()); SimpleDateFormat s = - * new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss"); dateOrdered = s.format(d); - * - * //getting salesrep int saleRep_id = payment.getDoc_User_ID(); MUser user = - * new MUser(ctx,saleRep_id,trxName); salesRep = user.getName(); - * - * //getting customer info int bpartner_id = payment.getC_BPartner_ID(); - * BPartnerBean bean = BPartnerManager.getBpartner(ctx,bpartner_id, - * trxName); - * - * String name1 = (bean.getPartnerName() == null)? " " : - * bean.getPartnerName(); String name2 = (bean.getName2() == null)? " " : - * bean.getName2(); customerName = (name1 + " " + name2).trim(); - * - * address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); - * address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); - * customerAddress = (address1 + " " + address2).trim(); - * - * - * ArrayList orderLineList = - * PaymentManager.getWebPaymentBean(ctx,payment); - * - * //----------------------------------- generating pdf - * -------------------------------------- String reportName = - * RandomStringGenerator.randomstring() + ".pdf"; String reportPath = - * ReportManager.getReportPath(reportName); - * - * - * Font titleFont = new Font(Font.TIMES_ROMAN, 18,Font.BOLD); Font - * subtitleFont = new Font(Font.TIMES_ROMAN, 14,Font.BOLD); - * - * Font headerFont = new Font(Font.TIMES_ROMAN, 11,Font.BOLD); Font - * simpleFont = new Font(Font.TIMES_ROMAN, 10); - * - * float cellBorderWidth = 0.0f; - * // step 1: creation of a document-object Document document = new - * Document(PageSize.A4,30,30,20,40);//l,r,t,b //document.getPageSize().set; - * - * System.out.println(document.leftMargin()); - * - * try { // step 2: // we create a writer that listens to the document // - * and directs a PDF-stream to a file PdfWriter.getInstance(document,new - * FileOutputStream(reportPath)); - * // step 3: we open the document document.open(); // step 4: we add a - * paragraph to the document - * - * Image logo = null; - * - * //TODO: make this part dynamic <------------------------------ IMPORTANT - * !!!!!!!!!!!!!!!!!!!!!!!!!!! String imageURI = PathInfo.PROJECT_HOME + - * "images/pos/openBLUE_POS_Logo.gif"; logo = Image.getInstance(imageURI); - * - * //MAttachment attachment = new - * MAttachment(ctx,MOrg.Table_ID,org.getID(),null); //logo = - * Image.getInstance(attachment.getEntries()[0].getData()); - * - * try { byte logoData[] = OrganisationManager.getLogo(ctx, null); logo = - * Image.getInstance(logoData); } catch(LogoException ex) { logo = - * Image.getInstance(imageURI); } - * - * logo.setAbsolutePosition(document.left(),document.top()-logo.height()); - * document.add(logo); - * - * PdfPTable table = new PdfPTable(2); PdfPCell cell = null; - * // table.getDefaultCell().setPadding(5.0f); - * table.setWidthPercentage(100.0f); - * - * //header cell Paragraph title = new Paragraph(); title.add(new - * Chunk(orgName,subtitleFont)); title.add(new Chunk("\n")); title.add(new - * Chunk(orgAddress,subtitleFont)); title.add(new Chunk("\n")); - * title.add(new Chunk("Phone: " + phone,subtitleFont)); title.add(new - * Chunk("\n")); title.add(new Chunk("Fax: " + fax,subtitleFont)); - * - * - * //cell = new PdfPCell(new Paragraph(new Chunk("Title1",titleFont))); cell = - * new PdfPCell(title); - * - * cell.setColspan(2); cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); - * cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); - * cell.setFixedHeight(logo.height()); cell.setBorderWidth(cellBorderWidth); - * table.addCell(cell); - * - * cell = new PdfPCell(new Paragraph("")); - * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); - * cell.setColspan(2); table.addCell(cell); - * - * //doc type cell = new PdfPCell(new Paragraph(new - * Chunk(docType,titleFont))); - * - * cell.setColspan(2); cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); - * cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * //spacing cell = new PdfPCell(new Paragraph("")); - * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); - * cell.setColspan(2); table.addCell(cell); - * - * - * //row 1 cell = new PdfPCell(new Paragraph(new - * Chunk(customerName,headerFont))); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * - * cell = new PdfPCell(new Paragraph(new Chunk("Sales Rep: - * "+salesRep,headerFont))); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * //row 2 cell = new PdfPCell(new Paragraph(new - * Chunk(customerAddress,headerFont))); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * //spacing cell = new PdfPCell(new Paragraph("")); - * cell.setBorderWidth(cellBorderWidth); cell.setFixedHeight(10); - * cell.setColspan(2); table.addCell(cell); - * - * //row 3 cell = new PdfPCell(new Paragraph(new Chunk("No: " + documentNo, - * headerFont))); cell.setColspan(2); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * //row 4 cell = new PdfPCell(new Paragraph(new Chunk("Doc Status: - * "+docStatus,headerFont))); cell.setColspan(2); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * - * //row 5 cell = new PdfPCell(new Paragraph(new Chunk("Payment By: - * "+paymentBy,headerFont))); cell.setColspan(2); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * - * //row 6 cell = new PdfPCell(new Paragraph(new Chunk("Date: - * "+dateOrdered,headerFont))); cell.setColspan(2); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - * - * //spacing cell = new PdfPCell(new Paragraph("")); cell.setColspan(2); - * cell.setFixedHeight(10); cell.setBorderWidth(cellBorderWidth); - * table.addCell(cell); - * - * //spacing cell = new PdfPCell(new Paragraph("")); cell.setColspan(2); - * cell.setFixedHeight(10); cell.setBorderWidth(cellBorderWidth); - * table.addCell(cell); - * - * - * //------------------------------------------------------ cell = new - * PdfPCell(); cell.setColspan(2); cell.setBorderWidth(cellBorderWidth); - * - * PdfPTable t = new PdfPTable(6); t.getDefaultCell().setPadding(3.0f); - * t.setWidthPercentage(100.0f); - * - * int[] widths = {1,4,1,2,2,2}; t.setWidths(widths); - * - * //setting headers t.addCell(new Paragraph(new - * Chunk("SerNo",headerFont))); t.addCell(new Paragraph(new - * Chunk("Name",headerFont))); t.addCell(new Paragraph(new - * Chunk("Qty",headerFont))); t.addCell(new Paragraph(new - * Chunk("Price",headerFont))); t.addCell(new Paragraph(new - * Chunk("VAT",headerFont))); t.addCell(new Paragraph(new - * Chunk("Total",headerFont))); - * - * //setting table data //--------------------------------writing table - * data------------------------------ int serNo = 0; int totalQty = 0; - * double totalAmt = 0.0; double totalTaxAmt = 0.0; double grandTotal = 0.0; - * - * BigDecimal qty = null; BigDecimal lineAmt = null; BigDecimal taxAmt = - * null; BigDecimal lineTotalAmt = null; - * - * for (WebOrderLineBean orderlineBean : orderLineList) { serNo++; qty = - * orderlineBean.getQtyOrdered(); lineAmt = orderlineBean.getLineNetAmt(); - * taxAmt = orderlineBean.getTaxAmt(); lineTotalAmt = - * orderlineBean.getLineTotalAmt(); - * - * totalQty += qty.intValue(); totalAmt += lineAmt.doubleValue(); - * totalTaxAmt += taxAmt.doubleValue(); grandTotal += - * lineTotalAmt.doubleValue(); - * - * t.addCell(new Paragraph(new Chunk(serNo+"",simpleFont))); t.addCell(new - * Paragraph(new Chunk(orderlineBean.getProductName(),simpleFont))); - * t.addCell(new Paragraph(new Chunk(qty.intValue()+"",simpleFont))); - * t.addCell(new Paragraph(new - * Chunk(formatter.format(lineAmt.doubleValue()),simpleFont))); - * t.addCell(new Paragraph(new - * Chunk(formatter.format(taxAmt.doubleValue()),simpleFont))); t.addCell(new - * Paragraph(new - * Chunk(formatter.format(lineTotalAmt.doubleValue()),simpleFont))); } - * //----------------------------------------------------------------------------------- - * - * //setting table footer t.getDefaultCell().setBackgroundColor(new - * Color(240,240,240)); - * - * PdfPCell c = new PdfPCell(new Paragraph(new Chunk("ORDER - * TOTAL",headerFont))); c.setColspan(2); c.setBackgroundColor(new - * Color(240,240,240)); t.addCell(c); - * - * t.addCell(new Paragraph(new Chunk(totalQty + "",simpleFont))); - * t.addCell(new Paragraph(new Chunk(currency + - * formatter.format(totalAmt),simpleFont))); t.addCell(new Paragraph(new - * Chunk(currency + formatter.format(totalTaxAmt),simpleFont))); - * t.addCell(new Paragraph(new Chunk(currency + - * formatter.format(grandTotal),simpleFont))); - * - * t.setSplitRows(true); cell.addElement(t); - * //------------------------------------------------------ - * - * //table.addCell(cell); table.setSplitRows(true); - * - * - * document.add(table); document.add(t); - * } catch (Exception e) { throw new OperationException(e); } - * // step 5: we close the document document.close(); - * - * - * return reportName; } - */ - - public static String getShipmentPDFReport(Properties ctx, int minoutId, - String trxName) throws OperationException { - String docStatus = null; - String dateOrdered = null; - String docType = null; - String orgName = null; - String orgAddress = null; - String salesRep = null; - String phone = " "; - String fax = " "; - - String customerName = null; - String customerAddress = null; - String documentNo = null; - - MInOut minout = MinOutManager.loadMInOut(ctx, minoutId, trxName); - - // getting orgInfo - MOrg org = new MOrg(ctx, minout.getAD_Org_ID(), trxName); - int location_id = org.getInfo().getC_Location_ID(); - MLocation location = new MLocation(ctx, location_id, trxName); - MBPartner orgPartner = new MBPartner(ctx, org.getLinkedC_BPartner_ID(trxName), - trxName); - MBPartnerLocation meLocation[] = MBPartnerLocation.getForBPartner(ctx, - orgPartner.get_ID()); - - if (meLocation.length != 1) - throw new OperationException( - "Should have only 1 location for organisation business partner!!"); - - MBPartnerLocation orgLocation = meLocation[0]; - - if (orgLocation.getPhone() != null) - phone = orgLocation.getPhone(); - - if (orgLocation.getFax() != null) - fax = orgLocation.getFax(); - ; - - orgName = org.getName(); - - String address1 = (location.getAddress1() == null) ? " " : location - .getAddress1(); - String address2 = (location.getAddress2() == null) ? " " : location - .getAddress2(); - orgAddress = (address1 + " " + address2).trim(); - - // getting order type - MDocType doctype = MDocType.get(ctx, minout.getC_DocType_ID()); - docType = doctype.getName(); - - // getting orderInfo - docStatus = minout.getDocStatusName(); - documentNo = minout.getDocumentNo(); - - Date d = new Date(minout.getCreated().getTime()); - SimpleDateFormat s = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - dateOrdered = s.format(d); - - // getting salesrep - int saleRep_id = minout.getSalesRep_ID(); - MUser user = new MUser(ctx, saleRep_id, trxName); - salesRep = user.getName(); - - // getting customer info - int bpartner_id = minout.getC_BPartner_ID(); - BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartner_id, - trxName); - - String name1 = (bean.getPartnerName() == null) ? " " : bean - .getPartnerName(); - String name2 = (bean.getName2() == null) ? " " : bean.getName2(); - customerName = (name1 + " " + name2).trim(); - - address1 = (bean.getAddress1() == null) ? " " : bean.getAddress1(); - address2 = (bean.getAddress2() == null) ? " " : bean.getAddress2(); - customerAddress = (address1 + " " + address2).trim(); - - ArrayList orderLineList = MinOutManager - .getWebMinOutLines(ctx, minout); - - // ----------------------------------- generating pdf - // -------------------------------------- - String reportName = RandomStringGenerator.randomstring() + ".pdf"; - String reportPath = ReportManager.getReportPath(reportName); - - Font titleFont = new Font(Font.TIMES_ROMAN, 18, Font.BOLD); - Font subtitleFont = new Font(Font.TIMES_ROMAN, 14, Font.BOLD); - - Font headerFont = new Font(Font.TIMES_ROMAN, 11, Font.BOLD); - Font simpleFont = new Font(Font.TIMES_ROMAN, 10); - - float cellBorderWidth = 0.0f; - - // step 1: creation of a document-object - Document document = new Document(PageSize.A4, 30, 30, 20, 40);// l,r,t,b - // document.getPageSize().set; - - System.out.println(document.leftMargin()); - - try { - // step 2: - // we create a writer that listens to the document - // and directs a PDF-stream to a file - PdfWriter.getInstance(document, new FileOutputStream(reportPath)); - - // step 3: we open the document - document.open(); - // step 4: we add a paragraph to the document - - Image logo = null; - - // TODO: make this part dynamic <------------------------------ - // IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!! - String imageURI = PathInfo.PROJECT_HOME - + "images/pos/openBLUE_POS_Logo.gif"; - logo = Image.getInstance(imageURI); - - // MAttachment attachment = new - // MAttachment(ctx,MOrg.Table_ID,org.getID(),null); - // logo = Image.getInstance(attachment.getEntries()[0].getData()); - - try { - byte logoData[] = OrganisationManager.getLogo(ctx, null); - logo = Image.getInstance(logoData); - } catch (LogoException ex) { - logo = Image.getInstance(imageURI); - } - - logo.setAbsolutePosition(document.left(), document.top() - - logo.getHeight()); - document.add(logo); - - PdfPTable table = new PdfPTable(2); - PdfPCell cell = null; - - // - table.getDefaultCell().setPadding(5.0f); - table.setWidthPercentage(100.0f); - - // header cell - Paragraph title = new Paragraph(); - title.add(new Chunk(orgName, subtitleFont)); - title.add(new Chunk("\n")); - title.add(new Chunk(orgAddress, subtitleFont)); - title.add(new Chunk("\n")); - title.add(new Chunk("Phone: " + phone, subtitleFont)); - title.add(new Chunk("\n")); - title.add(new Chunk("Fax: " + fax, subtitleFont)); - - // cell = new PdfPCell(new Paragraph(new - // Chunk("Title1",titleFont))); - cell = new PdfPCell(title); - - cell.setColspan(2); - cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); - cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); - cell.setFixedHeight(logo.getHeight()); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - cell = new PdfPCell(new Paragraph("")); - cell.setBorderWidth(cellBorderWidth); - cell.setFixedHeight(10); - cell.setColspan(2); - table.addCell(cell); - - // doc type - cell = new PdfPCell(new Paragraph(new Chunk(docType, titleFont))); - - cell.setColspan(2); - cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER); - cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // spacing - cell = new PdfPCell(new Paragraph("")); - cell.setBorderWidth(cellBorderWidth); - cell.setFixedHeight(10); - cell.setColspan(2); - table.addCell(cell); - - // row 1 - cell = new PdfPCell(new Paragraph(new Chunk(customerName, - headerFont))); - cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - cell = new PdfPCell(new Paragraph(new Chunk("Sales Rep: " - + salesRep, headerFont))); - cell.setHorizontalAlignment(PdfPCell.ALIGN_RIGHT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // row 2 - cell = new PdfPCell(new Paragraph(new Chunk(customerAddress, - headerFont))); - cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // spacing - cell = new PdfPCell(new Paragraph("")); - cell.setBorderWidth(cellBorderWidth); - cell.setFixedHeight(10); - cell.setColspan(2); - table.addCell(cell); - - // row 3 - cell = new PdfPCell(new Paragraph(new Chunk("No: " + documentNo, - headerFont))); - cell.setColspan(2); - cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // row 4 - cell = new PdfPCell(new Paragraph(new Chunk("Doc Status: " - + docStatus, headerFont))); - cell.setColspan(2); - cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - /* - * //row 5 cell = new PdfPCell(new Paragraph(new Chunk("Payment By: - * "+paymentBy,headerFont))); cell.setColspan(2); - * cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - * cell.setBorderWidth(cellBorderWidth); table.addCell(cell); - */ - - // row 6 - cell = new PdfPCell(new Paragraph(new Chunk("Date: " + dateOrdered, - headerFont))); - cell.setColspan(2); - cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // spacing - cell = new PdfPCell(new Paragraph("")); - cell.setColspan(2); - cell.setFixedHeight(10); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // spacing - cell = new PdfPCell(new Paragraph("")); - cell.setColspan(2); - cell.setFixedHeight(10); - cell.setBorderWidth(cellBorderWidth); - table.addCell(cell); - - // ------------------------------------------------------ - cell = new PdfPCell(); - cell.setColspan(2); - cell.setBorderWidth(cellBorderWidth); - - PdfPTable t = new PdfPTable(3); - t.getDefaultCell().setPadding(3.0f); - t.setWidthPercentage(100.0f); - - int[] widths = { 1, 10, 1 }; - t.setWidths(widths); - - // setting headers - t.addCell(new Paragraph(new Chunk("SerNo", headerFont))); - t.addCell(new Paragraph(new Chunk("Name", headerFont))); - t.addCell(new Paragraph(new Chunk("Qty", headerFont))); - - // setting table data - // --------------------------------writing table - // data------------------------------ - int serNo = 0; - - BigDecimal qty = null; - - for (WebMinOutLineBean orderlineBean : orderLineList) { - serNo++; - qty = orderlineBean.getQtyOrdered(); - - t.addCell(new Paragraph(new Chunk(serNo + "", simpleFont))); - t.addCell(new Paragraph(new Chunk(orderlineBean - .getProductName(), simpleFont))); - t.addCell(new Paragraph(new Chunk(qty.intValue() + "", - simpleFont))); - } - // ----------------------------------------------------------------------------------- - - // table.addCell(cell); - table.setSplitRows(true); - - document.add(table); - document.add(t); - - } catch (Exception e) { - throw new OperationException(e); - } - - // step 5: we close the document - document.close(); - - return reportName; - } - - public static String endOfTheDayPDF(Properties ctx, CloseTillBean bean) throws OperationException { - String reportName = RandomStringGenerator.randomstring() + ".pdf"; - String reportPath = ReportManager.getReportPath(reportName); - - double beginningBalance = (bean.getBeginningBalance() == null ? 0 - : bean.getBeginningBalance().doubleValue()); - double statementDifference = (bean.getNetCashTrx() == null ? 0 - : bean.getNetCashTrx().doubleValue()); - double transferAmount = (bean.getBalanceEntered() == null ? 0 - : bean.getBalanceEntered().doubleValue()); - double differenceAmount = (bean.getDifference() == null ? 0 - : bean.getDifference().doubleValue()); - double endingBalance = (bean.getEndingBalance() == null ? 0 - : bean.getEndingBalance().doubleValue()); - double tillCashTotal = (bean.getCashTotal() == null ? 0 : bean - .getCashTotal().doubleValue()); - double cashBeanCardTotal = (bean.getCardTotal() == null ? 0 - : bean.getCardTotal().doubleValue()); - double tillCardTotal = (bean.getCardTotal() == null ? 0 : bean - .getCardTotal().doubleValue()); - double cardDifference = (bean.getCardDifference() == null ? 0 - : bean.getCardDifference().doubleValue()); - double cashBeanChequeTotal = (bean.getChequeTotal() == null ? 0 - : bean.getChequeTotal().doubleValue()); - double tillChequeTotal = (bean.getChequeTotal() == null ? 0 - : bean.getChequeTotal().doubleValue()); - double chequeDifference = (bean.getChequeDifference() == null ? 0 - : bean.getChequeDifference().doubleValue()); - double grandTotal = (bean.getGrandTotal() == null ? 0 - : bean.getGrandTotal().doubleValue()); - - Font titleFont = new Font(Font.TIMES_ROMAN, 8, Font.BOLD); - Font subtitleFont = new Font(Font.TIMES_ROMAN, 8, Font.BOLD); - - // Font headerFont = new Font(Font.TIMES_ROMAN, 8,Font.BOLD); - Font simpleFont = new Font(Font.TIMES_ROMAN, 8); - - final float NO_BORDER = 0.0f; - // final float THIN_BORDER = 1.0f; - - String currency = "Rs "; - NumberFormat formatter = new DecimalFormat("###,###,##0.00"); - PdfPCell cell = null; - - // step 1: creation of a document-object - Document document = new Document(PageSize.A7, 3, 3, 2, 4);// l,r,t,b - // document.getPageSize().set; - - System.out.println(document.leftMargin()); - - try { - currency = POSTerminalManager.getDefaultSalesCurrency(ctx) - .getCurSymbol(); - PdfWriter.getInstance(document, new FileOutputStream(reportPath)); - - document.open(); - - PdfPTable layoutTbl = new PdfPTable(1); - layoutTbl.getDefaultCell().setBorderWidth(NO_BORDER); - layoutTbl.getDefaultCell().setPadding(2.0f); - - SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - Date today = new Date(System.currentTimeMillis()); - - // 1.add title - Paragraph title = new Paragraph(new Chunk("End of the Day Report", - titleFont)); - title.setAlignment(Paragraph.ALIGN_CENTER); - cell = new PdfPCell(title); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); - cell.setBorderWidth(NO_BORDER); - layoutTbl.addCell(cell); - - Paragraph subTitle = new Paragraph(new Chunk(sdf.format(today), - subtitleFont)); - subTitle.setAlignment(Paragraph.ALIGN_CENTER); - cell = new PdfPCell(subTitle); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); - cell.setBorderWidth(NO_BORDER); - layoutTbl.addCell(cell); - - // spacing - cell = new PdfPCell(new Paragraph("")); - cell.setFixedHeight(10); - cell.setBorderWidth(NO_BORDER); - layoutTbl.addCell(cell); - - // display report data - PdfPTable table = new PdfPTable(2); - Phrase phrase = null; - - // row 1 - phrase = new Phrase("Till No:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(bean.getTillName(), simpleFont); - table.addCell(phrase); - - // row 2 - phrase = new Phrase("Begining Balance:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency + formatter.format(beginningBalance), - simpleFont); - table.addCell(phrase); - - // row 3 - phrase = new Phrase("Net Cash Trx:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency - + formatter.format(statementDifference), simpleFont); - table.addCell(phrase); - - phrase = new Phrase("Till Balance Entered:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency + formatter.format(transferAmount), - simpleFont); - table.addCell(phrase); - - phrase = new Phrase("Difference:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency + formatter.format(differenceAmount), - simpleFont); - table.addCell(phrase); - - phrase = new Phrase("Ending Balance:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency + formatter.format(endingBalance), - simpleFont); - table.addCell(phrase); - - phrase = new Phrase("Cash Total:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency + formatter.format(tillCashTotal), - simpleFont); - table.addCell(phrase); - - phrase = new Phrase("Card Amt Entered:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency + formatter.format(cashBeanCardTotal), - simpleFont); - table.addCell(phrase); - - phrase = new Phrase("Card Total:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency + formatter.format(tillCardTotal), - simpleFont); - table.addCell(phrase); - - phrase = new Phrase("Card Difference:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency + formatter.format(cardDifference), - simpleFont); - table.addCell(phrase); - - phrase = new Phrase("Cheque Amt Entered:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency - + formatter.format(cashBeanChequeTotal), simpleFont); - table.addCell(phrase); - - phrase = new Phrase("Cheque Total:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency + formatter.format(tillChequeTotal), - simpleFont); - table.addCell(phrase); - - phrase = new Phrase("Cheque Difference:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency + formatter.format(chequeDifference), - simpleFont); - table.addCell(phrase); - - phrase = new Phrase("Grand Total:", simpleFont); - table.addCell(phrase); - - phrase = new Phrase(currency + formatter.format(grandTotal), - simpleFont); - table.addCell(phrase); - - layoutTbl.addCell(table); - - document.add(layoutTbl); - - } - catch (Exception e) - { - throw new OperationException(e); - } - - document.close(); - - return reportName; - - } - - public static String endOfTheDayReport(Properties ctx, CloseTillBean bean) { - SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - // String currency = - // POSTerminalManager.getPOSDefaultCurrency(ctx).getCurSymbol(); - Date today = new Date(System.currentTimeMillis()); - StringBuffer reportData = new StringBuffer(); - - String title = "End of the Day Report"; - String subtitle = sdf.format(today); - - // adding logo - reportData.append(TmkPrinterConstants.LOGO1); - - // adding title - reportData.append(title).append(TmkPrinterConstants.LINE_FEED); - - // adding subtitle - reportData.append(subtitle).append(TmkPrinterConstants.LINE_FEED); - - // adding space - reportData.append(TmkPrinterConstants.LINE_FEED); - - // adding report data - int maxwidth = 60; - int column1 = 30; - int column2 = maxwidth - column1; - - String format1 = "%1$-" + column1 + "s%2$" + column2 + "s%n"; // string,string - String format2 = "%1$-" + column1 + "s%2$" + column2 + ".2f%n"; // string,bigdecimal - - String tillNo = String - .format(format1, "Till No", bean.getTillName()); - String beginningBalance = String.format(format2, "Beginning Balance",bean.getBeginningBalance().doubleValue()); - String netCashTrx = String.format(format2, "Net Cash Trx", bean.getNetCashTrx().doubleValue()); - String tillBalanceEntered = String.format(format2,"Till Balance Entered", bean.getBalanceEntered().doubleValue()); - String difference = String.format(format2, "Difference", bean.getDifference().doubleValue()); - String endingBalance = String.format(format2, "Ending Balance",bean.getEndingBalance().doubleValue()); - String cashTotal = String.format(format2, "Cash Total", bean.getCashTotal().doubleValue()); - String cardTotal = String.format(format2, "Card Total", bean.getCardTotal().doubleValue()); - String chequeTotal = String.format(format2, "Cheque Total", bean.getChequeTotal()); - String grandTotal = String.format(format2, "Grand Total", bean.getGrandTotal()); - - // some new lines - // String cashEntered = String.format(format1, "Cash Amt Entered", - // cashBean.getca); - String cardEntered = String.format(format2, "Card Amt Entered",bean.getCardTotal()); - String cardDifference = String.format(format2, "Card Difference",bean.getCardDifference()); - String chequeEntered = String.format(format2, "Cheque Amt Entered",bean.getChequeTotal()); - String chequeDifference = String.format(format2, "Cheque Difference",bean.getChequeDifference()); - - reportData.append(tillNo).append(beginningBalance).append(netCashTrx) - .append(tillBalanceEntered).append(difference).append( - endingBalance) - // .append(cashEntered) - .append(cashTotal).append(cardEntered).append(cardTotal) - .append(cardDifference).append(chequeEntered).append( - chequeTotal).append(chequeDifference) - .append(grandTotal).append(TmkPrinterConstants.PAPER_CUT).append(TmkPrinterConstants.LINE_FEED); - - return reportData.toString(); - } - - public static String getDailySalesReport( Properties ctx, Timestamp time, int C_POS_ID, int maxLength, String trxName) throws SQLException, OperationException - { - if (maxLength < TmkPrinterConstants.PRINTER_DEFAULT_WIDTH) - { - maxLength = TmkPrinterConstants.PRINTER_DEFAULT_WIDTH; - } - SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - Date today = new Date(System.currentTimeMillis()); - String subtitle = sdf.format(today); - - StringBuffer sql = new StringBuffer(); - - sql.append(" select PROD.NAME,"); - sql.append(" SUM(0 - FACT.QTY) as Qty,"); - sql.append(" round(SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) * ((tax.RATE+100)/100),3) as Value"); - sql.append(" from FACT_ACCT FACT"); - sql.append(" inner join M_PRODUCT PROD on FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID"); - sql.append(" inner join C_TAX tax on tax.C_TAX_ID = FACT.C_TAX_ID"); - sql.append(" inner join C_INVOICE inv on inv.C_INVOICE_ID = fact.RECORD_ID"); - sql.append(" inner join C_ORDER ord on ord.C_Order_ID = inv.C_Order_ID"); - sql.append(" where FACT.ACCOUNT_ID = (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '41000' and AD_CLIENT_ID ="+Env.getAD_Client_ID(ctx)+")"); - sql.append(" and fact.DATEACCT = ").append(DB.TO_DATE(time)); - sql.append(" and fact.AD_ORG_ID= ? "); - sql.append(" and fact.AD_CLIENT_ID = ? "); - sql.append(" and ord.C_POS_ID = ?"); - sql.append(" GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),"); - sql.append(" tax.RATE,"); - sql.append(" PROD.NAME "); - sql.append(" Order by to_char(fact.DATEACCT,'DD-MM-YYYY')"); - sql.append(" desc,PROD.NAME asc"); - - PreparedStatement pstmt = null; - ResultSet rs = null; - - pstmt = DB.prepareStatement(sql.toString(),trxName); - pstmt.setInt(1, Env.getAD_Org_ID(ctx)); - pstmt.setInt(2, Env.getAD_Client_ID(ctx)); - pstmt.setInt(3, C_POS_ID); - pstmt.execute(); - - BigDecimal totalQty = Env.ZERO; - BigDecimal totalValue = Env.ZERO; - - ArrayList list = new ArrayList(); - Object[] data = null; - - try - { - rs = pstmt.executeQuery(); - - while (rs.next()) - { - data = new Object[3]; - - data[0] = rs.getString(1); - data[1] = rs.getBigDecimal(2); - data[2] = rs.getBigDecimal(3); - - totalQty = totalQty.add(rs.getBigDecimal(2)); - totalValue = totalValue.add(rs.getBigDecimal(3)); - - list.add(data); - } - - } - catch(SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs); - DB.close(pstmt); - } - - String doubleLine = ""; - String line = ""; - - for(int i=0; i getBestSellingItemsData(Properties ctx, Timestamp fromDate, Timestamp toDate, String trxName) throws OperationException, SQLException - { - ArrayList reportData = new ArrayList(); - Object[] data = null; - - BigDecimal totalQty = Env.ZERO; - BigDecimal totalValue = Env.ZERO; - - StringBuffer sql = new StringBuffer(); - - sql.append(" select PROD.NAME, SUM(0 - FACT.QTY) as QTY, round(SUM(FACT.AMTACCTCR - FACT.AMTACCTDR),2) as VALUE,"); - - if(DB.getDatabase().getName().equals(Database.DB_POSTGRESQL)) - { - sql.append(" case when prod.GROUP1 is null then 'OTHERS' else trim(prod.GROUP1) end as GROUP1"); - } - - if(DB.getDatabase().getName().equals(Database.DB_ORACLE)) - { - sql.append(" case when prod.GROUP1 is null then 'OTHERS' else to_char(prod.GROUP1) end as GROUP1"); - } - - sql.append(" from FACT_ACCT FACT inner join M_PRODUCT PROD on FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID") - .append(" where FACT.ACCOUNT_ID = (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '41000' and AD_CLIENT_ID ="+Env.getAD_Client_ID(ctx)+")") - .append(" and fact.DATEACCT between " + DB.TO_DATE(fromDate) + " and " + DB.TO_DATE(toDate) ) - .append(" and fact.AD_ORG_ID="+Env.getAD_Org_ID(ctx)) - .append(" and fact.AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)) - .append(" and PROD.ISACTIVE='Y'"); - - if(DB.getDatabase().getName().equals(Database.DB_ORACLE)) - { - sql.append(" and ROWNUM < 101"); - } - - sql.append(" GROUP BY PROD.NAME, prod.GROUP1, prod.GROUP2") - .append(" Order by round(SUM(FACT.AMTACCTCR - FACT.AMTACCTDR),3) desc"); - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement (sql.toString(), trxName); - rs = pstmt.executeQuery(); - - while(rs.next()) - { - data = new Object[4]; - - data[0] = rs.getString(1); - data[1] = rs.getBigDecimal(2); - data[2] = rs.getBigDecimal(3); - data[3] = rs.getString(4); - - totalQty = totalQty.add(rs.getBigDecimal(2)); - totalValue = totalValue.add(rs.getBigDecimal(3)); - - reportData.add(data); - } - - Object[] totalValues = {"TOTAL ", totalQty, totalValue, ""}; - reportData.add(totalValues); - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs); - DB.close(pstmt); - - } - - return reportData; - } - - /** - * Get Stock Enquiry Data - * @param ctx - * @param fromDate - * @param toDate - * @param trxName - * @return Array of Object - * @throws OperationException - * @throws SQLException - */ - public static ArrayList getStockEnquiryData(Properties ctx, Timestamp fromDate, Timestamp toDate, String trxName) throws OperationException, SQLException - { - ArrayList reportData = new ArrayList(); - Object[] data = null; - - BigDecimal totalOpStockQty = Env.ZERO; - BigDecimal totalOpStockValue = Env.ZERO; - BigDecimal totalClosingStockQty = Env.ZERO; - BigDecimal totalClosingStockValue = Env.ZERO; - - StringBuffer sql = new StringBuffer(); - - sql.append(" select p.UPC as Barcode, p.Name as Product,") - .append(" case when openB.sumO is null then 0 else openB.sumO end as OpStock, ") - .append(" (price.PRICESTD * (case when openB.sumO is null then 0 else openB.sumO end)) as TotalValue, ") - .append(" case when openC.sum1 is null then 0 else openC.sum1 end as ClosingStock ,") - .append(" (price.PRICESTD * (case when openC.sum1 is null then 0 else openC.sum1 end)) as TotValue ") - .append(" from (M_Product p ") - .append(" INNER JOIN ") - .append(" ( ") - .append(" Select M_Product_ID, sum(MovementQty) as sum1 from M_Transaction trx1 where trx1.MOVEMENTDATE < ").append(DB.TO_DATE(fromDate)).append(" and trx1.MOVEMENTTYPE in ('V+','V-','C-','C+','I+') group by M_Product_ID) openC ON p.M_PRODUCT_ID=openC.M_Product_ID ") - .append(" left outer JOIN (Select M_Product_ID, sum(MovementQty) as sumO from M_Transaction trxO where trxO.MOVEMENTDATE < ").append(DB.TO_DATE(toDate)).append(" and trxO.MOVEMENTTYPE in ('V+','V-','C-','C+','I+') group by M_Product_ID) openB ON p.M_PRODUCT_ID=openB.M_Product_ID ") - .append(" ) ") - .append(" left outer join M_PRODUCTPRICE price on p.M_Product_ID=price.M_Product_ID,AD_ORG org ") - .append(" where p.AD_ORG_ID = org.AD_ORG_ID ") - .append(" and p.AD_ORG_ID = ").append(Env.getAD_Org_ID(ctx)) - .append(" and p.ISACTIVE='Y' ") - .append(" and price.M_PRICELIST_VERSION_ID = ").append(Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL_VERSION)) - .append(" order by p.Name "); - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement (sql.toString(), trxName); - rs = pstmt.executeQuery(); - - while(rs.next()) - { - data = new Object[6]; - - data[0] = rs.getString(1); // Bar code - data[1] = rs.getString(2); // Product Name - data[2] = rs.getBigDecimal(3); // Opening Stock - data[3] = rs.getBigDecimal(4); // Opening Value - data[4] = rs.getBigDecimal(5); // Closing Stock - data[5] = rs.getBigDecimal(6); // Closing Value - - totalOpStockQty = totalOpStockQty.add(rs.getBigDecimal(3)); - totalOpStockValue = totalOpStockValue.add(rs.getBigDecimal(4)); - totalClosingStockQty = totalClosingStockQty.add(rs.getBigDecimal(5)); - totalClosingStockValue = totalClosingStockValue.add(rs.getBigDecimal(6)); - - reportData.add(data); - } - - Object[] totalValues = {"TOTAL VALUE ", "", totalOpStockQty, totalOpStockValue, totalClosingStockQty, totalClosingStockValue}; - reportData.add(totalValues); - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs); - DB.close(pstmt); - - } - - return reportData; - } - - public static ArrayList getStockSalesReport(Properties ctx, HashMap> productOrgList, ArrayList stockSalesList, boolean isSales, Integer productId, Integer orgId, Timestamp fromDate, Timestamp toDate) throws OperationException, SQLException - { - - if (productId == null) - { - throw new OperationException("product Id is null, cannot search for stock and sales by org"); - } - if (orgId == null) - { - throw new OperationException("org id is null, cannot search for stock and sales"); - } - - if (productOrgList == null) - { - productOrgList = new HashMap>(); - } - - MProduct product = MProduct.get(ctx, productId); - String productName = product.getName(); - int adClientId = Env.getAD_Client_ID(ctx); - - BigDecimal data = null; - BigDecimal stock = null; - boolean queryOrg = true; - MOrg org = MOrg.get(ctx, orgId); - - if (stockSalesList == null) - { - stockSalesList = new ArrayList(); - - data = getData(ctx, isSales, productId, orgId, fromDate, toDate); - - Object[] headerSales = new Object[] {"Product", org.getName(), "Total"}; - Object[] row = new Object[]{productName, data, data}; - stockSalesList.add(headerSales); - stockSalesList.add(row); - ArrayList orgList = new ArrayList(); - orgList.add(org.getName()); - productOrgList.put(productId, orgList); - } - - else - { - Object[] headerSales = stockSalesList.get(0); - - for (int i=1; i clone = new ArrayList(); - Iterator iterClone = stockSalesList.iterator(); - - while (iterClone.hasNext()) - { - clone.add(iterClone.next()); - } - - Iterator iter = stockSalesList.subList(1, stockSalesList.size()).iterator(); - while (iter.hasNext()) - { - Object[] row = iter.next(); - String prodName = row[0].toString(); - int[] ids = ProductManager.getProducts(ctx, prodName, "", "",null); - Integer prodId = 0; - if (ids !=null && ids.length >0) - { - prodId= Integer.valueOf(ids[0]); - } - data = getData(ctx, isSales, prodId, orgId, fromDate, toDate); - updateRow(clone,row, data); - productOrgList.get(prodId).add(org.getName()); // update list - } - stockSalesList = clone; - clone = null; - - } - if (!productOrgList.containsKey(productId)) // need to add new product - { - // add product for all existing orgs (plus the new one if just added) - headerSales = stockSalesList.get(0); - - Object[] newRowAdded = new Object[headerSales.length]; - newRowAdded[0] = productName; - ArrayList orgList = new ArrayList(); - BigDecimal total = Env.ZERO; - for (int i = 1; i< headerSales.length-1; i++) - { - String existingOrg = headerSales[i].toString(); - orgList.add(existingOrg); - Integer existingOrgId = OrganisationManager.getOrgByName(ctx, existingOrg, null).get_ID(); - data = getData(ctx, isSales, productId, existingOrgId, fromDate, toDate); - - newRowAdded[i] = data; - total = total.add(data); - } - newRowAdded[headerSales.length-1] = total; - productOrgList.put(productId, orgList); - stockSalesList.add(newRowAdded); - } - } - - return stockSalesList; - - } - - public static ArrayList doBackup(ArrayList list) - { - ArrayList backup = null; - if (list != null) - { - Iterator iter = list.iterator(); - - backup = new ArrayList(); - - while (iter.hasNext()) - { - backup.add(iter.next()); - } - } - return backup; - } - - - private static void updateRow(ArrayList stockSalesList, Object[] row, BigDecimal data) throws OperationException - { - Object[] newRow = new Object[stockSalesList.get(0).length]; - - if (!(newRow.length == row.length + 1)) - { - throw new OperationException("inconsistent header and row length"); - } - - for (int i=0; i< row.length-1; i++) - { - newRow[i] = row[i]; // fill new row with data of old row (product name to data for last org) exclude total - } - - newRow[row.length-1] = data; // append new data for new org added - - - BigDecimal total = Env.ZERO; // calculate new total - for (int j = 1; j orgSales = POSSalesReportManager.getSalesByOrg(ctx, productId, orgId, fromDate, toDate, null); - - data = orgSales.get(orgId); - - } - - else - { - HashMap orgStock = POSStockManager.getStockByOrg(ctx, productId, toDate, orgId, null); - data = orgStock.get(orgId); - - } - if (data == null) - { - return Env.ZERO; - } - - return data; - } - - public static ArrayList getStockSalesReportComplete(Properties ctx, HashSet productListCompleteSet, boolean isSales, ArrayList listComplete, Integer productId, - Integer orgId, Timestamp fromDate, Timestamp toDate) throws OperationException, SQLException - { - HashMap list = null; - - if (productListCompleteSet == null) - { - productListCompleteSet = new HashSet(); - } - - if (!productListCompleteSet.isEmpty() && productListCompleteSet.contains(productId)) - { - return listComplete; - } - else - { - productListCompleteSet.add(productId); - } - - if (isSales) - { - list = POSSalesReportManager.getSalesByOrg(ctx, productId, orgId, fromDate, toDate, null); - } - else - { - list = POSStockManager.getStockByOrg(ctx, productId, toDate, orgId, null); - } - - if (listComplete == null) - { - listComplete = getHeaderComplete(ctx); - } - - MProduct product = MProduct.get(ctx, productId); - Object[] header = listComplete.get(0); - Object[] row = new Object[header.length]; - - row[0] = product.getName(); - BigDecimal total = Env.ZERO; - for (int i = 1; i getHeaderComplete(Properties ctx) - { - ArrayList listComplete = new ArrayList(); - String orgList = Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); - String[] orgs = orgList.split(","); - - Object[] header = new Object[orgs.length +1]; - header[0] = "Product"; - - int i = 1; - for (String org : orgs) - { - Integer org_Id = Integer.valueOf(org); - if (org_Id != 0) - { - MOrg organisation = MOrg.get(ctx, org_Id); - header[i] = organisation.getName(); - i++; - } - } - header[i] = "Total"; - listComplete.add(header); - return listComplete; - } - - public static String getListMonthYears(Timestamp fromDate, Timestamp toDate) throws OperationException - { - DateFormatSymbols dfs = new DateFormatSymbols(Locale.ENGLISH); - - String date1 = TimestampConvertor.convertTimeStamp(fromDate, TimestampConvertor.BIRTH_DATE); - String date2 = TimestampConvertor.convertTimeStamp(toDate, TimestampConvertor.BIRTH_DATE); - String[] monthName = dfs.getMonths(); - - - StringBuffer list_monthYears = new StringBuffer(); - String[] s_date1 = date1.split("/"); - String[] s_date2 = date2.split("/"); - int begin_month = 0; - int begin_year = 0; - int end_month = 0; - int end_year = 0; - - if (s_date1 != null) - { - begin_month = Integer.parseInt(s_date1[1]); - begin_year = Integer.parseInt(s_date1[2]); - - } - - if (s_date2 != null) - { - end_month = Integer.parseInt(s_date2[1]); - end_year = Integer.parseInt(s_date2[2]); - } - - int month = begin_month -1; - int year = begin_year; - - while (month <= Calendar.DECEMBER && year <= end_year) - { - list_monthYears.append(monthName[month] + " " + year + ","); - - if (month == Calendar.DECEMBER) - { - year++; - month = -1; - } - month %= Calendar.DECEMBER; - month++; - - if (year == end_year) - { - if (month >= end_month) - { - break; - } - } - - } - - return list_monthYears.toString(); - - } - - public static ArrayList formatStockSalesReportData(ArrayList reportData, HashMap monthYearQtyMap, - Timestamp fromDate, Timestamp toDate, int precision) throws OperationException - { - String list_monthYears = POSReportManager.getListMonthYears(fromDate, toDate); - String[] listOfMonthYrs = list_monthYears.split(","); - - if (reportData == null) - { - reportData = new ArrayList(); - } - - if (monthYearQtyMap.isEmpty()) - { - List repDataOnly = reportData.subList(1, reportData.size()); - if (repDataOnly.isEmpty()) - { - for (String monthYear: listOfMonthYrs) - { - Object[] data = {monthYear, Env.ZERO}; - reportData.add(data); - } - } - else - { - for (int index =1; index iter = reportData.iterator(); - int j =1; - iter.next(); // escape headers - - while (iter.hasNext()) - { - Object[] dat = iter.next(); - String monthYr = dat[0].toString(); - if (monthYear.equals(monthYr)) - { - index = j; - } - j++; - } - } - if (index != -1) - { - Object[] oldData = reportData.get(index); - reportData.remove(index); - data = new Object[oldData.length +1]; - for (int i =0; i loadReports(Properties ctx) - { - int roleId = Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID); - - return loadReports(ctx, roleId); - } - - /** - * Loads reports accessible by this role. - * Reports are granted to a particular role as process accesses for that role. - * For the reports to be accessible, these process accesses should be active - * and this role should have read-write permissions. - * - * @param ctx context - * @param roleId id of role for which the accessible reports are to be loaded - * @return an arraylist of process ids which are the ids of those processes accessible by that role - */ - public static ArrayList loadReports(Properties ctx, int roleId) - { - if (roleId == 0) - { - return new ArrayList(); - } - MRole role = MRole.get(ctx, roleId); - int adClientId = role.getAD_Client_ID(); - - StringBuffer sqlBuffer = new StringBuffer(); - sqlBuffer.append("SELECT process.AD_Process_ID FROM AD_Process process") - .append(" INNER JOIN AD_Process_Access processAccess ON process.AD_Process_ID = processAccess.AD_Process_ID") - .append(" WHERE process.isActive='Y' AND process.isReport = 'Y' and process.isDirectPrint = 'N'") - .append(" AND processAccess.isActive = 'Y' AND processAccess.isReadWrite = 'Y' AND processAccess.AD_Role_ID = ?") - .append(" AND processAccess.AD_Client_ID = " + adClientId); - - ArrayList processList = new ArrayList(); - - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sqlBuffer.toString(), null); - pstmt.setInt(1, roleId); - rs = pstmt.executeQuery(); - - while (rs.next()) - { - processList.add(rs.getInt(1)); - } - } - catch(SQLException e) - { - - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - return processList; - - } - - /** - * Creates a process instance for this process and populates its parameters. - * For every mapping found in the hashmap paramKeyValue, a parameter is created. - * Each parameter is populated thus: - * Each key is a column name identifying a parameter and the corresponding - * hashmap value is the parameter value. - * - * @param ctx context - * @param processId id of the process whose instance is to be created - * @param paramKeyValue hashmap of column names mapped to their respective values - * - * @return id of the process instance created - * @throws OperationException - */ - public static ProcessInfo createProcessInstance(Properties ctx, int processId, Map map, String trxName) throws OperationException - { - checkProcessAccess(ctx, processId, trxName); - - MProcess process = MProcess.get(ctx, processId); - MProcessPara[] processParams = process.getParameters(); - ProcessInfoParameter[] pInfoParams = new ProcessInfoParameter[processParams.length]; - MPInstance processInstance = new MPInstance(ctx, processId, 0); - processInstance.save(trxName); - - int sequence = 0; - for (MProcessPara parameter : processParams) - { - String columnName = parameter.getColumnName(); - boolean isRange = parameter.isRange(); - int displayType = parameter.getAD_Reference_ID(); - - Class classType = DisplayType.getClass(displayType, true); - Object value = null; - Object value_to = null; - - if (isRange) - { - value = map.get(columnName + "From"); - value_to = map.get(columnName + "To"); - } - else - { - value = map.get(columnName); - } - - if (parameter.isMandatory()) - { - if (isRange) - { - if (value_to == null) - { - throw new MandatoryException(columnName + " value_to parameter is mandatory"); - } - } - if (value == null) - { - throw new MandatoryException(columnName + " value parameter is mandatory"); - } - } - - value = convertValue(value, classType); - value_to = convertValue(value_to, classType); - - MPInstancePara param = new MPInstancePara(processInstance, sequence); - param.setParameterName(columnName); - setParameterValue(param, value, value_to); - String info = null; - String info_to = null; - Lookup lookup = parameter.getLookup(); - if (lookup != null) - { - if (value != null) - { - info = lookup.get(value).toString(); - } - if (value_to != null) - { - info_to = parameter.getLookup().get(value_to).toString(); - } - param.setInfo(info); - param.setInfo_To(info_to); - } - param.save(trxName); - - ProcessInfoParameter infoParam = new ProcessInfoParameter(columnName, value, value_to, null, null); - pInfoParams[sequence] = infoParam; - - sequence++; - } - - ProcessInfo pi = new ProcessInfo(process.getName(), processId); - pi.setTitle(process.getName()); - pi.setTransactionName(trxName); - pi.setAD_Client_ID(Env.getAD_Client_ID(ctx)); - pi.setParameter(pInfoParams); - pi.setAD_PInstance_ID(processInstance.getAD_PInstance_ID()); - pi.setClassName(process.getClassname()); - - return pi; - } - - /** - * - * @param param - * @param value - * @param value_to - */ - private static void setParameterValue(MPInstancePara param, Object value, Object value_to) - { - if (value == null) - { - return; - } - - if (value.getClass() == Integer.class) - { - param.setP_Number((Integer)value); - - if (value_to !=null) - { - param.setP_Number_To((Integer)value_to); - } - } - else if (value.getClass() == BigDecimal.class) - { - param.setP_Number((BigDecimal)value); - - if (value_to !=null) - { - param.setP_Number_To((BigDecimal)value_to); - } - } - else if (value.getClass() == Timestamp.class) - { - param.setP_Date((Timestamp)value); - if (value_to !=null) - { - param.setP_Date_To((Timestamp)value_to); - } - } - else - { - param.setP_String(value.toString()); - if (value_to !=null) - { - param.setP_String_To(value_to.toString()); - } - } - - } - - /** - * - * @param value - * @param classType - * @return - */ - private static Object convertValue(Object value, Class classType) - { - if (value != null) - { - String[] values = (String[]) value; - String val = values[0]; - - if ("".equals(val)) - { - return null; - } - - if (classType == String.class || classType == Boolean.class) - { - value = val; - } - else if (classType == Integer.class || classType == BigDecimal.class) - { - value = BigDecimal.valueOf(Integer.valueOf(val)); - } - else if (classType == Timestamp.class) - { - val = val +" 0:0:0.0"; // SENDYFIXME Need to fix this - value = Timestamp.valueOf(val); - } - } - return value; - } - - /** - * Loads the print format associated with a process or if none is found, loads its default one. - * - * @param ctx context - * @param process the process whose print format is to be loaded - * @return print format to use with that process - * @throws Exception - */ - public static MPrintFormat loadPrintFormat(Properties ctx, MProcess process, String trxName) throws Exception - { - MPrintFormat retValue = null; - if (process.getAD_PrintFormat_ID() ==0) - { - I_AD_ReportView reportView = process.getAD_ReportView(); - int reportViewId = 0; - int tableId = 0; - - if (reportView != null) - { - reportViewId = reportView.getAD_ReportView_ID(); - tableId = reportView.getAD_Table_ID(); - } - - PreparedStatement pstmt = null; - ResultSet rs = null; - String sql = "SELECT * FROM AD_PrintFormat WHERE "; - if (reportViewId > 0) - { - sql += "AD_ReportView_ID=?"; - } - else - { - sql += "AD_Table_ID=?"; - } - - sql += " AND AD_Client_ID = " +Env.getAD_Client_ID(ctx); - sql += " ORDER BY IsDefault DESC"; - try - { - pstmt = DB.prepareStatement (sql, trxName); - pstmt.setInt (1, reportViewId > 0 ? reportViewId : tableId); - rs = pstmt.executeQuery (); - if (rs.next ()) - { - retValue = new MPrintFormat (ctx, rs, trxName); - } - } - catch (Exception e) - { - } - finally - { - DB.close(rs, pstmt); - pstmt = null; - rs = null; - } - retValue = retValue == null ? MPrintFormat.createFromTable(ctx, tableId) : retValue; - } - else - { - retValue = new MPrintFormat(ctx, process.getAD_PrintFormat_ID(), null); - } - return retValue; - } - - /** - * - * @param ctx - * @param className - * @param pi - * @param trx - * @throws InstantiationException - * @throws IllegalAccessException - * @throws ClassNotFoundException - *//* - public static void startProcess(Properties ctx, String className, ProcessInfo pi,Trx trx) - throws InstantiationException, IllegalAccessException, ClassNotFoundException - { - if (className == null) - { - return; - } - Class cl = Class.forName(className); - - if (cl == ReportStarter.class) - { - ReportStarter reportStarter = (ReportStarter)cl.newInstance(); - reportStarter.startProcess(ctx, pi, trx); - return; - } - SvrProcess server = (SvrProcess)cl.newInstance(); - server.startProcess(ctx, pi, trx); - }*/ - - public static boolean isJasperReport(String className) throws ClassNotFoundException - { - if (className!=null) - { - Class cl = Class.forName(className); - - if (cl == ReportStarter.class) - { - return true; - } - } - return false; - } - - /** - * - * @param ctx - * @param processId - * @param trxName - * @throws OperationException - */ - private static void checkProcessAccess(Properties ctx, int processId, String trxName) throws OperationException - { - String sql = "SELECT isActive, isReadWrite FROM AD_Process_Access WHERE AD_Process_ID = ? " + - "AND AD_Role_ID = ? AND AD_Client_ID = ?"; - - MProcess process = MProcess.get(ctx, processId); - PreparedStatement pstmt = null; - ResultSet rs = null; - - String isActive = "N"; - String isReadWrite = "N"; - - - int roleId = Env.getAD_Role_ID(ctx); - MRole role = MRole.get(ctx, roleId); - int adClientId = Env.getAD_Client_ID(ctx); - try - { - pstmt = DB.prepareStatement(sql, trxName); - pstmt.setInt(1, processId); - pstmt.setInt(2, roleId); - pstmt.setInt(3, adClientId); - - rs = pstmt.executeQuery(); - - if (rs.next()) - { - isActive = rs.getString(1); - isReadWrite = rs.getString(2); - } - else - { - throw new OperationException("The report "+process.getName()+" does not exist for role " + role.getName()); - } - } - catch (SQLException e) - { - - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - if (!"Y".equals(isActive)) - { - throw new OperationException("The access to the report "+process.getName()+" for role "+role.getName()+" is not active"); - } - - if (!"Y".equals(isReadWrite)) - { - throw new OperationException("Role "+role.getName()+ " does not have read/write permissions for report "+ process.getName()); - } - } - - /** - * - * @param writer - * @param title - * @param paramMap - * @param printData - * @param printFormat - * @param pdfURI - * @param csvURI - */ - public static void createHTML(Writer writer, String title, HashMap paramMap, - PrintData printData, MPrintFormat printFormat) - { - Language language = printFormat.getLanguage(); - XhtmlDocument doc = new XhtmlDocument(); - - String style = ""; - - head head = new head(style); - doc.appendHead(head); - - try - { - writer.append(""); - writer.append("
"+title+"
"); - - Set parameters = paramMap.keySet(); - - Iterator columnIter = parameters.iterator(); - writer.append("
Parameters:
"); - while (columnIter.hasNext()) - { - String columnName = columnIter.next(); - String value = paramMap.get(columnName); - writer.append("
" + columnName+": " + value + "
"); - } - writer.append("
 
"); - writer.append(""); - // for all rows (-1 = header row) - for (int row = -1; row < printData.getRowCount(); row++) - { - writer.append(""); - if (row != -1) - printData.setRowIndex(row); - // for all columns - String rowClass = "odd"; - if (row%2==0) - { - rowClass = "even"; - } - for (int col = 0; col < printFormat.getItemCount(); col++) - { - MPrintFormatItem item = printFormat.getItem(col); - if (item.isPrinted()) - { - // header row - if (row == -1) - { - writer.append(""); - } - else - { - writer.append(""); - } - else if (obj instanceof PrintDataElement) - { - String value = ((PrintDataElement)obj).getValueDisplay(language); // formatted - writer.append(Util.maskHTML(value)+""); - } - else if (obj instanceof PrintData) - { - // ignore contained Data - } - else - { - - } - } - } // printed - } // for all columns - writer.append(""); - } // for all rows - writer.append("
"+Util.maskHTML(item.getPrintName(language))+""); - Object obj = printData.getNode(new Integer(item.getAD_Column_ID())); - if (obj == null) - { - writer.append(" 
"); - PrintWriter printWriter = new PrintWriter(writer); - doc.output(printWriter); - printWriter.flush(); - printWriter.close(); - } - catch (Exception e) - { - } - } - - /** - * Load specific reportEngine for this print format and this process info - * @param ctx context - * @param printFormat print format - * @param pi - * @return - * @throws Exception - */ - public static ReportEngine getReportEngine(Properties ctx, MPrintFormat printFormat, ProcessInfo pi) throws Exception - { - MProcess process = MProcess.get(ctx, pi.getAD_Process_ID()); - int tableId = process.getAD_ReportView().getAD_Table_ID(); - String tableName = MTable.getTableName(ctx, tableId); - // Create query from parameters - MQuery query = MQuery.get (ctx, pi.getAD_PInstance_ID(), tableName); - PrintInfo printInfo = new PrintInfo(pi); - ReportEngine reportEngine = new ReportEngine(ctx, printFormat, query, printInfo); - - return reportEngine; - } - - /** - * - * @param ctx - * @param printFormat - * @param pi - * @return - * @throws Exception - */ - public static PrintData getPrintData(Properties ctx, MPrintFormat printFormat, ProcessInfo pi) throws Exception - { - MProcess process = MProcess.get(ctx, pi.getAD_Process_ID()); - int tableId = process.getAD_ReportView().getAD_Table_ID(); - String tableName = MTable.getTableName(ctx, tableId); - // Create query from parameters - MQuery query = MQuery.get (ctx, pi.getAD_PInstance_ID(), tableName); - - DataEngine dataEngine = new DataEngine(printFormat.getLanguage()); - return dataEngine.getPrintData(ctx, printFormat, query); - } - - /** - * - * @param ctx - * @param pinstanceId - * @param trxName - * @return - */ - public static HashMap getReportParameters(Properties ctx, int pinstanceId, String trxName) - { - HashMap map = new HashMap(); - - MPInstance pinstance = new MPInstance(ctx, pinstanceId, trxName); - - MPInstancePara[] params = pinstance.getParameters(); - - for (MPInstancePara para: params) - { - String columnName = para.getParameterName(); - String info = para.getInfo(); - String info_to = para.getInfo_To(); - - String name = getElementName(columnName, trxName); - - StringBuffer value = new StringBuffer(); - - if (info != null) - { - value.append(info); - - if (info_to != null) - { - value.append("-").append(info_to); - } - map.put(name, value.toString()); - } - } - - - return map; - } - - /** - * - * @param columnName - * @param trxName - * @return - */ - private static String getElementName(String columnName, String trxName) - { - String adElementName = null; - String sql = "SELECT name from AD_Element where columnName = '" + columnName +"'"; - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sql, trxName); - rs = pstmt.executeQuery(); - - if (rs.next()) - { - adElementName = rs.getString(1); - } - } - catch (SQLException e) - { - - } - finally - { - DB.close(rs, pstmt); - pstmt = null; - rs = null; - } - - return adElementName; - } - - /** - * Return an HTML version of close till report - * @param ctx - * @param tillBean - * @param cashBean - * @return - */ - public static String endOfTheDayHTMLReport(Properties ctx, CloseTillBean bean) { - - double beginningBalance = (bean.getBeginningBalance() == null ? 0 - : bean.getBeginningBalance().doubleValue()); - double statementDifference = (bean.getNetCashTrx() == null ? 0 - : bean.getNetCashTrx().doubleValue()); - double transferAmount = (bean.getBalanceEntered() == null ? 0 - : bean.getBalanceEntered().doubleValue()); - double differenceAmount = (bean.getDifference() == null ? 0 - : bean.getDifference().doubleValue()); - double endingBalance = (bean.getEndingBalance() == null ? 0 - : bean.getEndingBalance().doubleValue()); - double tillCashTotal = (bean.getCashTotal() == null ? 0 : bean - .getCashTotal().doubleValue()); - double cashBeanCardTotal = (bean.getCardTotal() == null ? 0 - : bean.getCardTotal().doubleValue()); - double tillCardTotal = (bean.getCardTotal() == null ? 0 : bean - .getCardTotal().doubleValue()); - double cardDifference = (bean.getCardDifference() == null ? 0 - : bean.getCardDifference().doubleValue()); - double cashBeanChequeTotal = (bean.getChequeTotal() == null ? 0 - : bean.getChequeTotal().doubleValue()); - double tillChequeTotal = (bean.getChequeTotal() == null ? 0 - : bean.getChequeTotal().doubleValue()); - double chequeDifference = (bean.getChequeDifference() == null ? 0 - : bean.getChequeDifference().doubleValue()); - double grandTotal = (bean.getGrandTotal() == null ? 0 - : bean.getGrandTotal().doubleValue()); - - - SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - // String currency = - // POSTerminalManager.getPOSDefaultCurrency(ctx).getCurSymbol(); - Date today = new Date(System.currentTimeMillis()); - StringBuffer reportData = new StringBuffer(); - - String title = "

End of the Day Report

"; - String subtitle = "

" + sdf.format(today) + "

"; - - // adding title - reportData.append(title); - - // adding subtitle - reportData.append(subtitle); - - // adding space - reportData.append("
"); - - // adding report data - int maxwidth = 40; - int column1 = 20; - int column2 = maxwidth - column1; - - String format1 = "%1$-" + column1 + "s%2$" + column2 + "s%n"; // string,string - String format2 = "%1$-" + column1 + "s%2$" + column2 + ".2f%n"; // string,bigdecimal - - String tillNoTxt = String.format(format1, "Till No", bean.getTillName()); - String beginningBalanceTxt = String.format(format2, "Beginning Balance",beginningBalance); - String netCashTrxTxt = String.format(format2, "Net Cash Trx", statementDifference); - String tillBalanceEnteredTxt = String.format(format2, "Till Balance Entered", transferAmount); - String differenceTxt = String.format(format2, "Difference", differenceAmount); - String endingBalanceTxt = String.format(format2, "Ending Balance", endingBalance); - String cashTotalTxt = String.format(format2, "Cash Total", tillCashTotal); - String cardTotalTxt = String.format(format2, "Card Total", tillCardTotal); - String chequeTotalTxt = String.format(format2, "Cheque Total", tillChequeTotal); - String grandTotalTxt = String.format(format2, "Grand Total", grandTotal); - - // some new lines - // String cashEntered = String.format(format1, "Cash Amt Entered", - String cardEnteredTxt = String.format(format2, "Card Amt Entered",cashBeanCardTotal); - String cardDifferenceTxt = String.format(format2, "Card Difference",cardDifference); - String chequeEnteredTxt = String.format(format2, "Cheque Amt Entered",cashBeanChequeTotal); - String chequeDifferenceTxt = String.format(format2, "Cheque Difference",chequeDifference); - - reportData.append(tillNoTxt) - .append(beginningBalanceTxt) - .append(netCashTrxTxt) - .append(tillBalanceEnteredTxt) - .append(differenceTxt) - .append(endingBalanceTxt) - // .append(cashEntered) - .append(cashTotalTxt) - .append(cardEnteredTxt) - .append(cardTotalTxt) - .append(cardDifferenceTxt) - .append(chequeEnteredTxt) - .append(chequeTotalTxt) - .append(chequeDifferenceTxt) - .append(grandTotalTxt) - .append("
"); - - return reportData.toString(); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSSalesReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSSalesReportManager.java deleted file mode 100644 index d8dfdffb8d..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/POSSalesReportManager.java +++ /dev/null @@ -1,1046 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 17-Jul-2006 14:15:12 by praveen - * - */ - -package org.posterita.businesslogic.performanceanalysis; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Properties; -import java.util.TreeMap; - -import org.compiere.model.MBPartner; -import org.compiere.model.MCashLine; -import org.compiere.model.MInvoice; -import org.compiere.model.MOrder; -import org.compiere.model.MPayment; -import org.compiere.model.MPriceList; -import org.compiere.model.MTransaction; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.POSHistoryBean; -import org.posterita.beans.ReportBean; -import org.posterita.beans.SalesDetailsBean; -import org.posterita.beans.UDIPair; -import org.posterita.beans.WebOrderLineBean; -import org.posterita.businesslogic.OrderManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.administration.WarehouseManager; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.order.UDIOrderTypes; - -public class POSSalesReportManager -{ - public static ArrayList getSalesGroupList(Properties ctx,ReportBean bean) throws OperationException - { - ArrayList groupList = new ArrayList(); - groupList.add(new UDIPair("Revenue Recognition",Constants.REVENUE_RECOGNITION)); - groupList.add(new UDIPair("Product",Constants.PRODUCT)); - groupList.add(new UDIPair("Customer",Constants.CUSTOMER)); - groupList.add(new UDIPair("AttributeSet",Constants.ATTRIBUTESET)); - groupList.add(new UDIPair("Group1",Constants.GROUP1)); - groupList.add(new UDIPair("Group2",Constants.GROUP2)); - - // String fromDate = null; - // String toDate = null; - - if(bean.getDateRange().equalsIgnoreCase(Constants.FIXED_DATE_RANGE)) - { - if(bean.getTimePeriod() == null) - { - throw new OperationException("Invalid parameter: timeperiod is null"); - } - - //Date startDate = - ReportDateManager.getStartDateForPeriod(bean.getTimePeriod()); - //Date endDate = - ReportDateManager.getEndDateForPeriod(bean.getTimePeriod()); - - //SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); - //fromDate = sdf.format(startDate); - //toDate = sdf.format(endDate); - } - else - { - //fromDate = BirtReportManager.getFromDate(bean); - // toDate = BirtReportManager.getToDate(bean); - } - - int ad_client_id = Env.getAD_Client_ID(ctx); - - if(bean.getAccountId()==null) - { - throw new OperationException("Invalid parameter value : accountId->" + bean.getAccountId()); - } - - int account_id = bean.getAccountId().intValue(); - - String sql = "select distinct attrSet.NAME as ATTRIBUTESET_NAME,attr.NAME as ATTRIBUTE_NAME,attrSet.M_ATTRIBUTESET_ID as ATTRIBUTESET_ID,attr.M_ATTRIBUTE_ID as ATTRIBUTE_ID " + - "from M_ATTRIBUTESETINSTANCE attrSetIns,M_PRODUCT prod,M_ATTRIBUTESET attrSet,M_ATTRIBUTEUSE attrUse,M_ATTRIBUTE attr,FACT_ACCT fact " + - "where prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID " + - "and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID " + - "and attrUse.M_ATTRIBUTESET_ID = attrSet.M_ATTRIBUTESET_ID " + - "and attr.M_ATTRIBUTE_ID = attrUse.M_ATTRIBUTE_ID " + - "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + - "and fact.account_id = " + - "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = ? and AD_CLIENT_ID = ? ) " + - "and fact.AD_CLIENT_ID = ? "; - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - try - { - pstmt.setString(1,account_id+""); - pstmt.setInt(2,ad_client_id); - pstmt.setInt(3,ad_client_id); - - ArrayList data = ReportManager.getReportData(pstmt,false); - String attributeSetName = null; - String attributeSetId = null; - String attributeName = null; - String attributeId = null; - - for (Object[] objects : data) - { - attributeSetName = objects[0]+""; - attributeName = objects[1]+""; - - attributeSetId = objects[2]+""; - attributeId = objects[3]+""; - - groupList.add(new UDIPair(attributeSetName+"_"+attributeName,attributeSetId+"_"+attributeId)); - } - } - catch (SQLException e) - { - throw new OperationException(e); - } - - return groupList; - } - - public static ArrayList getPriceQtyFilter(Properties ctx) - { - ArrayList filter = new ArrayList(); - filter.add(new UDIPair("Price",Constants.PRICE)); - filter.add(new UDIPair("Quantity",Constants.QUANTITY)); - - return filter; - } - - //-------------------------------------------------------------------------------------- - public static ArrayList getSalesOrPurchaseReportData(Properties ctx, ReportBean bean, String trxName) throws Exception - { - Timestamp startDate = null; - Timestamp endDate = null; - boolean isFullDetails = false; - - String isSalesRPT = bean.getIsSalesReport(); - Boolean isSalesReport = Boolean.valueOf(isSalesRPT); - String reportType = "SALES"; - String orderType = "POS Order"; - String returnedOrderType = "Customer Returned Order"; - String isSOTrx = "Y"; - - if(!(isSalesReport)) - { - reportType = "PURCHASES"; - orderType = "POS Goods Receive Note"; - returnedOrderType = "POS Goods Returned Note"; - isSOTrx = "N"; - } - - BigDecimal totalPayment = Env.ZERO; - - if (Constants.FULL_DETAILS.equals(bean.getFullDetails())) - { - isFullDetails = true; - - if(!(isSalesReport)) - { - isFullDetails = false; - } - } - - if(bean.getDateRange().equalsIgnoreCase(Constants.FIXED_DATE_RANGE)) - { - if(bean.getTimePeriod() == null) - { - throw new OperationException("Invalid parameter: timeperiod is null"); - } - - startDate = ReportDateManager.getStartDateForPeriod(bean.getTimePeriod()); - endDate = ReportDateManager.getEndDateForPeriod(bean.getTimePeriod()); - - } - else - { - startDate = ReportDateManager.getFromDateAsDate(bean); - endDate = ReportDateManager.getEndDateAsDate(bean); - } - int ad_client_id = Env.getAD_Client_ID(ctx); - - SalesDetailsBean sbean = null; - ArrayList salesList = new ArrayList(); - - //Purchase Price List - int purchasePriceListId = POSTerminalManager.getPOPriceListId(ctx); - Integer ppriceListVersionId = PriceListManager.getPriceListVersionID(ctx, purchasePriceListId, null); - MPriceList ppriceList = new MPriceList(ctx, purchasePriceListId, null); - StringBuffer sqlOrder = new StringBuffer(); - if(isSalesReport) - { - sqlOrder.append(" issotrx = 'Y'"); - } - else - { - sqlOrder.append(" issotrx = 'N'"); - } - - sqlOrder.append(" and c_pos_id=").append(Env.getContextAsInt(ctx, UdiConstants.TERMINAL_ID)); - sqlOrder.append(" and docstatus in ('CO','CL')"); - - if(isSalesReport) - { - sqlOrder.append(" and ordertype in ('POS Order','Credit Order','Customer Returned Order')"); - } - else - { - sqlOrder.append(" and ordertype in ('").append(orderType).append("','").append(returnedOrderType).append("') "); - } - - sqlOrder.append(" and ad_client_id = ").append(ad_client_id); - sqlOrder.append(" and dateacct between ").append(DB.TO_DATE(startDate, false)); - sqlOrder.append(" and ").append(DB.TO_DATE(endDate, false)); - sqlOrder.append(" and ad_org_id =").append(Env.getAD_Org_ID(ctx)); - sqlOrder.append(" order by dateacct"); - - // Get All Orders - int[] orderId = MOrder.getAllIDs(MOrder.Table_Name, sqlOrder.toString(), null); - - if(orderId != null) - { - - for (int c_order_id : orderId) - { - sbean = new SalesDetailsBean(); - BigDecimal productCost = Env.ZERO; - BigDecimal totalProductCosts = Env.ZERO; - BigDecimal taxAmt = Env.ZERO; - BigDecimal totalTaxAmt = Env.ZERO; - BigDecimal salesExempt = Env.ZERO; - BigDecimal totalSalesExempt = Env.ZERO; - BigDecimal salesExcVat = Env.ZERO; - BigDecimal totalSalesExcVat = Env.ZERO; - BigDecimal creditNoteExcVat = Env.ZERO; - BigDecimal totalCreditNoteExcVat = Env.ZERO; - BigDecimal creditNoteExempt = Env.ZERO; - BigDecimal totalCreditNoteExempt = Env.ZERO; - BigDecimal purchasesExempt = Env.ZERO; - BigDecimal totalPurchasesExempt = Env.ZERO; - BigDecimal purchasesExcVat = Env.ZERO; - BigDecimal totalPurchasesExcVat = Env.ZERO; - BigDecimal debitNoteExcVat = Env.ZERO; - BigDecimal totalDebitNoteExcVat = Env.ZERO; - BigDecimal debitNoteExempt = Env.ZERO; - BigDecimal totalDebitNoteExempt = Env.ZERO; - - MOrder order = new MOrder(ctx, c_order_id, null); - sbean.setOrderId(c_order_id); - sbean.setOrderType(order.getOrderType()); - sbean.setLinesTotals(order.getTotalLines()); - sbean.setBPartnerId(order.getC_BPartner_ID()); - sbean.setDate(order.getDateAcct()); - - ArrayList list = POSManager.populateOrderLines(ctx, order); - - for (WebOrderLineBean webOrderLineBean : list) - { - sbean.setGrandTotals(webOrderLineBean.getGrandTotal()); - sbean.setLinesTotals(webOrderLineBean.getTotalAmt()); - - taxAmt = webOrderLineBean.getTaxAmt(); - - if(taxAmt.compareTo(Env.ZERO)==0) - { - - if(order.getOrderType().equals(UDIOrderTypes.POS_ORDER.getOrderType())) - { - salesExempt = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); - salesExcVat = Env.ZERO; - } - - if(order.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) - { - salesExempt = webOrderLineBean.getLineTotalAmt().subtract(taxAmt).negate(); - taxAmt = taxAmt.negate(); - salesExcVat = Env.ZERO; - } - - if(order.getOrderType().equals(UDIOrderTypes.CREDIT_ORDER.getOrderType())) - { - creditNoteExempt = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); - creditNoteExcVat = Env.ZERO; - } - - if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType())) - { - purchasesExempt = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); - purchasesExcVat = Env.ZERO; - } - - if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) - { - debitNoteExempt = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); - debitNoteExcVat = Env.ZERO; - } - - } - else - { - if(order.getOrderType().equals(UDIOrderTypes.POS_ORDER.getOrderType())) - { - salesExempt = Env.ZERO; - salesExcVat = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); - } - - if(order.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) - { - salesExempt = Env.ZERO; - salesExcVat = webOrderLineBean.getLineTotalAmt().subtract(taxAmt).negate(); - taxAmt = taxAmt.negate(); - } - - if(order.getOrderType().equals(UDIOrderTypes.CREDIT_ORDER.getOrderType())) - { - creditNoteExempt = Env.ZERO; - creditNoteExcVat = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); - } - - if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType())) - { - purchasesExcVat = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); - purchasesExempt = Env.ZERO; - } - - if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) - { - debitNoteExcVat = webOrderLineBean.getLineTotalAmt().subtract(taxAmt); - debitNoteExempt = Env.ZERO; - } - } - - if(order.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) - { - productCost = webOrderLineBean.getPurchasePriceList().negate().multiply(webOrderLineBean.getQtyOrdered()); - } - else - { - productCost = webOrderLineBean.getPurchasePriceList().multiply(webOrderLineBean.getQtyOrdered()); - } - - totalTaxAmt = totalTaxAmt.add(taxAmt); - totalProductCosts = totalProductCosts.add(productCost); - totalSalesExempt = totalSalesExempt.add(salesExempt); - totalSalesExcVat = totalSalesExcVat.add(salesExcVat); - totalCreditNoteExcVat = totalCreditNoteExcVat.add(creditNoteExcVat); - totalCreditNoteExempt = totalCreditNoteExempt.add(creditNoteExempt); - totalPurchasesExcVat = totalPurchasesExcVat.add(purchasesExcVat); - totalPurchasesExempt = totalPurchasesExempt.add(purchasesExempt); - } - - sbean.setTotalTaxAmount(totalTaxAmt); - sbean.setTotalCosts(totalProductCosts); - sbean.setSalesExempt(totalSalesExempt); - sbean.setSalesExcVat(totalSalesExcVat); - sbean.setCreditNoteExcVat(totalCreditNoteExcVat); - sbean.setCreditNoteExempt(totalCreditNoteExempt); - sbean.setPurchasesExcVat(totalPurchasesExcVat); - sbean.setPurchasesExempt(totalPurchasesExempt); - sbean.setDebitNoteExcVat(totalDebitNoteExcVat); - sbean.setDebitNoteExempt(totalDebitNoteExempt); - - sbean.setCashAmount(Env.ZERO); - sbean.setCardAmount(Env.ZERO); - sbean.setChequeAmount(Env.ZERO); - - if (order.getPaymentRule().equals(MOrder.PAYMENTRULE_Cash) || order.getPaymentRule().equals(MOrder.PAYMENTRULE_Mixed)) - { - MInvoice invoice = MInvoice.get(ctx, order.getC_Invoice_ID()); - MCashLine cashLine = new MCashLine(ctx, invoice.getC_CashLine_ID(), null); - if (cashLine.getC_CashLine_ID() != 0) - { - sbean.setCashAmount(cashLine.getAmount()); - } - } - - if(order.getPaymentRule().equals(MOrder.PAYMENTRULE_Check) || order.getPaymentRule().equals(MOrder.PAYMENTRULE_CreditCard) || order.getPaymentRule().equals(MOrder.PAYMENTRULE_Mixed)) - { - int[] payIds = MPayment.getAllIDs(MPayment.Table_Name, "C_Invoice_ID = " + order.getC_Invoice_ID(), null); - for (int payId : payIds) - { - MPayment payment = new MPayment(ctx, payId, null); - - if (payment.get_ID() != 0) - { - if(payment.getTenderType().equals(MPayment.TENDERTYPE_CreditCard)) - { - sbean.setCardAmount(payment.getPayAmt()); - } - - if(payment.getTenderType().equals(MPayment.TENDERTYPE_Check)) - { - sbean.setChequeAmount(payment.getPayAmt()); - } - } - } - } - - totalPayment = sbean.getCardAmount().add(sbean.getCashAmount()).add(sbean.getChequeAmount()); - sbean.setTotal(totalPayment); - - salesList.add(sbean); - - } - - TreeMap map = new TreeMap(); - for(SalesDetailsBean salesBean : salesList) - { - Timestamp date = salesBean.getDate(); - SalesDetailsBean myDetailsBean = map.get(date); - if(myDetailsBean == null) - { - myDetailsBean = salesBean; - } - else - { - //merge myDetailsBean and salesBean - BigDecimal salesExcVat = myDetailsBean.getSalesExcVat().add(salesBean.getSalesExcVat()); - BigDecimal salesExempt = myDetailsBean.getSalesExempt().add(salesBean.getSalesExempt()); - BigDecimal totalCosts = myDetailsBean.getTotalCosts().add(salesBean.getTotalCosts()); - BigDecimal total = myDetailsBean.getTotal().add(salesBean.getTotal()); - BigDecimal totalTaxAmount = myDetailsBean.getTotalTaxAmount().add(salesBean.getTotalTaxAmount()); - BigDecimal creditNoteExcVat = myDetailsBean.getCreditNoteExcVat().add(salesBean.getCreditNoteExcVat()); - BigDecimal creditNoteExempt = myDetailsBean.getCreditNoteExempt().add(salesBean.getCreditNoteExempt()); - BigDecimal purchasesExcVat = myDetailsBean.getPurchasesExcVat().add(salesBean.getPurchasesExcVat()); - BigDecimal purchasesExempt = myDetailsBean.getPurchasesExempt().add(salesBean.getPurchasesExempt()); - BigDecimal debitNoteExcVat = myDetailsBean.getDebitNoteExcVat().add(salesBean.getDebitNoteExempt()); - BigDecimal debitNoteExempt = myDetailsBean.getDebitNoteExempt().add(salesBean.getDebitNoteExempt()); - - myDetailsBean.setDate(date); - myDetailsBean.setSalesExcVat(salesExcVat); - myDetailsBean.setSalesExempt(salesExempt); - myDetailsBean.setTotalCosts(totalCosts); - myDetailsBean.setTotal(total); - myDetailsBean.setTotalTaxAmount(totalTaxAmount); - myDetailsBean.setCreditNoteExcVat(creditNoteExcVat); - myDetailsBean.setCreditNoteExempt(creditNoteExempt); - myDetailsBean.setPurchasesExcVat(purchasesExcVat); - myDetailsBean.setPurchasesExempt(purchasesExempt); - myDetailsBean.setDebitNoteExcVat(debitNoteExcVat); - myDetailsBean.setDebitNoteExempt(debitNoteExempt); - } - - map.put(date, myDetailsBean); - - } - - salesList = new ArrayList(); - salesList.addAll(map.values()); - } - - - - ArrayList reportData = new ArrayList(); - - String note = ""; - if(isSalesReport) - { - note = "CREDIT NOTE "; - } - else - { - note = "DEBIT NOTE "; - } - - Object[] headers = { - "DATE", - reportType + " EXCL VAT", - note + "EXCL VAT", - "EXEMPT " + reportType, - "EXEMPT " + note, - "VAT", - "NET TOTAL " + reportType - }; - Object[] totals = { - "TOTAL", - Env.ZERO, - Env.ZERO, - Env.ZERO, - Env.ZERO, - Env.ZERO, - Env.ZERO - }; - - if (isFullDetails) - { - headers = new Object[]{ - "DATE", - reportType + " EXCL VAT", - note + "EXCL VAT", - "EXEMPT " + reportType, - "EXEMPT " + note, - "VAT", - "NET TOTAL " + reportType, - "COST", - "PROFIT", - "GP %" - }; - totals = new Object[]{ - "TOTAL", - Env.ZERO, - Env.ZERO, - Env.ZERO, - Env.ZERO, - Env.ZERO, - Env.ZERO, - Env.ZERO, - Env.ZERO, - Env.ZERO - }; - - } - - // add header - reportData.add(headers); - - - BigDecimal grossProfit = Env.ZERO; - - for (SalesDetailsBean sdBean : salesList) - { - String date = sdBean.getDate().toString(); - BigDecimal salesOrPurchasesEV = Env.ZERO; - - if(isSalesReport) - { - salesOrPurchasesEV = sdBean.getSalesExcVat(); - } - else - { - salesOrPurchasesEV = sdBean.getPurchasesExcVat(); - } - BigDecimal creditOrDebitNEV = Env.ZERO; - - if(isSalesReport) - { - creditOrDebitNEV = sdBean.getCreditNoteExcVat(); - } - else - { - creditOrDebitNEV = sdBean.getDebitNoteExcVat(); - } - - BigDecimal exemptSalesOrPurchases = Env.ZERO; - - if(isSalesReport) - { - exemptSalesOrPurchases = sdBean.getSalesExempt(); - } - else - { - exemptSalesOrPurchases = sdBean.getPurchasesExempt(); - } - - BigDecimal exemptCNOrDN = Env.ZERO; - if(isSalesReport) - { - exemptCNOrDN = sdBean.getCreditNoteExempt(); - } - else - { - exemptCNOrDN = sdBean.getDebitNoteExempt(); - } - - BigDecimal vat = sdBean.getTotalTaxAmount(); - BigDecimal total = salesOrPurchasesEV.add(vat).add(exemptSalesOrPurchases).add(creditOrDebitNEV).add(exemptCNOrDN); - BigDecimal cost = sdBean.getTotalCosts(); - BigDecimal payAmt = sdBean.getTotal(); - cost = cost.setScale(total.scale(), RoundingMode.HALF_DOWN); - BigDecimal profit = total.subtract(cost); - - if (total.doubleValue() != 0.0f) - { - double prof = profit.doubleValue(); - double tots = total.doubleValue(); - grossProfit = new BigDecimal(prof/tots*100.0); - grossProfit = grossProfit.setScale(2, RoundingMode.HALF_UP); - } - Object[] data = null; - - if (isFullDetails) - { - data = new Object[]{ - date, - salesOrPurchasesEV, - creditOrDebitNEV, - exemptSalesOrPurchases, - exemptCNOrDN, - vat, - total, - cost, - profit, - grossProfit - }; - } - else - { - data = new Object[]{ - date, - salesOrPurchasesEV, - creditOrDebitNEV, - exemptSalesOrPurchases, - exemptCNOrDN, - vat, - total - }; - } - - reportData.add(data); - - //update totals - totals[1] = ((BigDecimal)totals[1]).add(salesOrPurchasesEV); - totals[2] = ((BigDecimal)totals[2]).add(creditOrDebitNEV); - totals[3] = ((BigDecimal)totals[3]).add(exemptSalesOrPurchases); - totals[4] = ((BigDecimal)totals[4]).add(exemptCNOrDN); - totals[5] = ((BigDecimal)totals[5]).add(vat); - totals[6] = ((BigDecimal)totals[6]).add(total); - - if (isFullDetails) - { - totals[7] = ((BigDecimal)totals[7]).add(cost); - totals[8] = ((BigDecimal)totals[8]).add(profit); - totals[9] = ((BigDecimal)totals[9]).add(grossProfit); - } - } - if (isFullDetails) - { - BigDecimal salesTotal = ((BigDecimal)totals[1]).add((BigDecimal)totals[2]).add((BigDecimal)totals[3]).add((BigDecimal)totals[4]).add((BigDecimal)totals[5]); - - if (salesTotal.doubleValue() != 0f) - { - double prof = ((BigDecimal)totals[8]).doubleValue(); - double tots = ((BigDecimal)salesTotal).doubleValue(); - grossProfit = new BigDecimal(prof/tots*100.0); - totals[9] = grossProfit.setScale(2, RoundingMode.HALF_UP); - } - } - - - reportData.add(totals); - - return reportData; - - } - - public static ArrayList getDetailedSalesReport(Properties ctx, String salesType, boolean isSalesReport, Timestamp date1, Timestamp date2, String trxName) throws OperationException - { - - - String sql = "select ord.C_ORDER_ID," + // 1 - " ord.dateordered," + // 2 - " ord.grandtotal," + // 3 - " ord.DOCUMENTNO," + // 4 - " (name || ' ' || COALESCE(name2,trim(' '))) as name, " + // 5 - " ord.docStatus, " + // 6 - " ord.paymentrule," + // 7 - " bp.C_BPARTNER_ID," + // 8 - " bp.isCustomer," + // 9 - " ord.ORDERTYPE " + // 10 - " from c_order ord,C_BPARTNER bp" - + " where ord.C_BPARTNER_ID=bp.C_BPARTNER_ID" - + " and ord.docStatus in ('CL', 'CO')" - + " and ord.AD_ORG_ID=" + Env.getAD_Org_ID(ctx) - + " and ord.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) - + " and ord.isActive='Y'"; - - if("1".equals(salesType)) - { - if(isSalesReport) - { - sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Order','Credit Order')"; - } - else - { - sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Goods Receive Note')"; - } - } - - if("2".equals(salesType)) - { - if(isSalesReport) - { - sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('Customer Returned Order')"; - } - else - { - sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Goods Returned Note')"; - } - } - - if("3".equals(salesType)) - { - if(isSalesReport) - { - sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Order','Credit Order')"; - } - else - { - sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Goods Receive Note')"; - } - } - - if("4".equals(salesType)) - { - if(isSalesReport) - { - sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('Customer Returned Order')"; - } - else - { - sql = sql + " and ord.totallines <> ord.grandtotal and ord.ordertype in ('POS Goods Returned Note')"; - } - } - - sql = sql + " and ord.dateordered between "+ DB.TO_DATE(date1, false)+ " and "+ DB.TO_DATE(date2, false); - - sql = sql + " order by ord.created desc"; - - PreparedStatement pstmt = null; - ResultSet rs = null; - POSHistoryBean bean = null; - ArrayList list = new ArrayList(); - - try - { - pstmt = DB.prepareStatement(sql, trxName); - rs = pstmt.executeQuery(); - - while (rs.next()) - { - int c_order_id = rs.getInt(1); - bean = new POSHistoryBean(); - bean.setOrderId(c_order_id); - bean.setDateAcct(rs.getTimestamp(2)); - bean.setOrderGrandTotal(rs.getBigDecimal(3)); - bean.setDocumentNo(rs.getString(4)); - bean.setPartnerName(rs.getString(5)); - bean.setDocStatus(rs.getString(6)); - bean.setPaymentRule(rs.getString(7)); - bean.setBpartnerId(rs.getInt(8)); - bean.setIsCustomer("Y".equals(rs.getString(9)) ? true : false); - bean.setOrderType(rs.getString(10)); - - MOrder order = new MOrder(ctx, c_order_id, trxName); - MInvoice invoice = MInvoice.get(ctx, order.getC_Invoice_ID()); - BigDecimal amountPaid = Env.ZERO; - if (invoice.getC_CashLine_ID() != 0) - { - MCashLine cashLine = new MCashLine(ctx, invoice.getC_CashLine_ID(), trxName); - amountPaid = cashLine.getAmount(); - } - int[] payIds = MPayment.getAllIDs(MPayment.Table_Name, "C_Invoice_ID = " + invoice.get_ID() + - " AND AD_Client_ID = " + Env.getAD_Client_ID(ctx), trxName); - if (payIds != null && payIds.length != 0) - { - for (int payId : payIds) - { - MPayment payment = new MPayment(ctx, payId, trxName); - amountPaid = amountPaid.add(payment.getPayAmt()); - } - } - amountPaid = amountPaid.setScale(2, RoundingMode.HALF_DOWN); - bean.setAmountPaid(amountPaid); - BigDecimal grossProfit = Env.ZERO.setScale(2, RoundingMode.HALF_DOWN); - - if ("1".equals(salesType) || "3".equals(salesType)) - { - grossProfit = getGrossProfit(ctx, c_order_id, date1, date2, trxName); - } - - if (grossProfit == null) - { - grossProfit = Env.ZERO; - } - - bean.setGrossProfit(grossProfit); - list.add(bean); - - } - - } catch (SQLException e) { - throw new OperationException( - "Could not retrieve order history with sql: " + sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - return list; - - } - - private static BigDecimal getGrossProfit(Properties ctx, int c_order_id, Timestamp date1, Timestamp date2, String trxName) throws OperationException - { - - int poPriceListId = POSTerminalManager.getPOPriceListId(ctx); - int poPriceListVersionId = PriceListManager.getPriceListVersionID(ctx, poPriceListId, trxName); - - String sql = "select (l.qtyordered*(case when pp.pricelist is null then 0 else pp.pricelist end)) as cost, o.totallines as sales from" + - " c_order o inner join (c_orderline l left outer join m_productprice pp on" + - " (l.m_product_id = pp.m_product_id and pp.m_pricelist_version_id = " + poPriceListVersionId + ")) on" + - " o.c_order_id = l.c_order_id" + - " where o.issotrx = 'Y' " + - " and o.c_order_id = " + c_order_id + - " and o.docstatus in ('CO','CL')" + - " and o.C_Doctype_ID IN ('"+ OrderManager.getDocTypeFromOrderType(ctx, UDIOrderTypes.POS_ORDER.getOrderType(), true)+"')" + - " and o.ad_client_id = " + Env.getAD_Client_ID(ctx) + - " and o.ad_org_id = "+ Env.getAD_Org_ID(ctx) + - " and o.dateacct between " + DB.TO_DATE(date1, true)+ - " and "+ DB.TO_DATE(date2, true); - - PreparedStatement pstmt = null; - ResultSet rs = null; - BigDecimal grossProfit = Env.ZERO; - BigDecimal cost = Env.ZERO; - BigDecimal sales = Env.ZERO; - - try - { - pstmt = DB.prepareStatement(sql, trxName); - rs = pstmt.executeQuery(); - - while (rs.next()) - { - cost = cost.add(rs.getBigDecimal("cost")); - sales = rs.getBigDecimal("sales"); - } - - - - if (sales.compareTo(Env.ZERO)!=0) - { - BigDecimal profit = sales.subtract(cost); - - grossProfit = new BigDecimal(profit.doubleValue() / sales.doubleValue() * 100.0f); - } - else - { - grossProfit = BigDecimal.valueOf(0.0f); - } - } - catch (SQLException e) - { - throw new OperationException("Could not retrieve order history", e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - return grossProfit; - } - - - - public static HashMap getSalesByOrg(Properties ctx, Integer productId, Integer orgId, Timestamp fromDate, Timestamp toDate, String trxName) throws OperationException - { - - if (productId == null) - { - throw new OperationException("product Id is null, cannot search for sales by org for that product"); - } - - if (orgId == null) - { - throw new OperationException("org Id is null, cannot search for sales by org for that org"); - } - if (fromDate == null || toDate == null) - { - throw new OperationException("date cannot be null"); - } - - String locatorIds = WarehouseManager.getLocatorIds(ctx, orgId); - - StringBuffer sql = new StringBuffer("SELECT SUM(trx.movementQty), loc.AD_Org_ID") - .append(" FROM M_Transaction trx INNER JOIN M_Locator loc ON trx.M_Locator_ID = loc.M_Locator_ID") - .append(" WHERE trx.M_Product_ID = ? AND trx.M_Locator_ID IN (" + locatorIds + ")") - .append(" AND trx.movementDate BETWEEN " + DB.TO_DATE(fromDate, true) +" AND " + DB.TO_DATE(toDate, true)) - .append(" AND trx.movementType = ?") - .append(" GROUP BY loc.AD_Org_ID"); - - - PreparedStatement pstmt = null; - ResultSet rs = null; - HashMap orgSales = new HashMap(); - - try - { - pstmt = DB.prepareStatement(sql.toString(), trxName); - pstmt.setInt(1, productId); - pstmt.setString(2, MTransaction.MOVEMENTTYPE_CustomerShipment); - rs = pstmt.executeQuery(); - - while (rs.next()) - { - BigDecimal qty = rs.getBigDecimal(1); - Integer org_Id = rs.getInt(2); - - orgSales.put(org_Id, qty); - - } - } - catch (SQLException e) - { - throw new OperationException("could not retrieve sales by org from sql" + sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - return orgSales; - - } - - public static ArrayList getOrderDetailsPerProduct(Properties ctx,boolean isSales, - String productId, String orgIds, Timestamp date1, Timestamp date2) throws OperationException - { - StringBuffer payAmtSql = new StringBuffer(); - payAmtSql.append(" (SELECT SUM(p.Amount) FROM"); - payAmtSql.append(" ((SELECT payAmt as Amount FROM C_Payment p") - .append(" WHERE p.C_Invoice_ID=inv.C_Invoice_ID AND p.DocStatus IN ('CO', 'CL'))"); - payAmtSql.append(" UNION"); - payAmtSql.append(" (SELECT Amount FROM C_CashLine cl") - .append(" WHERE (cl.c_Invoice_ID=inv.C_Invoice_ID))) as p)"); - - StringBuffer sql = new StringBuffer("select ord.C_ORDER_ID,") - .append("inv.documentNo, ") - .append("(CASE WHEN inv.C_Invoice_ID IS NULL THEN 0 ELSE ") - .append(payAmtSql.toString()).append(" END) PayAmt") - .append(" from (c_order ord inner join c_orderline ordl ") - .append(" on ord.c_order_id = ordl.c_order_id) inner join c_invoice inv on") - .append(" ord.c_order_id = inv.c_order_id") - .append(" where ord.docStatus in ('CL', 'CO')"); - if (isSales) - { - sql = sql.append(" and ord.orderType = '"+UDIOrderTypes.POS_ORDER.getOrderType()+"'"); - } - else - { - sql = sql.append(" and ord.orderType = '"+ UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType()+"'"); - } - - sql = sql.append(" and ord.AD_ORG_ID in (" + orgIds + ") and ord.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx)) - .append( " and ord.isActive='Y' and ordl.m_product_id = " + productId) - .append(" and ord.dateordered between "+DB.TO_DATE(date1, true)+" and " + DB.TO_DATE(date2, true)) - .append(" order by ord.created desc"); - - PreparedStatement pstmt = null; - ResultSet rs = null; - POSHistoryBean bean = null; - ArrayList list = new ArrayList(); - - try - { - pstmt = DB.prepareStatement(sql.toString(), null); - rs = pstmt.executeQuery(); - - while (rs.next()) - { - /*ReportBean bean = new ReportBean();*/ - bean = new POSHistoryBean(); - int orderId = rs.getInt(1); - String invoiceDocumentNo = rs.getString(2); - BigDecimal amountPaid = rs.getBigDecimal(3); - - MOrder order = new MOrder(ctx, orderId, null); - MBPartner partner = MBPartner.get(ctx, order.getC_BPartner_ID()); - bean.setOrderId(orderId); - bean.setDateAcct(order.getDateAcct()); - bean.setDateOrdered(order.getDateOrdered()); - bean.setOrderGrandTotal(order.getGrandTotal()); - bean.setDocumentNo(order.getDocumentNo()); - bean.setDocStatus(order.getDocStatus()); - bean.setPaymentRule(order.getPaymentRule()); - bean.setOrderType(order.getOrderType()); - bean.setOrgId(order.getAD_Org_ID()); - bean.setInvoiceDocumentNo(invoiceDocumentNo); - bean.setPartnerName(partner.getName()); - bean.setBpartnerId(partner.getC_BPartner_ID()); - bean.setIsCustomer(partner.isCustomer()); - bean.setAmountPaid(amountPaid); - BigDecimal grossProfit = Env.ZERO.setScale(2, RoundingMode.HALF_UP); - - grossProfit = getGrossProfit(ctx, orderId, date1, date2, null); - - if (grossProfit == null) - { - grossProfit = Env.ZERO; - } - - bean.setGrossProfit(grossProfit); - list.add(bean); - - } - - } catch (SQLException e) { - throw new OperationException( - "Could not retrieve sales details per product", e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - return list; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportDateManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportDateManager.java deleted file mode 100644 index 9a80a6eced..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportDateManager.java +++ /dev/null @@ -1,258 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 19-Jul-2005 by alok - * - */ -package org.posterita.businesslogic.performanceanalysis; - -import java.sql.Timestamp; -import java.text.ParseException; -import java.util.Calendar; -import java.util.StringTokenizer; - -import org.jfree.date.SerialDate; - -import org.posterita.beans.ReportBean; -import org.posterita.core.TimestampConvertor; -import org.posterita.exceptions.InvalidDateTimeException; -import org.posterita.exceptions.InvalidMonthException; -import org.posterita.exceptions.OperationException; - -/** - * @author Praveen - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class ReportDateManager -{ - - public static String getEquivalentMonth(String month) throws InvalidMonthException - { - int intMonth = Integer.parseInt(month); - - switch(intMonth) - { - case 1: - return "Jan"; - case 2: - return "Feb"; - case 3: - return "Mar"; - case 4: - return "Apr"; - case 5: - return "May"; - case 6: - return "Jun"; - case 7: - return "Jul"; - case 8: - return "Aug"; - case 9: - return "Sep"; - case 10: - return "Oct"; - case 11: - return "Nov"; - case 12: - return "Dec"; - - default: - throw new InvalidMonthException("Invalid Month"); - - } - - } - - - public static ReportBean formatDate(ReportBean bean) throws InvalidMonthException - { - String fromDate = bean.getFromDate(); - String toDate = bean.getToDate(); - String delimiter = "/"; - - String newFromDate = format(fromDate, delimiter); - String newToDate = format(toDate, delimiter); - bean.setFromDate(newFromDate); - bean.setToDate(newToDate); - - return bean; - - } - - - public static String format(String date, String delimiter) throws InvalidMonthException - { - String newDateFormatDelimiter = "-"; - StringTokenizer dateTokenizer = new StringTokenizer(date, delimiter); - - String day = dateTokenizer.nextToken(); - String month = dateTokenizer.nextToken(); - String year = dateTokenizer.nextToken(); - - String equiMonth = getEquivalentMonth(month); - - ///dd/mm/yyyy - String newDateFormat = day - + newDateFormatDelimiter - + equiMonth - + newDateFormatDelimiter - + year; - - return newDateFormat; - } - - public static Timestamp getStartDateForPeriod(String period) throws OperationException - { - Calendar cal = Calendar.getInstance(); - SerialDate serialDate = null; - - cal.set(Calendar.HOUR_OF_DAY,0); - cal.set(Calendar.MINUTE,0); - cal.set(Calendar.SECOND,0); - cal.set(Calendar.MILLISECOND,0); - - if(period.equalsIgnoreCase(TODAY)) - { - //return default - } - else if(period.equalsIgnoreCase(CURRENT_WEEK)) - { - int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); - int d = 1-dayOfWeek; - - serialDate = SerialDate.createInstance(cal.getTime()); - SerialDate s = SerialDate.addDays(d,serialDate); - cal.setTime(s.toDate()); - - } - else if(period.equalsIgnoreCase(LAST_2WEEKS)) - { - int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); - int d = 1-dayOfWeek-7; - - serialDate = SerialDate.createInstance(cal.getTime()); - SerialDate s = SerialDate.addDays(d,serialDate); - cal.setTime(s.toDate()); - } - else if(period.equalsIgnoreCase(LAST_3WEEKS)) - { - int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); - int d = 1-dayOfWeek-14; - - serialDate = SerialDate.createInstance(cal.getTime()); - SerialDate s = SerialDate.addDays(d,serialDate); - cal.setTime(s.toDate()); - } - else if(period.equalsIgnoreCase(CURRENT_MONTH)) - { - cal.set(Calendar.DATE,1); - } - else if(period.equalsIgnoreCase(LAST_3MONTHS)) - { - cal.set(Calendar.DATE,1); - serialDate = SerialDate.createInstance(cal.getTime()); - SerialDate s = SerialDate.addMonths(-2,serialDate); - cal.setTime(s.toDate()); - } - else if(period.equalsIgnoreCase(LAST_2MONTHS)) - { - cal.set(Calendar.DATE,1); - serialDate = SerialDate.createInstance(cal.getTime()); - SerialDate s = SerialDate.addMonths(-1,serialDate); - cal.setTime(s.toDate()); - } - else if(period.equalsIgnoreCase(LAST_6MONTHS)) - { - cal.set(Calendar.DATE,1); - serialDate = SerialDate.createInstance(cal.getTime()); - SerialDate s = SerialDate.addMonths(-5,serialDate); - cal.setTime(s.toDate()); - } - else if(period.equalsIgnoreCase(CURRENT_YEAR)) - { - cal.set(Calendar.DATE,1); - cal.set(Calendar.MONTH,0); - - } - else - { - throw new OperationException("Invalid Period Format - " + period); - } - - return new Timestamp(cal.getTimeInMillis()); - } - - public static Timestamp getEndDateForPeriod(String period) - { - Calendar cal = Calendar.getInstance(); - return new Timestamp(cal.getTimeInMillis()); - } - - public static final String TODAY = "Today"; - - public static final String CURRENT_WEEK = "Current Week"; - public static final String LAST_2WEEKS = "Last 2 Weeks"; - public static final String LAST_3WEEKS = "Last 3 Weeks"; - - public static final String CURRENT_MONTH = "Current Month"; - public static final String LAST_2MONTHS = "Last 2 months"; - public static final String LAST_3MONTHS = "Last 3 Months"; - public static final String LAST_6MONTHS = "Last 6 Months"; - - public static final String CURRENT_YEAR = "Current Year"; - - - public static Timestamp getFromDate(ReportBean reportBean) throws InvalidMonthException, InvalidDateTimeException - { - //String delimiter = "/"; - //String dateFrom = ReportDateManager.format(reportBean.getFromDate(),delimiter); - - String dateFrom = reportBean.getFromDate(); - String timeFrom = dateFrom + " " + reportBean.getStartHour() + ":" + reportBean.getStartMinute() + ":00"; - return TimestampConvertor.getTimestamp(timeFrom, TimestampConvertor.DEFAULT_DATE_PATTERN1); - } - - public static Timestamp getToDate(ReportBean reportBean) throws InvalidMonthException, InvalidDateTimeException - { - //String delimiter = "/"; - //String dateTo = ReportDateManager.format(reportBean.getToDate(),delimiter); - - String dateTo = reportBean.getToDate(); - String timeTo = dateTo + " " + reportBean.getEndHour() + ":" + reportBean.getEndMinute() + ":00"; - return TimestampConvertor.getTimestamp(timeTo, TimestampConvertor.DEFAULT_DATE_PATTERN1); - } - - public static Timestamp getFromDateAsDate(ReportBean bean) throws InvalidMonthException, ParseException, InvalidDateTimeException - { - Timestamp date = getFromDate(bean); - - return date; - } - - public static Timestamp getEndDateAsDate(ReportBean bean) throws InvalidMonthException, ParseException, InvalidDateTimeException - { - Timestamp date = getToDate(bean); - - return date; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportManager.java deleted file mode 100644 index 7e7719f698..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/ReportManager.java +++ /dev/null @@ -1,263 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Feb 10, 2006 by praveen - * - */ -package org.posterita.businesslogic.performanceanalysis; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.util.DB; -import org.compiere.util.MimeType; -import org.posterita.exceptions.OperationException; - -public class ReportManager -{ - - public static ArrayList getReportData(Properties ctx, PreparedStatement pstmt) throws OperationException - { - ResultSet rs = null; - - try - { - ArrayList reportData = new ArrayList(); - - rs = pstmt.executeQuery(); - - int columnCount = rs.getMetaData().getColumnCount(); - - Object[] data = null; - - - Object[] header = new Object[columnCount]; - Object[] columnType = new Object[columnCount]; - - for(int i = 0; i < columnCount; i++) - { - header[i] = rs.getMetaData().getColumnName(i+1); - columnType[i] = rs.getMetaData().getColumnTypeName(i+1); - } - - reportData.add(header); - - while(rs.next()) - { - data = new Object[columnCount]; - - for(int i = 0; i < columnCount; i++) - { - data[i] = rs.getObject(i+1); - } - - reportData.add(data); - } - - rs.close(); - - return reportData; - } - catch (Exception e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch (Exception e) - {} - - pstmt = null; - } - - } - - public static ArrayList getReportData(Properties ctx, PreparedStatement pstmt, boolean columnHeader) throws OperationException - { - ResultSet rs = null; - - try - { - ArrayList reportData = new ArrayList(); - - rs = pstmt.executeQuery(); - - int columnCount = rs.getMetaData().getColumnCount(); - - Object[] data = null; - - - if(columnHeader) - { - Object[] header = new Object[columnCount]; - Object[] columnType = new Object[columnCount]; - - for(int i = 0; i < columnCount; i++) - { - header[i] = rs.getMetaData().getColumnName(i+1); - columnType[i] = rs.getMetaData().getColumnTypeName(i+1); - } - - reportData.add(header); - } - - - while(rs.next()) - { - data = new Object[columnCount]; - - for(int i = 0; i < columnCount; i++) - { - data[i] = rs.getObject(i+1); - } - - reportData.add(data); - } - - rs.close(); - - - return reportData; - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - } - - public static ArrayList getReportData(PreparedStatement pstmt) throws OperationException - { - return getReportData(null,pstmt); - } - - public static ArrayList getReportData(PreparedStatement pstmt,boolean columnHeader) throws OperationException - { - return getReportData(null,pstmt,columnHeader); - } - - public static ArrayList getReportData(Properties ctx,String sql,boolean columnHeader) throws OperationException - { - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - return getReportData(ctx,pstmt,columnHeader); - } - - public static ArrayList getReportData(Properties ctx,String sql) throws OperationException - { - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - return getReportData(ctx,pstmt); - } - - public static String getReportDirectoryFromServletContext(HttpServlet servlet) - { - ServletContext context = servlet.getServletContext(); - String reportDirectory = context.getRealPath(context.getInitParameter("REPORT_DIRECTORY")) + System.getProperty("file.separator"); - - return reportDirectory; - } - - public static String getReportDirectory() - { - //String - return System.getProperty("java.io.tmpdir"); - } - - public static String getReportURI(String reportName,HttpServletRequest request) - { - //return request.getContextPath() + "/GetReportAction.do?reportName=" + reportName; - return request.getContextPath() + "/servlet/DisplayReportServlet/" + reportName; - } - - public static String getReportPath(String reportName) - { - String path = getReportDirectory() + System.getProperty("file.separator") + reportName; - - return path; - } - - public static void writeReport(String reportName, HttpServletResponse response) throws OperationException - { - String reportPath= getReportPath(reportName); - - File f = new File(reportPath); - - if(!f.exists()) - { - throw new OperationException("Unable to load " + reportName + ". Cause file not found."); - } - - String mimeType = null; - mimeType = MimeType.getMimeType(reportName); - - try - { - response.setContentType(mimeType); - - FileInputStream fis = new FileInputStream(f); - BufferedInputStream bis = new BufferedInputStream(fis); - BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); - - //Transfer bytes from bis to bos - byte[] buf = new byte[1024]; - int len; - while ((len = bis.read(buf)) > 0) - { - bos.write(buf, 0, len); - } - bis.close(); - - bos.flush(); - bos.close(); - - } - catch (Exception e) - { - throw new OperationException(e); - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/SalesAnalysisReportManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/SalesAnalysisReportManager.java deleted file mode 100644 index 4800b08dcc..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/performanceanalysis/SalesAnalysisReportManager.java +++ /dev/null @@ -1,791 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 05-Jul-2006 13:45:44 by praveen - * - */ - -package org.posterita.businesslogic.performanceanalysis; - -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MAttribute; -import org.compiere.model.MElementValue; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.exceptions.OperationException; - -public class SalesAnalysisReportManager -{ - public static String getCVSReport(Properties ctx,Timestamp fromDate,Timestamp toDate) throws OperationException - { - ArrayList reportDataSource = getReportData(ctx,fromDate,toDate); - - return CSVReportManager.generateCSVReport(ctx,reportDataSource); - } - - public static String getPDFReport(Properties ctx,String fromDate,String toDate) throws OperationException - { - return null; - } - - private static ArrayList getReportData(Properties ctx,Timestamp fromDate,Timestamp toDate) throws OperationException - { - ArrayList reportData = null; - String sql = getReportSQL(); - int ad_client_id = Env.getAD_Client_ID(ctx); - int ad_org_id = Env.getAD_Org_ID(ctx); - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - try - { - pstmt.setInt(1,ad_client_id); - pstmt.setInt(2,ad_org_id); - pstmt.setTimestamp(3,fromDate); - pstmt.setTimestamp(4,toDate); - - reportData = ReportManager.getReportData(ctx,pstmt); - - return reportData; - - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - pstmt=null; - } - } - - private static String getReportSQL() - { - String sql = "select bp.name as \"Supplier\"," + - "pc.name as \"Category\"," + - "attr_brand as \"Brand\"," + - "attr_model as \"Model\"," + - "attr_design as \"Design\"," + - "attr_colour as \"Colour\"," + - "attr_size as \"Size\"," + - "sum(ol.qtyordered) as \"Quantity\"," + - "sum(ol.LINENETAMT) as \"Amount\" "+ - "from c_orderline ol,c_order ord,u_tshirt_v v,c_bpartner bp,c_bpartner_product bpp,C_REVENUERECOGNITION pc,M_PRODUCT pr " + - "where ord.orderType='POS Order' " + - "and ol.c_order_id=ord.c_order_id " + - "and v.m_product_id=ol.m_product_id " + - "and ol.M_PRODUCT_ID=bpp.M_PRODUCT_ID " + - "and bpp.c_bpartner_id=bp.c_bpartner_id " + - "and ol.M_PRODUCT_ID=pr.M_PRODUCT_ID " + - "and ol.AD_CLIENT_ID=? " + - "and ol.AD_ORG_ID=? " + - "and pr.C_REVENUERECOGNITION_ID=pc.C_REVENUERECOGNITION_ID " + - "and ord.docstatus='CO' " + - "and ol.CREATED between to_date(?,'DD-MM-YYYY HH24:MI:SS') " + - "and to_date(?,'DD-MM-YYYY HH24:MI:SS') " + - "group by bp.name,pc.name,attr_brand,attr_model,attr_design,attr_colour,attr_size"; - - return sql; - } - - public static String getPieChartDataSetSQL(Properties ctx,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup) throws OperationException - { - return dataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); - }//getPieChartDataSetSQL - - public static String getBarChartDataSetSQL(Properties ctx,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup) throws OperationException - { - return dataSetSQL(ctx,account_id,fromDate,toDate,salesGroup); - }//getBarChartDatasetSQL - - public static String getTabularDataSetSQL(Properties ctx,int account_id, Timestamp fromDate, Timestamp toDate,String salesGroup) throws OperationException - { - - int ad_client_id = Env.getAD_Client_ID(ctx); - String sql = null; - - - - //check account type - boolean isTaxDue = (account_id == Constants.TAX_DUE); - boolean isTaxCredit = (account_id == Constants.TAX_CREDIT); - boolean isProfitMargin = (account_id == Constants.PROFIT_MARGIN); - - final int TRADE_REVENUE = Constants.TRADE_REVENUE.intValue(); - final int COGS = Constants.COGS.intValue(); - - if(isProfitMargin) - { - String sql1 = getTabularDataSetSQL(ctx, TRADE_REVENUE, fromDate, toDate, salesGroup); - String sql2 = getTabularDataSetSQL(ctx, COGS, fromDate, toDate, salesGroup); - - sql2 = sql2.replace("SUM(0 - FACT.QTY)","SUM(FACT.QTY)"); - - if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) - { - sql = "" + - "select rev.\"Revenue_Recognition\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + - "(" + sql1 + ") rev," + - "(" + sql2 + ") co " + - "where rev.\"Revenue_Recognition\" = co.\"Revenue_Recognition\" " + - "and co.\"Date\" = rev.\"Date\" " + - "and co.\"Qty\" = rev.\"Qty\""; - } - else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) - { - sql = "" + - "select rev.\"Attributeset\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + - "(" + sql1 + ") rev," + - "(" + sql2 + ") co " + - "where rev.\"Attributeset\" = co.\"Attributeset\" " + - "and co.\"Date\" = rev.\"Date\" " + - "and co.\"Qty\" = rev.\"Qty\""; - } - else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) - { - sql = "" + - "select rev.\"Product\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + - "(" + sql1 + ") rev," + - "(" + sql2 + ") co " + - "where rev.\"Product\" = co.\"Product\" " + - "and co.\"Date\" = rev.\"Date\" " + - "and co.\"Qty\" = rev.\"Qty\""; - } - else if(salesGroup.equalsIgnoreCase(Constants.GROUP1)) - { - sql = "" + - "select rev.\"Group1\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + - "(" + sql1 + ") rev," + - "(" + sql2 + ") co " + - "where rev.\"Group1\" = co.\"Group1\" " + - "and co.\"Date\" = rev.\"Date\" " + - "and co.\"Qty\" = rev.\"Qty\""; - } - else if(salesGroup.equalsIgnoreCase(Constants.GROUP2)) - { - sql = "" + - "select rev.\"Group2\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + - "(" + sql1 + ") rev," + - "(" + sql2 + ") co " + - "where rev.\"Group2\" = co.\"Group2\" " + - "and co.\"Date\" = rev.\"Date\" " + - "and co.\"Qty\" = rev.\"Qty\""; - } - else if(salesGroup.equalsIgnoreCase(Constants.CUSTOMER)) - { - sql = "" + - "select rev.\"Customer\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + - "(" + sql1 + ") rev," + - "(" + sql2 + ") co " + - "where rev.\"Customer\" = co.\"Customer\" " + - "and co.\"Date\" = rev.\"Date\" " + - "and co.\"Qty\" = rev.\"Qty\""; - } - else - { - String[] s = salesGroup.split("_"); - - if(s.length!=2) - { - throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); - } - - int attributeId = Integer.parseInt(s[1]); - - String attributeName = new MAttribute(ctx,attributeId,null).getName(); - - sql = "" + - "select rev.\""+ attributeName +"\",rev.\"Date\",(rev.\"Value\" + co.\"Value\") as \"value\",rev.\"Qty\" from" + - "(" + sql1 + ") rev," + - "(" + sql2 + ") co " + - "where rev.\""+ attributeName +"\" = co.\""+ attributeName +"\" " + - "and co.\"Date\" = rev.\"Date\" " + - "and co.\"Qty\" = rev.\"Qty\""; - } - - - - return sql; - } - - if(isTaxCredit || isTaxDue) - { - int[] ids = MElementValue.getAllIDs(MElementValue.Table_Name,"AD_CLIENT_ID ="+ Env.getAD_Client_ID(ctx) + " AND VALUE ='"+ account_id + "'",null); - MElementValue elementValue = new MElementValue(ctx,ids[0],null); - String accountName = elementValue.getName(); - - sql = "" + - "select COALESCE(SUM(fact.AMTACCTDR - fact.AMTACCTCR), 0) as \""+ accountName +"\" " + - "from FACT_ACCT FACT where fact.ACCOUNT_ID = " + - "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '" + account_id + "' and AD_CLIENT_ID = "+ ad_client_id +") " + - "and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = " + ad_client_id; - - return sql; - } - - if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) - { - sql = "" + - "select DECODE(rev.NAME, null, 'others', rev.Name) as \"Revenue_Recognition\"," + //1.Revenue Recognition - "to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date - "SUM(fact.AMTACCTCR-fact.AMTACCTDR) as \"Value\"," + //3.Value - " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty - "from FACT_ACCT fact, (M_PRODUCT prod left outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID ) " + - "where fact.ACCOUNT_ID = " + - "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id+") " + - "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + - //"and rev.C_REVENUERECOGNITION_ID(+) = prod.C_REVENUERECOGNITION_ID " + - "and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " group by rev.NAME,to_char(fact.DATEACCT,'DD-MM-YYYY') " + - " order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,rev.NAME asc"; - } - else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) - { - sql = "" + - " select DECODE(attrSet.NAME, null, 'others', attrSet.NAME) as \"Attributeset\"," + //1.Attributeset - " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date - " SUM(fact.AMTACCTCR-fact.AMTACCTDR) as \"Value\"," + //3.Value - " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty - " from FACT_ACCT fact, (M_PRODUCT prod left outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID ),M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet " + - " where fact.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + - //" and rev.C_REVENUERECOGNITION_ID(+) = prod.C_REVENUERECOGNITION_ID " + - " and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID " + - " and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID " + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " group by attrSet.name,to_char(fact.DATEACCT,'DD-MM-YYYY') " + - " order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,attrSet.name asc"; - } - else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) - { - sql = "" + - " select PROD.NAME as \"Product\"," + //1.Product - " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //3.Date - " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //4.Value - " SUM(0 - FACT.QTY) as \"Qty\" " + //5.Qty - " from FACT_ACCT FACT, M_PRODUCT PROD " + - " where FACT.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.NAME" + - " Order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,PROD.NAME asc"; - } - else if(salesGroup.equalsIgnoreCase(Constants.GROUP1)) - { - sql = "" + - " select DECODE(PROD.GROUP1, null, 'Ungroup', PROD.GROUP1) as \"Group1\"," + //1.Product - " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //3.Date - " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //4.Value - " SUM(0 - FACT.QTY) as \"Qty\" " + //5.Qty - " from FACT_ACCT FACT, M_PRODUCT PROD " + - " where FACT.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.GROUP1" + - " Order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,PROD.GROUP1 asc"; - } - else if(salesGroup.equalsIgnoreCase(Constants.GROUP2)) - { - sql = "" + - " select DECODE(PROD.GROUP2, null, 'Ungroup', PROD.GROUP2) as \"Group2\"," + //1.Product - " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //3.Date - " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //4.Value - " SUM(0 - FACT.QTY) as \"Qty\" " + //5.Qty - " from FACT_ACCT FACT, M_PRODUCT PROD " + - " where FACT.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.GROUP2" + - " Order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,PROD.GROUP2 asc"; - } - else if(salesGroup.equalsIgnoreCase(Constants.CUSTOMER)) - { - sql = "" + - //" select BP.NAME||' '||BP.NAME2 \"Customer\"," + //1.Customer - " Select BP.NAME as \"Customer\","+ - " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date - " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value - " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty - " from FACT_ACCT FACT, C_BPARTNER BP " + - " where FACT.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " AND FACT.C_BPARTNER_ID = BP.C_BPARTNER_ID " + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - //" having SUM(0 - FACT.QTY) <> 0 " + - " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),BP.NAME" + - " Order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,BP.NAME asc"; - //" GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),BP.NAME||' '||BP.NAME2" + - //" Order by to_char(fact.DATEACCT,'DD-MM-YYYY') desc,BP.NAME||' '||BP.NAME2 asc"; - } - else - { - String[] s = salesGroup.split("_"); - - if(s.length!=2) - { - throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); - } - - int attributeSetId = Integer.parseInt(s[0]); - int attributeId = Integer.parseInt(s[1]); - - String attributeName = new MAttribute(ctx,attributeId,null).getName(); - - sql = "select ATTRIBUTE_VALUE as \""+attributeName+ "\"," + - "to_char(DATEACCT,'DD-MM-YYYY') as \"Date\"," + - "sum(AMTACCTCR-AMTACCTDR) as \"Value\"," + - "SUM(0 - QTY) as \"Qty\" " + - "from " + - "(" + - " select attrIns.m_attribute_id,prod.m_product_category_id, attrIns.m_attributevalue_id,attr.name ATTRIBUTE_NAME,attrSet.name ATTRIBUTESET_NAME,attrSet.M_ATTRIBUTESET_ID,prod.m_product_id, attrVal.name ATTRIBUTE_VALUE, attrVal.description,fact.AMTACCTCR,fact.AMTACCTDR,fact.DATEACCT,fact.QTY" + - " from M_PRODUCT prod,M_ATTRIBUTEINSTANCE attrIns ,M_attribute attr,M_attributeValue attrVal, M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet, FACT_ACCT fact" + - " where prod.M_ATTRIBUTESETINSTANCE_id = attrIns.M_ATTRIBUTESETINSTANCE_id" + - " and attr.m_attribute_id = attrIns.m_attribute_id" + - " and attrIns.m_attributevalue_id = attrVal.m_attributevalue_id" + - " and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID" + - " and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID" + - " and fact.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID" + - " and fact.AD_CLIENT_ID = " + ad_client_id + - " and attrSetIns.M_ATTRIBUTESET_ID = " + attributeSetId + - " and attr.M_ATTRIBUTE_ID = " + attributeId + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - ")" + - "group by ATTRIBUTE_VALUE,to_char(DATEACCT,'DD-MM-YYYY') " + - "order by to_char(DATEACCT,'DD-MM-YYYY') desc,ATTRIBUTE_VALUE asc"; - } - - return sql; - - }//getTabularDataSetSQL - - public static String dataSetSQL(Properties ctx,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup) throws OperationException - { - int ad_client_id = Env.getAD_Client_ID(ctx); - String sql = null; - - - - boolean isProfitMargin = (account_id == Constants.PROFIT_MARGIN); - - if(isProfitMargin) - { - String innerSql = getTabularDataSetSQL(ctx, account_id, fromDate, toDate, salesGroup); - - if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) - { - sql = "select \"Revenue_Recognition\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") sub group by \"Revenue_Recognition\""; - } - else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) - { - sql = "select \"Attributeset\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") att group by \"Attributeset\""; - } - else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) - { - sql = "select \"Product\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") prod group by \"Product\""; - } - else if(salesGroup.equalsIgnoreCase(Constants.CUSTOMER)) - { - sql = "select \"Customer\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") customer group by \"Customer\""; - } - else if(salesGroup.equalsIgnoreCase(Constants.GROUP1)) - { - sql = "select \"Group1\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") group1 group by \"Group1\""; - } - else if(salesGroup.equalsIgnoreCase(Constants.GROUP2)) - { - sql = "select \"Group2\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") group2 group by \"Group2\""; - } - else - { - String[] s = salesGroup.split("_"); - - if(s.length!=2) - { - throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); - } - - int attributeId = Integer.parseInt(s[1]); - - String attributeName = new MAttribute(ctx,attributeId,null).getName(); - - sql = "select \""+ attributeName +"\",sum(\"value\"),sum(\"Qty\") from ("+ innerSql +") attName group by \""+ attributeName +"\""; - } - - return sql; - } - - if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) - { - sql = "select DECODE(rev.NAME, null, 'Others', rev.NAME) as RevenueRecognition,SUM(fact.AMTACCTCR - fact.AMTACCTDR) as Revenue_Recognition,SUM(0-fact.QTY) as Qty " + - "from FACT_ACCT fact, (M_PRODUCT prod right outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID) " + - "where fact.ACCOUNT_ID = " + - "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id+") " + - "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + - "and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " group by rev.NAME"; - } - else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) - { - sql = "select attrSet.name as attributeset,SUM(fact.AMTACCTCR - fact.AMTACCTDR) as Attribute_Set,SUM(0-fact.QTY) as Qty " + - "from FACT_ACCT fact, (M_PRODUCT prod right outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID),M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet " + - "where fact.ACCOUNT_ID = " + - "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + - "and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID " + - "and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID " + - "and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " group by attrSet.name"; - } - else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) - { - sql = "select PROD.NAME as \"Product\",SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\",SUM(0 - FACT.QTY) as \"Qty\" " + - "from FACT_ACCT FACT, M_PRODUCT PROD " + - "where FACT.ACCOUNT_ID = " + - "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - "AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + - "and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " GROUP BY PROD.NAME"; - } - else if(salesGroup.equalsIgnoreCase(Constants.GROUP1)) - { - sql = "select DECODE(PROD.GROUP1, null, 'Ungrouped', PROD.GROUP1) as \"Group1\",SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\",SUM(0 - FACT.QTY) as \"Qty\" " + - "from FACT_ACCT FACT, M_PRODUCT PROD " + - "where FACT.ACCOUNT_ID = " + - "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - "AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + - "and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " GROUP BY PROD.GROUP1"; - } - else if(salesGroup.equalsIgnoreCase(Constants.GROUP2)) - { - sql = "select DECODE(PROD.GROUP2, null, 'Ungrouped', PROD.GROUP2) as \"Group2\",SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\",SUM(0 - FACT.QTY) as \"Qty\" " + - "from FACT_ACCT FACT, M_PRODUCT PROD " + - "where FACT.ACCOUNT_ID = " + - "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - "AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + - "and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " GROUP BY PROD.GROUP2"; - } - else if(salesGroup.equalsIgnoreCase(Constants.CUSTOMER)) - { - //sql = "select BP.NAME || ' ' || BP.NAME2 as \"Customer\", " + - sql = "Select BP.NAME as \"Customer\","+ - "SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\", SUM(0 - FACT.QTY) as \"Qty\" " + - "from FACT_ACCT FACT, C_BPARTNER BP " + - "where FACT.ACCOUNT_ID = " + - "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - "AND FACT.C_BPARTNER_ID = BP.C_BPARTNER_ID " + - "and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - //" having SUM(0 - FACT.QTY) <> 0 " + - " GROUP BY BP.NAME Order by BP.NAME asc"; - //"GROUP BY BP.NAME || ' ' || BP.NAME2 Order by BP.NAME || ' ' || BP.NAME2 asc"; - } - else - { - String[] s = salesGroup.split("_"); - - if(s.length!=2) - { - throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); - } - - int attributeSetId = Integer.parseInt(s[0]); - int attributeId = Integer.parseInt(s[1]); - - String attributeName = new MAttribute(ctx,attributeId,null).getName(); - - sql = "select ATTRIBUTE_VALUE, sum(AMTSOURCECR - AMTSOURCEDR) as \""+attributeName+ "\",SUM(0-QTY) as Qty from " + - "(" + - " select attrIns.m_attribute_id,prod.m_product_category_id, attrIns.m_attributevalue_id,attr.name ATTRIBUTE_NAME,attrSet.name ATTRIBUTESET_NAME,attrSet.M_ATTRIBUTESET_ID,prod.m_product_id, attrVal.name ATTRIBUTE_VALUE, attrVal.description,fact.AMTSOURCECR,fact.AMTSOURCEDR,fact.QTY" + - " from M_PRODUCT prod,M_ATTRIBUTEINSTANCE attrIns ,M_attribute attr,M_attributeValue attrVal, M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet, FACT_ACCT fact" + - " where prod.M_ATTRIBUTESETINSTANCE_id = attrIns.M_ATTRIBUTESETINSTANCE_id" + - " and attr.m_attribute_id = attrIns.m_attribute_id" + - " and attrIns.m_attributevalue_id = attrVal.m_attributevalue_id" + - " and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID" + - " and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID" + - " and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID" + - " and fact.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " and fact.AD_CLIENT_ID = " + ad_client_id + - " and attrSetIns.M_ATTRIBUTESET_ID = " + attributeSetId + - " and attr.M_ATTRIBUTE_ID = " + attributeId + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - ")" + - " group by ATTRIBUTE_VALUE"; - - - } - - return sql; - }//dataSetSQL - - public static String getTimeSeriesDataSetSQL(Properties ctx,int account_id,Timestamp fromDate,Timestamp toDate,String salesGroup) throws OperationException - { - - int ad_client_id = Env.getAD_Client_ID(ctx); - String sql = null; - - - - boolean isProfitMargin = (account_id == Constants.PROFIT_MARGIN); - if(isProfitMargin) - { - return getTabularDataSetSQL(ctx, account_id, fromDate, toDate, salesGroup); - } - - - - if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) - { - sql = "" + - "select DECODE(rev.NAME, null, 'others', rev.Name) as RevenueRecognition," + //1.Revenue Recognition - "to_char(fact.DATEACCT,'DD-MM-YYYY')," + //2.Date - "SUM(fact.AMTACCTCR-fact.AMTACCTDR) as REVENUE," + //3.Value - "SUM(0-fact.QTY) " + //4.Qty - "from FACT_ACCT fact, (M_PRODUCT prod left outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID ) " + - "where fact.ACCOUNT_ID = " + - "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id+") " + - "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + - //"and rev.C_REVENUERECOGNITION_ID(+) = prod.C_REVENUERECOGNITION_ID " + - "and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - "and fact.AD_CLIENT_ID = "+ad_client_id + - " group by rev.NAME,to_char(fact.DATEACCT,'DD-MM-YYYY')"; - } - else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) - { - sql = "select attrSet.name as attributeset,to_char(fact.DATEACCT,'DD-MM-YYYY'),SUM(fact.AMTACCTCR-fact.AMTACCTDR) as REVENUE,SUM(0-fact.QTY) " + - "from FACT_ACCT fact, (M_PRODUCT prod left outer join C_REVENUERECOGNITION rev on rev.C_REVENUERECOGNITION_ID = prod.C_REVENUERECOGNITION_ID ),M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet " + - "where fact.ACCOUNT_ID = " + - "(select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - "and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID " + - //"and rev.C_REVENUERECOGNITION_ID(+) = prod.C_REVENUERECOGNITION_ID " + - "and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID " + - "and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID " + - "and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - "and fact.AD_CLIENT_ID = "+ad_client_id + - " group by attrSet.name,to_char(fact.DATEACCT,'DD-MM-YYYY')"; - } - else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) - { - sql = "" + - " select PROD.NAME as \"Product\"," + //1.Product - " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date - " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value - " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty - " from FACT_ACCT FACT, M_PRODUCT PROD " + - " where FACT.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.NAME"; - } - else if(salesGroup.equalsIgnoreCase(Constants.PRODUCT)) - { - sql = "" + - " select PROD.NAME as \"Product\"," + //1.Product - " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date - " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value - " SUM(0 - FACT.QTY) \"Qty\" " + //4.Qty - " from FACT_ACCT FACT, M_PRODUCT PROD " + - " where FACT.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.NAME"; - } - else if(salesGroup.equalsIgnoreCase(Constants.GROUP1)) - { - sql = "" + - " select NVL(PROD.GROUP1,'OTHERS') as \"Group1\"," + //1.Product - " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date - " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value - " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty - " from FACT_ACCT FACT, M_PRODUCT PROD " + - " where FACT.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.GROUP1"; - } - else if(salesGroup.equalsIgnoreCase(Constants.GROUP2)) - { - sql = "" + - " select NVL(PROD.GROUP2,'OTHERS') as \"Group2\"," + //1.Product - " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date - " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value - " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty - " from FACT_ACCT FACT, M_PRODUCT PROD " + - " where FACT.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " AND FACT.M_PRODUCT_ID = PROD.M_PRODUCT_ID " + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),PROD.GROUP2"; - } - else if(salesGroup.equalsIgnoreCase(Constants.CUSTOMER)) - { - sql = "" + - //" select BP.NAME||' '||BP.NAME2 as \"Customer\"," + //1.Customer - "Select BP.NAME as \"Customer\","+ - " to_char(fact.DATEACCT,'DD-MM-YYYY') as \"Date\"," + //2.Date - " SUM(FACT.AMTACCTCR - FACT.AMTACCTDR) as \"Value\"," + //3.Value - " SUM(0 - FACT.QTY) as \"Qty\" " + //4.Qty - " from FACT_ACCT FACT, C_BPARTNER BP " + - " where FACT.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " AND FACT.C_BPARTNER_ID = BP.C_BPARTNER_ID " + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " and fact.AD_CLIENT_ID = "+ad_client_id + - //" having SUM(0 - FACT.QTY) <> 0 " + - " GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),BP.NAME"; - //" GROUP BY to_char(fact.DATEACCT,'DD-MM-YYYY'),BP.NAME||' '||BP.NAME2"; - - } - else - { - String[] s = salesGroup.split("_"); - - if(s.length!=2) - { - throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); - } - - int attributeSetId = Integer.parseInt(s[0]); - int attributeId = Integer.parseInt(s[1]); - - sql = "select ATTRIBUTE_VALUE,to_char(DATEACCT,'DD-MM-YYYY'),sum(AMTACCTCR-AMTACCTDR),SUM(0-QTY) from " + - "(" + - " select attrIns.m_attribute_id,prod.m_product_category_id, attrIns.m_attributevalue_id,attr.name ATTRIBUTE_NAME,attrSet.name ATTRIBUTESET_NAME,attrSet.M_ATTRIBUTESET_ID,prod.m_product_id, attrVal.name ATTRIBUTE_VALUE, attrVal.description,fact.AMTACCTCR,fact.AMTACCTDR,fact.DATEACCT,fact.QTY" + - " from M_PRODUCT prod,M_ATTRIBUTEINSTANCE attrIns ,M_attribute attr,M_attributeValue attrVal, M_ATTRIBUTESETINSTANCE attrSetIns, M_ATTRIBUTESET attrSet, FACT_ACCT fact" + - " where prod.M_ATTRIBUTESETINSTANCE_id = attrIns.M_ATTRIBUTESETINSTANCE_id" + - " and attr.m_attribute_id = attrIns.m_attribute_id" + - " and attrIns.m_attributevalue_id = attrVal.m_attributevalue_id" + - " and prod.M_ATTRIBUTESETINSTANCE_ID = attrSetIns.M_ATTRIBUTESETINSTANCE_ID" + - " and attrSet.M_ATTRIBUTESET_ID = attrSetIns.M_ATTRIBUTESET_ID" + - " and fact.ACCOUNT_ID = " + - " (select C_ELEMENTVALUE_ID from C_ELEMENTVALUE where value = '"+account_id+"' and AD_CLIENT_ID = "+ad_client_id +") " + - " and fact.M_PRODUCT_ID = prod.M_PRODUCT_ID" + - " and fact.AD_CLIENT_ID = " + ad_client_id + - " and attrSetIns.M_ATTRIBUTESET_ID = " + attributeSetId + - " and attr.M_ATTRIBUTE_ID = " + attributeId + - " and fact.DATEACCT between " + - DB.TO_DATE(fromDate, false) + - " and " + - DB.TO_DATE(toDate, false) + - " group by ATTRIBUTE_VALUE,to_char(DATEACCT,'DD-MM-YYYY')"; - } - - return sql; - - }//getTimeSeriesDataSetSQL - -}//SalesAnalysisReportManager diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/product/GenericProductImpl.java b/posterita/posterita/src/main/org/posterita/businesslogic/product/GenericProductImpl.java deleted file mode 100644 index 34769bec44..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/product/GenericProductImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Oct 10, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.businesslogic.product; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Properties; - -import org.compiere.model.MAttachmentEntry; -import org.compiere.model.MProduct; - -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.businesslogic.core.AttachmentManager; -import org.posterita.exceptions.OperationException; - -public class GenericProductImpl implements IProduct -{ - - public String getProductName(Properties ctx, int productId, String trxName) throws OperationException - { - MProduct product = ProductManager.loadProduct(ctx, productId, trxName); - - return product.getName(); - } - - public String getBarcodeForSimilarProducts(Properties ctx, int productId, String trxName) throws OperationException - { - return null; - } - - public HashMap getAllImages(Properties ctx, int productId, String trxName) throws OperationException - { - HashMap imagesMap = new HashMap(); - ArrayList entryList = AttachmentManager.getAllImagesAttachmentEntries(ctx, MProduct.Table_ID, productId, trxName); - - for(MAttachmentEntry entry : entryList) - { - imagesMap.put(entry.getName(), entry.getData()); - } - - return imagesMap; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/product/IProduct.java b/posterita/posterita/src/main/org/posterita/businesslogic/product/IProduct.java deleted file mode 100644 index a8d521c111..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/product/IProduct.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Oct 10, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.businesslogic.product; - -import java.util.HashMap; -import java.util.Properties; - -import org.posterita.exceptions.OperationException; - -public interface IProduct -{ - - public String getProductName(Properties ctx, int productId, String trxName) throws OperationException; - - public String getBarcodeForSimilarProducts(Properties ctx, int productId, String trxName) throws OperationException; - - public HashMap getAllImages(Properties ctx, int productId, String trxName) throws OperationException; -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryCartManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryCartManager.java deleted file mode 100644 index b90659df73..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryCartManager.java +++ /dev/null @@ -1,684 +0,0 @@ -package org.posterita.businesslogic.stock; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.NoSuchElementException; -import java.util.Properties; -import java.util.StringTokenizer; - -import javax.servlet.http.HttpServletRequest; -import javax.swing.text.NumberFormatter; - -import org.apache.ecs.xhtml.div; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.tbody; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.tfoot; -import org.apache.ecs.xhtml.th; -import org.apache.ecs.xhtml.thead; -import org.apache.ecs.xhtml.tr; -import org.apache.struts.upload.FormFile; -import org.compiere.model.MDocType; -import org.compiere.model.MInventory; -import org.compiere.model.MInventoryLine; -import org.compiere.model.MPInstance; -import org.compiere.model.MProduct; -import org.compiere.model.MProductPrice; -import org.compiere.model.MUOM; -import org.compiere.process.InventoryCountCreate; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.InventoryCartBean; -import org.posterita.beans.InventoryLineBean; -import org.posterita.beans.ItemBean; -import org.posterita.beans.ProductBean; -import org.posterita.businesslogic.POSProductManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.performanceanalysis.CSVReportManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.RandomStringGenerator; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.BarcodeAlreadyExistsException; -import org.posterita.exceptions.CannotCreateInventoryLineException; -import org.posterita.exceptions.ImportProductException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductAlreadyExistException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.exceptions.ProductNotImportedException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - -public class InventoryCartManager -{ - private static final int CREATE_INVENTORY_COUNT_LIST_PROCESS=289; - - private static String getInventoryCartAsHTML(ArrayList itemList, Properties ctx) throws ParseException, OperationException - { - NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0")); - - int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - String currSymbol = PriceListManager.getCurrency(ctx, priceListId); - - BigDecimal totalQtyCount = Env.ZERO; - BigDecimal totalQtyBook = Env.ZERO; - BigDecimal totalQtyCsv = Env.ZERO; - BigDecimal difference = Env.ZERO; - BigDecimal totalDifference = Env.ZERO; - - String[] headers = {"Name","Description","UOM","Quantity CSV", "Quantity Book","Quantity Count", "Difference"}; - table tbl = new table("0", "0", "0", "100%", ""); - tbl.setID("inventoryCart"); - tbl.addAttribute("class", "filterable sortable"); - - BigDecimal qtyCsv = Env.ZERO; - BigDecimal qtyCount = Env.ZERO; - BigDecimal qtyBook = Env.ZERO; - - thead theader = new thead(); - - tr headerRow = new tr(); - headerRow.setClass("itemTitleList"); - - for(String header : headers) - { - th h = new th(header); - headerRow.addElement(h); - } - - theader.addElement(headerRow); - tbl.addElement(theader); - - - //add body - tbody body = new tbody(); - int count = 0; - - if(itemList != null) - { - for(ItemBean bean : itemList) - { - count ++; - - tr dataRow = new tr(); - - dataRow.setClass("evenRow"); - dataRow.setID("row" + count); - dataRow.addAttribute("productId", bean.getProductId().toString()); - dataRow.addAttribute("qty", bean.getQtyCount().toString()); - dataRow.addAttribute("qtyBook", bean.getQtyBook().toString()); - - qtyCount = bean.getQtyCount(); - qtyCsv = bean.getQtyCsv(); - qtyBook = bean.getQtyBook(); - - difference = qtyBook.subtract(qtyCount); - - totalQtyCount = totalQtyCount.add(bean.getQtyCount()); - totalQtyBook = totalQtyBook.add(bean.getQtyBook()); - totalQtyCsv = totalQtyCsv.add(bean.getQtyCsv()); - totalDifference = totalDifference.add(difference); - - int n = qtyCount.compareTo(qtyBook); - - //Greater - if(n == -1) - { - dataRow.addAttribute("style", "color:#0101DF"); - } - - //Equal - if(n == 0) - { - dataRow.addAttribute("style", "color:#000000"); - } - - //less - if(n == 1) - { - dataRow.addAttribute("style", "color:#DF0101"); - } - - - - String[] columnData = { - bean.getProductName(), - bean.getDescription(), - bean.getUom(), - formatter.valueToString(bean.getQtyCsv()), - formatter.valueToString(bean.getQtyBook()), - formatter.valueToString(bean.getQtyCount()), - formatter.valueToString(difference) - }; - - for(int i=0; iTotal ").setColSpan("3")); - footerRow.addElement(new td(new div(formatter.valueToString(totalQtyCsv)).setID("cartTotalCsv"))); - footerRow.addElement(new td(new div(formatter.valueToString(totalQtyBook)).setID("cartTotalBook"))); - footerRow.addElement(new td(new div(formatter.valueToString(totalQtyCount)).setID("cartTotalCount"))); - footerRow.addElement(new td(new div(formatter.valueToString(totalDifference)).setID("cartDifference"))); - - footer.addElement(footerRow); - tbl.addElement(footer); - - - return tbl.toString(); - } - - public static String getInventoryCartAsHTML(HttpServletRequest request) throws ParseException, OperationException - { - //add body - ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); - Properties ctx = TmkJSPEnv.getCtx(request); - return getInventoryCartAsHTML(itemList, ctx); - } - - public static void clearInventorycart(Properties ctx, HttpServletRequest request) - { - //bug fix - request.setAttribute("cartTotalCsv", null); - request.setAttribute("cartTotalBook", null); - request.setAttribute("cartTotalCount", null); - - Env.setContext(ctx, Constants.DESCRIPTION, ""); - Env.setContext(ctx, Constants.INVENTORY_ID, ""); - - request.getSession().setAttribute(Constants.DOC_NO, null); - request.getSession().setAttribute(Constants.DOC_STATUS, null); - request.getSession().setAttribute(Constants.DESCRIPTION, null); - request.getSession().setAttribute(Constants.INVENTORY_ID, null); - request.getSession().setAttribute(Constants.INVENTORY_CART, null); - request.getSession().setAttribute(Constants.INVENTORY_CART_ITEMS, null); - } - - public static void saveCountQtyInInventoryLine(Properties ctx,int inventoryLineId, BigDecimal qtyBook, BigDecimal countQty, BigDecimal qtyCsv, String trxName) throws OperationException - { - MInventoryLine line = new MInventoryLine(ctx,inventoryLineId,trxName); - line.setQtyCount(countQty); - line.setQtyBook(qtyBook); - line.setQtyCsv(qtyCsv); - PoManager.save(line); - } - - public static boolean addInventoryLine(Properties ctx, Integer inventoryId,Integer productId, BigDecimal qtyBook, BigDecimal qtyCount, BigDecimal qtyCsv, boolean updateCount,String trxName) throws OperationException - { - if(productId == null || productId.intValue()==0) - { - throw new ProductNotFoundException("product not available"); - } - - MProduct product = new MProduct(ctx,productId.intValue(),trxName); - if(product.getProductType().equalsIgnoreCase(MProduct.PRODUCTTYPE_Service)) - { - throw new CannotCreateInventoryLineException("product is a service, cannot add to inventory"); - } - MInventory inventory = new MInventory(ctx,inventoryId,trxName); - MInventoryLine inventoryLine[]=inventory.getLines(true); - boolean added=true; - if(inventoryLine.length>0) - { - for(int i=0;i 1) - { - throw new OperationException("More that one inventory lines found matching criteria"); - } - else - { - return inventoryLines[0]; - } - - } - - public static MInventory createInventory(Properties ctx,String description,String trxName) throws OperationException - { - MInventory inventory = new MInventory(ctx,0,trxName); - MDocType[] docTypes= MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_MaterialPhysicalInventory); - if(docTypes.length>1) - throw new OperationException("More than one document type for Physical Inventory"); - - inventory.setC_DocType_ID(docTypes[0].get_ID()); - inventory.setM_Warehouse_ID(POSTerminalManager.getWarehouseId(ctx)); - if(description!=null) - inventory.setDescription(description); - - PoManager.save(inventory); - return inventory; - - } - - public static ArrayList getInventoryLines(Properties ctx,int inventoryId) throws OperationException - { - - MInventory inventory = new MInventory(ctx,inventoryId,null); - MInventoryLine inventoryLine[]=inventory.getLines(true); - - ArrayList countList = new ArrayList(); - - ItemBean bean=null; - BigDecimal bookQtyValue=null; - BigDecimal countQtyValue=null; - - for(int i=0;i getInventoryData(Properties ctx, ArrayList list, String trxName) throws ParseException - { - - ArrayList reportData = new ArrayList(); - NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0.00")); - NumberFormatter qtyFormatter = new NumberFormatter(new DecimalFormat("0")); - - String productName = null; - String productDescrition = null; - String barcode = null; - - BigDecimal qtyBook = Env.ZERO; - BigDecimal qtyCount = Env.ZERO; - BigDecimal qtyCsv = Env.ZERO; - - BigDecimal bookValue = Env.ZERO; - BigDecimal countValue = Env.ZERO; - - BigDecimal qtyBookTotal = Env.ZERO; - BigDecimal qtyCountTotal = Env.ZERO; - BigDecimal qtyCsvTotal = Env.ZERO; - - BigDecimal valueBookTotal = Env.ZERO; - BigDecimal valueCountTotal = Env.ZERO; - - BigDecimal qtyDifference = Env.ZERO; - BigDecimal valueDifference = Env.ZERO; - - - for(ItemBean itemBean : list) - { - qtyBook = itemBean.getQtyBook(); - qtyCount = itemBean.getQtyCount(); - - qtyBookTotal = qtyBookTotal.add(qtyBook); - qtyCountTotal = qtyCountTotal.add(qtyCount); - - productName = itemBean.getProductName(); - productDescrition = itemBean.getDescription(); - barcode = itemBean.getBarCode(); - - int purchasePriceListVersionId = Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL_VERSION); - MProductPrice purchasePrice = MProductPrice.get(ctx, purchasePriceListVersionId, itemBean.getProductId(), trxName); - - if(purchasePrice==null) - { - bookValue=new BigDecimal(0); - countValue=new BigDecimal(0); - } - else - { - bookValue=purchasePrice.getPriceList().multiply(itemBean.getQtyBook()); - countValue=purchasePrice.getPriceList().multiply(itemBean.getQtyCount()); - } - - valueBookTotal = valueBookTotal.add(bookValue); - valueCountTotal = valueCountTotal.add(countValue); - - qtyDifference = qtyCount.subtract(qtyBook); - valueDifference = countValue.subtract(bookValue); - - Object[] data = {barcode, productName, qtyFormatter.valueToString(qtyCsv), qtyFormatter.valueToString(qtyBook), qtyFormatter.valueToString(qtyCount), formatter.valueToString(bookValue), formatter.valueToString(countValue), qtyFormatter.valueToString(qtyDifference), formatter.valueToString(valueDifference)}; - - reportData.add(data); - } - - // Add Total - Object[] totalValue = {"TOTAL"," ", qtyFormatter.valueToString(qtyCsvTotal) ,qtyFormatter.valueToString(qtyBookTotal), qtyFormatter.valueToString(qtyCountTotal), formatter.valueToString(valueBookTotal), formatter.valueToString(valueCountTotal), qtyFormatter.valueToString(qtyCountTotal.subtract(qtyBookTotal)), formatter.valueToString(valueCountTotal.subtract(valueBookTotal))}; - reportData.add(totalValue); - - return reportData; - } - - public static InventoryCartBean addItemsFromCsv(Properties ctx, FormFile file, InventoryLineBean ibean, InventoryCartBean cartBean, String trxName) throws NumberFormatException, ProductAlreadyExistException,BarcodeAlreadyExistsException, OperationException - { - - InputStream is = null; - BufferedInputStream bis = null; - BufferedReader reader = null; - - ArrayList ilBean = new ArrayList(); - - StringBuffer csv = new StringBuffer(); - StringBuffer importProductEx = new StringBuffer(); - try - { - is = file.getInputStream(); - bis = new BufferedInputStream(is); - reader = new BufferedReader(new InputStreamReader(bis)); - - String s = null; - Integer lineNumber = 0; - String barcode = null; - String qty=null; - - BigDecimal qtyCsv = new BigDecimal(0); - - ArrayList uomErrorList = new ArrayList(); - - boolean isProductImported = true; - String filename = ""; - - while((s=reader.readLine())!=null && s.trim().length()>0) - { - lineNumber++; - StringTokenizer st = new StringTokenizer(s,","); - - ibean = new InventoryLineBean(); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - try - { - trx.start(); - try - { - barcode = st.nextToken(); - barcode = barcode.replaceAll("\"",""); - qty=st.nextToken(); - qty=qty.replaceAll("\"",""); - qtyCsv = new BigDecimal(qty); - - } - catch (NoSuchElementException e) - { - // TODO: handle exception - throw new ImportProductException("An error occurred while passing the data in the file."); - } - - ProductBean product = POSProductManager.getProduct(ctx, barcode, trxName); - - ibean.setProductId(product.getProductId()); - ibean.setBarCode(barcode); - ibean.setProductName(product.getProductName()); - ibean.setDescription(product.getDescription()); - ibean.setUom(product.getUom()); - ibean.setQtyCount(qtyCsv); - ibean.setQtyCsv(qtyCsv); - ibean.setQtyBook(product.getQtyOnHand()); - ibean.setPriceListId(product.getPriceListId()); - - ilBean.add(ibean); - trx.commit(); - - cartBean = StockManager.addToInventoryCart(ctx, ibean, cartBean, false , true); - } - catch (OperationException e) - { - trx.rollback(); - importProductEx = importProductEx.append("
Product with barcode: "+ barcode + " at line " + lineNumber + " not imported. ").append(e.getMessage()); - isProductImported = false; - csv.append(s).append("\"\n"); - } - finally - { - trx.close(); - } - - } - - if (isProductImported == false) - { - filename = RandomStringGenerator.randomstring() + ".csv"; - String filepath = ReportManager.getReportPath(filename); - try - { - FileWriter writer = new FileWriter(filepath); - writer.write(csv.toString()); - writer.flush(); - writer.close(); - } - catch (IOException e1) - { - throw new OperationException(e1); - } - throw new ProductNotImportedException(filename+importProductEx.toString()); - } - } - catch (FileNotFoundException e) - { - e.printStackTrace(); - } - catch (IOException e) - { - e.printStackTrace(); - } - finally - { - if (is != null) - { - try - { - is.close(); - } - catch(Exception ex) - {} - } - - if (bis != null) - { - try - { - bis.close(); - } - catch(Exception ex) - {} - } - - if (reader != null) - { - try - { - reader.close(); - } - catch(Exception ex) - {} - } - } - - return cartBean; - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryManager.java deleted file mode 100644 index c9be2af3a4..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/stock/InventoryManager.java +++ /dev/null @@ -1,788 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 4, 2006 by alok - */ - - -package org.posterita.businesslogic.stock; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Properties; - -import javax.swing.text.NumberFormatter; - -import org.compiere.model.MDocType; -import org.compiere.model.MInventory; -import org.compiere.model.MInventoryLine; -import org.compiere.model.MPInstance; -import org.compiere.model.MProduct; -import org.compiere.model.MProductPrice; -import org.compiere.model.MUOM; -import org.compiere.process.DocumentEngine; -import org.compiere.process.InventoryCountCreate; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.posterita.beans.InventoryBean; -import org.posterita.beans.InventoryLineBean; -import org.posterita.beans.ProductBean; -import org.posterita.businesslogic.POSProductManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.performanceanalysis.CSVReportManager; -import org.posterita.exceptions.CannotCreateInventoryLineException; -import org.posterita.exceptions.NoCheckBoxSelectedException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; - - -public class InventoryManager -{ - private static final int CREATE_INVENTORY_COUNT_LIST_PROCESS=289; - - public static MInventory createInventory(Properties ctx,String description,String trxName) throws OperationException - { - MInventory inventory = new MInventory(ctx,0,trxName); - MDocType[] docTypes= MDocType.getOfDocBaseType(ctx,MDocType.DOCBASETYPE_MaterialPhysicalInventory); - if(docTypes.length>1) - throw new OperationException("More than one document type for Physical Inventory"); - - inventory.setC_DocType_ID(docTypes[0].get_ID()); - inventory.setM_Warehouse_ID(POSTerminalManager.getWarehouseId(ctx)); - if(description!=null) - inventory.setDescription(description); - - PoManager.save(inventory); - return inventory; - - } - - /** - * Add Inventory Line - * @param ctx - * @param inventoryId - * @param productId - * @param qtyCount - * @param updateCount - * @param trxName - * @return - * @throws OperationException - */ - public static boolean addInventoryLine(Properties ctx, Integer inventoryId,Integer productId, BigDecimal qtyCsv, BigDecimal qtyCount, boolean updateCount,String trxName) throws OperationException - { - if(productId == null || productId.intValue()==0) - { - throw new ProductNotFoundException("product not available"); - } - - MProduct product = new MProduct(ctx,productId.intValue(),trxName); - if(product.getProductType().equalsIgnoreCase(MProduct.PRODUCTTYPE_Service)) - { - throw new CannotCreateInventoryLineException("product is a service, cannot add to inventory"); - } - MInventory inventory = new MInventory(ctx,inventoryId,trxName); - MInventoryLine inventoryLine[]=inventory.getLines(true); - boolean added=true; - if(inventoryLine.length>0) - { - for(int i=0;i 1) - { - throw new OperationException("More that one inventory lines found matching criteria"); - } - else - { - return inventoryLines[0]; - } - - } - - public static void addAllProductsInventoryLine(Properties ctx, Integer inventoryId,String trxName) throws OperationException - { - - MPInstance instance = new MPInstance(ctx,CREATE_INVENTORY_COUNT_LIST_PROCESS,inventoryId.intValue()); - instance.save(); - ProcessInfo poInfo = new ProcessInfo("Create Inventory Count List",CREATE_INVENTORY_COUNT_LIST_PROCESS); - // poInfo.setParameter(param); - poInfo.setRecord_ID(inventoryId.intValue()); - poInfo.setAD_Process_ID(CREATE_INVENTORY_COUNT_LIST_PROCESS); - poInfo.setAD_PInstance_ID(instance.get_ID()); - InventoryCountCreate countCreate = new InventoryCountCreate(); - Trx trx = Trx.get(trxName, false); - boolean success = countCreate.startProcess(ctx,poInfo,trx); - if(success==false) - throw new OperationException("Problem encountered while creating inventory"); - } - - - public static ArrayList getInventoryLines(Properties ctx,int inventoryId) throws OperationException - { - - MInventory inventory = new MInventory(ctx,inventoryId,null); - MInventoryLine inventoryLine[]=inventory.getLines(true); - - ArrayList countList = new ArrayList(); - - InventoryLineBean bean=null; - BigDecimal bookQtyValue=null; - BigDecimal countQtyValue=null; - - for(int i=0;i list=new ArrayList(); - try - { - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean=new InventoryBean(); - - bean.setInventoryId(rs.getInt(1)); - bean.setInventoryNo(rs.getString(2)); - bean.setMovementDate(rs.getString(3)); - bean.setDocStatus(rs.getString(5)); - bean.setDescription(rs.getString(4)); - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - - pstmt.close(); - } - catch (SQLException e) - { - - } - - } - return list; - - } - - public static ArrayList viewInventoryHistory(Properties ctx, int adOrgId, int productId, Timestamp fromDate, Timestamp toDate, String trxName) throws OperationException - { - - String sql = "SELECT inv.M_Inventory_ID, inv.documentNo, inv.movementDate, inv.description, inv.docStatus" + - " FROM M_Inventory inv INNER JOIN m_inventoryline invl ON"+ - " inv.M_Inventory_ID = invl.M_Inventory_ID WHERE"+ - " invl.M_Product_ID = "+ productId +" AND"+ - " inv.AD_Client_ID = "+Env.getAD_Client_ID(ctx)+" AND"+ - " inv.AD_Org_ID = "+ adOrgId+ " AND"+ - " inv.movementDate BETWEEN " + DB.TO_DATE(fromDate, false) + " AND " + DB.TO_DATE(toDate, false); - - PreparedStatement pstmt = DB.prepareStatement(sql,trxName); - ResultSet rs = null; - InventoryBean bean=null; - - ArrayList list=new ArrayList(); - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean=new InventoryBean(); - - bean.setInventoryId(rs.getInt(1)); - bean.setInventoryNo(rs.getString(2)); - bean.setMovementDate(rs.getString(3)); - bean.setDocStatus(rs.getString(5)); - bean.setDescription(rs.getString(4)); - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - close(pstmt, rs); - } - return list; - - } - - private static void close(PreparedStatement pstmt, ResultSet rs) throws OperationException - { - if (pstmt!=null) - { - try - { - pstmt.close(); - } - catch (Exception ex) - { - throw new OperationException("Could not close prepared statement" , ex); - } - finally - { - pstmt = null; - } - } - if (rs != null) - { - try - { - rs.close(); - } - catch (Exception ex) - { - throw new OperationException("Could not close result set", ex); - } - finally - { - rs = null; - } - } - } - - public static String getInventoryDocStatus(Properties ctx,int inventoryId) - { - MInventory inventory = new MInventory(ctx,inventoryId,null); - return inventory.getDocStatus(); - - } - - - private static void updateCountQty(Properties ctx,int inventoryID) - { - String sql = "UPDATE M_INVENTORYLINE SET QTYCOUNT=1 WHERE M_INVENTORYLINE_ID="+ - "(SELECT MAX(M_INVENTORYLINE_ID) FROM M_INVENTORYLINE WHERE AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+ - " AND M_INVENTORY_ID="+inventoryID+")"; - DB.executeUpdate(sql, null); - } - - public static String createCSVForInventory(Properties ctx,ArrayList list) throws OperationException - { - Object[] columns = null; - ArrayList objectList = new ArrayList(); - Object[] header =new Object[]{"Name","Barcode","QtyBook","QtyCount","Book Qty Value","Count Qty Value"}; - objectList.add(header); - - double sumQtyBook = 0.0d; - double sumQtyCount = 0.0d; - double sumBookQtyValue = 0.0d; - double sumCountQtyValue = 0.0d; - - for(InventoryBean bean : list) - { - columns = new Object[]{ - bean.getProductName(), - bean.getBarCode(), - bean.getQtyBook(), - bean.getQtyCount(), - bean.getBookQtyValue(), - bean.getCountQtyValue() - }; - objectList.add(columns); - - sumQtyBook += bean.getQtyBook().doubleValue(); - sumQtyCount += bean.getQtyCount().doubleValue(); - sumBookQtyValue += bean.getBookQtyValue().doubleValue(); - sumCountQtyValue += bean.getCountQtyValue().doubleValue(); - } - Object[] total = new Object[]{ - "Total", - " ", - new Double(sumQtyBook), - new Double(sumQtyCount), - new Double(sumBookQtyValue), - new Double(sumCountQtyValue) - }; - objectList.add(total); - - return CSVReportManager.generateCSVReport(ctx,objectList); - } - - public static void deleteInventory(Properties ctx,int inventoryId) - { - MInventory inventory = new MInventory(ctx,inventoryId,null); - inventory.delete(true); - } - - public static void deleteInventoryLine(Properties ctx,int inventoryId,int M_INVENTORYLINE_ID) - { - String sql="DELETE FROM M_INVENTORYLine WHERE M_INVENTORYLINE_ID="+M_INVENTORYLINE_ID+ - " AND M_INVENTORY_ID="+inventoryId+ - " AND AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - - DB.executeUpdate(sql,null); - } - - - public static MInventory mergeInventory(Properties ctx,InventoryBean bean,String trxName) throws OperationException - { - if(bean.getInventoryIds()==null || bean.getInventoryIds().length==0) - { - throw new NoCheckBoxSelectedException("Please select an Inventory"); - } - - MInventory inventory=createInventory(ctx,"Combined created on "+new Timestamp(System.currentTimeMillis()),trxName); - - for(int i = 0; i < bean.getInventoryIds().length; i++) - { - MInventory existingInv = new MInventory(ctx, bean.getInventoryIds()[i],trxName); - - MInventoryLine [] line = existingInv.getLines(true); - - for( int j = 0 ; j< line.length ; j++) - { - addInventoryLine(ctx, inventory.get_ID(),line[j].getProduct().get_ID(), line[j].getQtyCsv(), line[j].getQtyCount(), true, trxName); - } - - existingInv.processIt(DocumentEngine.ACTION_Void); - PoManager.save(existingInv); - } - - return inventory; - } - - - private static ArrayList getProductsNotScanned(Properties ctx, int inventoryId) throws OperationException - { - String sql = "select pr.m_product_id " + - "from M_PRODUCT pr" + - " where not Exists" + - "(select * from m_inventory inv,M_INVENTORYLINE invl" + - " where inv.m_inventory_id=" +inventoryId+ - " and inv.m_inventory_id=invl.m_inventory_id" + - " and invl.m_product_id=pr.m_product_id) " + - // Fix: Cannot do inventory on product that has no storage yet (i.e: No PO/SO) - " and Exists (select * from M_Storage s where s.M_Product_ID=pr.M_Product_ID) " + - "and pr.isactive='Y'" + - " and pr.AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx)+ - " and pr.productType='"+MProduct.PRODUCTTYPE_Item+"'"; - - - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - ArrayList list = new ArrayList(); - - try - { - ResultSet rs = pstmt.executeQuery(); - while(rs.next()) - { - list.add(Integer.valueOf(rs.getInt(1))); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch (SQLException e) - { - - } - } - - return list; - } - - - //------------------------------------------------------------------------------------------// - - public static ArrayList getInventoryReportData(Properties ctx, int inventoryId, String trxName) throws OperationException, SQLException, ParseException - { - ArrayList reportData = new ArrayList(); - NumberFormatter qtyformatter = new NumberFormatter(new DecimalFormat("0")); - NumberFormatter valueformatter = new NumberFormatter(new DecimalFormat("0.00")); - - MInventory inventory = new MInventory(ctx,inventoryId,null); - MInventoryLine inventoryLine[]=inventory.getLines(true); - - String productName = null; - BigDecimal qtyBook = Env.ZERO; - BigDecimal qtyCount = Env.ZERO; - BigDecimal bookValue = Env.ZERO; - BigDecimal countValue = Env.ZERO; - BigDecimal qtyBookTotal = Env.ZERO; - BigDecimal qtyCountTotal = Env.ZERO; - BigDecimal valueBookTotal = Env.ZERO; - BigDecimal valueCountTotal = Env.ZERO; - BigDecimal qtyDifference = Env.ZERO; - BigDecimal valueDifference = Env.ZERO; - - - for(int i=0;i list=new ArrayList(); - try - { - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean=new InventoryBean(); - - bean.setInventoryId(rs.getInt(1)); - bean.setInventoryNo(rs.getString(2)); - bean.setMovementDate(rs.getString(3)); - bean.setDocStatus(rs.getString(5)); - bean.setDescription(rs.getString(4)); - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - - pstmt.close(); - } - catch (SQLException e) - { - - } - - } - return list; - - } - - public static ArrayList searchProductInInventory(Properties ctx, Integer productId, String barcode) throws OperationException - { - StringBuffer sql = new StringBuffer(); - - sql.append(" select inv.m_inventory_id, inv.documentno, to_char(inv.movementdate,'dd/Mon/yyyy'), inv.description, inv.docstatus"); - sql.append(" from m_inventory inv"); - sql.append(" inner join m_inventoryline invl on invl.m_inventory_id = inv.m_inventory_id"); - sql.append(" where inv.AD_CLIENT_ID=").append(Env.getAD_Client_ID(ctx)); - sql.append(" and inv.ad_org_id=").append(Env.getAD_Org_ID(ctx)); - sql.append(" and invl.m_product_id ="); - - - if(productId != null) - { - sql.append(productId); - } - - if(barcode != null) - { - ProductBean pBean = POSProductManager.getProduct(ctx, barcode, null); - sql.append(pBean.getProductId()); - } - - sql.append(" order by DOCUMENTNO desc"); - - PreparedStatement pstmt = DB.prepareStatement(sql.toString(),null); - - InventoryBean bean=null; - - ArrayList list=new ArrayList(); - try - { - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean=new InventoryBean(); - - bean.setInventoryId(rs.getInt(1)); - bean.setInventoryNo(rs.getString(2)); - bean.setMovementDate(rs.getString(3)); - bean.setDocStatus(rs.getString(5)); - bean.setDescription(rs.getString(4)); - list.add(bean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - - pstmt.close(); - } - catch (SQLException e) - { - - } - - } - return list; - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/stock/MMovementManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/stock/MMovementManager.java deleted file mode 100644 index 7b5bb13474..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/stock/MMovementManager.java +++ /dev/null @@ -1,1399 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on May 22, 2006 by alok - */ -package org.posterita.businesslogic.stock; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.swing.text.NumberFormatter; - -import org.apache.ecs.xhtml.div; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.th; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.MDocType; -import org.compiere.model.MGLCategory; -import org.compiere.model.MLocation; -import org.compiere.model.MLocator; -import org.compiere.model.MMovement; -import org.compiere.model.MMovementConfirm; -import org.compiere.model.MMovementLine; -import org.compiere.model.MOrg; -import org.compiere.model.MOrgInfo; -import org.compiere.model.MPriceList; -import org.compiere.model.MProduct; -import org.compiere.model.MProductPrice; -import org.compiere.model.MStorage; -import org.compiere.model.MWarehouse; -import org.compiere.process.DocAction; -import org.compiere.process.DocumentEngine; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.TangoColors; -import org.posterita.beans.ItemBean; -import org.posterita.beans.MMovementCartBean; -import org.posterita.beans.StockMovementBean; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.administration.WarehouseManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.lib.UdiConstants; -import org.posterita.util.PoManager; -/** - * manager for moving product between warehouses and locators - * @author sendy - * - */ -public class MMovementManager -{ - /** - * Create New Inventory Move (Material Movement) - * @param ctx - * @param description - * @param trxName - * @return MMovement - * @throws OperationException - */ - public static MMovement createInventoryMove(Properties ctx,String description,String trxName) throws OperationException - { - MMovement mmovement = new MMovement(ctx, 0, trxName); - mmovement.setDescription(description); - // Set Material Movement Document - int docTypeId = getDocType(ctx, "Inter Branch Transfer"); - mmovement.setC_DocType_ID(docTypeId); - - PoManager.save(mmovement); - return mmovement; - - } - - /** - * Get Document Type - * @param ctx - * @param name - * @return - * @throws OperationException - */ - private static int getDocType(Properties ctx, String name) throws OperationException - { - if (name == null) - { - return 0; - } - - int[] docTypesMM = MDocType.getAllIDs(MDocType.Table_Name, "AD_Client_ID = "+ Env.getAD_Client_ID(ctx)+ " AND docBaseType = '" + MDocType.DOCBASETYPE_MaterialMovement + "' AND name = '" + name +"'", null); - - int docType_Id = 0; - int[] glc = MGLCategory.getAllIDs(MGLCategory.Table_Name, "AD_Client_ID = "+ Env.getAD_Client_ID(ctx)+" AND name = 'Material Management'", null); - - if (glc.length == 0) - { - throw new OperationException("gl category does not exist"); - - } - if (glc.length > 1) - { - throw new OperationException("more than one gl category found"); - } - - int gl_catId = glc[0]; - if (docTypesMM.length == 0) - { - MDocType docType = new MDocType(ctx, 0 ,null); - docType.setAD_Org_ID(0); - docType.setName(name); - docType.setPrintName(name); - docType.setGL_Category_ID(gl_catId); - docType.setDocBaseType(MDocType.DOCBASETYPE_MaterialMovement); - docType.setIsInTransit(true); - docType.save(); - docType_Id = docType.getC_DocType_ID(); - } - else if (docTypesMM.length> 1) - { - throw new OperationException("Error while getting document type for material movement"); - } - - else - { - docType_Id = docTypesMM[0]; - } - - return docType_Id; - } - - /** - * Check Locator - * @param locatorFrom - * @param locatorTo - * @throws OperationException - */ - private static void checkLocator(int locatorFrom, int locatorTo) throws OperationException - { - if (locatorFrom == 0 || locatorTo == 0) - { - throw new OperationException("No warehouse locators defined"); - } - - if (locatorFrom == locatorTo) - { - throw new OperationException("Organisation from cannot be equal to Organisation To!"); - } - - } - - /** - * Get Locator - * @param ctx - * @param adClientId - * @param org - * @param trxName - * @return - */ - private static int getLocator(Properties ctx, int adClientId, MOrg org, String trxName) - { - MOrgInfo orgInfo = org.getInfo(); - - int warehouseId = orgInfo.getM_Warehouse_ID(); - - int[] locator = MLocator.getAllIDs(MLocator.Table_Name, "AD_Client_ID = "+ adClientId - + " AND AD_Org_ID = " + org.getAD_Org_ID() + - " AND M_Warehouse_ID = " + warehouseId, trxName); - - if (locator.length == 0) - { - return 0; - } - - else - { - return locator[0]; - } - - } - - /** - * Create Or Update Material Movement Line - * @param ctx - * @param movementId - * @param productId - * @param qtyToMove - * @param fromLocatorId - * @param toLocatorId - * @param trxName - * @return - * @throws OperationException - */ - public static boolean createOrUpdateMaterialMovementLine(Properties ctx, int movementId, int productId, BigDecimal qtyToMove, int fromLocatorId, int toLocatorId, String trxName) throws OperationException - { - if (trxName == null) - { - throw new OperationException("transaction cannot be null while creating a material movement line"); - } - - if (movementId < 1) - { - throw new OperationException("movement Id is mandatory"); - } - - if(productId ==0) - { - throw new ProductNotFoundException("product not available"); - } - - MProduct product = new MProduct(ctx, productId, trxName); - if(product.getProductType().equalsIgnoreCase(MProduct.PRODUCTTYPE_Service)) - { - throw new OperationException("product is a service, cannot add to stock transfer"); - } - - checkLocator(fromLocatorId, toLocatorId); - - MMovement movement = new MMovement(ctx, movementId, trxName); - MMovementLine[] movementLine = movement.getLines(true); - boolean added = true; - - if(movementLine.length>0) - { - for(int i=0;i getAvailableProducts(Properties ctx, int orgId, String productName, - String description, String barcode, String trxName) throws ProductNotFoundException - { - - ArrayList productList = new ArrayList(); - StringBuffer sql = new StringBuffer("SELECT s.M_Product_ID FROM M_Storage s INNER JOIN M_Product p on ") - .append("s.M_Product_ID = p.M_Product_ID WHERE s.AD_Client_ID = ? AND s.AD_Org_ID = ? "); - - ArrayList list = new ArrayList(); - if (productName!=null && !"".equals(productName)) - { - sql.append(" AND lower(p.name) like lower(%?%)"); - list.add(productName); - } - if (description!=null && !"".equals(description)) - { - sql.append(" AND lower(p.description) like " +"(%?%)"); - list.add(description); - } - if (barcode!=null && !"".equals(barcode)) - { - sql.append(" AND p.upc = ?"); - list.add(barcode); - } - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (sql.toString(), trxName); - pstmt.setInt(1, Env.getAD_Client_ID(ctx)); - pstmt.setInt(2, orgId); - - for (int i = 0; i convertToBeanList(Properties ctx, ArrayList prodList, HashMap stockProductList, ArrayList product, int preOrgFromId, int orgFromId, int orgToId, String trxName) throws OperationException - { - MOrg orgFrom = MOrg.get(ctx, orgFromId); - MOrgInfo orgInfo = orgFrom.getInfo(); - int warehouseId = orgInfo.getM_Warehouse_ID(); - - MOrg orgTo = MOrg.get(ctx, orgToId); - - if (orgFromId != preOrgFromId) - { - if (prodList != null) - { - prodList.clear(); - } - preOrgFromId = orgFromId; - } - - Iterator prodIter = product.iterator(); - while (prodIter.hasNext()) - { - StockMovementBean stockBean = new StockMovementBean(); - MProduct prod = prodIter.next(); - - if (!stockProductList.containsKey(prod.getM_Product_ID())) - { - stockBean = getStockMovementBean(ctx, 0, prod, orgFrom, orgTo, Env.ZERO); - } - - prodList.add(stockBean); - stockProductList.put(prod.getM_Product_ID(), stockBean); - } - return prodList; - } - - /** - * - * @param ctx - * @param movementLineId - * @param product - * @param orgFrom - * @param orgTo - * @param qtyToMove - * @return - * @throws OperationException - */ - public static StockMovementBean getStockMovementBean(Properties ctx, int movementLineId, MProduct product, - MOrg orgFrom, MOrg orgTo, BigDecimal qtyToMove) throws OperationException - { - StockMovementBean stockBean = new StockMovementBean(); - - int movementId = 0; - BigDecimal qtyAvailable = Env.ZERO; - String documentNo = ""; - String docStatus = ""; - int lineNo = 0; - - if (product == null) - { - throw new OperationException("product cannot be null"); - } - if (orgFrom == null || orgTo == null) - { - throw new OperationException("organisations cannot be null"); - } - - MWarehouse warehouseFrom = MWarehouse.get(ctx, orgFrom.getInfo().getM_Warehouse_ID()); - MLocator fromLoc = MLocator.get(ctx, warehouseFrom.get_ID(), warehouseFrom.getName()+" Locator", "0", "0", "0"); - qtyAvailable = MStorage.getQtyAvailable(warehouseFrom.get_ID(), fromLoc.getM_Locator_ID(), product.getM_Product_ID(), - 0, null); - - MMovementLine movementLine = new MMovementLine(ctx, movementLineId, null); - if (movementLineId != 0) - { - movementId = movementLine.getM_Movement_ID(); - fromLoc = MLocator.get(ctx,movementLine.getM_Locator_ID()); - orgFrom = MOrg.get(ctx, fromLoc.getAD_Org_ID()); - - MLocator toLoc = MLocator.get(ctx,movementLine.getM_LocatorTo_ID()); - orgTo = MOrg.get(ctx, toLoc.getAD_Org_ID()); - - qtyToMove = movementLine.getMovementQty(); - - MMovement movement = new MMovement(ctx, movementLine.getM_Movement_ID(), null); - documentNo = movement.getDocumentNo(); - docStatus = movement.getDocStatus(); - lineNo = movementLine.getLine(); - } - stockBean.setMovementId(movementId); - stockBean.setMovementLineId(movementLineId); - stockBean.setLineNo(lineNo); - stockBean.setDocumentNo(documentNo); - stockBean.setDocStatus(docStatus); - stockBean.setProductId(product.getM_Product_ID()); - stockBean.setProductName(product.getName()); - stockBean.setOrgFromName(orgFrom.getName()); - stockBean.setOrgToName(orgTo.getName()); - stockBean.setIsActive(product.isActive()); - stockBean.setDescription(product.getDescription()); - stockBean.setBarCode(product.getUPC()); - stockBean.setQtyOnHand(qtyAvailable); - stockBean.setQtyToMove(Env.ZERO); - stockBean.setOrgFromId(orgFrom.get_ID()); - stockBean.setOrgToId(orgTo.get_ID()); - stockBean.setUom(product.getUOMSymbol()); - stockBean.setQuantity(qtyToMove); - return stockBean; - } - - /** - * - * @param productId - * @param stockProductList - * @return - */ - public static StockMovementBean getStockBean(int productId , HashMap stockProductList) - { - if (stockProductList != null) - { - if (stockProductList.containsKey(productId)) - { - return stockProductList.get(productId); - } - } - - return null; - - } - - /** - * - * @param ctx - * @param movementId - * @return - * @throws OperationException - */ - public static ArrayList getMovementLines(Properties ctx, int movementId) throws OperationException - { - MMovement movement = new MMovement(ctx, movementId, null); - ArrayList movementLines = new ArrayList(); - - MMovementLine[] lines = movement.getLines(true); - - for (MMovementLine line : lines) - { - StockMovementBean bean = new StockMovementBean(); - int locFromId = line.getM_Locator_ID(); - int locToId = line.getM_LocatorTo_ID(); - MLocator locFrom = MLocator.get(ctx, locFromId); - MLocator locTo = MLocator.get(ctx, locToId); - int orgFromId = locFrom.getAD_Org_ID(); - int orgToId = locTo.getAD_Org_ID(); - - MOrg orgFrom = MOrg.get(ctx, orgFromId); - MOrg orgTo = MOrg.get(ctx, orgToId); - - bean = getStockMovementBean(ctx, line.get_ID(), line.getProduct(), orgFrom, orgTo, null); - - movementLines.add(bean); - } - return movementLines; - } - - /** - * - * @param ctx - * @param orgFromId - * @param docStatus - * @param docNo - * @param fromDate - * @param toDate - * @return - * @throws OperationException - */ - public static ArrayList getMovementByOrgFrom(Properties ctx, int orgFromId, String docStatus, String docNo, Timestamp fromDate, Timestamp toDate) throws OperationException - { - ArrayList list = new ArrayList(); - int adClientId = Env.getAD_Client_ID(ctx); - - int docTypeId = getDocType(ctx, "Inter Branch Transfer"); - - StringBuffer sql = new StringBuffer("SELECT DISTINCT(mm.M_Movement_ID) from M_Movement mm INNER JOIN " + - "(M_MovementLine ml INNER JOIN M_Locator lc ON ml.M_Locator_ID = lc.M_Locator_ID) " + - "ON mm.M_Movement_ID = ml.M_Movement_ID WHERE mm.C_DocType_ID = ? " + - "AND mm.AD_Client_ID = ? AND lc.AD_Org_ID = ? "); - - - if (docStatus != null) - { - sql = sql.append(" AND mm.DocStatus = '" + docStatus + "'"); - } - - if (docNo != null) - { - if (docNo.indexOf('%') != -1) - { - sql = sql.append(" AND mm.DocumentNo LIKE '" + docNo + "'"); - } - else - { - sql = sql.append(" AND mm.DocumentNo LIKE '%" + docNo + "%'"); - } - } - - if (fromDate != null && toDate != null) - { - sql = sql.append(" AND mm.movementDate >= " + - DB.TO_DATE(fromDate, true) +" AND mm.movementDate <= " + DB.TO_DATE(toDate, true)); - } - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sql.toString(), null); - pstmt.setInt(1, docTypeId); - pstmt.setInt(2, adClientId); - pstmt.setInt(3, orgFromId); - - rs = pstmt.executeQuery(); - while (rs.next()) - { - int movementId = rs.getInt(1); - - MMovement movement = new MMovement(ctx, movementId, null); - StockMovementBean bean = new StockMovementBean(); - bean.setIsActive(movement.isActive()); - bean.setMovementId(movementId); - bean.setDescription(movement.getDescription()); - bean.setDocStatus(movement.getDocStatus()); - MDocType dt = MDocType.get(ctx, movement.getC_DocType_ID()); - bean.setDocumentType(dt.getName()); - bean.setDocumentNo(movement.getDocumentNo()); - MOrg org = MOrg.get(ctx, movement.getAD_Org_ID()); - bean.setOrgName(org.getName()); - String isApproved = movement.isApproved()? "Y":"N"; - bean.setIsApproved(isApproved); - bean.setMovementDate(String.valueOf(movement.getMovementDate())); - - list.add(bean); - } - } - catch (SQLException e) - { - - } - finally - { - DB.close(rs, pstmt); - rs=null; - pstmt=null; - } - - return list; - } - - /** - * - * @param ctx - * @param orgId - * @param type - * @param productId - * @param fromDate - * @param toDate - * @return - * @throws OperationException - */ - public static ArrayList getMMovement(Properties ctx, String orgId, String type, int productId, Timestamp fromDate, Timestamp toDate) throws OperationException - { - ArrayList list = new ArrayList(); - int adClientId = Env.getAD_Client_ID(ctx); - - int docTypeId = getDocType(ctx, "Inter Branch Transfer"); - - StringBuffer sql = new StringBuffer("SELECT mm.M_Movement_ID, lc.AD_Org_Id from M_Movement mm INNER JOIN "); - if ("1".equals(type)) - { - sql.append("(M_MovementLine ml INNER JOIN M_Locator lc ON ml.M_LocatorTo_ID = lc.M_Locator_ID) "); - } - if ("2".equals(type)) - { - sql.append("(M_MovementLine ml INNER JOIN M_Locator lc ON ml.M_Locator_ID = lc.M_Locator_ID) "); - } - - sql.append("ON mm.M_Movement_ID = ml.M_Movement_ID WHERE ml.M_Product_ID = "+ productId + - " AND mm.AD_Client_ID = "+adClientId+" AND lc.AD_Org_ID =" + orgId + - " AND mm.DocStatus IN ('CO','CL')"); - - - if (fromDate != null && toDate != null) - { - sql = sql.append(" AND mm.MovementDate BETWEEN " + DB.TO_DATE(fromDate, false) + - " AND " + DB.TO_DATE(toDate, false)); - } - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - pstmt = DB.prepareStatement(sql.toString(), null); - rs = pstmt.executeQuery(); - while (rs.next()) - { - int movementId = rs.getInt(1); - int org_Id = rs.getInt(2); - MOrg organisation = MOrg.get(ctx, org_Id); - - MMovement movement = new MMovement(ctx, movementId, null); - StockMovementBean bean = new StockMovementBean(); - bean.setOrgName(organisation.getName()); - bean.setIsActive(movement.isActive()); - bean.setMovementId(movementId); - bean.setDescription(movement.getDescription()); - bean.setDocStatus(movement.getDocStatus()); - MDocType dt = MDocType.get(ctx, movement.getC_DocType_ID()); - bean.setDocumentType(dt.getName()); - bean.setDocumentNo(movement.getDocumentNo()); - String isApproved = movement.isApproved()? "Y":"N"; - bean.setIsApproved(isApproved); - bean.setMovementDate(String.valueOf(movement.getMovementDate())); - - list.add(bean); - } - } - catch (SQLException e) - { - throw new OperationException("could not execute query"+ e); - } - finally - { - DB.close(rs, pstmt); - rs=null; - pstmt=null; - } - - return list; - } - - /** - * - * @param ctx - * @param orgToId - * @param trxName - * @return - */ - public static ArrayList getMoveConfirmByOrgTo(Properties ctx, int orgToId, String trxName) - { - - int adClientId = Env.getAD_Client_ID(ctx); - - MDocType[] docTypes = MDocType.getOfDocBaseType(ctx, MDocType.DOCBASETYPE_MaterialMovement); - int c_doctype_id = 0; - - for(MDocType docType:docTypes) - { - if ("Inter Branch Transfer".equals(docType.getName())) - { - c_doctype_id = docType.getC_DocType_ID(); - } - } - String sql = "SELECT DISTINCT(mc.M_MovementConfirm_ID) FROM M_MovementConfirm mc INNER JOIN (M_Movement mm INNER JOIN " + - "(M_MovementLine ml INNER JOIN M_Locator lc ON ml.M_LocatorTo_ID = lc.M_Locator_ID)" + - "ON mm.M_Movement_ID = ml.M_Movement_ID) ON mc.M_Movement_ID = mm.M_Movement_ID WHERE " + - "mm.C_DocType_ID = ? AND mm.AD_Client_ID = ? AND lc.AD_Org_ID = ?"; - - PreparedStatement pstmt = null; - ResultSet rs = null; - ArrayList m_list = new ArrayList(); - try - { - pstmt = DB.prepareStatement(sql, trxName); - pstmt.setInt(1, c_doctype_id); - pstmt.setInt(2, adClientId); - pstmt.setInt(3, orgToId); - - rs = pstmt.executeQuery(); - - while (rs.next()) - { - int moveConfirmId = rs.getInt(1); - StockMovementBean bean = new StockMovementBean(); - - MMovementConfirm moveConfirm = new MMovementConfirm(ctx, moveConfirmId, trxName); - int movementId = moveConfirm.getM_Movement_ID(); - MMovement movement = new MMovement(ctx, movementId, trxName); - MMovementLine[] lines = movement.getLines(true); - if (lines.length > 0) - { - int locatorId = lines[0].getM_Locator_ID(); - MLocator loc = MLocator.get(ctx, locatorId); - MOrg org = MOrg.get(ctx, loc.getAD_Org_ID()); - bean.setOrgFromName(org.getName()); - } - bean.setMovementId(movementId); - bean.setMoveConfirmId(moveConfirmId); - bean.setIsActive(moveConfirm.isActive()); - bean.setDocStatus(moveConfirm.getDocStatus()); - bean.setDocumentNo(movement.getDocumentNo()); - bean.setMovementDate(String.valueOf(movement.getMovementDate())); - m_list.add(bean); - } - } - catch (SQLException e) - { - - } - finally - { - DB.close(rs, pstmt); - rs=null; - pstmt=null; - } - - return m_list; - } - - /** - * - * @param ctx - * @param moveConfirmId - * @param trxName - * @throws OperationException - */ - public static void completeMoveConfirm(Properties ctx, int moveConfirmId, - String trxName) throws OperationException - { - - MMovementConfirm moveConfirm = new MMovementConfirm(ctx, moveConfirmId, trxName); - String docStatus = moveConfirm.getDocStatus(); - int movementId = moveConfirm.getM_Movement_ID(); - - - if (!docStatus.equals(DocAction.STATUS_Drafted) || docStatus.equals(DocAction.STATUS_InProgress)) - { - throw new OperationException("material movement document status invalid"); - } - - moveConfirm.setDocStatus(DocumentEngine.STATUS_Completed); - moveConfirm.setDocAction(DocumentEngine.ACTION_Close); - moveConfirm.completeIt(); - moveConfirm.save(); - - MMovement movement = new MMovement(ctx, movementId, trxName); - movement.setIsApproved(true); - movement.save(); - } - - /** - * - * @param ctx - * @param list - * @param moveConfirmId - * @return - */ - public static ArrayList getConfirmList(Properties ctx, - ArrayList list, int moveConfirmId) - { - Iterator iter = list.iterator(); - while (iter.hasNext()) - { - StockMovementBean bean = iter.next(); - int movId = bean.getMoveConfirmId(); - if (movId == moveConfirmId) - { - MMovementConfirm mvConfirm = new MMovementConfirm(ctx, moveConfirmId, null); - bean.setDocStatus(mvConfirm.getDocStatus()); - } - } - return list; - } - - /** - * - * @param ctx - * @param list - * @param movementId - * @return - */ - public static ArrayList getMoveList(Properties ctx, - ArrayList list, int movementId) - { - if (list != null) - { - Iterator iter = list.iterator(); - while (iter.hasNext()) - { - StockMovementBean bean = iter.next(); - int movId = bean.getMovementId(); - - if (movId == movementId) - { - MMovement movement = new MMovement(ctx, movId, null); - bean.setDocStatus(movement.getDocStatus()); - } - } - } - return list; - } - - /** - * - * @param ctx - * @param movementId - * @return - */ - public static StockMovementBean getBean(Properties ctx, int movementId) - { - MMovement movement = new MMovement(ctx, movementId, null); - MMovementLine[] lines = movement.getLines(true); - - MLocator locFrom = new MLocator(ctx,lines[0] .getM_Locator_ID(), null); - MLocator locTo = new MLocator(ctx, lines[0].getM_LocatorTo_ID(), null); - - MOrg orgFrom = MOrg.get(ctx, locFrom.getAD_Org_ID()); - MOrg orgTo = MOrg.get(ctx, locTo.getAD_Org_ID()); - - MOrgInfo orgFromInfo = orgFrom.getInfo(); - MOrgInfo orgToInfo = orgTo.getInfo(); - - MLocation locationFrom = MLocation.get(ctx, orgFromInfo.getC_Location_ID(), null); - MLocation locationTo = MLocation.get(ctx, orgToInfo.getC_Location_ID(), null); - - StockMovementBean bean = new StockMovementBean(); - - String addressFrom = locationFrom.getAddress1() == null? "":locationFrom.getAddress1(); - String addressTo = locationTo.getAddress1() == null? "":locationTo.getAddress1(); - - bean.setAddress1(addressFrom); - bean.setAddress2(addressTo); - bean.setDocStatus(movement.getDocStatus()); - bean.setDocumentNo(movement.getDocumentNo()); - bean.setMovementDate(movement.getMovementDate().toString()); - bean.setOrgFromName(orgFrom.getName()); - bean.setOrgToName(orgTo.getName()); - - return bean; - - } - - /** - * - * @param ctx - * @param qtyToMove - * @param index - * @param salesPriceListId - * @param list - * @return - * @throws OperationException - */ - public static BigDecimal setQtyToMove(Properties ctx, BigDecimal qtyToMove, Integer index, Integer salesPriceListId, ArrayList list) throws OperationException - { - qtyToMove = qtyToMove == null? Env.ZERO : qtyToMove; - - if (index == null) - { - throw new OperationException("stock index is null"); - } - - StockMovementBean bean = list.get(index); - - BigDecimal salesPriceList = Env.ZERO; - if (salesPriceListId == 0) - { - salesPriceListId = POSTerminalManager.getSOPriceListId(ctx); - } - - MPriceList priceList = MPriceList.get(ctx, salesPriceListId, null); - MProductPrice productPrice = MProductPrice.get(ctx, - PriceListManager.getPriceListVersionID(ctx, salesPriceListId, null), bean.getProductId(), null); - if (productPrice != null) - { - salesPriceList = productPrice.getPriceList(); - } - BigDecimal stockValue = salesPriceList.multiply(qtyToMove); - bean.setStockValue(stockValue); - bean.setQtyToMove(qtyToMove); - return stockValue; - } - - //***********************************************************************************************// - - /** - * Get Stock Transfer Cart in HTML - * @param itemList - * @param ctx - * @return - * @throws ParseException - * @throws OperationException - */ - private static String getMMovementCartAsHTML(ArrayList itemList, Properties ctx) throws ParseException, OperationException - { - NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0.00")); - - int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - String currSymbol = PriceListManager.getCurrency(ctx, priceListId); - - BigDecimal totalQty = Env.ZERO; - BigDecimal totalValue = Env.ZERO; - - String[] headers = {"Product Name","Description","Barcode","UOM", "Qty Available", "No of Pack", "Qty To Move", "Stock Value"}; - table tbl = new table("0", "0", "0", "100%", ""); - tbl.setID("cart"); - tbl.setBgColor(TangoColors.ALUMINIUM_2); - - BigDecimal qty = Env.ZERO; - BigDecimal stockValue = Env.ZERO; - - tr headerRow = new tr(); - headerRow.setClass("itemTitleList"); - - - for(String header : headers) - { - th h = new th(header); - headerRow.addElement(h); - } - - tbl.addElement(headerRow); - - //add body - int count = 0; - - if(itemList != null) - for(ItemBean bean : itemList) - { - count ++; - - tr dataRow = new tr(); - - if(count % 2 == 0) - { - dataRow.setClass("evenRow"); - } - else - { - dataRow.setClass("oddRow"); - } - dataRow.setID("row" + count); - dataRow.addAttribute("productId", bean.getProductId().toString()); - dataRow.addAttribute("qty", bean.getQtyToMove().toString()); - dataRow.addAttribute("unitsPerPack", bean.getUnitsPerPack().toString()); - qty = bean.getQtyToMove(); - stockValue = bean.getStockValue(); - - input packSize = new input("text", "packSize" + count, bean.getNoOfPack()); - packSize.setID("packSize" + count); - packSize.setSize(10); - - totalQty = totalQty.add(qty); - totalValue = totalValue.add(stockValue); - String[] columnData = { - bean.getProductName(), - bean.getDescription(), - bean.getBarCode(), - bean.getUom(), - bean.getQtyBook().toString(), - packSize.toString(), - bean.getQtyToMove().toString(), - bean.getStockValue().toString() - }; - - for(int i=0; iTOTAL STOCK TO BE TRANSFERED:  ").setColSpan("6")); - footerRow.addElement(new td(new div(totalQty.toString()).setID("cartTotal"))); - footerRow.addElement(new td(new div(totalValue.toString()).setID("totalStockValue"))); - - tbl.addElement(footerRow); - - - return tbl.toString(); - } - - - /** - * Get Stock Transfer Cart in HTML - * @param request - * @return - * @throws ParseException - * @throws OperationException - */ - public static String getMMovementCartAsHTML(HttpServletRequest request) throws ParseException, OperationException - { - //add body - ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.MMOVEMENT_CART_ITEMS); - Properties ctx = TmkJSPEnv.getCtx(request); - return getMMovementCartAsHTML(itemList, ctx); - } - - /** - * Clear Stock Transfer Cart - * @param request - */ - public static void clearCart(Properties ctx, HttpServletRequest request) - { - request.setAttribute("qtyTotal", null); - request.setAttribute("grandTotal", null); - - Env.setContext(ctx, Constants.MMOVEMENT_ID, ""); - request.getSession().removeAttribute(Constants.DOC_NO); - request.getSession().removeAttribute(Constants.DOC_STATUS); - request.getSession().removeAttribute(Constants.DESCRIPTION); - request.getSession().removeAttribute(Constants.MMOVEMENT_ID); - request.getSession().removeAttribute(Constants.MMOVEMENT_CART); - request.getSession().removeAttribute(Constants.MMOVEMENT_CART_ITEMS); - - } - - /** - * Set the no of pack - * @param ctx - * @param itemBean - * @throws OperationException - */ - public static void setNoOfPack(Properties ctx, ItemBean itemBean) throws OperationException - { - //Load Product - MProduct product = new MProduct(ctx, itemBean.getProductId(),null); - - // Calculate no of pack - BigDecimal UnitsPerPack = new BigDecimal(product.getUnitsPerPack()); - BigDecimal noOfPack = itemBean.getQtyToMove().divide(UnitsPerPack, BigDecimal.ROUND_UP); - itemBean.setNoOfPack(noOfPack.intValue()); - - } - - /** - * Delete Movement line - * @param ctx - * @param movementId - */ - public static void deleteMovementLine(Properties ctx, int movementLineId) - { - // Load Movement lines and force delete - MMovementLine movementLine = new MMovementLine(ctx, movementLineId, null); - movementLine.delete(true, null); - } - - /** - * Delete Movement Lines - * @param ctx - * @param movementId - */ - public static void deleteMovementLines(Properties ctx,int movementId) - { - String sql="DELETE FROM M_MovementLine WHERE " + - " M_Movement_Id="+movementId+ - " AND AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - - DB.executeUpdate(sql,null); - } - - /** - * view Inventory Move (Material Movement) History - * @param ctx - * @return list of inventory move - * @throws OperationException - */ - public static ArrayList viewMMovementHistory(Properties ctx, String docStatus, Integer month, Integer year) throws OperationException - { - - ArrayList stockMovementList = new ArrayList(); - StockMovementBean stockMovementBean = null; - - /** - * SQL FOR MOVEMENT HISTORY - */ - StringBuffer sql = new StringBuffer(); - sql.append(" SELECT M_MOVEMENT_ID") - .append(" FROM M_MOVEMENT ") - .append(" WHERE AD_CLIENT_ID = ").append(Env.getAD_Client_ID(ctx)) - .append(" AND AD_ORG_ID = ").append(Env.getAD_Org_ID(ctx)); - - if (docStatus != null) - { - sql = sql.append(" and docstatus='").append(docStatus).append("'"); - } - - if (month != null) - { - String mm = String.valueOf(month); - if (mm.length() == 1) - { - mm = "0" + mm; - } - - sql = sql.append( " AND TO_CHAR(MOVEMENTDATE, 'mm')= '").append(mm).append("'"); - } - - if (year != null) - { - sql = sql.append(" AND TO_CHAR(MOVEMENTDATE, 'yyyy') ='").append(year).append("'"); - } - - sql.append(" ORDER BY DOCUMENTNO DESC "); - - PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); - - try - { - ResultSet rs = pstmt.executeQuery(); - - while(rs.next()) - { - stockMovementBean = new StockMovementBean(); - stockMovementBean.setMovementId(rs.getInt(1)); - - MMovement mmovement = new MMovement(ctx, stockMovementBean.getMovementId(), null); - - stockMovementBean.setIsActive(mmovement.isActive()); - stockMovementBean.setDocumentNo(mmovement.getDocumentNo()); - - MDocType docType = new MDocType(ctx, mmovement.getC_DocType_ID(), null); - String documentType = docType.getName() ; - stockMovementBean.setDocumentType(documentType); - - stockMovementBean.setMovementDate(mmovement.getMovementDate().toString()); - stockMovementBean.setDescription(mmovement.getDescription()); - stockMovementBean.setDocStatus(mmovement.getDocStatus()); - - if(mmovement.isApproved() == true) - { - stockMovementBean.setIsApproved("Y"); - } - else - { - stockMovementBean.setIsApproved("N"); - } - - stockMovementList.add(stockMovementBean); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch (SQLException e) - { - - } - - } - - return stockMovementList; - } - - /** - * Delete Inventory Move - * @param ctx - * @param movementId - */ - public static void deleteInventoryMove(Properties ctx, int movementId) - { - MMovement movement = new MMovement(ctx, movementId, null); - movement.delete(true); - } - - /** - * Get existing materital movement - * @param ctx - * @param movementId - * @param priceListId - * @return - * @throws OperationException - */ - public static MMovementCartBean getMMovementCartBean(Properties ctx, int movementId, int priceListId) throws OperationException - { - ItemBean bean = null; - ArrayList items = new ArrayList(); - - MMovement movement = new MMovement(ctx, movementId, null); - MMovementLine[] movementLine = movement.getLines(true); - - for (MMovementLine line : movementLine) - { - MProduct product = new MProduct(ctx, line.getM_Product_ID(), null); - - bean = new ItemBean(); - bean.setProductId(product.getM_Product_ID()); - bean.setProductName(product.getName()); - bean.setDescription(product.getDescription()); - bean.setQtyToMove(line.getMovementQty()); - bean.setUnitsPerPack(product.getUnitsPerPack()); - setNoOfPack(ctx, bean); - - int warehouseId = WarehouseManager.getDefaultWarehouse(ctx).getM_Warehouse_ID(); - MLocator locator = MLocator.get(ctx, warehouseId, "", "0", "0", "0"); - BigDecimal qtyAvailable = MStorage.getQtyAvailable(warehouseId, locator.get_ID(), product.getM_Product_ID(), 0, null); - - bean.setQtyBook(qtyAvailable); - - items.add(bean); - } - - - StockManager.setMMovementItemCosts(ctx, priceListId, items, false); - - MMovementCartBean cartBean = new MMovementCartBean(); - cartBean.setItems(items); - - return cartBean; - } - - public static String getMMovementCartFromInventoryMove(Properties ctx, int movementId, String trxName) throws OperationException, ParseException - { - int priceListId = PriceListManager.getDefaultPriceListId(ctx, false); - MMovementCartBean bean = getMMovementCartBean(ctx, movementId, priceListId); - return getMMovementCartAsHTML(bean.getItems(), ctx); - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockList.java b/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockList.java deleted file mode 100644 index ba5734c061..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockList.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.posterita.businesslogic.stock; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import org.compiere.util.Env; -import org.posterita.beans.StockMovementBean; -import org.posterita.exceptions.OperationException; - -public class StockList -{ - private ArrayList products; - private BigDecimal noOfProducts = Env.ZERO; - private Properties ctx = null; - - public StockList(Properties ctx) - { - this.ctx = ctx; - products = new ArrayList(); - } - - public void addMovementLine(StockMovementBean bean) - { - noOfProducts = noOfProducts.add(Env.ONE); - - products.add(bean); - } - - public void removeMovementLine(StockMovementBean bean) - { - products.remove(bean); - noOfProducts = noOfProducts.subtract(Env.ONE); - } - - public void clear() - { - products.clear(); - noOfProducts = Env.ZERO; - } - - public BigDecimal getNoOfProducts() - { - return noOfProducts; - } - - public ArrayList getStockProducts() throws OperationException - { - ArrayList productList = new ArrayList(); - StockMovementBean bean = null; - - Iterator iter = products.iterator(); - - while (iter.hasNext()) - { - bean = iter.next(); - - productList.add(bean); - } - - return productList; - } - - public boolean hasProduct(StockMovementBean stock) - { - return products.contains(stock); - } -} diff --git a/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockManager.java b/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockManager.java deleted file mode 100644 index 62506a229d..0000000000 --- a/posterita/posterita/src/main/org/posterita/businesslogic/stock/StockManager.java +++ /dev/null @@ -1,1489 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on Aug 19, 2005 by alok - * - */ -package org.posterita.businesslogic.stock; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.Iterator; -import java.util.Properties; -import java.util.TreeSet; - -import org.compiere.model.MAttribute; -import org.compiere.model.MBPartner; -import org.compiere.model.MLocator; -import org.compiere.model.MPriceList; -import org.compiere.model.MProduct; -import org.compiere.model.MProductPrice; -import org.compiere.model.MStorage; -import org.compiere.model.MTax; -import org.compiere.model.MUOM; -import org.compiere.model.MWarehouse; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.posterita.Constants; -import org.posterita.beans.AttributeValuesPair; -import org.posterita.beans.InventoryCartBean; -import org.posterita.beans.InventoryLineBean; -import org.posterita.beans.ItemBean; -import org.posterita.beans.MMovementCartBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.ProductBean; -import org.posterita.beans.ShoppingCartBean; -import org.posterita.beans.StockMovementBean; -import org.posterita.businesslogic.AttributeValuesManager; -import org.posterita.businesslogic.POSProductManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.businesslogic.administration.WarehouseManager; -import org.posterita.core.utils.FormatBigDecimal; -import org.posterita.exceptions.InputQuantityLessThanZeroException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.exceptions.ProductNotOnPriceListException; -import org.posterita.exceptions.QuantityNotAvailableException; -import org.posterita.exceptions.TotalQuantityLessThanZeroException; -import org.posterita.exceptions.UOMValuePrecisionNotValidException; -import org.posterita.lib.UdiConstants; - - -public class StockManager -{ - - public static Comparator getDistinctByAttributeComparator(Properties ctx, int attributeID) - { - final MAttribute attribute = new MAttribute(ctx, attributeID, null); - Comparator c = new Comparator() - { - - public int compare(ProductBean o1, ProductBean o2) - { - ProductBean bean1 = (ProductBean) o1; - ProductBean bean2 = (ProductBean) o2; - - KeyNamePair attributeValuePair1 = (KeyNamePair) bean1.getAttributeValuesMap().get(attribute.getName()); - KeyNamePair attributeValuePair2 = (KeyNamePair) bean2.getAttributeValuesMap().get(attribute.getName()); - - - Integer attributeValueID1 = Integer.valueOf(attributeValuePair1.getKey()); - Integer attributeValueID2 = Integer.valueOf(attributeValuePair2.getKey()); - return (attributeValueID1.compareTo(attributeValueID2)); - } - - }; - - return c; - - } - - - public static ShoppingCartBean addToCart(Properties ctx,OrderLineBean bean, ShoppingCartBean cartBean, String backOrder) throws OperationException - { - validateInputQuantity(ctx,bean, backOrder); - - Integer priceListId = bean.getPriceListId(); - if(priceListId == null) - { - priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - } - - ArrayList oldItems; - if (cartBean == null) - { - cartBean = new ShoppingCartBean(); - String currency = PriceListManager.getCurrency(ctx, priceListId); - cartBean.setCurrency(currency); - oldItems = new ArrayList(); - } - else - { - oldItems = cartBean.getItems(); - } - - ArrayList itemsToBeAdded = getItems(ctx, bean, backOrder); - - oldItems = addToItemList(oldItems, itemsToBeAdded,true); - setPOSItemPrices(ctx, priceListId, oldItems, true); - - cartBean.setItems(oldItems); - cartBean.setTotalPrice(setGrandTotal(oldItems)); - cartBean.setPricelistId(priceListId); - - return cartBean; - } - - - public static BigDecimal setGrandTotal(ArrayList items) - { - Iterator iter = items.iterator(); - - BigDecimal grandTotalPrice = new BigDecimal(0); - - while (iter.hasNext()) - { - ItemBean bean = (ItemBean) iter.next(); - - grandTotalPrice = grandTotalPrice.add(bean.getPrice()); - } - - return FormatBigDecimal.currency(grandTotalPrice); - } - - @SuppressWarnings("unchecked") - public static ShoppingCartBean addToPOSCart(Properties ctx,OrderLineBean bean, ShoppingCartBean cartBean,boolean isSales,boolean ifAdd) - throws OperationException,ProductNotFoundException,ProductNotOnPriceListException, - UOMValuePrecisionNotValidException - { - //setPrice for the items - - ArrayList oldItems; - if (cartBean == null) - { - cartBean = new ShoppingCartBean(); - oldItems = new ArrayList(); - } - else - { - oldItems = cartBean.getItems(); - } - - ArrayList oldItemsClone = (ArrayList)oldItems.clone(); - - ArrayList itemsToBeAdded = getPOSItems(ctx, bean); - oldItems = addToItemList(oldItemsClone, itemsToBeAdded,ifAdd); - // need to take into account business partner price list - - Integer priceListId = bean.getPriceListId(); - Integer bpartnerId = bean.getBpartnerId(); - if (priceListId == null && bpartnerId != null) - { - MBPartner bpartner = MBPartner.get(ctx, bpartnerId); - priceListId = bpartner.getM_PriceList_ID(); - } - - oldItems = setPOSItemPrices(ctx, priceListId, oldItems, isSales); - cartBean.setItems(oldItems); - cartBean.setTotalPrice(setGrandTotal(oldItems)); - cartBean.setPricelistId(priceListId); - - return cartBean; - } - - public static ArrayList setItemPrices(Properties ctx, ArrayList items) throws OperationException - { - -// UDIMPriceListVersion udiSalesPriceListVersion = (UDIMPriceListVersion) GenericSystemObjectsFactory.getFactoryInstance().get(ctx, GenericSystemObjectsFactory.SALES_PRICELV_ID); - int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - MPriceList priceList = MPriceList.get(ctx, priceListId, null); - int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); - Iterator iter = items.iterator(); - - ItemBean bean; - BigDecimal pricePerUnit; - BigDecimal totalPrice; - - while (iter.hasNext()) - { - bean = (ItemBean) iter.next(); - - pricePerUnit = ProductManager.getListPrice(ctx, priceListVersionId, bean.getProductId(), priceList.isSOPriceList(), null); - - totalPrice = pricePerUnit.multiply(new BigDecimal(bean.getQty().intValue())); - - totalPrice = FormatBigDecimal.currency(totalPrice); - - bean.setActualPrice(pricePerUnit); - bean.setPrice(totalPrice); - } - - return items; - } - - public static ArrayList setPOSItemPrices(Properties ctx, ArrayList items,boolean isSales) throws ProductNotOnPriceListException,OperationException - { - ArrayList list = setPOSItemPrices(ctx, 0, items, isSales); - - return list; - } - - - public static ArrayList setPOSItemPrices(Properties ctx, int priceListId, ArrayList items,boolean isSales) throws ProductNotOnPriceListException,OperationException - { - if (items == null || items.size() == 0) - { - return items; - } - - if (priceListId == 0) - { - priceListId = POSTerminalManager.getPriceListId(ctx, isSales); - } - - MPriceList priceList = MPriceList.get(ctx, priceListId, null); - int precision = MPriceList.getStandardPrecision(ctx, priceListId); - int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); - - Iterator iter = items.iterator(); - - ItemBean bean; - - Boolean isTaxIncluded = priceList.isTaxIncluded(); - BigDecimal listPrice = Env.ZERO; - BigDecimal limitPrice = Env.ZERO; - BigDecimal actualPrice = Env.ZERO; - - BigDecimal lineQty = Env.ZERO; - BigDecimal actualLineInclTotalPrice = Env.ZERO; - BigDecimal lineTotalTax = Env.ZERO; - BigDecimal lineUnitTax = Env.ZERO; - BigDecimal lineInclLimitPrice = Env.ZERO; - - BigDecimal orderInclTotal = Env.ZERO; - BigDecimal orderTaxTotal = Env.ZERO; - BigDecimal orderPriceLimitTotal = Env.ZERO; - - BigDecimal qtyTotal= Env.ZERO; - - while (iter.hasNext()) - { - bean = (ItemBean) iter.next(); - MProduct product = new MProduct(ctx,bean.getProductId(),null); - MProductPrice price = MProductPrice.get(ctx, priceListVersionId, bean.getProductId(), null); - if (price == null) - { - throw new ProductNotOnPriceListException(""+updateProductLink(ctx,bean.getProductId())); - } - - listPrice = price.getPriceList(); - limitPrice = price.getPriceLimit(); - bean.setListPrice(listPrice); - - lineQty = bean.getQty(); - BigDecimal lineTotal = listPrice.multiply(lineQty); - - int[] taxIds = MTax.getAllIDs(MTax.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_TAXCATEGORY_ID=" +product.getC_TaxCategory_ID() + " and isActive='Y'",null); - if (taxIds == null || taxIds.length == 0) - { - throw new OperationException("no tax Category for the product, or it has been set inactive"); - } - - MTax tax = new MTax(ctx,taxIds[0],null); - lineTotalTax = tax.calculateTax(lineTotal, isTaxIncluded, 12); - BigDecimal taxMulFactor = (tax.getRate().divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_UP)).add(Env.ONE); - - bean.setIsTaxIncluded(isTaxIncluded); - - BigDecimal discountedLineInclUnitPrice = Env.ZERO; - BigDecimal discountPercentOnLine = Env.ZERO; - BigDecimal discountedLineTotal = Env.ZERO; - bean.setDiscountedLinePrice(listPrice); - - if (bean.getIsDiscountOnInclUnitPrice()) - { - discountedLineInclUnitPrice = bean.getDiscountedInclUnitPrice().setScale(2, BigDecimal.ROUND_HALF_UP); - bean.setDiscountedLinePrice(discountedLineInclUnitPrice); - } - else if (bean.getIsDiscountOnPercentage()) - { - discountPercentOnLine = bean.getDiscountPercent(); - } - else if (bean.getIsDiscountOnTotal()) - { - discountedLineTotal = bean.getPrice(); - } - - if (discountPercentOnLine != null && discountPercentOnLine.compareTo(Env.ZERO)!=0) - { - BigDecimal discFactor = (Env.ONEHUNDRED.subtract(discountPercentOnLine)).divide(Env.ONEHUNDRED, 12, RoundingMode.HALF_DOWN); - actualLineInclTotalPrice = (lineTotal).multiply(discFactor).setScale(2, RoundingMode.HALF_UP); - - } - else if (discountedLineInclUnitPrice != null && discountedLineInclUnitPrice.compareTo(Env.ZERO)!=0) - { - if(isTaxIncluded) - { - actualLineInclTotalPrice = ((discountedLineInclUnitPrice.multiply(taxMulFactor)).setScale(2, BigDecimal.ROUND_HALF_UP)).multiply(lineQty); - } - else - { - actualLineInclTotalPrice = (discountedLineInclUnitPrice.multiply(lineQty)).setScale(2, BigDecimal.ROUND_HALF_UP); - } - } - else - { - actualLineInclTotalPrice = lineTotal; - } - - actualPrice = actualLineInclTotalPrice.divide(lineQty).setScale(2, RoundingMode.HALF_UP); - lineUnitTax = tax.calculateTax(actualPrice, isTaxIncluded, 12).setScale(2, RoundingMode.HALF_UP); - lineTotalTax = lineUnitTax.multiply(lineQty); - - if (isTaxIncluded) - { - BigDecimal unitExclPrice = (actualPrice.subtract(lineUnitTax)).setScale(precision, RoundingMode.HALF_DOWN); - bean.setUnitPrice(unitExclPrice); - bean.setInclPrice(actualPrice); - - lineInclLimitPrice = limitPrice; - bean.setPriceLimit(lineInclLimitPrice); - } - else - { - BigDecimal unitInclPrice = (actualPrice.add(lineUnitTax)).setScale(precision, RoundingMode.HALF_DOWN); - bean.setInclPrice(unitInclPrice); - bean.setUnitPrice(actualPrice); - - actualLineInclTotalPrice = (actualLineInclTotalPrice.add(lineTotalTax)).setScale(precision, RoundingMode.HALF_DOWN); - lineInclLimitPrice = limitPrice.add(tax.calculateTax(limitPrice, false, 12)); - bean.setPriceLimit(lineInclLimitPrice.setScale(precision, RoundingMode.HALF_DOWN)); - } - - bean.setPrice(actualLineInclTotalPrice); - bean.setTaxAmt(lineTotalTax.setScale(precision, RoundingMode.HALF_DOWN)); - bean.setTaxRate(tax.getRate()); - bean.setUom(product.getUOMSymbol()); - - orderTaxTotal = orderTaxTotal.add(lineTotalTax).setScale(precision, RoundingMode.HALF_DOWN); - orderInclTotal = orderInclTotal.add(actualLineInclTotalPrice).setScale(precision, RoundingMode.HALF_DOWN); - orderPriceLimitTotal = orderPriceLimitTotal.add(lineInclLimitPrice.multiply(bean.getQty())); - qtyTotal = qtyTotal.add(bean.getQty()); - - bean.setPriceTotal(orderInclTotal); - bean.setTaxTotal(orderTaxTotal); - bean.setgrandTotal(orderInclTotal); - bean.setQtyTotal(qtyTotal); - bean.setPriceLimitTotal(orderPriceLimitTotal); - } - - return items; - } - - public static ArrayList getItems(Properties ctx, OrderLineBean bean, String backOrder) throws OperationException - { - ArrayList orderLines = bean.getOrderLineList(); - - Iterator iter = orderLines.iterator(); - - OrderLineBean orderLineBean; - - ItemBean itemBean; - ArrayList items = new ArrayList(); - - while (iter.hasNext()) - { - orderLineBean = (OrderLineBean) iter.next(); - - itemBean = new ItemBean(); - itemBean.setProductId(orderLineBean.getProductId()); - itemBean.setDescription(ProductManager.getProductName(ctx, orderLineBean.getProductId().intValue())); - itemBean.setQty(orderLineBean.getQuantity()); - itemBean.setBackOrder(backOrder); - - if (orderLineBean.getQuantity().intValue() != 0) - items.add(itemBean); - } - - return items; - } - - public static ArrayList getPOSItems(Properties ctx, OrderLineBean orderLineBean) - throws OperationException,ProductNotFoundException,UOMValuePrecisionNotValidException - { - - ItemBean itemBean; - ArrayList items = new ArrayList(); - int productId = 0; - - if (orderLineBean.getProductId()==null) - { - productId = getProductIdFromBarCode(ctx,orderLineBean.getBarCode()); - orderLineBean.setProductId(Integer.valueOf(productId)); - } - else - { - productId = orderLineBean.getProductId(); - } - - MProduct product = MProduct.get(ctx, productId); - if (product.get_ID() == 0 || product.isActive()==false) - { - throw new ProductNotFoundException("product not found or is either deActivated"); - } - - if (orderLineBean.getQuantity()==null) - { - orderLineBean.setQuantity(Env.ONE); - } - - BigDecimal qty = orderLineBean.getQuantity(); - String barcode = product.getUPC(); - String name = product.getName(); - String description = product.getDescription(); - int uomPrecision = validateProductUOMQuantityPrecision(ctx, productId, qty); - - itemBean = new ItemBean(); - itemBean.setProductId(productId); - itemBean.setProductName(name); - itemBean.setBarCode(barcode); - itemBean.setPriceListId(orderLineBean.getPriceListId()); - itemBean.setDescription(description); - itemBean.setQty(orderLineBean.getQuantity().setScale(uomPrecision, BigDecimal.ROUND_HALF_UP)); - itemBean.setIsDiscountOnInclUnitPrice(false); - itemBean.setIsDiscountOnPercentage(false); - itemBean.setIsDiscountOnTotal(false); - itemBean.setDiscountedLinePrice(Env.ZERO); - items.add(itemBean); - - return items; - } - - - public static ArrayList addToItemList(ArrayList items, ArrayList itemsToBeAdded, boolean ifAdd) throws ProductNotOnPriceListException, OperationException - { - Iterator iter = itemsToBeAdded.iterator(); - ItemBean itemBean; - - ItemBean foundItemBean; - while (iter.hasNext()) - { - itemBean = (ItemBean) iter.next(); - - foundItemBean = findItem(itemBean, items); - - if (foundItemBean == null) - items.add(itemBean); - else - { - itemBean.updateQuantity(foundItemBean, itemBean,ifAdd); - BigDecimal finalQty=foundItemBean.getQty(); - - if(Env.ZERO.compareTo(finalQty) == 0) - deleteItemFromList(items,foundItemBean.getProductId()); - } - } - - return items; - } - - - public static ArrayList deleteItemFromList(ArrayList items, Integer productId) throws ProductNotOnPriceListException, OperationException - { - ItemBean itemBean = new ItemBean(); - - itemBean.setProductId(productId); - items.remove(itemBean); - - - - return items; - } - - - - public static ItemBean findItem(ItemBean queryItemBean, ArrayList items) - { - int indexOfFound = items.indexOf(queryItemBean); - - if (indexOfFound == -1) - return null; - - ItemBean found = (ItemBean) items.get(indexOfFound); - - return found; - } - - public static InventoryCartBean findInventoryLine(InventoryCartBean queryItemBean, ArrayList items) - { - int indexOfFound = items.indexOf(queryItemBean); - - if (indexOfFound == -1) - return null; - - InventoryCartBean found = (InventoryCartBean) items.get(indexOfFound); - - return found; - } - - - @SuppressWarnings("unchecked") - public static ArrayList deleteItemFromPOSList(Properties ctx,ArrayList items, Integer productId,boolean isSales) throws ProductNotOnPriceListException, OperationException - { - ItemBean itemBean = new ItemBean(); - - itemBean.setProductId(productId); - items.remove(itemBean); - - setPOSItemPrices(ctx,items,true); - - return items; - } - - public static ArrayList updateItemFromPOSList(Properties ctx, Integer priceListId, ArrayList items, Integer productId, BigDecimal quantity) throws ProductNotOnPriceListException, OperationException - { - - if (items == null) - { - return items; - } - - ItemBean itemBean = new ItemBean(); - itemBean.setProductId(productId); - - - int index = items.indexOf(itemBean); - - if(index != -1) - { - itemBean = (ItemBean) items.get(index); - - if(quantity.doubleValue() == 0.0d) - { - items.remove(index); - } - else - { - itemBean.setQty(quantity); - } - - setPOSItemPrices(ctx,priceListId, items, true); - } - - return items; - } - - public static ArrayList updateItemFromInventoryList(Properties ctx, Integer priceListId, ArrayList items, Integer productId, Integer quantity) throws ProductNotOnPriceListException, OperationException - { - - if (items == null) - { - return items; - } - - ItemBean itemBean = new ItemBean(); - itemBean.setProductId(productId); - - - int index = items.indexOf(itemBean); - - if(index != -1) - { - itemBean = (ItemBean) items.get(index); - - if(quantity.intValue() == 0) - { - items.remove(index); - } - else - { - itemBean.setQtyCount(new BigDecimal(quantity.intValue())); - } - - setInventoryItemPrices(ctx,priceListId, items, true); - } - - return items; - } - - - public static ArrayList updateItemFromMMovementList(Properties ctx, Integer priceListId, ArrayList items, Integer productId, Integer quantity) throws ProductNotOnPriceListException, OperationException - { - - if (items == null) - { - return items; - } - - ItemBean itemBean = new ItemBean(); - itemBean.setProductId(productId); - - - int index = items.indexOf(itemBean); - - if(index != -1) - { - itemBean = (ItemBean) items.get(index); - - if(quantity.intValue() == 0) - { - items.remove(index); - } - else - { - itemBean.setQtyToMove(new BigDecimal(quantity.intValue())); - } - - setMMovementItemCosts(ctx, priceListId, items, false); - } - - return items; - } - - public static ArrayList updateNoOfPack(Properties ctx, Integer priceListId, ArrayList items, Integer productId, Integer noOfPack) throws ProductNotOnPriceListException, OperationException - { - - if (items == null) - { - return items; - } - - ItemBean itemBean = new ItemBean(); - itemBean.setProductId(productId); - - - int index = items.indexOf(itemBean); - - if(index != -1) - { - itemBean = (ItemBean) items.get(index); - - if(noOfPack.intValue() == 0) - { - items.remove(index); - } - else - { - itemBean.setNoOfPack(noOfPack); - } - - } - - return items; - } - - public static boolean validateInputQuantity(Properties ctx,OrderLineBean bean, String backOrder) throws OperationException - { - - boolean valid = checkForNegativeQuantity(ctx, bean); - - if (!valid) - throw new InputQuantityLessThanZeroException("Please enter a quantity greater than 0"); - - boolean totalQtyValid = checkTotalQuantityGreaterThanZero(ctx,bean); - - if(!totalQtyValid) - throw new TotalQuantityLessThanZeroException("Please enter a quantity per Size!"); - - validateAvailableStock(ctx, bean, backOrder); - - return true; - } - - public static void validateAvailableStock(Properties ctx, OrderLineBean bean, String backOrder) throws OperationException - { - //Here we are assuming that if backOrder is null - //then we take it as NO. - //Normally what I have understood from previous discussions - //we should always display all products that are available - //In some way it means that we have to take it as NO when backOrder is null - if (backOrder == null) - backOrder = Constants.YES_CHAR; - - if (backOrder.equals(Constants.YES_CHAR)) - return; - - ArrayList orderLineList = bean.getOrderLineList(); - - Iterator iter = orderLineList.iterator(); - - OrderLineBean bean2; - boolean isInstock; - while (iter.hasNext()) - { - bean2 = (OrderLineBean) iter.next(); - isInstock = isInstock(ctx, bean2); - - if (!isInstock) - { - QuantityNotAvailableException exception = new QuantityNotAvailableException(); - MProduct product = new MProduct(ctx, bean2.getProductId().intValue(), null); - AttributeValuesPair pair = AttributeValuesManager.retrieveAttributeValues(ctx, product.getM_AttributeSetInstance_ID()); - exception.setMessage(pair.getSizeAttributeValue().getName()); - throw exception; - } - - } - } - - - private static boolean checkForNegativeQuantity(Properties ctx, OrderLineBean bean) - { - ArrayList orderLines = bean.getOrderLineList(); - - Iterator iter = orderLines.iterator(); - - OrderLineBean orderLineBean; - - while (iter.hasNext()) - { - orderLineBean = (OrderLineBean) iter.next(); - - if (orderLineBean.getQuantity().intValue() < 0) - return false; - - } - - return true; - } - - private static boolean checkTotalQuantityGreaterThanZero(Properties ctx, OrderLineBean bean) - { - ArrayList orderLines = bean.getOrderLineList(); - - Iterator iter = orderLines.iterator(); - - OrderLineBean orderLineBean; - - int totalQuantity = 0; - - while (iter.hasNext()) - { - orderLineBean = (OrderLineBean) iter.next(); - - totalQuantity = totalQuantity + orderLineBean.getQuantity().intValue(); - } - - if (totalQuantity == 0) - return false; - - return true; - } - - private static boolean isInstock(Properties ctx, OrderLineBean bean) throws OperationException - { - int posteritaWarehouseIds[] = MWarehouse.getAllIDs(MWarehouse.Table_Name, " ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ad_org_id=" + Env.getAD_Org_ID(ctx), null); - - if (posteritaWarehouseIds.length == 0) - throw new OperationException("No warehouse found"); - - if (posteritaWarehouseIds.length > 1) - throw new OperationException("Expected one warehouse for organisation Tamak but got " + posteritaWarehouseIds.length); - - MWarehouse warehouse = new MWarehouse(ctx, posteritaWarehouseIds[0], null); - - MLocator defaultWarehouseLocator = warehouse.getDefaultLocator(); - - int qtyAvailable = getQtyAvailable(ctx, bean.getProductId().intValue(), defaultWarehouseLocator.get_ID()); - - int qtyEntered = bean.getQuantity().intValue(); - - if (qtyEntered > qtyAvailable) - return false; - - return true; - } - - private static int getQtyAvailable(Properties ctx, int productId, int locatorId) throws OperationException - { - String sql = "select sum(qtyonhand) from m_storage" + - " where m_product_id=" + productId + - " and m_locator_id=" + locatorId + - " and qtyreserved=0" + - " and ad_client_id=" + Env.getAD_Client_ID(ctx) + - " and ad_org_id=" + Env.getAD_Org_ID(ctx); - - PreparedStatement ps = DB.prepareStatement(sql, null); - ResultSet rs = null; - - int qtyAvailable = 0; - try - { - rs = ps.executeQuery(); - - while (rs.next()) - { - qtyAvailable = rs.getInt(1); - } - - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - ps.close(); - } - catch (SQLException e1) - { - throw new OperationException(e1); - } - - ps = null; - } - - return qtyAvailable; - } - - - public static ArrayList getDistinctByDescription(Properties ctx, ArrayList productList) - { - Comparator c = new Comparator() - { - - public int compare(ProductBean o1, ProductBean o2) - { - ProductBean bean1 = (ProductBean) o1; - ProductBean bean2 = (ProductBean) o2; - - return (bean1.getDescription().compareToIgnoreCase(bean2.getDescription())); - } - - }; - - TreeSet set = new TreeSet(c); - set.addAll(productList); - - ArrayList distinctBy = new ArrayList(set); - - return distinctBy; - } - - public static String setBackOrderFilter(Properties ctx, String sql, String backOrder) - { - if (backOrder.equals("N")) - sql = sql +" and s.qtyonhand > s.qtyreserved"; - - return sql; - } - - - public static int getProductIdFromBarCode(Properties ctx,String barCode) throws OperationException - { - String sql = "select m_product_id from m_product where UPC='"+barCode+"'" - +" and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - int productId=0; - - try - { - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) - { - productId=rs.getInt(1); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - //begin e-evolution is necessary find also search key - if (productId == 0) - { - sql = "select m_product_id from m_product where value='"+barCode+"'" - +" and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); - - System.out.println("BarCode: " + barCode); - - pstmt = DB.prepareStatement(sql, null); - - try - { - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) - { - productId=rs.getInt(1); - } - rs.close(); - } - catch (SQLException e) - { - throw new OperationException(e); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - } - //end e-evolution is necessary find also search key - - return productId; - } - - private static String updateProductLink(Properties ctx,int productId) - { - - String link = "" - + "here" - + ""; - String str = " Click " - + link - + " to update the product"; - - return str; - - } - - public static int validateProductUOMQuantityPrecision(Properties ctx, Integer productId, BigDecimal qty) throws UOMValuePrecisionNotValidException - { - int enteredPrecision = getQtyPrecision(qty); - - MProduct product = new MProduct(ctx,productId,null); - int uomPrecision = MUOM.getPrecision(ctx, product.getC_UOM_ID()); - - // validate UOM precision and quantity precision - if ( enteredPrecision > uomPrecision) - { - throw new UOMValuePrecisionNotValidException( - "The precision entered for the quantity field of the product: '"+product.getName() - + "' should not be greater than " + uomPrecision); - } - - return uomPrecision; - } - - public static int getQtyPrecision(BigDecimal qty) - { - int enteredPrecision = 0; - int position = 0; - int count = 0; - - String s = qty.toString(); - - - position = s.indexOf('.') + 1; // position of decimal point - - if (position > 0) - { - int i = s.length() - 1; - - while (s.charAt(i) == '0') // count no of trailing zeroes (to be removed) - { - count++; - i--; - } - - enteredPrecision = s.length() - position - count; - } - - return enteredPrecision; - } - - public static ArrayList getInventoryLines(Properties ctx, InventoryLineBean bean) - throws OperationException,ProductNotFoundException,UOMValuePrecisionNotValidException - { - - ItemBean itemBean; - ArrayList lines = new ArrayList(); - int productId = 0; - - if (bean.getProductId()==null) - { - productId = getProductIdFromBarCode(ctx,bean.getBarCode()); - bean.setProductId(Integer.valueOf(productId)); - } - else - { - productId = bean.getProductId(); - } - - MProduct product = MProduct.get(ctx, productId); - if (product.get_ID() == 0 || product.isActive()==false) - { - throw new ProductNotFoundException("product not found or is either deActivated"); - } - - if(bean.getQtyCsv() == null) - { - bean.setQtyCsv(Env.ZERO); - } - - if(bean.getQtyCount() == null) - { - bean.setQtyCount(Env.ONE); - } - - BigDecimal qty = bean.getQtyCount(); - String barcode = product.getUPC(); - String name = product.getName(); - String description = product.getDescription(); - int uomPrecision = validateProductUOMQuantityPrecision(ctx, productId, qty); - - ProductBean pBean = POSProductManager.getProduct(ctx, barcode, null); - - itemBean = new ItemBean(); - itemBean.setProductId(productId); - itemBean.setProductName(name); - itemBean.setBarCode(barcode); - itemBean.setPriceListId(bean.getPriceListId()); - itemBean.setDescription(description); - itemBean.setQtyCount((bean.getQtyCount().setScale(uomPrecision, BigDecimal.ROUND_HALF_UP))); - itemBean.setQtyBook(pBean.getQtyOnHand()); - itemBean.setQtyCsv(bean.getQtyCsv()); - - lines.add(itemBean); - - return lines; - } - - public static ArrayList addToInventoryList(ArrayList items, ArrayList itemsToBeAdded, boolean ifAdd) throws ProductNotOnPriceListException, OperationException - { - Iterator iter = itemsToBeAdded.iterator(); - ItemBean itemBean; - - ItemBean foundItemBean; - while (iter.hasNext()) - { - itemBean = (ItemBean) iter.next(); - - foundItemBean = findItem(itemBean, items); - - if (foundItemBean == null) - items.add(itemBean); - else - { - itemBean.updateQuantityCount(foundItemBean, itemBean,ifAdd); - int finalQty=foundItemBean.getQtyCount().intValue(); - - itemBean.updateQuantityCsv(foundItemBean, itemBean,ifAdd); - int finalQtycsv=foundItemBean.getQtyCsv().intValue(); - - if(finalQty==0) - deleteItemFromList(items,foundItemBean.getProductId()); - } - - - } - - return items; - } - - public static ArrayList setInventoryItemPrices(Properties ctx, int priceListId, ArrayList items,boolean isSales) throws ProductNotOnPriceListException,OperationException - { - if (items == null || items.size() == 0) - { - return items; - } - - if (priceListId == 0) - { - priceListId = POSTerminalManager.getPriceListId(ctx, isSales); - } - - int precision = MPriceList.getStandardPrecision(ctx, priceListId); - - - int priceListVersionId = 0; - priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); - //UDIMPriceListVersion udiSalesPriceListVersion = (UDIMPriceListVersion) GenericSystemObjectsFactory.getFactoryInstance().get(ctx, GenericSystemObjectsFactory.SALES_PRICELV_ID); - Iterator iter = items.iterator(); - - ItemBean bean; - BigDecimal priceStd = Env.ZERO; - BigDecimal priceList = Env.ZERO; - BigDecimal priceLimit = Env.ZERO; - BigDecimal totalPrice = Env.ZERO; - BigDecimal totalTax = Env.ZERO; - BigDecimal discount = Env.ZERO; - - BigDecimal total = Env.ZERO; - BigDecimal taxTotal = Env.ZERO; - BigDecimal priceTotal = Env.ZERO; - BigDecimal qtyTotal= Env.ZERO; - - while (iter.hasNext()) - { - bean = (ItemBean) iter.next(); - - int product_id = bean.getProductId(); - - MProductPrice price = MProductPrice.get(ctx, priceListVersionId, product_id, null); - - if (price == null) - { - throw new ProductNotOnPriceListException(""+updateProductLink(ctx,bean.getProductId())); - } - - priceStd = price.getPriceStd(); - priceList = price.getPriceList(); - priceLimit = price.getPriceLimit(); - - /*if(priceList.doubleValue() != 0.0) - { - discount = priceStd.subtract(priceList) - .multiply(new BigDecimal(100)) - .divide(priceList, precision, BigDecimal.ROUND_HALF_UP); - }*/ - - - MProduct product = new MProduct(ctx,bean.getProductId(),null); - - int [] taxIds = MTax.getAllIDs(MTax.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_TAXCATEGORY_ID=" +product.getC_TaxCategory_ID() + " and isActive='Y'",null); - if(taxIds == null || taxIds.length == 0) - { - throw new OperationException("no tax Category for the product, or it has been set inactive"); - } - - MTax tax = new MTax(ctx,taxIds[0],null); - BigDecimal taxAmt = tax.calculateTax(priceList,false,4); - - bean.setUnitPrice(priceList); - bean.setDiscountPercent(discount); - - totalPrice = priceList.multiply(bean.getQtyCount()); - totalPrice = totalPrice.setScale(precision, RoundingMode.HALF_UP); - totalTax = taxAmt.multiply(bean.getQtyCount()); - totalTax = totalTax.setScale(precision, RoundingMode.HALF_UP); - bean.setStandardPrice(totalPrice); - bean.setTaxAmt(totalTax); - bean.setUom(product.getUOMSymbol()); - bean.setPrice(totalPrice.add(totalTax)); - bean.setActualPrice(totalPrice.add(totalTax)); //initially price and the actual price are same - - priceTotal = priceTotal.add(totalPrice); - priceTotal = priceTotal.setScale(precision, RoundingMode.HALF_UP); - - BigDecimal priceLimitTotal = Env.ZERO; - - priceLimitTotal = priceLimitTotal.add(priceLimit.multiply(bean.getQtyCount())); - taxAmt = tax.calculateTax(priceLimitTotal,false,4); - priceLimitTotal = priceLimitTotal.add(taxAmt); - priceLimitTotal = priceLimitTotal.setScale(precision, RoundingMode.HALF_UP); - - taxTotal = taxTotal.add(totalTax); - taxTotal = taxTotal.setScale(precision, RoundingMode.HALF_UP); - total = total.add(totalPrice.add(totalTax)); - total = total.setScale(precision, RoundingMode.HALF_UP); - qtyTotal = qtyTotal.add(bean.getQtyCount()); - - bean.setPriceTotal(priceTotal); - bean.setTaxTotal(taxTotal); - bean.setgrandTotal(total); - bean.setQtyTotal(qtyTotal); - - } - - return items; - } - - public static InventoryCartBean addToInventoryCart(Properties ctx,InventoryLineBean bean, InventoryCartBean cartBean,boolean isSales,boolean ifAdd) - throws OperationException,ProductNotFoundException,ProductNotOnPriceListException, - UOMValuePrecisionNotValidException - { - //setPrice for the items - - ArrayList oldItems; - if (cartBean == null) - { - cartBean = new InventoryCartBean(); - oldItems = new ArrayList(); - } - else - { - oldItems = cartBean.getItems(); - } - - ArrayList oldItemsClone = (ArrayList)oldItems.clone(); - ArrayList itemsToBeAdded = getInventoryLines(ctx, bean); - oldItems = addToInventoryList(oldItemsClone, itemsToBeAdded,ifAdd); - // need to take into account business partner price list - - Integer priceListId = bean.getPriceListId(); - - if(priceListId == null || priceListId == 0) - { - priceListId = POSTerminalManager.getPriceListId(ctx, isSales); - } - - oldItems = setInventoryItemPrices(ctx, priceListId, oldItems, isSales); - cartBean.setItems(oldItems); - cartBean.setTotalPrice(setGrandTotal(oldItems)); - cartBean.setPricelistId(priceListId); - - return cartBean; - } - - - /** - * Add To movement Cart (Stock Transfer Cart) - * @param ctx - * @param bean - * @param cartBean - * @param isSales - * @param ifAdd - * @return - * @throws OperationException - * @throws ProductNotFoundException - * @throws ProductNotOnPriceListException - */ - public static MMovementCartBean addToMovementCart(Properties ctx,StockMovementBean bean, MMovementCartBean cartBean, boolean isSales, boolean ifAdd) throws OperationException,ProductNotFoundException,ProductNotOnPriceListException - { - //setPrice for the items - - ArrayList oldItems; - if (cartBean == null) - { - cartBean = new MMovementCartBean(); - oldItems = new ArrayList(); - } - else - { - oldItems = cartBean.getItems(); - } - - ArrayList oldItemsClone = (ArrayList)oldItems.clone(); - ArrayList itemsToBeAdded = getMMovementItems(ctx, bean); - oldItems = addToMMovementList(ctx, oldItemsClone, itemsToBeAdded,ifAdd); - // need to take into account business partner price list - - Integer priceListId = POSTerminalManager.getPriceListId(ctx, isSales); - - oldItems = setMMovementItemCosts(ctx, priceListId, oldItems, isSales); - cartBean.setItems(oldItems); - cartBean.setPricelistId(priceListId); - - return cartBean; - } - - /** - * Get Movement Items - * @param ctx - * @param bean - * @return - * @throws OperationException - * @throws ProductNotFoundException - */ - public static ArrayList getMMovementItems(Properties ctx, StockMovementBean bean) throws OperationException,ProductNotFoundException - { - - ItemBean itemBean; - ArrayList stockItems = new ArrayList(); - int productId = 0; - - if (bean.getProductId()==null) - { - productId = getProductIdFromBarCode(ctx,bean.getBarCode()); - bean.setProductId(Integer.valueOf(productId)); - } - else - { - productId = bean.getProductId(); - } - - MProduct product = MProduct.get(ctx, productId); - if (product.get_ID() == 0 || product.isActive()==false) - { - throw new ProductNotFoundException("product not found or is either deActivated"); - } - - if(bean.getQtyToMove() == null) - { - bean.setQtyToMove(Env.ONE); - } - - if(bean.getNoOfPack() == null) - { - bean.setNoOfPack(1); - } - - BigDecimal qty = bean.getQtyToMove(); - int noOfPack = bean.getNoOfPack(); - String barcode = product.getUPC(); - String name = product.getName(); - String description = product.getDescription(); - int uomPrecision = validateProductUOMQuantityPrecision(ctx, productId, qty); - - int warehouseId = WarehouseManager.getDefaultWarehouse(ctx).getM_Warehouse_ID(); - MLocator locator = MLocator.get(ctx, warehouseId, "", "0", "0", "0"); - BigDecimal qtyAvailable = MStorage.getQtyAvailable(warehouseId, locator.get_ID(), productId, 0, null); - - itemBean = new ItemBean(); - itemBean.setProductId(productId); - itemBean.setProductName(name); - itemBean.setBarCode(barcode); - itemBean.setUnitsPerPack(product.getUnitsPerPack()); - itemBean.setDescription(description); - itemBean.setUom(product.getUOMSymbol()); - itemBean.setQtyToMove(qty); - itemBean.setNoOfPack(noOfPack); - itemBean.setQtyBook(qtyAvailable); - - stockItems.add(itemBean); - - return stockItems; - } - - /** - * Add Items to Movement List - * @param ctx - * @param items - * @param itemsToBeAdded - * @param ifAdd - * @return - * @throws ProductNotOnPriceListException - * @throws OperationException - */ - public static ArrayList addToMMovementList(Properties ctx, ArrayList items, ArrayList itemsToBeAdded, boolean ifAdd) throws ProductNotOnPriceListException, OperationException - { - Iterator iter = itemsToBeAdded.iterator(); - ItemBean itemBean; - - ItemBean foundItemBean; - while (iter.hasNext()) - { - itemBean = (ItemBean) iter.next(); - - foundItemBean = findItem(itemBean, items); - - if (foundItemBean == null) - items.add(itemBean); - else - { - itemBean.updateQuantityToMove(foundItemBean, itemBean,ifAdd); - int finalQty=foundItemBean.getQtyToMove().intValue(); - - if(finalQty==0) - { - deleteItemFromList(items,foundItemBean.getProductId()); - } - else - { - // set the no of pack - MMovementManager.setNoOfPack(ctx, foundItemBean); - } - } - - - } - - return items; - } - - /** - * Set Movement Items Costs - * @param ctx - * @param priceListId - * @param items - * @param isSales - * @return - * @throws ProductNotOnPriceListException - * @throws OperationException - */ - public static ArrayList setMMovementItemCosts(Properties ctx, int priceListId, ArrayList items,boolean isSales) throws ProductNotOnPriceListException,OperationException - { - if (items == null || items.size() == 0) - { - return items; - } - - if (priceListId == 0) - { - priceListId = POSTerminalManager.getPriceListId(ctx, isSales); - } - - int precision = MPriceList.getStandardPrecision(ctx, priceListId); - MPriceList ppriceList = new MPriceList(ctx, priceListId, null); - - int priceListVersionId = 0; - priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); - - Iterator iter = items.iterator(); - - ItemBean bean; - BigDecimal priceStd = Env.ZERO; - - while (iter.hasNext()) - { - bean = (ItemBean) iter.next(); - - int product_id = bean.getProductId(); - - MProductPrice price = MProductPrice.get(ctx, priceListVersionId, product_id, null); - - if (price == null) - { - throw new ProductNotOnPriceListException(""+updateProductLink(ctx,bean.getProductId())); - } - - priceStd = price.getPriceStd().setScale(2, BigDecimal.ROUND_HALF_UP); - - MProduct product = new MProduct(ctx,bean.getProductId(),null); - int warehouseId = WarehouseManager.getDefaultWarehouse(ctx).getM_Warehouse_ID(); - MLocator locator = MLocator.get(ctx, warehouseId, "", "0", "0", "0"); - BigDecimal qtyAvailable = MStorage.getQtyAvailable(warehouseId, locator.get_ID(), bean.getProductId(), 0, null); - - if(bean.getQtyToMove().compareTo(qtyAvailable) == -1) - { - BigDecimal noOfPack = bean.getQtyToMove().divide(new BigDecimal(product.getUnitsPerPack()), BigDecimal.ROUND_DOWN); - bean.setNoOfPack(noOfPack.intValue()); - } - - int [] taxIds = MTax.getAllIDs(MTax.Table_Name,"AD_CLIENT_ID="+Env.getAD_Client_ID(ctx)+" and C_TAXCATEGORY_ID=" +product.getC_TaxCategory_ID() + " and isActive='Y'",null); - if(taxIds == null || taxIds.length == 0) - { - throw new OperationException("no tax Category for the product, or it has been set inactive"); - } - - MTax tax = new MTax(ctx,taxIds[0],null); - BigDecimal taxMul = (tax.getRate().add(Env.ONEHUNDRED)).divide(Env.ONEHUNDRED, 2, BigDecimal.ROUND_HALF_EVEN); - - BigDecimal stockValue = Env.ZERO; - - if(ppriceList.isTaxIncluded()) - { - stockValue = priceStd.multiply(bean.getQtyToMove()); - } - else - { - stockValue = (priceStd.multiply(bean.getQtyToMove())).multiply(taxMul); - } - - bean.setStockValue(stockValue); - - } - - return items; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/cashType/UDICashType.java b/posterita/posterita/src/main/org/posterita/cashType/UDICashType.java deleted file mode 100644 index 7c24eb5329..0000000000 --- a/posterita/posterita/src/main/org/posterita/cashType/UDICashType.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 17-Mar-2006 - */ - - -package org.posterita.cashType; - - -public interface UDICashType -{ - - public String getCashType(); - - -} diff --git a/posterita/posterita/src/main/org/posterita/cashType/UDICashTypes.java b/posterita/posterita/src/main/org/posterita/cashType/UDICashTypes.java deleted file mode 100644 index 3b5f36693d..0000000000 --- a/posterita/posterita/src/main/org/posterita/cashType/UDICashTypes.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 17-Mar-2006 - */ - - -package org.posterita.cashType; - - - -public class UDICashTypes -{ - private UDICashTypes() - { - - } - - public static UDICashType GENERAL_RECEIPTS = new GeneralReceipts(); - - public static UDICashType GENERAL_EXPENSE = new GeneralExpense(); - - public static UDICashType INVOICE = new Invoice(); - - public static UDICashType BANK_ACCOUNT_TRANSFER = new BankAccountTransfer(); - - - - public static class GeneralReceipts implements UDICashType - { - public String getCashType() - { - return "General Receipts"; - } - } - - - public static class GeneralExpense implements UDICashType - { - public String getCashType() - { - return "General Expense"; - } - } - - public static class Invoice implements UDICashType - { - public String getCashType() - { - return "Invoice"; - } - } - - public static class BankAccountTransfer implements UDICashType - { - public String getCashType() - { - return "Bank Account Transfer"; - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/AbstractChart.java b/posterita/posterita/src/main/org/posterita/core/AbstractChart.java deleted file mode 100644 index 0ce7f14561..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/AbstractChart.java +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 12-Jul-2006 15:56:26 by praveen - * - */ - -package org.posterita.core; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.StringWriter; - -import org.jfree.chart.ChartRenderingInfo; -import org.jfree.chart.ChartUtilities; -import org.jfree.chart.JFreeChart; -import org.jfree.chart.entity.StandardEntityCollection; - -import org.posterita.exceptions.OperationException; - -public abstract class AbstractChart -{ - protected String title = ""; - protected String subtitle = null; - protected String xLabel = ""; - protected String yLabel = ""; - protected boolean showLegend = true; - protected boolean showTooltip = true; - protected boolean showLabels = false; - protected ChartRenderingInfo renderingInfo = new ChartRenderingInfo(new StandardEntityCollection()); - protected JFreeChart chart = null; - - public abstract JFreeChart createChart() throws OperationException ; - - public abstract void getDataSetFromSQL(String sql) throws OperationException ; - - public String saveChartAsPNG(String filePath,int width,int height) throws OperationException - { - try { - ChartUtilities.saveChartAsPNG(new File(filePath),getChart(),width,height,renderingInfo); - return filePath; - } catch (IOException e) { - throw new OperationException("Problem occured while saving chart.",e); - } - } - - public String saveChartAsJPEG(String filePath,int width,int height) throws OperationException - { - try { - ChartUtilities.saveChartAsJPEG(new File(filePath),getChart(),width,height,renderingInfo); - return filePath; - } catch (IOException e) { - throw new OperationException("Problem occured while saving chart.",e); - } - } - - public void writeChartAsPNG(OutputStream outputStream,int width,int height) throws OperationException - { - try { - ChartUtilities.writeChartAsPNG(outputStream,getChart(),width,height,renderingInfo); - } catch (IOException e) { - throw new OperationException("Problem occured while write chart.",e); - } - } - - public void writeChartAsJPEG(OutputStream outputStream,int width,int height) throws OperationException - { - try { - ChartUtilities.writeChartAsJPEG(outputStream,getChart(),width,height,renderingInfo); - } catch (IOException e) { - throw new OperationException("Problem occured while write chart.",e); - } - } - - public String getImageMap(String imageMapName) throws OperationException - { - try { - StringWriter stringWriter = new StringWriter(); - PrintWriter printWriter = new PrintWriter(stringWriter); - ChartUtilities.writeImageMap(printWriter, imageMapName, renderingInfo,false); - printWriter.flush(); - - String imageMap = stringWriter.getBuffer().toString(); - return imageMap; - } catch (IOException e) { - throw new OperationException("Problem occured while writing imagemap",e); - } - } - - public void writeImageMap(OutputStream outputStream,String imageMapName) throws OperationException - { - PrintWriter printWriter = new PrintWriter(outputStream); - try { - ChartUtilities.writeImageMap(printWriter, imageMapName, renderingInfo,false); - printWriter.flush(); - printWriter.close(); - } catch (IOException e) { - throw new OperationException("Problem occured while writing imagemap",e); - } - } - - public String saveImageMap(String imageMapPath) throws OperationException - { - String fileSeparator = System.getProperty("file.separator"); - int index = imageMapPath.lastIndexOf(fileSeparator)+1; - String imageMapName = imageMapPath.substring(index); - - try { - FileOutputStream fos = new FileOutputStream(new File(imageMapPath)); - PrintWriter printWriter = new PrintWriter(fos); - ChartUtilities.writeImageMap(printWriter, imageMapName, renderingInfo,false); - printWriter.flush(); - fos.close(); - - return imageMapName; - } catch (IOException e) { - throw new OperationException("Problem occured while writing imagemap",e); - } - } - - public boolean isShowLegend() { - return showLegend; - } - - public void setShowLegend(boolean showLegend) { - this.showLegend = showLegend; - } - - public boolean isShowTooltip() { - return showTooltip; - } - - public void setShowTooltip(boolean showTooltip) { - this.showTooltip = showTooltip; - } - - public String getSubtitle() { - return subtitle; - } - - public void setSubtitle(String subtitle) { - this.subtitle = subtitle; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getXLabel() { - return xLabel; - } - - public void setXLabel(String label) { - xLabel = label; - } - - public String getYLabel() { - return yLabel; - } - - public void setYLabel(String label) { - yLabel = label; - } - - public boolean isShowLabels() { - return showLabels; - } - - public void setShowLabels(boolean showLabels) { - this.showLabels = showLabels; - } - - public ChartRenderingInfo getRenderingInfo() { - return renderingInfo; - } - - public void setRenderingInfo(ChartRenderingInfo renderingInfo) { - this.renderingInfo = renderingInfo; - } - - public JFreeChart getChart() throws OperationException { - - if(chart==null) - createChart(); - - return chart; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/AbstractParser.java b/posterita/posterita/src/main/org/posterita/core/AbstractParser.java deleted file mode 100644 index d0f75c658b..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/AbstractParser.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 12-Jul-2006 16:05:22 by praveen - * - */ - -package org.posterita.core; - -import org.posterita.exceptions.OperationException; - - - -/** - * @author vikram - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ - - -public abstract class AbstractParser -{ - protected static final String START_TAG = "<"; - protected static final String END_TAG = ">"; - protected static final String START_COMMENT = ""; - - protected String removeTag(String strData, String startTagData, String endTagData) throws OperationException - { - int startTag; - int endTag; - startTag = strData.indexOf(startTagData); - endTag = strData.indexOf(endTagData); - - if (startTag == -1) - { - throw new OperationException("No startTag found"); - } - - if (endTag == -1) - { - throw new OperationException("No endTag found"); - } - if (startTag > endTag) - { - throw new OperationException("startTag greater than endTag found"); - } - String beginning; - String end; - - beginning = strData.substring(0, startTag +startTagData.length()-1); - end = strData.substring(endTag +startTagData.length()); - strData = beginning.concat(end); - - return strData; - } - - protected String removeTags(String str) throws OperationException - { - while (str.indexOf(START_TAG) != -1) - { - str = removeTag(str, START_TAG, END_TAG); - } - - return str; - } - - - protected String removeComments(String str) throws OperationException - { - while (str.indexOf(START_COMMENT) != -1) - { - str = removeTag(str, START_COMMENT, END_COMMENT); - } - - return str; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/BarChart.java b/posterita/posterita/src/main/org/posterita/core/BarChart.java deleted file mode 100644 index 02c0798b58..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/BarChart.java +++ /dev/null @@ -1,174 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 12-Jul-2006 16:05:22 by praveen - * - */ - -package org.posterita.core; - -import java.sql.SQLException; - -import org.compiere.util.DB; -import org.jfree.chart.ChartFactory; -import org.jfree.chart.JFreeChart; -import org.jfree.chart.axis.NumberAxis; -import org.jfree.chart.labels.StandardCategoryItemLabelGenerator; -import org.jfree.chart.plot.CategoryPlot; -import org.jfree.chart.plot.PlotOrientation; -import org.jfree.chart.renderer.category.BarRenderer; -import org.jfree.chart.renderer.category.CategoryItemRenderer; -import org.jfree.chart.title.TextTitle; -import org.jfree.data.category.DefaultCategoryDataset; -import org.jfree.data.jdbc.JDBCCategoryDataset; - -import org.posterita.exceptions.OperationException; - -public class BarChart extends AbstractChart -{ - public static final String CHART_TYPE = "BarChart"; - public static final PlotOrientation VERTICAL = PlotOrientation.VERTICAL; - public static final PlotOrientation HORIZONTAL = PlotOrientation.HORIZONTAL; - public static final int BARCHART_FLAT = 1; - public static final int BARCHART_3D = 2; - - private DefaultCategoryDataset dataset = null; - private PlotOrientation orientation = VERTICAL; - private int type = BARCHART_FLAT; - private double maximumBarWidth = 0.1d; - private boolean integerTickUnits = false; - - public BarChart(){}; - - public BarChart(DefaultCategoryDataset dataset,String title) - { - this.dataset = dataset; - this.title = title; - - } - - public BarChart(DefaultCategoryDataset dataset,String title,String xLabel,String yLabel) - { - this.dataset = dataset; - this.title = title; - this.xLabel = xLabel; - this.yLabel = yLabel; - } - - public JFreeChart createChart() throws OperationException - { - if(dataset==null) - { - throw new OperationException("Cannot create Bar chart: cause -> dataset empty!"); - } - - switch (type) { - case BARCHART_FLAT: - chart = ChartFactory.createBarChart(title,xLabel,yLabel,dataset,orientation,showLegend,showTooltip,true); - break; - - case BARCHART_3D: - chart = ChartFactory.createBarChart3D(title,xLabel,yLabel,dataset,orientation,showLegend,showTooltip,true); - break; - - default: - throw new OperationException("Invalid barchart type! Can only be BarChart.BARCHART_FLAT or BarChart.BARCHART_3D"); - } - - //setting subtitle - if(subtitle!=null) - { - TextTitle title = new TextTitle(subtitle); - chart.addSubtitle(title); - } - - CategoryPlot plot = chart.getCategoryPlot(); - NumberAxis axis = (NumberAxis) plot.getRangeAxis(); - - //setting tickUnits - if(integerTickUnits) - axis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); - - BarRenderer barRender = (BarRenderer) plot.getRenderer(); - barRender.setMaximumBarWidth(maximumBarWidth); - - //displaying labels - if(showLabels) - { - CategoryItemRenderer itemRender = plot.getRenderer(); - itemRender.setItemLabelGenerator(new StandardCategoryItemLabelGenerator()); - itemRender.setItemLabelsVisible(true); - } - - return chart; - } - - public DefaultCategoryDataset getDataset() { - return dataset; - } - - public void setDataset(DefaultCategoryDataset dataset) { - this.dataset = dataset; - } - - public PlotOrientation getOrientation() { - return orientation; - } - - public void setOrientation(PlotOrientation orientation) { - this.orientation = orientation; - } - - public int getType() { - return type; - } - - public void setType(int type) { - this.type = type; - } - - public double getMaximumBarWidth() { - return maximumBarWidth; - } - - public void setMaximumBarWidth(double maximumBarWidth) { - this.maximumBarWidth = maximumBarWidth; - } - - public boolean isIntegerTickUnits() { - return integerTickUnits; - } - - public void setIntegerTickUnits(boolean integerTickUnits) { - this.integerTickUnits = integerTickUnits; - } - - public void getDataSetFromSQL(String sql) throws OperationException - { - JDBCCategoryDataset jdbcDataset = new JDBCCategoryDataset(DB.getConnectionRO()); - - try - { - jdbcDataset.executeQuery(sql); - this.dataset = jdbcDataset; - } catch (SQLException e) { - throw new OperationException(e); - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/BarLabelGenerator.java b/posterita/posterita/src/main/org/posterita/core/BarLabelGenerator.java deleted file mode 100644 index d9072aa2b1..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/BarLabelGenerator.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 29-Aug-2006 16:39:33 by praveen - * - */ - -package org.posterita.core; - -import java.util.Map; - -import org.jfree.chart.labels.StandardCategoryItemLabelGenerator; -import org.jfree.data.category.CategoryDataset; - -public class BarLabelGenerator extends StandardCategoryItemLabelGenerator -{ - /** - * - */ - private static final long serialVersionUID = 1L; - Map labelMap = null; - - public BarLabelGenerator(Map labelMap) - { - this.labelMap = labelMap; - } - - public String generateLabel(CategoryDataset arg0, int arg1, int arg2) - { - return super.generateLabel(arg0, arg1, arg2); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/CheckDuplicateEntities.java b/posterita/posterita/src/main/org/posterita/core/CheckDuplicateEntities.java deleted file mode 100644 index a2608281d9..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/CheckDuplicateEntities.java +++ /dev/null @@ -1,178 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 01-Aug-2005 by alok - * - */ -package org.posterita.core; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Properties; - -import org.compiere.util.DB; -import org.compiere.util.Env; - - - - -public class CheckDuplicateEntities -{ - - public static boolean checkDuplicateName(Properties ctx,String name,String tableName) - { - boolean existName = false; - - String sql = " select name from "+tableName + - " where upper(name) = upper('"+name+"')" + - " and AD_CLIENT_ID = "+ Env.getAD_Client_ID(ctx); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - ResultSet rs = null; - - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - existName = true; - } - - rs.close(); - } - catch(SQLException e) - { - e.printStackTrace(); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return existName; - - } - - public static boolean checkDuplicateBPName(Properties ctx,String name,String name2,String tableName) - { - boolean existName = false; - String sql; - - if (name2 != null) - sql = " select name, name2 from "+tableName + - " where upper(name) = upper('"+name+"')" + - " and upper(name2) = upper('" + name2 + "')" + - " and ad_org_id = " + Env.getAD_Org_ID(ctx) + - " and AD_CLIENT_ID = "+ Env.getAD_Client_ID(ctx); - else - sql = " select name, name2 from "+tableName + - " where upper(name) = upper('"+name+"')" + - " and upper(name2) is null" + - " and ad_org_id = " + Env.getAD_Org_ID(ctx) + - " and AD_CLIENT_ID = "+ Env.getAD_Client_ID(ctx); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - ResultSet rs = null; - - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - existName = true; - } - - rs.close(); - } - catch(SQLException e) - { - e.printStackTrace(); - } - finally - { - try - { - pstmt.close(); - } - catch (Exception e) - {} - - pstmt = null; - } - - return existName; - - } - - public static boolean checkDuplicateChequeNo(Properties ctx,String chequeNo,String tableName) - { - boolean existCheque = false; - - String sql = " select CHEQUENO from "+tableName + - " where upper(CHEQUENO) = upper('"+chequeNo+"')" + - " and AD_CLIENT_ID = "+ Env.getAD_Client_ID(ctx); - - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - ResultSet rs = null; - - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - existCheque = true; - } - - rs.close(); - } - catch(SQLException e) - { - e.printStackTrace(); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return existCheque; - - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/Configuration.java b/posterita/posterita/src/main/org/posterita/core/Configuration.java deleted file mode 100644 index 7d08a925db..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/Configuration.java +++ /dev/null @@ -1,310 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * Apr 9, 2008 11:07:09 AM by praveen - * - */ - -package org.posterita.core; - -import java.util.logging.Level; - -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.util.CLogger; -import org.posterita.Constants; - -public class Configuration -{ - public static final String IS_QUICK_SALES = "configuration.isQuickSales"; - public static final String IS_CUSTOMER_COMPULSORY = "configuration.isCustomerCompulsory"; - public static final String ALLOW_CREDIT_SALES = "configuration.allowCreditSales"; - public static final String ALLOW_CUSTOMER_RETURN_ORDER = "configuration.allowCustomerReturnOrder"; - public static final String ALLOW_INVOKE_CUSTOMER_RETURN_ORDER = "configuration.allowInvokeCustomerReturnOrder"; - public static final String PAYMENT_RULE = "configuration.paymentRule"; - public static final String SEARCH_PRODUCT_BY = "configuration.searchProductBy"; - - public static final String BARCODE = "barcode"; - public static final String DESCRIPTION = "description"; - public static final String PRODUCT_NAME = "productQuery"; - - private static CLogger log = CLogger.getCLogger(Configuration.class); - - private boolean isQuickSales = true; - private boolean isCustomerCompulsory = false; - private boolean allowCreditSales = true; - private boolean allowCustomerReturnOrder = true; - private boolean allowInvokeCustomerReturnOrder = true; - private String paymentRule = "cash"; - private String searchProductBy = BARCODE; - private String orderType; - private int priceListId; - private boolean isSOTrx; - - public boolean getIsSOTrx() - { - return isSOTrx; - } - - public void setIsSOTrx(boolean isSOTrx) - { - this.isSOTrx = isSOTrx; - } - - public int getPriceListId() - { - return priceListId; - } - - public void setPriceListId(int priceListId) - { - this.priceListId = priceListId; - } - - public String getOrderType() - { - return orderType; - } - - public void setOrderType(String orderType) - { - this.orderType = orderType; - } - - public Configuration() - { - //do nothing - } - - public static Configuration getConfiguration(HttpServletRequest request) - { - Configuration config = null; - config = (Configuration) request.getSession().getAttribute(Constants.CONFIGURATION); - - if(config == null) - { - config = new Configuration(); - config.load(request); - - request.getSession().setAttribute(Constants.CONFIGURATION, config); - } - - return config; - } - - /** - * Loads configuration from cookie - * @param request - */ - public void load(HttpServletRequest request) - { - //TODO refactor load configuration from role - - Cookie[] cookies = request.getCookies(); - if(cookies != null && cookies.length > 0) - { - for(Cookie cookie : cookies) - { - String name = cookie.getName(); - String value = cookie.getValue(); - - if(name.startsWith("configuration.")) - { - if(IS_QUICK_SALES.equalsIgnoreCase(name)) - { - try - { - isQuickSales = Boolean.parseBoolean(value); - } - catch(Exception e) - { - log.log(Level.WARNING, "Invalid value for: "+ IS_QUICK_SALES +" Using default: " + isQuickSales, e); - } - } - - if(IS_CUSTOMER_COMPULSORY.equalsIgnoreCase(name)) - { - try - { - isCustomerCompulsory = Boolean.parseBoolean(value); - } - catch(Exception e) - { - log.log(Level.WARNING, "Invalid value for: "+ IS_CUSTOMER_COMPULSORY +" Using default: " + isCustomerCompulsory, e); - } - } - - if(ALLOW_CREDIT_SALES.equalsIgnoreCase(name)) - { - try - { - allowCreditSales = Boolean.parseBoolean(value); - } - catch(Exception e) - { - log.log(Level.WARNING, "Invalid value for: "+ ALLOW_CREDIT_SALES +" Using default: " + allowCreditSales, e); - } - } - - if(ALLOW_CUSTOMER_RETURN_ORDER.equalsIgnoreCase(name)) - { - try - { - allowCustomerReturnOrder = Boolean.parseBoolean(value); - } - catch(Exception e) - { - log.log(Level.WARNING, "Invalid value for: "+ ALLOW_CUSTOMER_RETURN_ORDER +" Using default: " + allowCustomerReturnOrder, e); - } - } - - if(ALLOW_INVOKE_CUSTOMER_RETURN_ORDER.equalsIgnoreCase(name)) - { - try - { - allowInvokeCustomerReturnOrder = Boolean.parseBoolean(value); - } - catch(Exception e) - { - log.log(Level.WARNING, "Invalid value for: "+ ALLOW_INVOKE_CUSTOMER_RETURN_ORDER +" Using default: " + allowInvokeCustomerReturnOrder, e); - } - } - - if(PAYMENT_RULE.equalsIgnoreCase(name)) - { - if(value.equalsIgnoreCase(Constants.PAYMENT_RULE_CASH)|| - value.equalsIgnoreCase(Constants.PAYMENT_RULE_CARD)|| - value.equalsIgnoreCase(Constants.PAYMENT_RULE_CHEQUE)|| - value.equalsIgnoreCase(Constants.PAYMENT_RULE_MIXED)) - { - paymentRule = value; - } - else - { - log.log(Level.WARNING, "Invalid value for: "+ PAYMENT_RULE +" Using default: " + paymentRule); - } - } - - if(SEARCH_PRODUCT_BY.equalsIgnoreCase(name)) - { - if(value.equalsIgnoreCase("barcode")|| - value.equalsIgnoreCase("name")|| - value.equalsIgnoreCase("description")) - { - searchProductBy = value; - } - else - { - log.log(Level.WARNING, "Invalid value for: "+ SEARCH_PRODUCT_BY +" Using default: " + searchProductBy); - } - } - - } - } - } - - } - - /** - * Save default configuration in cookies - * @param request - */ - public void save(HttpServletResponse response) - { - String[][] nameValues = { - { IS_QUICK_SALES, isQuickSales + "" }, - { IS_CUSTOMER_COMPULSORY, isCustomerCompulsory + "" }, - { ALLOW_CREDIT_SALES, allowCreditSales + "" }, - { ALLOW_CUSTOMER_RETURN_ORDER, allowCustomerReturnOrder + "" }, - { ALLOW_INVOKE_CUSTOMER_RETURN_ORDER, allowInvokeCustomerReturnOrder + "" }, - { PAYMENT_RULE, paymentRule }, - { SEARCH_PRODUCT_BY, searchProductBy } - }; - - for (int i = 0; i < nameValues.length; i++) - { - String[] namevalue = nameValues[i]; - String name = namevalue[0]; - String value = namevalue[1]; - - Cookie cookie = new Cookie(name, value); - cookie.setMaxAge(60*60*24*365); - - response.addCookie(cookie); - } - } - - public boolean isQuickSales() { - return isQuickSales; - } - - public void setQuickSales(boolean isQuickSales) { - this.isQuickSales = isQuickSales; - } - - public boolean isCustomerCompulsory() { - return isCustomerCompulsory; - } - - public void setCustomerCompulsory(boolean isCustomerCompulsory) { - this.isCustomerCompulsory = isCustomerCompulsory; - } - - public boolean isAllowCreditSales() { - return allowCreditSales; - } - - public void setAllowCreditSales(boolean allowCreditSales) { - this.allowCreditSales = allowCreditSales; - } - - public boolean isAllowCustomerReturnOrder() { - return allowCustomerReturnOrder; - } - - public void setAllowCustomerReturnOrder(boolean allowCustomerReturnOrder) { - this.allowCustomerReturnOrder = allowCustomerReturnOrder; - } - - public boolean isAllowInvokeCustomerReturnOrder() { - return allowInvokeCustomerReturnOrder; - } - - public void setAllowInvokeCustomerReturnOrder( - boolean allowInvokeCustomerReturnOrder) { - this.allowInvokeCustomerReturnOrder = allowInvokeCustomerReturnOrder; - } - - public String getPaymentRule() { - return paymentRule; - } - - public void setPaymentRule(String paymentRule) { - this.paymentRule = paymentRule; - } - - public String getSearchProductBy() { - return searchProductBy; - } - - public void setSearchProductBy(String searchProductBy) { - this.searchProductBy = searchProductBy; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/ContextId.java b/posterita/posterita/src/main/org/posterita/core/ContextId.java deleted file mode 100644 index 43844daa22..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/ContextId.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Sep 26, 2006 - */ - - -package org.posterita.core; - -import java.util.Properties; - - -public class ContextId -{ - Properties ctx; - int id; - Object bean; - - public ContextId(Properties ctx, int id) - { - - this.ctx = ctx; - this.id = id; - } - - public Properties getCtx() { - return ctx; - } - - public void setCtx(Properties ctx) { - this.ctx = ctx; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public Object getBean() { - return bean; - } - - public void setBean(Object bean) { - this.bean = bean; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/CrossTabReportGenerator.java b/posterita/posterita/src/main/org/posterita/core/CrossTabReportGenerator.java deleted file mode 100644 index fdd3add876..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/CrossTabReportGenerator.java +++ /dev/null @@ -1,254 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Feb 24, 2006 by praveen - * - */ -package org.posterita.core; - -import java.awt.Color; -import java.util.Iterator; - -import org.posterita.exceptions.OperationException; -import com.lowagie.text.Chunk; -import com.lowagie.text.Document; -import com.lowagie.text.DocumentException; -import com.lowagie.text.Element; -import com.lowagie.text.Image; -import com.lowagie.text.Paragraph; -import com.lowagie.text.Rectangle; -import com.lowagie.text.pdf.PdfPCell; -import com.lowagie.text.pdf.PdfPTable; - - -public class CrossTabReportGenerator extends PDFReportGenerator -{ - - protected void writeDocument(Document document) throws OperationException - { - try - { - int noOfRows = dataSource.size(); - String longestText = ""; - int columnCount = 0; - - Object[] obj = null; - - Object[] header = (Object[]) dataSource.get(0); - columnCount = header.length; - - PdfPTable table = new PdfPTable(columnCount); - table.setWidthPercentage(100); - table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); - table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); - table.getDefaultCell().setPaddingBottom(5); - table.getDefaultCell().setPaddingTop(5); - - - //adding the headers - for(int i = 0; i < columnCount; i++) - { - if(i==0) - { - longestText = header[i].toString(); - table.addCell(new Paragraph(header[i].toString())); - } - else - { - Image img = getTextAsImage(header[i].toString()); - img.setRotationDegrees(90); - img.setAlignment(Image.ALIGN_BOTTOM); - - PdfPCell cell = new PdfPCell(img); - cell.setPadding(4); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); - cell.setVerticalAlignment(Element.ALIGN_BOTTOM); - //cell.setBackgroundColor(new Color(0, 0, 255)); - - table.addCell(cell); - } - } - - - - //adding the data - for(int j = 1; j < noOfRows; j++) - { - obj = (Object[]) dataSource.get(j); - - - for(int k = 0; k < columnCount; k++) - { - if(k==0) - { - String text = obj[0].toString(); - - if(new Chunk(text,HEADER_FONT).getWidthPoint() > new Chunk(longestText,HEADER_FONT).getWidthPoint()) - { - longestText = text; - } - - - Chunk txtck = new Chunk(obj[0].toString(),HEADER_FONT); - PdfPCell cell = new PdfPCell(new Paragraph(txtck)); - - if(j == noOfRows - 1) - { - cell.setBackgroundColor(new Color(170,170,170)); - } - - cell.setHorizontalAlignment(Element.ALIGN_LEFT); - cell.setVerticalAlignment(Element.ALIGN_MIDDLE); - cell.setPaddingBottom(5); - cell.setPaddingTop(5); - cell.setPaddingLeft(5); - - table.addCell(cell); - } - else - { - Chunk txtck = new Chunk(obj[k].toString(),DATA_FONT); - - if(k == columnCount-1) - { - PdfPCell cell = new PdfPCell(new Paragraph(txtck)); - cell.setBackgroundColor(new Color(170,170,170)); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); - cell.setVerticalAlignment(Element.ALIGN_MIDDLE); - cell.setPaddingBottom(5); - cell.setPaddingTop(5); - - table.addCell(cell); - } - else - { - PdfPCell cell = new PdfPCell(new Paragraph(txtck)); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); - cell.setVerticalAlignment(Element.ALIGN_MIDDLE); - cell.setPaddingBottom(5); - cell.setPaddingTop(5); - - if(j == noOfRows - 1) - { - cell.setBackgroundColor(new Color(170,170,170)); - } - - table.addCell(cell); - } - } - - } - - } - - //setting table width - Chunk dataChk = new Chunk("9999",DATA_FONT); - Chunk headerChk = new Chunk(longestText,HEADER_FONT); - - float dataChkLength = dataChk.getWidthPoint() + 2*CELLPADDING ; - float headerChkLength = headerChk.getWidthPoint() + 2*CELLPADDING; - - float tableWidth = headerChkLength + dataChkLength*columnCount; - float actualTableWidth = document.getPageSize().getWidth() - 2*MARGIN; - - float columnWidth = dataChkLength; - - if(tableWidth < actualTableWidth) - { - columnWidth = (actualTableWidth - headerChkLength)/(columnCount - 1); - } - - - float[] widths = new float[columnCount]; - widths[0] = headerChkLength + 2*CELLPADDING; - - for(int i=1; i longestText.length()) - { - longestText = header; - } - } - - - //setting the table width - Chunk dataChk = new Chunk("9999",DATA_FONT); - Chunk headerChk = new Chunk(longestText,HEADER_FONT); - - float dataChkLength = dataChk.getWidthPoint() + 2*CELLPADDING ; - float headerChkLength = headerChk.getWidthPoint() + 2*CELLPADDING; - - float tableWidth = headerChkLength + dataChkLength*columnCount; - - float actualTableWidth = document.getPageSize().getWidth() - 2*MARGIN; - //float actualTableHeight = document.getPageSize().height() - 2*MARGIN; - - //if the table size is greater than that of the page we should - //scale the page - - if(tableWidth > actualTableWidth) - { - float documentWidth = document.getPageSize().getWidth(); - float documentHeight = document.getPageSize().getHeight(); - - float newDocumentWidth = tableWidth + 2*MARGIN; - float newDocumentHeight = (documentHeight * newDocumentWidth)/documentWidth; - - return new Rectangle(newDocumentWidth,newDocumentHeight); - } - - return document.getPageSize(); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/DocStatusMap.java b/posterita/posterita/src/main/org/posterita/core/DocStatusMap.java deleted file mode 100644 index 6f6afe11b9..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/DocStatusMap.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jun 17, 2005 by din - */ - -package org.posterita.core; - -import java.util.LinkedHashMap; - -import org.compiere.process.DocAction; - -public class DocStatusMap -{ - static LinkedHashMap docStatusMap; - - public static LinkedHashMap getDocStatusMap() - { - return docStatusMap; - } - - - static - { - docStatusMap = new LinkedHashMap(); - docStatusMap.put(DocAction.STATUS_Approved,"Approved"); - docStatusMap.put(DocAction.STATUS_Closed,"Closed"); - docStatusMap.put(DocAction.STATUS_Completed,"Completed"); - docStatusMap.put(DocAction.STATUS_Drafted,"Drafted"); - docStatusMap.put(DocAction.STATUS_InProgress,"In Progress"); - docStatusMap.put(DocAction.STATUS_Invalid,"Invalid"); - docStatusMap.put(DocAction.STATUS_NotApproved,"Not Approved"); - docStatusMap.put(DocAction.STATUS_Reversed,"Reserved"); - docStatusMap.put(DocAction.STATUS_Unknown,"UnKnown"); - docStatusMap.put(DocAction.STATUS_Voided,"Voided"); - docStatusMap.put(DocAction.STATUS_WaitingConfirmation,"Waiting Confirmation"); - docStatusMap.put(DocAction.STATUS_WaitingPayment,"Waiting Payment"); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/EmailValidator.java b/posterita/posterita/src/main/org/posterita/core/EmailValidator.java deleted file mode 100644 index 04b7adb676..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/EmailValidator.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 12-Jul-2006 16:05:22 by praveen - * - */ - - -package org.posterita.core; - -public class EmailValidator -{ - public static boolean isValidEmail(String theEmail) - { - if(theEmail == null) - return false; - - else if(theEmail.length() == 0) - return false; - - else if(theEmail.length() > 78) // email addresses must fit on one line - return false; - - else - { - // if last character is a period, remove it - if(theEmail.charAt(theEmail.length()-1) == '.') - theEmail = theEmail.substring(0, theEmail.length() -1); - - //check for presence of "at" sign - int atIndex = theEmail.indexOf('@'); - - if(atIndex < 0) return false; - - //check for valid characters in the mailbox portion of the address - String mailbox = theEmail.substring(0, atIndex); - - if(mailbox == null || mailbox.length() == 0) - return false; - - else - { - int oldDotIndex = 0; - int dotEnd = mailbox.indexOf('.', oldDotIndex); - boolean done = false; - do - { - //cannot have 2 dots in a row - if(dotEnd == oldDotIndex) - return false; - - if(dotEnd < 0) - { - dotEnd = mailbox.length(); - done = true; - } - - for(int i = oldDotIndex; i < dotEnd; i++) - { - char cur = mailbox.charAt(i); - - if(!Character.isLetter(cur) && - !Character.isDigit(cur) && - cur != '!' && cur != '#' && - cur != '$' && cur != '%' && - cur != '&' && cur != '\'' && - cur != '*' && cur != '+' && - cur != '-' && cur != '/' && - cur != '=' && cur != '?' && - cur != '^' && cur != '_' && - cur != '`' && cur != '{' && - cur != '|' && cur != '}' && - cur != '~') - return false; - } - - oldDotIndex = dotEnd+1; - dotEnd = mailbox.indexOf('.', oldDotIndex+1); - } - while(!done); - } - - //check for a valid domain name - String domain = theEmail.substring(atIndex+1); - - if(domain == null || domain.length() == 0) - return false; - - else - { - //domains are divided into groups separated by dots - int oldDotIndex = 0; - int dotEnd = domain.indexOf('.', oldDotIndex); - - if(dotEnd < 0) - return false; - - - do - { - //cannot have 2 dots in a row - if(oldDotIndex == dotEnd) - return false; - - //first character must be letter or digit - if(!Character.isLetter(domain.charAt(oldDotIndex)) && - !Character.isDigit(domain.charAt(oldDotIndex))) - return false; - - //middle characters can be digits, letters, or hyphens - for(int i = oldDotIndex+1; i < dotEnd - 1; i++) - { - char cur = domain.charAt(i); - - if(!Character.isLetter(cur) && - !Character.isDigit(cur) && - cur != '-') - return false; - } - - //last character must be a letter or digit - if(!Character.isLetter(domain.charAt(dotEnd - 1)) && - !Character.isDigit(domain.charAt(dotEnd - 1))) - return false; - - oldDotIndex = dotEnd+1; - dotEnd = domain.indexOf('.', oldDotIndex+1); - } - - while(dotEnd > 0); - - //check the last part of the domain - String ext = domain.substring(oldDotIndex); - - if(ext == null || ext.length() == 0) - return false; - - else if(ext.length() < 2 || ext.length() > 4) - return false; - - else - { - for(int i = 0; i < ext.length(); i++) - { - if(!Character.isLetter(ext.charAt(i)) && - !Character.isDigit(ext.charAt(i))) - return false; - } - } - - } - } - return true; - } // end isValidEmail - -} diff --git a/posterita/posterita/src/main/org/posterita/core/FactoryPropertiesManager.java b/posterita/posterita/src/main/org/posterita/core/FactoryPropertiesManager.java deleted file mode 100644 index 5a1786f513..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/FactoryPropertiesManager.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 24-Jun-2005 by alok - * - */ -package org.posterita.core; - -import org.posterita.factory.DBPropertiesManager; -import org.posterita.factory.WebProperties; - - - -public class FactoryPropertiesManager -{ - private FactoryPropertiesManager() - { - - } - - private static WebProperties singleton; - - public static WebProperties getProperty() - { - if (singleton == null) - singleton = new DBPropertiesManager(); - - return singleton; - } - - protected String getFileName() - { - return "Factory"; - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/FileManager.java b/posterita/posterita/src/main/org/posterita/core/FileManager.java deleted file mode 100644 index 0c172a3731..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/FileManager.java +++ /dev/null @@ -1,269 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.core; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.util.ArrayList; - -import org.compiere.util.KeyNamePair; - -import org.posterita.beans.AttributeValuesPair; -import org.posterita.beans.ProductBean; -import org.posterita.exceptions.OperationException; - -public class FileManager -{ - public static final String FILE_PATH_SEPARATOR = System.getProperty("file.separator"); - - public static void createFile(String filename) throws IOException - { - File newFile = new File(filename); - - File parentFile = newFile.getParentFile(); - - if(!parentFile.exists()) - parentFile.mkdirs(); - if (!newFile.exists()) - newFile.createNewFile(); - - - } - - - public static void write(String filename, String content, boolean cond) throws IOException - { - createFile(filename); - - - //BufferedWriter bw = null; - - - FileOutputStream out = new FileOutputStream(filename, cond); - OutputStreamWriter wr = new OutputStreamWriter(out,"ISO-8859-1"); - - - wr.write(content); - - wr.flush(); - - wr.close(); - - } - - public static ArrayList read(InputStream is) throws IOException - { - String delimiter = ","; - String line; - ProductBean bean; - AttributeValuesPair pair = null; - ArrayList list = new ArrayList(); - - InputStreamReader isr = new InputStreamReader(is); - BufferedReader bf = new BufferedReader(isr); - line = bf.readLine(); - String model; - String colour; - String transmission; - String year; - String strProductid; - String serno; - String engineNo; - while ((line = bf.readLine())!=null) - { - - bean = new ProductBean(); - ArrayList tokens = tokenize(line,delimiter); - strProductid = tokens.get(0).toString(); - bean.setProductId(Integer.valueOf(strProductid)); - - model = tokens.get(1).toString(); - KeyNamePair knpModel = new KeyNamePair(1,model); - - - transmission = tokens.get(2).toString(); - KeyNamePair knpTransmission = new KeyNamePair(2,transmission); - - colour = tokens.get(3).toString(); - KeyNamePair knpColour = new KeyNamePair(3,colour); - - year = tokens.get(4).toString(); - KeyNamePair knpYear = new KeyNamePair(4,year); - - pair = new AttributeValuesPair(); - pair.setModelAttributeValue(knpModel); - pair.setTransmissionAttributeValue(knpTransmission); - pair.setColourAttributeValue(knpColour); - pair.setYearAttributeValue(knpYear); - bean.setAttributeValuesPair(pair); - - - serno = tokens.get(5).toString(); - engineNo = tokens.get(6).toString(); - bean.setSerno(serno); - bean.setEngineNo(engineNo); - list.add(bean); - } - - bf.close(); - isr.close(); - return list; - - } - - public static ArrayList tokenize(String str, String delimiter) - { - ArrayList list = Interpreter.interprete(str,delimiter); - - return list; - } - - public static void write(InputStream content, String fileTarget) throws IOException - { - createFile(fileTarget); - - FileOutputStream streamOut = new FileOutputStream(fileTarget); - - int bytesRead = 0; - - byte[] buffer = new byte[8192]; - while((bytesRead = content.read(buffer,0,8192))!=-1) - { - streamOut.write(buffer,0,bytesRead); - } - - streamOut.close(); - content.close(); - } - - public static void copy(File src, File dst) throws IOException - { - InputStream in = new FileInputStream(src); - OutputStream out = new FileOutputStream(dst); - - // Transfer bytes from in to out - byte[] buf = new byte[1024]; - int len; - - while ((len = in.read(buf)) > 0) - { - out.write(buf, 0, len); - } - - in.close(); - out.close(); - } - - public static ArrayList readLines(File file) throws OperationException - { - BufferedReader bufferedReader = null; - - if(file == null) - throw new OperationException("File cannot be null"); - if(!file.exists()) - throw new OperationException("File does not exist, file: " + file.getAbsolutePath()); - if(file.isDirectory()) - throw new OperationException("File cannot be a directory, file: " + file.getAbsolutePath()); - - ArrayList readLines = new ArrayList(); - - try - { - FileReader fileInReader = new FileReader(file); - bufferedReader = new BufferedReader(fileInReader); - String line; - while((line = bufferedReader.readLine()) != null) - readLines.add(line); - - return readLines; - } - catch(FileNotFoundException ex) - { - throw new OperationException("File not found exception, file: " + file.getAbsolutePath(), ex); - } - catch(IOException ex) - { - throw new OperationException("IOException while reading file: " + file.getAbsolutePath(), ex); - } - finally - { - if (bufferedReader != null) - { - try - { - bufferedReader.close(); - } - catch(Exception e) - {} - } - } - - } - - public static void moveFile(File from, File to) throws OperationException - { - if (from.getAbsolutePath().equals(to.getAbsolutePath())) - return; - - if(!from.exists()) - throw new OperationException("From file does not exist"); - if(from.isDirectory()) - throw new OperationException("From file cannot be a directory"); - - if(to.exists()) - throw new OperationException("To file already exists"); - - try - { - InputStream in = new FileInputStream(from); - OutputStream out = new FileOutputStream(to); - - // Transfer bytes from in to out - byte[] buf = new byte[1024]; - int len; - - while ((len = in.read(buf)) > 0) - { - out.write(buf, 0, len); - } - - in.close(); - out.close(); - - if (!from.delete()) - throw new OperationException("Cannot delete from file: " + from.getAbsolutePath()); - } - catch(IOException ex) - { - throw new OperationException("Could not move file, from: " + from.getAbsolutePath() + " and to: " + to.getAbsolutePath()); - } - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/FilePropertiesManager.java b/posterita/posterita/src/main/org/posterita/core/FilePropertiesManager.java deleted file mode 100644 index 3f7e6d9090..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/FilePropertiesManager.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.core; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.MissingResourceException; -import java.util.Properties; -import java.util.ResourceBundle; - -import org.posterita.beans.MessageBean; -import org.posterita.exceptions.OperationException; -import org.posterita.factory.WebProperties; -import org.posterita.lib.PropertiesConstant; -import org.posterita.util.PathInfo; - - -public abstract class FilePropertiesManager implements WebProperties -{ - protected static final String propertiesFileDirectory = "/WEB-INF/src/"; - protected ResourceBundle bundle; - - protected abstract String getFileName(); - - public synchronized void put(Properties ctx, String key, String value) throws OperationException - { - Object obj = new MessageBean(); - - ClassLoader loader = obj.getClass().getClassLoader(); - - InputStream stream = loader.getResourceAsStream("posterita.properties"); - - Properties prop2 = new Properties(); - try - { - prop2.load(stream); - } - catch (IOException e) - { - throw new OperationException(e.getMessage()); - } - - String absoluteFilePath = prop2.getProperty(PropertiesConstant.UDI_HOME) + propertiesFileDirectory + getFileName() + ".properties"; - - File file = new File(absoluteFilePath); - - InputStream is = null; - OutputStream os = null; - Properties prop = new Properties(); - try - { - is = new FileInputStream(file); - prop.load(is); - prop.put(key,value); - os = new FileOutputStream(file); - prop.store(os,getFileName()); - os.flush(); - os.close(); - } - catch(IOException ioException) - { - throw new OperationException(ioException.getMessage()); - } - finally - { - try - { - if( is != null) - { - is.close(); - } - if( os != null) - { - os.close(); - } - } - catch(Exception ex) - {} - } - - bundle = ResourceBundle.getBundle(getFileName()); - } - - public synchronized String get(Properties ctx, String key) - { - if (bundle == null) - bundle = ResourceBundle.getBundle(getFileName()); - - String value; - if(key.equals(PropertiesConstant.UDI_HOME)) - return PathInfo.PROJECT_HOME; - try - { - value = (String) bundle.getString(key); - } - catch (MissingResourceException e) - { - return null; - } - - return value; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/I18nAdapter.java b/posterita/posterita/src/main/org/posterita/core/I18nAdapter.java deleted file mode 100644 index caa92c191c..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/I18nAdapter.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.posterita.core; - -import java.util.Locale; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import javax.servlet.jsp.PageContext; -import javax.servlet.jsp.tagext.Tag; - -import org.apache.struts.Globals; -import org.displaytag.localization.I18nResourceProvider; -import org.displaytag.localization.LocaleResolver; -import org.posterita.core.bean.ElementBean; -import org.posterita.core.businesslogic.ElementManager; - -public class I18nAdapter implements I18nResourceProvider, LocaleResolver -{ - - public String getResource(String resourceKey, String defaultValue, - Tag tag, PageContext pageContext) - { - Properties ctx = TmkJSPEnv.getCtx((HttpServletRequest)pageContext.getRequest()); - - String key = resourceKey; - - if (key == null) - { - key = defaultValue; - } - - ElementBean msgBean = ElementManager.getMsg(ctx, key); - return msgBean.getName(); - } - - /** - * @see LocaleResolver#resolveLocale(HttpServletRequest) - */ - public Locale resolveLocale(HttpServletRequest request) - { - Locale userLocale = null; - HttpSession session = request.getSession(false); - - if (session != null) - { - userLocale = (Locale) session.getAttribute(Globals.LOCALE_KEY); - } - - if (userLocale == null) - { - userLocale = request.getLocale(); - } - - return userLocale; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/ImageServer.java b/posterita/posterita/src/main/org/posterita/core/ImageServer.java deleted file mode 100644 index cffb111628..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/ImageServer.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 14, 2006 by praveen - * - */ -package org.posterita.core; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Properties; - -import javax.servlet.http.HttpServletResponse; - -import org.compiere.model.MAttachment; -import org.compiere.model.MAttachmentEntry; - -import org.posterita.exceptions.OperationException; -import org.posterita.util.PathInfo; - -public class ImageServer -{ - public static final String DEFAULT_IMAGE_PATH = PathInfo.PROJECT_HOME + "/images/webstore/noimage.jpg"; - - public static boolean sendImage(Properties ctx, int attachment_id, String size, HttpServletResponse response) throws OperationException - { - MAttachment attachment = new MAttachment(ctx,attachment_id,null); - - if(attachment == null) - { - return false; - } - - MAttachmentEntry[] entries = attachment.getEntries(); - MAttachmentEntry entry = null; - - try - { - for(int i=0; i appList = ApplicationManager.getAvailableApplications(); - servlet.getServletContext().setAttribute(Constants.WEB_APPLICATIONS, appList); - } - - - /** - * Clears all the dynamically generated reports - * @param servlet - */ - private void clearReportsDirectory(HttpServlet servlet) - { - /* - ServletContext context = servlet.getServletContext(); - String reportDirectoryPath = context.getRealPath(context.getInitParameter("REPORT_DIRECTORY")); - File reportDirectory = new File(reportDirectoryPath); - - if(reportDirectory.exists()) - { - System.out.println("Cleaning old reports --> "+ reportDirectoryPath); - - File[] files = reportDirectory.listFiles(); - for (File file : files) - { - if(file.isFile()) - file.delete(); - } - - System.out.println("Cleaning process completed successfully."); - } - else - { - System.out.println("Creating report directory."); - if(reportDirectory.mkdirs()) - { - System.out.println("Report directory created successfully."); - } - else - { - System.err.println("Unable to create report directory!"); - } - } - */ - - } - - public void destroy() - { - } - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/Interpreter.java b/posterita/posterita/src/main/org/posterita/core/Interpreter.java deleted file mode 100644 index adfa85ad7e..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/Interpreter.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 29-Jul-2005 by alok - * - */ -package org.posterita.core; - -import java.util.ArrayList; - - -public class Interpreter -{ - public static ArrayList interprete(String initValues, String Delimiter) - { - - int index1; - int index2; - String firstValue; - String finalVal; - ArrayList list = new ArrayList(); - - - initValues = initValues.replaceAll("\"", ""); - for( int i=0;i< initValues.length();i++) - { - index1 = initValues.indexOf(Delimiter); - - firstValue = initValues.substring(index1+1); - - index2 = firstValue.indexOf(Delimiter); - if (index2 >=0) - { - finalVal = initValues.substring(index1+1,index1+index2+1); - initValues=initValues.substring(index1+index2); - list.add(finalVal); - } - - else - { - finalVal = initValues.substring(index1+1); - list.add(finalVal); - break; - } - } - return list; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/JulianDate.java b/posterita/posterita/src/main/org/posterita/core/JulianDate.java deleted file mode 100644 index 75a9d9ed13..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/JulianDate.java +++ /dev/null @@ -1,698 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 29-Jul-2005 by alok - * - */ - -package org.posterita.core; - -import java.sql.Timestamp; -import java.text.DateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; - - - -/** - * A light weight date class stored in julian format. - */ -public class JulianDate implements Comparable -{ - /** - * The end of time. - */ - public static final JulianDate MAX_VALUE = new JulianDate(Integer.MAX_VALUE); - - /** - * Beginning of AD - */ - public static final int INT_REAL_MIN_VALUE = 1721424; - public static final JulianDate MIN_VALUE = new JulianDate(0); - - /** - * Calculator used to convert java.util.Dates. - */ - protected static final GregorianCalendar gc = new GregorianCalendar(); - - /** - * Julian date, defaults to January 1'st, 1970 - */ - protected int julian = 2440588; - - /** - * No argument constructor. - */ - public JulianDate() {} - - /** - * Constructs a date according to the specified year, month, and day. - *

- * Entering an illegal value (e.g., a 14 for a month, or 31 for the number - * of days in February) results in a date of unpredictable value. - * - * @param year The year expressed as a 4-digit number. For example, 2002 - * @param month The month expressed as an integer between 1 and 12 - * @param day The day of the month, expressed as a number between 1 up to 31 - * - */ - public JulianDate(int year, int month, int day) - { - YMD ymd = new YMD(year, month, day); - - julian = ymd.julian(); - } - - - /** - * Constructs a julian date from a julian date value. - */ - public JulianDate(int julian) - { - this.julian = julian; - } - - /** - * Constructs a julian date from another julian date. - */ - public JulianDate(JulianDate d) - { - julian = d.julian; - } - - /** - * Constructs a julian date from a java date. - */ - public JulianDate(Date date) - { - julian = toJulian(date); - } - - /** - * Compares the current object and the passed-in object for equality. - * - * @param obj the object to compare with the current object. - * @return true if the two objects are equal, false otherwise. - */ - public boolean equals(Object obj) - { - try - { - JulianDate d = (JulianDate)obj; - - return (julian == d.julian); - } - catch (Exception ignore) {} - - return false; - } - - /** - * Returns the hash code of this object. - * - * @return the hash code of this object. - */ - public int hashCode() - { - return julian; - } - - /** - * - * Checks if the specified date is eual to this date. - * - * @return true if the specified object equals this object, - * otherwise returns false. - */ - public boolean equals(JulianDate d) - { - return (julian == d.julian); - } - - /** - * Returns the int difference between two julian dates. - * - * @param d the julian date whose value will be subtracted from this date. - * - * @return the difference betwween the julian value of this date and the - * julian value of the specified date. - */ - public int difference(JulianDate d) - { - return (julian - d.julian); - } - - /** - * Returns the julian value of this date. - * - * @return the julian value of this date. - */ - public int getJulian() - { - return julian; - } - - public Integer getJulianInt() - { - return Integer.valueOf(julian); - } - - /** - * Method used to create a timestamp. must have nonjulian time. - * - * @return the mseconds that are in the date(non Julian). - */ - public long getStandardTime() - { - return getJavaDate().getTime(); - } - - /** - * Returns a Long that is the last MSecond Of the Date Object. - * - * @return the last MSecond Of the Date Object. - */ - public long getLastMSDate() - { - JulianDate startOfDayTime = new JulianDate(this.getYear(), this.getMonth(), this.getDay()); - return (startOfDayTime.getStandardTime() + (24 * 60 * 60 * 1000 - 1)); - } - - /** - * Returns the day of the present year in which this date falls. - *

- * The 1'st of January is day 0. - * - * @return the day of the present year in which this date falls. - */ - public int getDay() - { - YMD ymd = new YMD(julian); - - return ymd.day; - } - - /** - * Returns the month of the present year in which this date falls. - *

- * January is month 0. - * - * @return the month of the present year in which this date falls. - */ - public int getMonth() - { - YMD ymd = new YMD(julian); - - return ymd.month; - } - - /** - * Returns the year in which this date falls. - * - * @return the year in which this date falls. - */ - public int getYear() - { - YMD ymd = new YMD(julian); - - return ymd.year; - } - - /** - * Checks if this date is on or before the input date. - * - * @return true if this date is on or before the input date, - * false otherwise. - */ - public boolean isOnOrBefore(JulianDate d) - { - return (julian < d.julian || julian == d.julian); - } - - - /** - * Checks if this date is on or after the input date. - * - * @return true if this date is on or after the input date, - * false otherwise. - */ - public boolean isOnOrAfter(JulianDate d) - { - return (julian > d.julian || julian == d.julian); - } - - /** - * Checks if this date is before the input date. - * - * @return true if this date is before the input date, - * false otherwise. - */ - public boolean isBefore(JulianDate d) - { - return (julian < d.julian); - } - - /** - * Checks if this date is after the input date. - * - * @return true if this date is before the input date, - * false otherwise. - */ - public boolean isAfter(JulianDate d) - { - return (julian > d.julian); - } - - /** - * Shifts the adjusted version by the offset, interpreted - * as a number of calendar dates, and sets the unadjusted version to be - * equal to the adjusted version. - * For example, if initially the unadjusted date is December 25, and the - * adjusted date is December 26, then shifting by an shift of 2 - * would cause the adjusted and unadjusted version to be December 28. - * - * @return the shifted date. - */ - public JulianDate shift(int shift) - { - JulianDate date = new JulianDate(this); - - date.julian += shift; - - return date; - } - - /** - * Returns a java.util.Date representation of the adjusted - * version of this. - * - * return a java.util.Date representation of the adjusted - * version of this. - */ - public java.util.Date getJavaDate() - { - return fromJulian(julian); - } - - /** - * Returns a java.sql.Date representation of the unadjusted - * version of this. - * - * @return a java.sql.Date representation of the unadjusted - * version of this. - */ - public java.sql.Date getSqlDate() - { - return new java.sql.Date(getJavaDate().getTime()); - } - - /** - * Returns a java.sql.Date representation of the adjusted - * version of this. - * - * @return a java.sql.Date representation of the adjusted - * version of this. - */ - public java.sql.Date getAdjSqlDate() - { - return new java.sql.Date(getJavaDate().getTime()); - } - - /** - * Add the given number of period units to this date. - */ - public JulianDate add(int units, int amount) - { - JulianDate date = null; - - synchronized (gc) - { - gc.setTime(getJavaDate()); - gc.add(units, amount); - - date = new JulianDate(gc.getTime()); - } - - return date; - } - - /** - * Convert a Java Date to it's Julian equivalent. - * - * @param the specified java date - * @return the corresponding julian value. - */ - protected int toJulian(java.util.Date date) - { - YMD ymd = null; - - synchronized (gc) - { - gc.setTime(date); - - ymd = new YMD(gc.get(GregorianCalendar.YEAR), gc.get(GregorianCalendar.MONTH) + 1, // GC month starts at 0 - gc.get(GregorianCalendar.DAY_OF_MONTH)); - } - - return ymd.julian(); - } - - /** - * Convert a Julian to it's Java Date equivalent. - * - * @param the specified julian value. - * @return the corresponding java date. - */ - protected java.util.Date fromJulian(int julian) - { - YMD ymd = new YMD(julian); - GregorianCalendar cal = new GregorianCalendar(ymd.year, ymd.month - 1, ymd.day); - - return cal.getTime(); - } - - /** - * Returns the day of the week of this date. - * - * @return the day of the week of this date. - */ - public int toDayOfWeek() - { - return new YMD(julian).toDayOfWeek(this); - } - - /** - * Returns a string representation of this object. - * - * @return a string representation of this object. - */ - public String toString() - { - DateFormat shortDF = DateFormat.getDateInstance(DateFormat.SHORT); - - return shortDF.format(fromJulian(julian)); - } - - /** - * Convert between Greogorian dates and Julian dates. - *

- * Algorithm adapted from Press et al., Numerical Recipes in C, 2nd ed., - * Cambridge University Press 1992 - */ - protected class YMD - { - - /** - * Gregorian day of month (1-31). - */ - int day = 0; - - /** - * Gregorian month of year (1-12). - */ - int month = 0; - - /** - * Gregorian year. - */ - int year = 0; - - YMD(int year, int month, int day) - { - this.year = year; - this.month = month; - this.day = day; - } - - YMD(int julian) - { - if (julian < 0) - { - julian = 0; - - } - - int a = julian; - - if (julian >= 2299161) - { - int jadj = (int)(((float)(julian - 1867216) - 0.25) / 36524.25); - - a += 1 + jadj - (int)(0.25 * jadj); - } - - int b = a + 1524; - int c = (int)(6680.0 + ((float)(b - 2439870) - 122.1) / 365.25); - int d = (int)(365 * c + (0.25 * c)); - int e = (int)((b - d) / 30.6001); - - day = b - d - (int)(30.6001 * e); - month = e - 1; - - if (month > 12) - { - month -= 12; - - } - - year = c - 4715; - - if (month > 2) - { - --year; - - } - - if (year <= 0) - { - --year; - } - } - - int julian() - { - int y = year; - - if (year < 0) - { - y++; - - } - - int m = month; - - if (month > 2) - { - m++; - } - else - { - y--; - m += 13; - } - - int julian = (int)(java.lang.Math.floor(365.25 * y) + java.lang.Math.floor(30.6001 * m) + day + 1720995.0); - - int yearZero = 15 + 31 * (10 + 12 * 1582); - - if (day + 31 * (month + 12 * year) >= yearZero) - { - int jadj = (int)(0.01 * y); - - julian += 2 - jadj + (int)(0.25 * jadj); - } - - return julian; - } - - public final int toDayOfWeek(JulianDate julDate) - { - - long julian = julDate.getDay(); - // If julian is negative, then julian%7 will be negative, so we adjust - // accordingly. We add 1 because Julian day 0 is Monday. - int dayOfWeek = (int)((julian + 1) % 7); - - return dayOfWeek + ((dayOfWeek < 0) ? (7 + Calendar.SUNDAY) : Calendar.SUNDAY); - } - - } - - /** - * Gets the day of week of the julian day, following the Calendar - * convention: - *

  • Calendar.SUNDAY = 1 - *
  • Calendar.MONDAY = 2 - *
  • ... - *
  • Calendar.SATURDAY = 7 - * - * @return gets the day of week of the julian day - */ - public static int getDayOfWeek(int julian) - { - // If julian is negative, then julian%DAYS_IN_WEEK will be negative, so we adjust - // accordingly. We add 1 because Julian day 0 is Monday. - int dayOfWeek = (int)((julian + 1) % DAYS_IN_WEEK); - - return dayOfWeek + ((dayOfWeek < 0) ? (DAYS_IN_WEEK + Calendar.SUNDAY) : Calendar.SUNDAY); - } - - /** - * Number of days in a week. - */ - public static final int DAYS_IN_WEEK = 7; - - /** - * Checks if a year is a leap year. - * - * @param aYear the year to check - * @eturn true if the specified year is a leap year, false otherwise. - */ - public static final boolean isLeapYear(int aYear) - { - return ((aYear % 4 == 0) && ((aYear % 100 != 0) || (aYear % 400 == 0))); - } - - /** - * Checks if the period contains the 29th of February. - * - * @param start the start date of the period - * @param end the end date of the period - * Returns true if the period contains the 29th of February, false otherwise. - */ - public static final boolean containsFebruary29AsAdj(JulianDate start, JulianDate end) - { - int startYear = start.getYear(); - int endYear = end.getYear(); - - if (isLeapYear(startYear)) - { - if (start.isOnOrBefore(new JulianDate(startYear, 2, 29))) - { - if (end.isOnOrAfter(new JulianDate(startYear, 2, 29))) - { - return true; - } - } - } - else if (isLeapYear(endYear)) - { - if (end.isOnOrAfter(new JulianDate(endYear, 2, 29))) - { - if (start.isOnOrBefore(new JulianDate(endYear, 2, 29))) - { - return true; - } - } - } - - return false; - } - - - /** - * Checks if this date is at the end of the month. - * - * Returns true if the date is on the last day of the month, false otherwise. - */ - public boolean isEndOfMonth() - { - return equals(getLastDayOfMonth()); - } - - /** - * Returns the last day of the specified month. - * - * @param aMonth the specified month - * @param aYear the specified year - * @return the last JulianDate of this month. - */ - public static final JulianDate getLastDayOfMonth(int aMonth, int aYear) - { - return getFirstDayOfNextMonth(aMonth, aYear).shift(-1); - } - - /** - * Returns the last day of the month in which this date falls. - * - * @return the last day of the month in which this date falls. - */ - public JulianDate getLastDayOfMonth() - { - return getLastDayOfMonth(this.getMonth(), this.getYear()); - } - - /** - * Returns the day following the specified month. - * - * @param aMonth the soecified month. - * @param aYear the specified year. - * @return the first JulianDate of the next month. - */ - public static final JulianDate getFirstDayOfNextMonth(int aMonth, int aYear) - { - if (aMonth == Calendar.DECEMBER + 1) // Calendar month starts at 0 - { - return new JulianDate(aYear + 1, 1, 1); - } - else - { - return new JulianDate(aYear, aMonth + 1, 1); - } - } - - /** - * Get today as a JulianDate. - * - * @return today as a JulianDate.. - */ - public static final JulianDate getToday() - { - Calendar rightNow = Calendar.getInstance(); - - // Calendar.MONTH starts at 0!! - return new JulianDate(rightNow.get(Calendar.YEAR), - rightNow.get(Calendar.MONTH) + 1, - rightNow.get(Calendar.DAY_OF_MONTH)); - } - - public int compareTo(Object o) - { - JulianDate date = (JulianDate) o; - return this.difference(date); - - } - - - public static Timestamp getTodayDateOnly() - { - Calendar cal = Calendar.getInstance(); - - cal.set(Calendar.HOUR_OF_DAY,0); - cal.set(Calendar.MINUTE,0); - cal.set(Calendar.SECOND,0); - cal.set(Calendar.MILLISECOND,0); - - Timestamp today = new Timestamp(cal.getTimeInMillis()); - - return today; - } - - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/core/KeyNamePairUtil.java b/posterita/posterita/src/main/org/posterita/core/KeyNamePairUtil.java deleted file mode 100644 index a258159eca..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/KeyNamePairUtil.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.core; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.util.DB; -import org.compiere.util.KeyNamePair; - -public class KeyNamePairUtil -{ - public static ArrayList getData(Properties ctx, String tableName, String whereClause) throws SQLException - { - return getData(ctx, tableName, whereClause, null); - } - - public static ArrayList getData(Properties ctx, String tableName, String whereClause, String trxName) throws SQLException - { - - // StringBuffer where = new StringBuffer(); - //StringBuffer from = new StringBuffer(); - - String keyColumn = tableName + "_ID"; - String sql; - - sql = "select name, " - + keyColumn - + " from " - + tableName; - - if (whereClause!=null) - sql = sql + " where " + whereClause+(" order by 1"); - - PreparedStatement pstmt = null; - - pstmt = DB.prepareStatement(sql, trxName); - ResultSet rs; - ArrayList data = new ArrayList(); - KeyNamePair pair; - int key; - String name; - - - try - { - rs = pstmt.executeQuery(); - - while (rs.next()) - { - name = rs.getString(1); - key = rs.getInt(2); - pair = new KeyNamePair(key, name); - data.add(pair); - } - - rs.close(); - } - catch (SQLException e) - { - throw e; - } - finally - { - try - { - pstmt.close(); - } - catch (Exception e) - {} - - pstmt = null; - } - - return data; - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/MenuItem.java b/posterita/posterita/src/main/org/posterita/core/MenuItem.java deleted file mode 100644 index 41097eb98d..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/MenuItem.java +++ /dev/null @@ -1,749 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 25, 2005 by vishee - */ - -package org.posterita.core; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import org.posterita.factory.AbstractFactory; -import org.compiere.model.MWebMenu; - -public class MenuItem -{ - - protected String menuLink; - protected MWebMenu menu; - protected ArrayList children; - protected int menuId; - protected boolean available; - - //dangerous constructor since nothing else is initialised. - private MenuItem(int menuId) - { - this.menuId = menuId; - } - - public MenuItem(MWebMenu menu) - { - this.menu = menu; - children = new ArrayList(); - menuLink = menu.getMenuLink(); - menuId = menu.get_ID(); - } - - public ArrayList getSubMenus() - { - return children; - } - - public Iterator getSubMenusIterator() - { - return children.iterator(); - } - - public void addSubMenu(MenuItem subMenu) - { - children.add(subMenu); - } - - public boolean hasSubMenu() - { - return (!children.isEmpty()); - } - - public boolean getHasSubMenu() - { - return (!children.isEmpty()); - } - - public boolean isActive() - { - return menu.isActive(); - } - - public String getImageLink() - { - return menu.getImageLink(); - } - - public String getMenuLink() - { - return menuLink; - } - - public int getMenuId() - { - return menuId; - } - - public String getModule() - { - return menu.getModule(); - } - - public int getParentMenuId() - { - return menu.getParentMenu_ID(); - } - - public String getPosition() - { - return menu.getPosition(); - } - - public void setMenuLink(String link) - { - menuLink = link; - } - - public String getDescription() - { - return menu.getDescription(); - } - - public boolean AmIaParent(int menuId) - { - ArrayList list = getAllChildren(); - MenuItem item = new MenuItem(menuId); - return list.contains(item); - } - - public ArrayList getBreadCrumb(int menuId) - { - ArrayList list = new ArrayList(); - - if (children.size() == 0) - return list; - - Iterator iter = children.iterator(); - - MenuItem me = new MenuItem(menuId); - - while (iter.hasNext()) - { - MenuItem item = (MenuItem) iter.next(); - - if (item.AmIaParent(menuId) || item.equals(me)) - { - list.add(item); - list.addAll(item.getBreadCrumb(menuId)); - } - - } - - return list; - } - - public String convert(int menuId) - { - ArrayList breadCrumb = getBreadCrumb(menuId); - Iterator iter = breadCrumb.iterator(); - - String bread = "\"\"  "; - while(iter.hasNext()) - { - MenuItem item = (MenuItem) iter.next(); - bread = bread + item.getName(); - } - - return bread; - } - - public ArrayList getAllChildren() - { - ArrayList list = new ArrayList(); - - if (children.size() == 0) - return list; - - Iterator iter = children.iterator(); - - while (iter.hasNext()) - { - MenuItem item = (MenuItem) iter.next(); - - ArrayList temp = item.getAllChildren(); - list.add(item); - list.addAll(temp); - } - - return list; - } - - - - - public static MenuItem getDummyMenuItem(Properties ctx) - { - MWebMenu menu = new MWebMenu(ctx, 0, null); - menu.setName("Dummy Root Menu"); - menu.setIsActive(false); - - MenuItem retMenu = new MenuItem(menu); - - return retMenu; - } - - - - public ArrayList getTopMenus() - { - return getMenus(AbstractFactory.MENU_POSITION_TOP); - } - - public ArrayList getLeftMenus() - { - return getMenus(AbstractFactory.MENU_POSITION_LEFT); - - } - - private ArrayList getMenus(String position) - { - ArrayList menuList = new ArrayList(); - - ArrayList menus = children; - - Iterator parentIter = menus.iterator(); - - while(parentIter.hasNext()) - { - MenuItem menuItem = (MenuItem)parentIter.next(); - if(menuItem.getPosition().compareTo(position) == 0) - { - menuList.add(menuItem); - } - } - - return menuList; - } - - // not good. - public ArrayList getSubMenus(int parentId) - { - ArrayList subMenus = new ArrayList(); - - Iterator pIter = children.iterator(); - MenuItem mItem; - - while(pIter.hasNext()) - { - mItem = (MenuItem)pIter.next(); - - if(mItem.getMenuId() == parentId) - { - subMenus = mItem.children; - - return subMenus; - } - } - - return subMenus; - } - - public boolean equals(Object obj) - { - MenuItem item = (MenuItem) obj; - - if ( obj == null) - return false; - - if (this.getMenuId() == item.getMenuId()) - return true; - else - return false; - } - - public boolean isAvailable() - { - return available; - } - - public void setAvailable(boolean available) - { - this.available = available; - } - - - public void setCategory(String category) - { - menu.setCategory(category); - } - - -/* public String getBreadCrumbMenu(Properties ctx, Integer menuId) - { - - if (menuId.intValue() != 0) - { - X_U_WebMenu menu = new X_U_WebMenu(ctx, menuId.intValue(), null); - - breadcrumb = breadcrumb + "" + menu.getName() + ""; - - if (menu.getParentMenu_ID() == 0) - return breadcrumb; - - getBreadCrumbMenu(ctx, Integer.valueOf(menu.getParentMenu_ID())); - } - - return breadcrumb; - } -*/ -/* public static String printTopMenu(MenuItem menuItem) - { - Iterator parentIter = menuItem.getSubMenusIterator(); - String htmlCode = ""; - htmlCode += ""; - MenuItem pItem; - - while(parentIter.hasNext()) - { - pItem = (MenuItem)parentIter.next(); - if(pItem.getPosition() == MenuFactory.MENU_POSITION_TOP) - { - - } - } - - htmlCode += "
    "; - }*/ - -/* private Properties ctx; - private Integer menuId; - private Integer parentMenuId; - private String name; - private String link; - private MenuItem[] children; - private String imageLink; - - private static final String BREAD_CRUMB_DELIMITER = ">"; - - public MenuItem(Properties ctx, Integer menuId) - { - this.ctx = ctx; - this.menuId = menuId; - } - - public String print() throws SystemException - { - MenuItem[] items = getChildren(); - - table table = new table(); - - for (int i = 0; i < items.length; i++) - { - MenuItem item = items[i]; - - tr tr = new tr(); - td td = new td(); - - img img = new img("images/link_icon.gif"); - img.addAttribute("width","15"); - img.addAttribute("height","15"); - img.addAttribute("border","0"); - img.addAttribute("align","absmiddle"); - img.addAttribute("vspace","5"); - - a a; - - //this is a leaf node - if (MenuManager.getChildren(ctx, item.getMenuId()).length == 0) - a = new a(item.getLink()); - else - a = new a(item.getLink() + item.getMenuId()); - - a.setClass("left"); - a.addElement(img); - - img.setTagText("" + item.getName()); - - a.addElement(img); - a.setPrettyPrint(true); - - td.addElement(a); - tr.addElement(td); - - table.addElement(tr); - } - - return table.toString(); - } - - public String getBreadCrumb(Integer menuId) throws SystemException, OperationException - { - MenuItem item = MenuManager.getParent(ctx, menuId); - MenuItem childMenuItm = getMenuItem(menuId); - - if (item == null) - return createBreadCrumb(childMenuItm); - - String breadCrumb = new String(""); - do - { - breadCrumb = createBreadCrumb(item) + BREAD_CRUMB_DELIMITER + breadCrumb; - item = MenuManager.getParent(ctx, item.getMenuId()); - } - while(item!=null); - - return breadCrumb; - - } - - private static String createBreadCrumb(MenuItem item) - { - a a = new a(item.getLink() + item.getMenuId()); - a.setTagText(item.getName()); - return a.toString(); - } - - public MenuItem[] getMenuJSP() throws SystemException - { - this.menuId = null; // make sure to retrieve first level menu - return getChildren(); - } - - public MenuItem[] MenuItems(Integer menuId) throws SystemException - { - return MenuManager.getChildren(ctx, menuId); - } - - private MenuItem getMenuItem(Integer menuItemId) - { - X_U_Menu menu = new X_U_Menu(ctx, menuItemId.intValue(), null); - MenuItem menuItem = new MenuItem(ctx, menuItemId); - menuItem.setLink(menu.getMenuLink()); - menuItem.setName(menu.getName()); - menuItem.setParentMenuId(Integer.valueOf(menu.getParentMenu_ID())); - return menuItem; - } - - - protected MenuItem[] getChildren() throws SystemException - { - if (children != null) - return children; - - MenuItem[] item = MenuManager.getChildren(ctx, menuId); - - children = item; - - return children; - } - - - public Integer getMenuId() - { - return menuId; - } - - public void setMenuId(Integer menuId) - { - this.menuId = menuId; - } - - public String getLink() - { - return link; - } - - public void setLink(String link) - { - this.link = link; - } - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - - public Integer getParentMenuId() - { - return parentMenuId; - } - - public void setParentMenuId(Integer parentMenuId) - { - this.parentMenuId = parentMenuId; - } - - - //Generating menurole - - public static String getMenu(Properties ctx,Integer menuId) throws SystemException, OperationException - { - - String tab = "    "; - - StringBuffer menuStr = new StringBuffer(""); - - StringBuffer whereClause = new StringBuffer("ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ad_org_id="+ Env.getAD_Org_ID(ctx)); - - // Modification brought due to Organisation type - String orgType = OrganisationManager.getOrganisationType(ctx); - - if(orgType == UdiConstants.ORG_TYPE_WHOLESALER) - whereClause.append(" and IsWholesaler='Y'"); - else if(orgType == UdiConstants.ORG_TYPE_RETAILER) - whereClause.append(" and IsRetailer='Y'"); - - // end modification - - MenuItem menuItem; - - if(menuId == null) - { - whereClause.append(" and parentmenu_id is null"); - } - else - { - whereClause.append(" and parentmenu_id =" + menuId); - - X_U_Menu menu = new X_U_Menu(ctx,menuId.intValue(), null); - - - if((MenuManager.getChildren(ctx,menuId).length == 0) && - (MenuManager.getParent(ctx,menuId) != null)) - { - menuStr.append(""); - menuStr.append(tab + menu.getName()); - menuStr.append(""); - menuStr.append(""); - menuStr.append(""); - } - else - { - menuStr.append(""); - menuStr.append(tab + menu.getName()); - menuStr.append(""); - menuStr.append(" "); - menuStr.append(""); - } - } - - //getting the child menus - int[] childId = X_U_Menu.getAllIDs(X_U_Menu.Table_Name,whereClause.toString(),null); - tab = tab + tab; - - for(int i=0; i 0) - { - img = new img(imageLink); - img.addAttribute("width","48"); - img.addAttribute("height","48"); - img.addAttribute("border","0"); - img.addAttribute("align","absmiddle"); - img.addAttribute("vspace","5"); - img.setTagText("" + item.getName()); - a.addElement(img); - } - else - { - a.setTagText(item.getName()); - } - - a.setPrettyPrint(true); - - td.addElement(a); - td.setHeight(48); - tr.addElement(td); - } - table.setCellPadding(10); - table.setBorder(2); - table.setBorderColor("#CC0000"); - table.setClass("header"); - table.addElement(tr); - return table.toString(); - } - - public String getImageLink() - { - return imageLink; - } - - public void setImageLink(String imageLink) - { - this.imageLink = imageLink; - } -*/ - public String getCategory() - { - //return ElementManager.getMsg(menu.getCtx(),menu.getCategory()).getName(); - return menu.getCategory(); - } - - public String getName() - { - //return ElementManager.getMsg(menu.getCtx(),menu.getName()).getName(); - return menu.getName(); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/NameValuePair.java b/posterita/posterita/src/main/org/posterita/core/NameValuePair.java deleted file mode 100644 index 0b100c6bb7..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/NameValuePair.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.core; - -import org.compiere.util.NamePair; - - -public class NameValuePair extends NamePair -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - /** - * Constructor KeyValue Pair - - * @param key Key (-1 is considered as null) - * @param name string representation - */ - public NameValuePair(String name, String value) - { - super(name); - this.value = value; - this.name = name; - } // KeyNamePair - - - private String value; - private String name; - - public String getValue() - { - return value; - } - - - public boolean equals(Object obj) - { - if (obj instanceof NameValuePair) - { - NameValuePair pair = (NameValuePair) obj; - if (pair.getName() != null) - if (pair.getName().equals(name) && pair.getValue().equals(value)) - return true; - - } - return false; - } // equals - - - - public String getID() - { - return name; - } - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - public void setValue(String value) - { - this.value = value; - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/PDFReportGenerator.java b/posterita/posterita/src/main/org/posterita/core/PDFReportGenerator.java deleted file mode 100644 index 96ef612e2f..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/PDFReportGenerator.java +++ /dev/null @@ -1,181 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 1, 2006 by praveen - * - */ -package org.posterita.core; - -import java.awt.Color; -import java.io.FileOutputStream; -import java.util.ArrayList; -import java.util.Properties; - -import org.posterita.exceptions.OperationException; -import org.posterita.lib.PropertiesConstant; -import com.lowagie.text.Chunk; -import com.lowagie.text.Document; -import com.lowagie.text.Element; -import com.lowagie.text.Font; -import com.lowagie.text.FontFactory; -import com.lowagie.text.Image; -import com.lowagie.text.PageSize; -import com.lowagie.text.Paragraph; -import com.lowagie.text.Rectangle; -import com.lowagie.text.pdf.BaseFont; -import com.lowagie.text.pdf.PdfTemplate; -import com.lowagie.text.pdf.PdfWriter; - -public abstract class PDFReportGenerator -{ - protected float CELLPADDING = 4; - protected float MARGIN = 30f; - - //setting default fonts - protected Font TITLE_FONT = FontFactory.getFont(FontFactory.HELVETICA,18,Font.BOLD,new Color(255,0,0)); - protected Font SUBTITLE_FONT = FontFactory.getFont(FontFactory.HELVETICA,15,Font.BOLD,new Color(255,0,0)); - protected Font HEADER_FONT = FontFactory.getFont(FontFactory.HELVETICA,10,Font.BOLD); - protected Font DATA_FONT = FontFactory.getFont(FontFactory.HELVETICA,10); - - //setting default pagesize - protected Rectangle PAGE_SIZE = PageSize.A4.rotate(); - - protected Image getTextAsImage(String text) throws OperationException - { - try - { - PdfTemplate template = writer.getDirectContent().createTemplate(20, 20); - //BaseFont bf = BaseFont.createFont("Helvetica", "winansi", false); - BaseFont bf = HEADER_FONT.getBaseFont(); - float size = 10; - float width = bf.getWidthPoint(text, size); - template.beginText(); - //template.setRGBColorFillF(1, 1, 1); - template.setFontAndSize(bf, size); - template.setTextMatrix(0, 2); - template.showText(text); - template.endText(); - template.setWidth(width); - template.setHeight(size + 2); - // make an Image object from the template - Image img = Image.getInstance(template); - img.setAlignment(Image.RIGHT | Image.TEXTWRAP); - - return img; - - } - catch (Exception e) - { - throw new OperationException(e); - } - } - - - public String getPDFReport(Properties ctx,ArrayList dataSource) throws OperationException - { - String filename = RandomStringGenerator.randomstring() + ".pdf"; - String dir = UDIFilePropertiesManager.getProperty().get(ctx, PropertiesConstant.UDI_HOME) + "/config/reports/pdf/"; - String filepath = dir + filename; - - //Generatting report - - //Initialising the datasource - this.dataSource = dataSource; - - if(dataSource == null) - throw new OperationException("Cannot generate report! Cause: empty datasource"); - - Rectangle dimension = getDocumentDimension(); - Document document = new Document(dimension,MARGIN,MARGIN,MARGIN,MARGIN); - - try - { - writer = PdfWriter.getInstance(document, new FileOutputStream(filepath)); - writer.setPageEvent(new PDFReportPageEventHelper()); - - document.open(); - - //Add the title part - Paragraph title = new Paragraph(); - Paragraph subTitle = new Paragraph(); - - - if(reportTitle != null) - { - title.add(new Chunk(reportTitle,TITLE_FONT)); - title.setAlignment(Element.ALIGN_CENTER); - document.add(title); - } - - if(reportSubTitle != null) - { - subTitle.add(new Chunk(reportSubTitle,SUBTITLE_FONT)); - subTitle.setAlignment(Element.ALIGN_CENTER); - document.add(subTitle); - } - - if((reportSubTitle != null)||(reportTitle != null)) - { - document.add(new Paragraph(" ")); - } - - writeDocument(document); - - document.close(); - writer.close(); - - - return "config/report/pdf/" + filename; - } - catch (Exception e) - { - throw new OperationException(e); - } - - } - - public String getReportSubTitle() - { - return reportSubTitle; - } - - public void setReportSubTitle(String reportSubTitle) - { - this.reportSubTitle = reportSubTitle; - } - - public String getReportTitle() - { - return reportTitle; - } - - public void setReportTitle(String reportTitle) - { - this.reportTitle = reportTitle; - } - - - protected abstract void writeDocument(Document document) throws OperationException; - protected abstract Rectangle getDocumentDimension(); - - protected ArrayList dataSource = null; - protected PdfWriter writer = null; - private String reportTitle = null; - private String reportSubTitle = null; - -} diff --git a/posterita/posterita/src/main/org/posterita/core/PDFReportPageEventHelper.java b/posterita/posterita/src/main/org/posterita/core/PDFReportPageEventHelper.java deleted file mode 100644 index d0f583e0e8..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/PDFReportPageEventHelper.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 1, 2006 by praveen - * - */ -package org.posterita.core; - -import java.text.SimpleDateFormat; -import java.util.Calendar; - -import com.lowagie.text.Document; -import com.lowagie.text.Font; -import com.lowagie.text.FontFactory; -import com.lowagie.text.Rectangle; -import com.lowagie.text.pdf.PdfContentByte; -import com.lowagie.text.pdf.PdfPTable; -import com.lowagie.text.pdf.PdfPageEventHelper; -import com.lowagie.text.pdf.PdfTemplate; -import com.lowagie.text.pdf.PdfWriter; - -/** - * This class extends the page event handler that displays the - * header and footer. - */ -public class PDFReportPageEventHelper extends PdfPageEventHelper -{ - protected PdfPTable table; - protected PdfTemplate tpl; - protected String dateAndTime; - - protected static final Font PAGE_FOOTER_FONT = FontFactory.getFont(FontFactory.HELVETICA,10,Font.BOLD); - protected static final float MARGIN = 30f; - - public void onOpenDocument(PdfWriter writer, Document document) - { - SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - dateAndTime = sdf.format(Calendar.getInstance().getTime()); - - table = new PdfPTable(2); - tpl = writer.getDirectContent().createTemplate(100, 100); - tpl.setBoundingBox(new Rectangle(-20, -20, 100, 100)); - - } - - public void onEndPage(PdfWriter writer, Document document) - { - PdfContentByte cb = writer.getDirectContent(); - cb.saveState(); - // write the headertable - table.setTotalWidth(document.right() - document.left()); - table.writeSelectedRows(0, -1, document.left(), document.getPageSize().getHeight() - 50, cb); - // compose the footer - String text = "Page " + writer.getPageNumber() + " of "; - float textSize = PAGE_FOOTER_FONT.getBaseFont().getWidthPoint(text, 10); - float textBase = document.bottom() - 20; - cb.beginText(); - cb.setFontAndSize(PAGE_FOOTER_FONT.getBaseFont(), 10); - - float adjust = PAGE_FOOTER_FONT.getBaseFont().getWidthPoint("0", 10); - cb.setTextMatrix(document.right() - textSize - adjust, textBase); - cb.showText(text); - cb.endText(); - cb.addTemplate(tpl, document.right() - adjust, textBase); - - cb.saveState(); - - text = "Report Generated on : " + dateAndTime; - - textSize = PAGE_FOOTER_FONT.getBaseFont().getWidthPoint(text, 10); - textBase = document.bottom() - 20; - cb.beginText(); - cb.setFontAndSize(PAGE_FOOTER_FONT.getBaseFont(), 10); - - adjust = PAGE_FOOTER_FONT.getBaseFont().getWidthPoint("0", 10); - cb.setTextMatrix(MARGIN, textBase); - cb.showText(text); - cb.endText(); - - cb.saveState(); - - } - - public void onCloseDocument(PdfWriter writer, Document document) { - tpl.beginText(); - tpl.setFontAndSize(PAGE_FOOTER_FONT.getBaseFont(), 10); - tpl.setTextMatrix(0, 0); - tpl.showText("" + (writer.getPageNumber() - 1)); - tpl.endText(); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/PieChart.java b/posterita/posterita/src/main/org/posterita/core/PieChart.java deleted file mode 100644 index 7eae18b472..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/PieChart.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 12-Jul-2006 17:18:07 by praveen - * - */ - -package org.posterita.core; - -import java.sql.SQLException; - -import org.compiere.util.DB; -import org.jfree.chart.ChartFactory; -import org.jfree.chart.JFreeChart; -import org.jfree.chart.title.TextTitle; -import org.jfree.data.general.DefaultPieDataset; -import org.jfree.data.jdbc.JDBCPieDataset; - -import org.posterita.exceptions.OperationException; - -public class PieChart extends AbstractChart -{ - public static final String CHART_TYPE = "PieChart"; - public static final int PIE_FLAT = 1; - public static final int PIE_3D = 2; - - private DefaultPieDataset dataset = null; - private int type = PIE_FLAT; - - public PieChart(){}; - - public PieChart(DefaultPieDataset dataset,String title) - { - this.dataset = dataset; - this.title = title; - - } - - public JFreeChart createChart() throws OperationException - { - if(dataset==null) - { - throw new OperationException("Cannot create Pie chart: cause -> dataset empty!"); - } - - - switch (type) { - case PIE_FLAT: - chart = ChartFactory.createPieChart(title,dataset,showLegend,showTooltip,true); - break; - - case PIE_3D: - chart = ChartFactory.createPieChart3D(title,dataset,showLegend,showTooltip,true); - break; - - default: - throw new OperationException("Invalid Piechart type! Can only be Piechart.PIE_FLAT or Piechart.PIE_3D"); - } - - //setting subtitle - if(subtitle!=null) - { - TextTitle title = new TextTitle(subtitle); - chart.addSubtitle(title); - } - - return chart; - - } - - public void getDataSetFromSQL(String sql) throws OperationException - { - - JDBCPieDataset jdbcDataset = new JDBCPieDataset(DB.getConnectionRO()); - - try - { - jdbcDataset.executeQuery(sql); - this.dataset = jdbcDataset; - } catch (SQLException e) { - throw new OperationException(e); - } - } - - public DefaultPieDataset getDataset() { - return dataset; - } - - public void setDataset(DefaultPieDataset dataset) { - this.dataset = dataset; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/PieLabelGenerator.java b/posterita/posterita/src/main/org/posterita/core/PieLabelGenerator.java deleted file mode 100644 index d4d6d19e83..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/PieLabelGenerator.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 29-Aug-2006 13:54:31 by praveen - * - */ - -package org.posterita.core; - -import java.util.Map; - -import org.jfree.chart.labels.StandardPieSectionLabelGenerator; -import org.jfree.data.general.PieDataset; - -public class PieLabelGenerator extends StandardPieSectionLabelGenerator -{ - /** - * - */ - private static final long serialVersionUID = 1L; - Map labelMap = null; - - public PieLabelGenerator(Map labelMap) - { - this.labelMap = labelMap; - } - - public String generateSectionLabel(PieDataset arg0, Comparable arg1) - { - return ""+labelMap.get(arg1); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/PrintOrderApplet.java b/posterita/posterita/src/main/org/posterita/core/PrintOrderApplet.java deleted file mode 100644 index a0519bb412..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/PrintOrderApplet.java +++ /dev/null @@ -1,360 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 17-Nov-2006 10:46:34 by praveen - * - */ - -package org.posterita.core; - -import java.applet.Applet; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.io.BufferedInputStream; -import java.io.ByteArrayOutputStream; -import java.net.URL; -import java.net.URLConnection; - -import javax.print.DocFlavor; -import javax.print.DocPrintJob; -import javax.print.PrintService; -import javax.print.PrintServiceLookup; -import javax.print.SimpleDoc; -import javax.print.attribute.HashPrintRequestAttributeSet; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JTextField; - -import org.jpedal.PdfDecoder; - -/** - * Modifications: Added pdf printing capability - * @author ashley - */ -public class PrintOrderApplet extends Applet implements Runnable, ItemListener -{ - private static final long serialVersionUID = 1L; - /** Printer Name **/ - private String printerName = null; - /** Print Data **/ - private byte[] _printData = null; - private String _dataURL = null; - private String _dataContentType = null; - private JComboBox cmbPrintServices; - private PrintService pServices[]; - private JTextField txtUrl; - - /** - * Initialise the applet and the print services - * @see java.applet.Applet#init() - */ - public void init() - { - pServices = getPrintServices(); - cmbPrintServices = new JComboBox(); - cmbPrintServices.setSize(100, 20); - cmbPrintServices.addItemListener(this); - - for (int i = 0; i < pServices.length; i++) - { - cmbPrintServices.addItem(pServices[i].getName()); - } - - add(cmbPrintServices); - - if(pServices.length == 0l) - { - cmbPrintServices.addItem("No Printers found on the system"); - } - - JLabel lbl = new JLabel(); - add(lbl); - - txtUrl = new JTextField(40); - add(txtUrl); - - JButton btn = new JButton("Print"); - btn.addActionListener( - new ActionListener(){ - public void actionPerformed(ActionEvent e) - { - String url = txtUrl.getText(); - printURL(url); - }} - ); - - add(btn); - } - - /** - * Triggered when printer is changed - * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent) - */ - public void itemStateChanged(ItemEvent e) - { - String pName = (String)e.getItem(); - if (e.getStateChange() == ItemEvent.SELECTED) - { - this.printerName = pName; - } - } - - /** - * Launch printing in a thread - * @see java.lang.Runnable#run() - */ - public void run() - { - PrintService printService = getPrintService(printerName); - - if (printService == null) - { - System.out.println("Could not get printer with name: " + printerName); - System.out.println("Taking default print service"); - printService = getDefaultPrintService(); - } - - if (printService == null) - { - System.out.println("No printers found"); - return; - } - - boolean isDataReady = loadPrintData(); - - if(isDataReady) - { - printData(printService); - } - else - { - System.out.println("Unable to print data."); - } - } - - /** - * Removes network protocol from printer name (Java problem) - * @param name Name of printer - * @return Name trimmed from Network protocol - */ - private String getValidatedPrinterName(String name) - { - if (name == null || name.length() == 0) - { - return name; - } - - if (name.startsWith("IPP") || name.startsWith("Win32")) - { - int index = name.indexOf(":"); - name = name.substring(index + 1, name.length()); - name = name.trim(); - } - return name; - } - - /** - * Get the system's print service by name - * @param name Name of Printer - * @return PrintService with the - */ - private PrintService getPrintService(String name) - { - PrintService pService = null; - if (name == null || name.trim().length() == 0) - { - return null; - } - - name = getValidatedPrinterName(name); - PrintService pServices[] = getPrintServices(); - for (int i = 0; i < pServices.length; i++) - { - String pServiceName = pServices[i].getName(); - pServiceName = getValidatedPrinterName(pServiceName); - if (name.equalsIgnoreCase(pServiceName)) - { - pService = pServices[i]; - break; - } - } - return pService; - } - - /** - * Get the system's default print service - * @return Default PrintService - */ - private PrintService getDefaultPrintService() - { - return PrintServiceLookup.lookupDefaultPrintService(); - } - - /** - * Get all the print services available on the system - * @return System available Print Services - */ - private PrintService[] getPrintServices() - { - if (pServices != null && pServices.length > 0) - { - return pServices; - } - - return PrintServiceLookup.lookupPrintServices(null, null); - } - - /** - * Retrieves the data from URL Provided - * @return true if loading of data successful - */ - private boolean loadPrintData() - { - try - { - URL url = new URL(_dataURL); - - System.out.println("Connecting to :" + _dataURL); - - URLConnection conn = url.openConnection(); - _dataContentType = conn.getContentType(); - - BufferedInputStream bis = new BufferedInputStream(conn.getInputStream()); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - System.out.println("Reading ......"); - - byte[] buf = new byte[1024]; - int len; - - while ((len = bis.read(buf)) > 0) - { - bos.write(buf, 0, len); - } - bis.close(); - - bos.flush(); - bos.close(); - - System.out.println("Reading completed successfully"); - - _printData = bos.toByteArray(); - - } - catch (Exception e) - { - e.printStackTrace(); - return false; - } - - return true; - } - - /** - * Sends the data to the print service based on the content type of the data - * @param printService Printer on which to print - * @return true if print command sent successfully - */ - private boolean printData(PrintService printService) - { - try - { - SimpleDoc doc; - - System.out.println("Printing data as:" + _dataContentType); - - //Print data as byte or PDF - if(_dataContentType.equalsIgnoreCase("application/pdf")) - { - PdfDecoder decodePDF = new PdfDecoder(true); - decodePDF.openPdfArray(_printData); - decodePDF.setPagePrintRange(1, decodePDF.getPageCount()); - decodePDF.setUsePDFPaperSize(true); - doc = new SimpleDoc(decodePDF, DocFlavor.SERVICE_FORMATTED.PAGEABLE, null); - } - else - { - doc = new SimpleDoc(_printData, DocFlavor.BYTE_ARRAY.AUTOSENSE, null); - } - - DocPrintJob job = printService.createPrintJob(); - job.print(doc, new HashPrintRequestAttributeSet()); - - System.out.println("Job sent to printer succesfully"); - return true; - } - catch (Exception e) - { - e.printStackTrace(); - return false; - } - } - - /** - * Prints data retrieved from URL - * @param url Data URL - */ - public void printURL(String url) - { - _dataURL = url; - System.out.println("Printing URL: " + url); - Thread thread = new Thread(this); - thread.start(); - } - - /** - * Returns flat string of the printers - * @return All printers available separated by ### - */ - public String getPrintersForJS() - { - if (pServices == null || pServices.length == 0) - { - return "No printers found, check settings"; - } - - String printers = ""; - for (int i = 0; i < pServices.length - 1; i++) - { - printers += pServices[i].getName() + "###"; - } - - printers += pServices[pServices.length - 1]; - - return printers; - } - - /** - * @return the printerName - */ - public String getPrinterName() - { - return printerName; - } - - /** - * @param printerName the printerName to set - */ - public void setPrinterName(String printerName) - { - this.printerName = printerName; - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/RandomStringGenerator.java b/posterita/posterita/src/main/org/posterita/core/RandomStringGenerator.java deleted file mode 100644 index 404c0985ac..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/RandomStringGenerator.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 29-Jul-2005 by alok - * - */ -package org.posterita.core; - -import java.util.Random; - -/** - * @author jane - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class RandomStringGenerator -{ - private static Random rn = new Random(); - - private RandomStringGenerator() - { - } - - public static int rand(int lo, int hi) - { - int n = hi - lo + 1; - int i = rn.nextInt() % n; - if (i < 0) - i = -i; - return lo + i; - } - - @SuppressWarnings("deprecation") - public static String randomstring(int lo, int hi) - { - int n = rand(lo, hi); - byte b[] = new byte[n]; - for (int i = 0; i < n; i++) - b[i] = (byte)rand('a', 'z'); - return new String(b, 0); - } - - public static String randomstring() - { - return randomstring(5, 25); - } - - - - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/Range.java b/posterita/posterita/src/main/org/posterita/core/Range.java deleted file mode 100644 index 6bbd2047db..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/Range.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 29-Jul-2005 by alok - * - */ - -package org.posterita.core; - -import java.io.Serializable; - - -public class Range implements Serializable -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - Comparable minValue; - Comparable maxValue; - - public Range(Comparable minValue, Comparable maxValue) - { - setMinValue(minValue); - setMaxValue(maxValue); - } - - public Comparable getMinValue() - { - return minValue; - } - - public void setMinValue(Comparable minValue) - { - this.minValue = minValue; - } - - public Comparable getMaxValue() - { - return maxValue; - } - - public void setMaxValue(Comparable maxValue) - { - this.maxValue = maxValue; - } - /** - * @value - * @return return true if the value is found in between the minimum value - * and the maximum value, else return false; - */ - @SuppressWarnings("unchecked") - public boolean isInRange(Comparable value) - { - if(value == null) - return false; - if((minValue == null || value.compareTo(minValue)>=0) && - (maxValue == null || value.compareTo(maxValue)<=0)) - return true; - - return false; - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/ReadKiaDemoData.java b/posterita/posterita/src/main/org/posterita/core/ReadKiaDemoData.java deleted file mode 100644 index 54f5da2d13..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/ReadKiaDemoData.java +++ /dev/null @@ -1,444 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - **/ -package org.posterita.core; - -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.StringTokenizer; - - -public class ReadKiaDemoData -{ - private static String DELIMITER = ","; - public static void main(String args[]) throws IOException - { - ArrayList list = readNatisFile("/home/vickram/Documents/natisFile.csv"); - ArrayList models = readModels("/home/vickram/Documents/modelMatch.csv"); - list = processNatisUploads(list, models); - write(list, "/home/vickram/Documents/processed.csv"); - } - - public static ArrayList readNatisFile(String filename) throws FileNotFoundException - { - FileInputStream fis = new FileInputStream(filename); - - ArrayList list = new ArrayList(); - - String unitNo; - String vinNo; - String natisModelNo; - String natisModelDesc; - String engineNo; - String mainColorCode; - String noOfWheels; - String tare; - String enginePower; - String engineCapacity; - String year; - String countryCode; - String shippingInvoiceNo; - String colorCodeHex; - String colourName; - String eta; - String price; - - KiaNatisProductBean bean; - - InputStreamReader isr = null; - BufferedReader bf = null; - - String line; - try - { - isr = new InputStreamReader(fis); - bf = new BufferedReader(isr); - StringTokenizer tokenizer; - - while ((line = bf.readLine())!=null) - { - tokenizer = new StringTokenizer(line, ","); - - unitNo = tokenizer.nextToken(); - vinNo = tokenizer.nextToken(); - natisModelNo = tokenizer.nextToken(); - natisModelDesc = tokenizer.nextToken(); - engineNo = tokenizer.nextToken(); - mainColorCode = tokenizer.nextToken(); - noOfWheels = tokenizer.nextToken(); - tare = tokenizer.nextToken(); - enginePower = tokenizer.nextToken(); - engineCapacity = tokenizer.nextToken(); - year = tokenizer.nextToken(); - countryCode = tokenizer.nextToken(); - shippingInvoiceNo = tokenizer.nextToken(); - colorCodeHex = tokenizer.nextToken(); - colourName = tokenizer.nextToken(); - eta = tokenizer.nextToken(); - eta = "12252005"; - price = tokenizer.nextToken(); - - engineNo = engineNo.replaceAll(" ", ""); - bean = new ReadKiaDemoData().new KiaNatisProductBean(); - bean.setUnitNo(unitNo); - bean.setVinNo(vinNo); - bean.setNatisModelNo(natisModelNo); - bean.setNatisModelDesc(natisModelDesc); - bean.setEngineNo(engineNo); - bean.setMainColorCode(mainColorCode); - bean.setNoOfWheels(noOfWheels); - bean.setTare(tare); - bean.setEnginePower(enginePower); - bean.setEngineCapacity(engineCapacity); - bean.setYear(year); - bean.setCountryCode(countryCode); - bean.setShippingInvoiceNo(shippingInvoiceNo); - bean.setColorCodeHex(colorCodeHex); - bean.setColourName(colourName); - bean.setEta(eta); - bean.setPrice(price); - list.add(bean); - - } - - } - catch(Exception e) - { - e.printStackTrace(); - } - finally - { - try - { - if ( isr != null) - { - isr.close(); - } - if ( bf != null) - { - bf.close(); - } - } - catch(Exception ex) - {} - } - - return list; - } - - public static ArrayList readModels(String filename) throws FileNotFoundException - { - FileInputStream fis = new FileInputStream(filename); - - ArrayList list = new ArrayList(); - - String model; - String modelNo; - String modelDerivative; - - - KiaNatisProductBean bean; - - InputStreamReader isr = null; - BufferedReader bf = null; - - String line; - try - { - isr = new InputStreamReader(fis); - bf = new BufferedReader(isr); - StringTokenizer tokenizer; - - while ((line = bf.readLine())!=null) - { - tokenizer = new StringTokenizer(line, ","); - - model = tokenizer.nextToken(); - modelNo = tokenizer.nextToken(); - modelDerivative = tokenizer.nextToken(); - - bean = new ReadKiaDemoData().new KiaNatisProductBean(); - bean.setModel(model); - bean.setNatisModelNo(modelNo); - bean.setModelDerivative(modelDerivative); - list.add(bean); - - } - - } - catch(Exception e) - { - e.printStackTrace(); - } - finally - { - try - { - if (fis != null) - { - fis.close(); - } - if (isr != null) - { - isr.close(); - } - if( bf != null) - { - bf.close(); - } - } - catch(Exception ex) - {} - } - - return list; - } - - - class KiaNatisProductBean - { - String unitNo; - String vinNo; - String natisModelNo; - String natisModelDesc; - String engineNo; - String mainColorCode; - String noOfWheels; - String tare; - String enginePower; - String engineCapacity; - String year; - String countryCode; - String shippingInvoiceNo; - String colorCodeHex; - String colourName; - String eta; - String price; - String model; - String modelDerivative; - - - public String getModel() { - return model; - } - public void setModel(String model) { - this.model = model; - } - public String getModelDerivative() { - return modelDerivative; - } - public void setModelDerivative(String modelDerivative) { - this.modelDerivative = modelDerivative; - } - public String getColorCodeHex() { - return colorCodeHex; - } - public void setColorCodeHex(String colorCodeHex) { - this.colorCodeHex = colorCodeHex; - } - public String getColourName() { - return colourName; - } - public void setColourName(String colourName) { - this.colourName = colourName; - } - public String getCountryCode() { - return countryCode; - } - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; - } - public String getEngineCapacity() { - return engineCapacity; - } - public void setEngineCapacity(String engineCapacity) { - this.engineCapacity = engineCapacity; - } - public String getEngineNo() { - return engineNo; - } - public void setEngineNo(String engineNo) { - this.engineNo = engineNo; - } - public String getEnginePower() { - return enginePower; - } - public void setEnginePower(String enginePower) { - this.enginePower = enginePower; - } - public String getEta() { - return eta; - } - public void setEta(String eta) { - this.eta = eta; - } - public String getMainColorCode() { - return mainColorCode; - } - public void setMainColorCode(String mainColorCode) { - this.mainColorCode = mainColorCode; - } - public String getNatisModelDesc() { - return natisModelDesc; - } - public void setNatisModelDesc(String natisModelDesc) { - this.natisModelDesc = natisModelDesc; - } - public String getNatisModelNo() { - return natisModelNo; - } - public void setNatisModelNo(String natisModelNo) { - this.natisModelNo = natisModelNo; - } - public String getNoOfWheels() { - return noOfWheels; - } - public void setNoOfWheels(String noOfWheels) { - this.noOfWheels = noOfWheels; - } - public String getPrice() { - return price; - } - public void setPrice(String price) { - this.price = price; - } - public String getShippingInvoiceNo() { - return shippingInvoiceNo; - } - public void setShippingInvoiceNo(String shippingInvoiceNo) { - this.shippingInvoiceNo = shippingInvoiceNo; - } - public String getTare() { - return tare; - } - public void setTare(String tare) { - this.tare = tare; - } - public String getUnitNo() { - return unitNo; - } - public void setUnitNo(String unitNo) { - this.unitNo = unitNo; - } - public String getVinNo() { - return vinNo; - } - public void setVinNo(String vinNo) { - this.vinNo = vinNo; - } - public String getYear() { - return year; - } - public void setYear(String year) { - this.year = year; - } - - public String toString() - { - String str = unitNo + DELIMITER + - vinNo + DELIMITER + - natisModelNo + DELIMITER + - natisModelDesc + DELIMITER + - engineNo + DELIMITER + - mainColorCode + DELIMITER + - noOfWheels + DELIMITER + - tare + DELIMITER + - enginePower + DELIMITER + - engineCapacity + DELIMITER + - year + DELIMITER + - countryCode + DELIMITER + - shippingInvoiceNo + DELIMITER + - colorCodeHex + DELIMITER + - colourName + DELIMITER + - eta + DELIMITER + - price + DELIMITER + - "" + DELIMITER + //natis registration status - "" + DELIMITER + //order status - ""; //description - return str; - } - } - - public static ArrayList processNatisUploads(ArrayList natisUploads, ArrayList models) - { - Iterator iter = natisUploads.iterator(); - - KiaNatisProductBean bean; - - String match; - while (iter.hasNext()) - { - bean = (KiaNatisProductBean) iter.next(); - match = getModelMatch(bean, models); - bean.setNatisModelDesc(match); - - } - - return natisUploads; - } - - public static String getModelMatch(KiaNatisProductBean bean, ArrayList models) - { - Iterator iter = models.iterator(); - - KiaNatisProductBean model; - - while (iter.hasNext()) - { - model = (KiaNatisProductBean) iter.next(); - - if (matchFound(bean, model)) - return model.getModel(); - } - - return "No match Found"; - - } - - public static boolean matchFound(KiaNatisProductBean bean, KiaNatisProductBean bean2) - { - if (bean.getNatisModelNo().equals(bean2.getNatisModelNo())) - if (bean.getNatisModelDesc().equals(bean2.getModelDerivative())) - return true; - - return false; - } - - public static void write(ArrayList natisModels, String fileName) throws IOException - { - Iterator iter = natisModels.iterator(); - - StringBuffer buffer = new StringBuffer(); - KiaNatisProductBean bean; - while (iter.hasNext()) - { - bean = (KiaNatisProductBean) iter.next(); - buffer.append(bean.toString()); - buffer.append("\n"); - - } - - FileManager.write(fileName, buffer.toString(), false); - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/SessionStorage.java b/posterita/posterita/src/main/org/posterita/core/SessionStorage.java deleted file mode 100644 index e168383764..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/SessionStorage.java +++ /dev/null @@ -1,513 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 29, 2005 by praveen - * - */ -package org.posterita.core; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; -import java.util.TreeSet; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.model.MCountry; -import org.compiere.model.MOrder; -import org.compiere.model.MOrg; -import org.compiere.model.MPOSTerminal; -import org.compiere.model.MStore; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.ValueNamePair; -import org.posterita.Constants; -import org.posterita.beans.AttributeValuesBean; -import org.posterita.beans.FilterBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.PriceListBean; -import org.posterita.beans.ProductAttributeBean; -import org.posterita.beans.ProductInfo; -import org.posterita.beans.ReportBean; -import org.posterita.beans.StockBean; -import org.posterita.beans.UDIPair; -import org.posterita.beans.WebDocumentBean; -import org.posterita.businesslogic.CurrencyManager; -import org.posterita.businesslogic.HistoryFilterBean; -import org.posterita.businesslogic.MenuManager; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.performanceanalysis.POSSalesReportManager; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.SystemException; -import org.posterita.lib.UdiConstants; - -public class SessionStorage -{ - - public static void putProductAttributes(HttpServletRequest request, ProductAttributeBean productAttributeBean) - { - //extract parameters from request - //1.attributeSetId - //2.attributeId - request.getSession().setAttribute(Constants.ATTRIBUTE_NAME, productAttributeBean.getAttributes()); - request.getSession().setAttribute(Constants.ATTRIBUTE_SET, productAttributeBean.getAttributeSets()); - request.getSession().setAttribute(Constants.ATTRIBUTE_VALUES, productAttributeBean.getAttributeValues()); - } - - @SuppressWarnings("unchecked") - public static void putTextileProductInfo(HttpServletRequest request, ProductInfo info) - { - //Properties ctx = TmkJSPEnv.getCtx(request); - - TreeSet brandSet = new TreeSet(info.getAttributeValuesBean().getBrand()); - TreeSet modelSet = new TreeSet(info.getAttributeValuesBean().getModel()); - TreeSet designSet = new TreeSet(info.getAttributeValuesBean().getDesign()); - TreeSet colourSet = new TreeSet(info.getAttributeValuesBean().getColour()); - TreeSet sizeSet = new TreeSet(info.getAttributeValuesBean().getSize()); - TreeSet trxSet = new TreeSet(info.getAttributeValuesBean().getTrx()); - TreeSet yearSet = new TreeSet(info.getAttributeValuesBean().getYears()); - - request.getSession().setAttribute(Constants.POS_STOCK,info.getProducts()); - request.getSession().setAttribute(Constants.BRAND_ATTRIBUTE_VALUES, brandSet); - request.getSession().setAttribute(Constants.MODEL_ATTRIBUTE_VALUES, modelSet); - request.getSession().setAttribute(Constants.DESIGN_ATTRIBUTE_VALUES, designSet); - request.getSession().setAttribute(Constants.COLOUR_ATTRIBUTE_VALUES, colourSet); - request.getSession().setAttribute(Constants.SIZE_ATTRIBUTE_VALUES, sizeSet); - request.getSession().setAttribute(Constants.TRX_ATTRIBUTE_VALUES, trxSet); - request.getSession().setAttribute(Constants.YEAR_ATTRIBUTE_VALUES, yearSet); - } - - public static void putWebOrderBean(Properties ctx,HttpServletRequest request, WebDocumentBean bean) throws OperationException - { - request.getSession().setAttribute(Constants.ORDER_LINES,bean.getLines()); - request.getSession().setAttribute(Constants.MORDER, bean.getOrder()); - } - - public static void putHistoryFilterBeans(HttpServletRequest request, ArrayList orderHistory) - { - HistoryFilterBean orderHistoryBeans = new HistoryFilterBean(orderHistory); - - TreeSet bPartners = orderHistoryBeans.getBPartnerList(); - TreeSet docStatus = orderHistoryBeans.getDocStatusList(); - - request.getSession().setAttribute(Constants.BPARTNER, bPartners); - request.getSession().setAttribute(Constants.DOC_STATUS, docStatus); - } - - public static WebDocumentBean getWebOrderBean(Properties ctx, HttpServletRequest request) - { - ArrayList orderLines = (ArrayList) request.getSession().getAttribute(Constants.ORDER_LINES); - - MOrder order = (MOrder) request.getSession().getAttribute(Constants.MORDER); - - WebDocumentBean webOrderBean = new WebDocumentBean(); - webOrderBean.setLines(orderLines); - webOrderBean.setOrder(order); - return webOrderBean; - } - - public static void putPriceList(HttpServletRequest request, ArrayList priceList) - { - AttributeValuesBean attrs = PriceListManager.getAttributeValues(priceList); - - ArrayList modelSet = attrs.getModel(); - ArrayList colourSet = attrs.getColour(); - ArrayList trxSet = attrs.getTrx(); - ArrayList yearSet = attrs.getYears(); - - request.getSession().setAttribute(Constants.PRICE_LIST, priceList); - request.getSession().setAttribute(Constants.MODEL_ATTRIBUTE_VALUES, modelSet); - request.getSession().setAttribute(Constants.COLOUR_ATTRIBUTE_VALUES, colourSet); - request.getSession().setAttribute(Constants.TRX_ATTRIBUTE_VALUES, trxSet); - request.getSession().setAttribute(Constants.YEAR_ATTRIBUTE_VALUES, yearSet); - - } - - public static void putOrderFiltering(Properties ctx, HttpServletRequest request, FilterBean filterBean) - { - ArrayList bpList = (ArrayList) filterBean.getBpList(); - ArrayList docStatusList = (ArrayList) filterBean.getDocStatusList(); - - if ((bpList!=null) && (bpList.size()!=0)) - { - TreeSet bpSet = new TreeSet(bpList); - request.setAttribute(Constants.BPARTNER, bpSet); - } - - if ((docStatusList!=null) && (docStatusList.size()!=0)) - { - TreeSet bpSet = new TreeSet(docStatusList); - request.setAttribute(Constants.DOC_STATUS, bpSet); - } - } - - public static void putSCOrderFiltering(Properties ctx, HttpServletRequest request, FilterBean filterBean) throws OperationException - { - putOrderFiltering(ctx, request, filterBean); - - MOrg myOrg = OrganisationManager.getMyOrg(ctx); - } - - @SuppressWarnings("unchecked") - public static void putPriceListProducts(HttpServletRequest request, ProductInfo info) - { - TreeSet modelSet = new TreeSet(info.getAttributeValuesBean().getModel()); - TreeSet colourSet = new TreeSet(info.getAttributeValuesBean().getColour()); - TreeSet trxSet = new TreeSet(info.getAttributeValuesBean().getTrx()); - TreeSet yearSet = new TreeSet(info.getAttributeValuesBean().getYears()); - - request.getSession().setAttribute(Constants.MODEL_ATTRIBUTE_VALUES, modelSet); - request.getSession().setAttribute(Constants.COLOUR_ATTRIBUTE_VALUES, colourSet); - request.getSession().setAttribute(Constants.TRX_ATTRIBUTE_VALUES, trxSet); - request.getSession().setAttribute(Constants.YEAR_ATTRIBUTE_VALUES, yearSet); - } - - public static void putMenus(Properties ctx, HttpServletRequest request) throws SystemException, OperationException - { - ArrayList menuList = MenuManager.getMenus(ctx, request); - MenuItem menus = MenuManager.buildMenuTree(ctx, menuList); - ArrayList topMenusList = menus.getTopMenus(); - ArrayList leftMenusList = menus.getLeftMenus(); - - request.getSession().setAttribute(Constants.MENUS, menus); - request.getSession().setAttribute(Constants.TOP_MENUS, topMenusList); - request.getSession().setAttribute(Constants.LEFT_MENUS, leftMenusList); - - } - - public static void putOrg(Properties ctx, HttpServletRequest request) - { - MOrg org = new MOrg(ctx, Env.getAD_Org_ID(ctx), null); - - request.getSession().setAttribute(Constants.ORGANISATION, org); - } - - public static void putProductAttributeValueIds(HttpServletRequest request, StockBean bean) - { - request.getSession().setAttribute(Constants.MODEL_ATTRIBUTE_VALUE_ID, bean.getModel()); - request.getSession().setAttribute(Constants.COLOUR_ATTRIBUTE_VALUE_ID, bean.getColour()); - request.getSession().setAttribute(Constants.TRX_ATTRIBUTE_VALUE_ID, bean.getTransmission()); - request.getSession().setAttribute(Constants.YEAR_ATTRIBUTE_VALUE_ID, bean.getYear()); - } - - public static StockBean getProductAttributeValueIds(HttpServletRequest request, StockBean bean) - { - Integer modelAttributeValueId = (Integer) request.getSession().getAttribute(Constants.MODEL_ATTRIBUTE_VALUE_ID); - Integer colourAttributeValueId = (Integer) request.getSession().getAttribute(Constants.COLOUR_ATTRIBUTE_VALUE_ID); - Integer trxAttributeValueId = (Integer) request.getSession().getAttribute(Constants.TRX_ATTRIBUTE_VALUE_ID); - Integer yearAttributeValueId = (Integer) request.getSession().getAttribute(Constants.YEAR_ATTRIBUTE_VALUE_ID); - - bean.setModel(modelAttributeValueId); - bean.setColour(colourAttributeValueId); - bean.setTransmission(trxAttributeValueId); - bean.setYear(yearAttributeValueId); - - return bean; - } - - public static void putOrderInfo(Properties ctx, WebDocumentBean webBean, HttpServletRequest request) - { - request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); - request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); - request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); - request.getSession().setAttribute(Constants.ME, webBean.getMe()); - request.getSession().setAttribute(Constants.YOU,webBean.getYou()); - request.getSession().setAttribute(Constants.MORDER, webBean.getOrder()); - request.getSession().setAttribute(Constants.MORDER_LINES_COLLECTION,webBean.getLines()); - request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); - request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); - request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); - request.getSession().setAttribute(Constants.ORDER_TAX,webBean.getTotalTax()); - request.getSession().setAttribute(Constants.TOTAL_LINES,webBean.getTotalLines()); - request.getSession().setAttribute(Constants.GRAND_TOTAL,webBean.getGrandTotal()); - request.getSession().setAttribute(Constants.ALLOCATION,webBean.getAllocations()); - request.getSession().setAttribute(Constants.SALES_REP, webBean.getSalesRep()); - } - - public static void putPOSOrderInfo(Properties ctx,OrderLineBean bean,HttpServletRequest request,String forward) throws OperationException - { - if (forward == null) - throw new OperationException("Invalid forward parameter, it is set to null"); - - if (forward.equals(POSManager.DELETE_POS_ORDERLINE)) - { - Integer posOrderId=(Integer)request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); - MOrder posOrder = new MOrder(ctx, posOrderId, null); - ArrayList POSlist = POSManager.populateOrderLines(ctx,posOrder); - WebDocumentBean POSdocumentBean=POSManager.calculateOrderTotals(POSlist); - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,posOrder.get_ID()); - request.setAttribute(Constants.POS_ORDER_LINES,POSlist); - request.setAttribute(Constants.ORDER_TAX,POSdocumentBean.getTotalTax()); - request.setAttribute(Constants.TOTAL_LINES,POSdocumentBean.getTotalLines()); - request.setAttribute(Constants.GRAND_TOTAL,POSdocumentBean.getGrandTotal()); - } - else if (forward.equals(POSManager.DELETE_PARTIAL_POS_ORDERLINE)) - { - Integer posOrderId=(Integer)request.getSession().getAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); - MOrder posOrder = new MOrder(ctx, posOrderId, null); - ArrayList POSlist = POSManager.populateOrderLines(ctx,posOrder); - WebDocumentBean POSdocumentBean=POSManager.calculateOrderTotals(POSlist); - request.getSession().setAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID,posOrder.get_ID()); - request.setAttribute(Constants.PARTIAL_POS_ORDER_LINES,POSlist); - request.setAttribute(Constants.ORDER_TAX,POSdocumentBean.getTotalTax()); - request.setAttribute(Constants.TOTAL_LINES,POSdocumentBean.getTotalLines()); - request.setAttribute(Constants.GRAND_TOTAL,POSdocumentBean.getGrandTotal()); - } - else if (forward.equals(POSManager.DELETE_GOODS_RECEIVE_ORDERLINE)) - { - Integer goodsReceiceNoteId=(Integer)request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE_ID); - MOrder goodsReceiveNote = new MOrder(ctx,goodsReceiceNoteId,null); - goodsReceiveNote = new MOrder(ctx, goodsReceiveNote.get_ID(), null); - ArrayList Receivelist = POSManager.populateOrderLines(ctx,goodsReceiveNote); - WebDocumentBean receivedocumentBean=POSManager.calculateOrderTotals(Receivelist); - request.getSession().setAttribute(Constants.GOODS_RECEIVE_NOTE_ID,goodsReceiveNote.get_ID()); - request.setAttribute(Constants.GOODS_RECEIVE_NOTE_LINES,Receivelist); - request.setAttribute(Constants.ORDER_TAX,receivedocumentBean.getTotalTax()); - request.setAttribute(Constants.TOTAL_LINES,receivedocumentBean.getTotalLines()); - request.setAttribute(Constants.GRAND_TOTAL,receivedocumentBean.getGrandTotal()); - } - else if (forward.equals(POSManager.DELETE_CUSTOMER_RETURN_ORDERLINE)) - { - Integer customerReturnOrderId=(Integer)request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); - MOrder customerReturnOrder=new MOrder(ctx,customerReturnOrderId,null); - ArrayList returnList = POSManager.populateOrderLines(ctx,customerReturnOrder); - WebDocumentBean receivedocumentBean=POSManager.calculateOrderTotals(returnList); - request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER,customerReturnOrder); - request.setAttribute(Constants.CUSTOMER_RETURN_ORDER_LINES,returnList); - request.setAttribute(Constants.ORDER_TAX,receivedocumentBean.getTotalTax()); - request.setAttribute(Constants.TOTAL_LINES,receivedocumentBean.getTotalLines()); - request.setAttribute(Constants.GRAND_TOTAL,receivedocumentBean.getGrandTotal()); - } - else - { - Integer goodsReturnNoteId=(Integer)request.getSession().getAttribute(Constants.GOODS_RETURN_NOTE_ID); - MOrder goodsReturnNote=new MOrder(ctx,goodsReturnNoteId,null); - goodsReturnNote = new MOrder(ctx, goodsReturnNote.get_ID(), null); - ArrayList list = POSManager.populateOrderLines(ctx,goodsReturnNote); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - - request.getSession().setAttribute(Constants.GOODS_RETURN_NOTE,goodsReturnNote); - request.setAttribute(Constants.GOODS_RETURN_NOTE_LINES,list); - request.setAttribute(Constants.ORDER_TAX,documentBean.getTotalTax()); - request.setAttribute(Constants.TOTAL_LINES,documentBean.getTotalLines()); - request.setAttribute(Constants.GRAND_TOTAL,documentBean.getGrandTotal()); - } - } - - public static void putCompleteOrderInfo(Properties ctx,HttpServletRequest request,WebDocumentBean webBean,WebDocumentBean documentBean) - { - request.setAttribute(Constants.ORDER_TAX,documentBean.getTotalTax()); - request.setAttribute(Constants.TOTAL_LINES,documentBean.getTotalLines()); - request.setAttribute(Constants.SUB_TOTAL, documentBean.getSubTotal()); - request.setAttribute(Constants.GRAND_TOTAL,documentBean.getGrandTotal()); - request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); - request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); - request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); - request.getSession().setAttribute(Constants.ME, webBean.getMe()); - request.getSession().setAttribute(Constants.YOU,webBean.getYou()); - request.getSession().setAttribute(Constants.MORDER, webBean.getOrder()); - request.getSession().setAttribute(Constants.MORDER_LINES_COLLECTION,webBean.getLines()); - request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); - request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); - request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); - request.getSession().setAttribute(Constants.ORDER_TAX,webBean.getTotalTax()); - request.getSession().setAttribute(Constants.TOTAL_LINES,webBean.getTotalLines()); - request.getSession().setAttribute(Constants.GRAND_TOTAL,webBean.getGrandTotal()); - request.getSession().setAttribute(Constants.ALLOCATION,webBean.getAllocations()); - request.getSession().setAttribute(Constants.SALES_REP, webBean.getSalesRep()); - request.getSession().setAttribute(Constants.DESCRIPTION, webBean.getDescription()); - request.getSession().setAttribute(Constants.PAYMENT_BY_CASH, webBean.getPaymentByCash()); - request.getSession().setAttribute(Constants.PAYMENT_BY_CARD, webBean.getPaymentByCard()); - request.getSession().setAttribute(Constants.PAYMENT_BY_CHEQUE, webBean.getPaymentbyCheque()); - request.setAttribute(Constants.CURRENCY_SYMBOLE,webBean.getCurrencySymbole()); - - } - - - public static void setPOSTerminal(Properties ctx, int terminalId, HttpServletRequest request) throws OperationException - { - Env.setContext(ctx, UdiConstants.TERMINAL_ID, terminalId); - - MPOSTerminal terminal = new MPOSTerminal(ctx, terminalId, null); - - int purchasePList = terminal.getPO_PriceList_ID(); - int purchasePLVersion = PriceListManager.getPriceListVersionID(ctx, purchasePList, null); - - Env.setContext(ctx,UdiConstants.POS_PURCHASE_PL_VERSION,purchasePLVersion); - Env.setContext(ctx,UdiConstants.POS_PURCHASE_PL,purchasePList); - - } - - public static void putSalesGroupFilter(Properties ctx,HttpServletRequest request,ReportBean bean) throws OperationException - { - ArrayList groupList = POSSalesReportManager.getSalesGroupList(ctx,bean); - ArrayList priceQtyFilter = POSSalesReportManager.getPriceQtyFilter(ctx); - - request.getSession().setAttribute(Constants.SALESGROUP_LIST,groupList); - request.getSession().setAttribute(Constants.PRICEQTY_FILTER,priceQtyFilter); - request.getSession().removeAttribute(Constants.REPORT_URL); - } - public static void removeSession(Properties ctx,HttpServletRequest request) - { - //goods Receive Note - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); - request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.DESCRIPTION); - request.getSession().removeAttribute(Constants.B_PARTNER_ID); - request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_ID); - request.getSession().removeAttribute(Constants.DESCRIPTION); - request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER); - request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER_ID); - - //goods return Note - - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART); - request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_ID); - request.getSession().removeAttribute(Constants.B_PARTNER_ID); - request.getSession().removeAttribute(Constants.DESCRIPTION); - request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER); - request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER_ID); - - //Customer Return Order - - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.DESCRIPTION); - request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); - request.getSession().removeAttribute(Constants.B_PARTNER_ID); - - request.getSession().removeAttribute(Constants.ORDER_TYPE); - request.getSession().removeAttribute(Constants.POS_ORDER_DOC_NUMBER); - request.getSession().removeAttribute(Constants.CREDIT_PAYMENT_TERM_ID); - request.getSession().removeAttribute( Constants.PRESENT_CUSTOMER_RET_ORDER ); - request.getSession().removeAttribute( Constants.PRESENT_CUSTOMER_RET_ORDER_ID); - - //pos order - - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.BPARTNER); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); - - - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); - request.getSession().removeAttribute(Constants.PRESENT_POS_ORDER); - request.getSession().removeAttribute( Constants.PRESENT_POS_ORDER_ID ); - - //credit order - - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.CREDIT_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); - request.getSession().removeAttribute(Constants.CREDITORDER_BPARTNER); - request.getSession().removeAttribute(Constants.SHIPMENT_REQUIRED); - request.getSession().removeAttribute(Constants.TO_BE_SHIPPED); - request.getSession().removeAttribute(Constants.CREDITORDER_BPARTNER); - request.getSession().removeAttribute( Constants.PRESENT_CREDIT_ORDER ); - request.getSession().removeAttribute( Constants.PRESENT_CREDIT_ORDER_ID); - - request.getSession().removeAttribute(Constants.ORDER_TYPE); - request.getSession().removeAttribute(Constants.POS_ORDER_DOC_NUMBER); - } - - public static void putCountriesAndCurrencies(Properties ctx, HttpServletRequest request) throws OperationException - { - try - { - ArrayList countriesKNPair = KeyNamePairUtil.getData(ctx, MCountry.Table_Name, "IsActive='Y'"); - ArrayList currenciesKNPair = CurrencyManager.getAllCurrencies(); - - request.getSession().setAttribute(Constants.COUNTRIES, countriesKNPair); - request.getSession().setAttribute(Constants.CURRENCIES, currenciesKNPair); - } - catch (SQLException e) - { - throw new OperationException(e); - } - } - - public static void putStoreName(Properties ctx, HttpServletRequest request) - { - MStore store = MStore.get(ctx, Env.getContextAsInt(ctx, UdiConstants.WSTORE_CTX_PARAM)); - - if (store == null) - request.getSession().setAttribute(Constants.APP_NAME, ""); - else - request.getSession().setAttribute(Constants.APP_NAME, store.getName()); - } - - public static void putLoginSession(Properties ctx, HttpServletRequest request, HttpServletResponse response, int terminalId) throws OperationException - { - setPOSTerminal(ctx, terminalId, request); - POSTerminalManager.setTerminalInCookie(response, terminalId); - String currSymboleSales = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); - String currSymbolePurchase = POSTerminalManager.getDefaultPurchaseCurrency(ctx).getCurSymbol(); - request.getSession().setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); - request.getSession().setAttribute(Constants.CURRENCY_SYMBOLE_PURCHASE,currSymbolePurchase); - request.getSession().setAttribute(Constants.USER_ORGS,OrganisationManager.getUserOrgPairs(ctx)); - request.getSession().setAttribute(Constants.USER_ORGS_STOCK, OrganisationManager.getUserOrgPairs(ctx, false)); - putCountriesAndCurrencies(ctx, request); - putStoreName(ctx, request); - putPriceLists(ctx, request); - - // Terminal Transfer values - ValueNamePair noTransfer = new ValueNamePair("", ""); - ValueNamePair bankAccountTransfer = new ValueNamePair(MPOSTerminal.CASHBOOKTRANSFERTYPE_BankAccount, "Bank Account"); - ValueNamePair cashbookTransfer = new ValueNamePair(MPOSTerminal.CASHBOOKTRANSFERTYPE_CashBook, "Cashbook"); - ArrayList terminalTransferList = new ArrayList(); - terminalTransferList.add(noTransfer); - terminalTransferList.add(bankAccountTransfer); - terminalTransferList.add(cashbookTransfer); - request.getSession().setAttribute(Constants.TERMINAL_TRANSFER_TYPE, terminalTransferList); - } - - public static void putPriceLists(Properties ctx, HttpServletRequest request) throws OperationException - { - int soPriceListId = POSTerminalManager.getSOPriceListId(ctx); - int poPriceListId = POSTerminalManager.getPOPriceListId(ctx); - int warehouseId = POSTerminalManager.getWarehouseId(ctx); - Env.setContext(ctx, UdiConstants.PRICELIST_CTX_PARAM, soPriceListId); - Env.setContext(ctx, UdiConstants.WAREHOUSE_CTX_PARAM, warehouseId); - - ArrayList activeSalesPriceLists = PriceListManager.getPriceLists(ctx,0,"",true,null,null,true,null); - ArrayList salesPriceListsKNP = PriceListManager.getKeyNamePair(ctx, activeSalesPriceLists); - - ArrayList activePurchasePriceLists = PriceListManager.getPriceLists(ctx,0,"",true,null,null,false,null); - ArrayList purchasePriceListsKNP = PriceListManager.getKeyNamePair(ctx, activePurchasePriceLists); - - ArrayList activePriceLists = PriceListManager.getPriceLists(ctx, 0, "", true, null, null, null, null); - ArrayList priceListsKNP = PriceListManager.getKeyNamePair(ctx, activePriceLists); - - request.getSession().setAttribute(Constants.USER_SALES_PRICE_LISTS, salesPriceListsKNP); - request.getSession().setAttribute(Constants.USER_PURCHASE_PRICE_LISTS, purchasePriceListsKNP); - request.getSession().setAttribute(Constants.USER_PRICE_LISTS, priceListsKNP); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/SimpleCalendarDate.java b/posterita/posterita/src/main/org/posterita/core/SimpleCalendarDate.java deleted file mode 100644 index cefc49cb08..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/SimpleCalendarDate.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 29-Jul-2005 by alok - * - */ - -package org.posterita.core; - -/* - * This class is used for formatting purposes only - * @author vishee - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -public class SimpleCalendarDate -{ - private String year; - private String month; - private String day; - - - public SimpleCalendarDate(String day, String month, String year) - { - this.day = day; - this.month = month; - this.year = year; - } - - - - /** - * @return Returns the day. - */ - public String getDay() - { - return day; - } - /** - * @param day The day to set. - */ - public void setDay(String day) - { - this.day = day; - } - /** - * @return Returns the month. - */ - public String getMonth() - { - return month; - } - /** - * @param month The month to set. - */ - public void setMonth(String month) - { - this.month = month; - } - /** - * @return Returns the year. - */ - public String getYear() - { - return year; - } - /** - * @param year The year to set. - */ - public void setYear(String year) - { - this.year = year; - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/SimpleReportGenerator.java b/posterita/posterita/src/main/org/posterita/core/SimpleReportGenerator.java deleted file mode 100644 index b793058ae7..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/SimpleReportGenerator.java +++ /dev/null @@ -1,178 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 6, 2006 by praveen - * - */ -package org.posterita.core; - -import java.util.Iterator; - -import org.posterita.exceptions.OperationException; -import com.lowagie.text.Chunk; -import com.lowagie.text.Document; -import com.lowagie.text.Element; -import com.lowagie.text.PageSize; -import com.lowagie.text.Paragraph; -import com.lowagie.text.Rectangle; -import com.lowagie.text.pdf.PdfPCell; -import com.lowagie.text.pdf.PdfPTable; - -public class SimpleReportGenerator extends PDFReportGenerator -{ - private PdfPTable table = null; - float[] columnWidth = null; - - public SimpleReportGenerator() - { - this.PAGE_SIZE = PageSize.A4.rotate(); - } - - protected void writeDocument(Document document) throws OperationException - { - int columnCount = 0; - - Object[] obj = null; - - Iterator iter = dataSource.iterator(); - - try - { - if(iter.hasNext()) - { - obj = (Object[]) iter.next(); - - columnCount = obj.length; - - table = new PdfPTable(columnCount); - - - for(int i = 0; i < columnCount; i++) - { - Paragraph p = new Paragraph(new Chunk(obj[i].toString(),HEADER_FONT)); - PdfPCell cell = new PdfPCell(p); - cell.setHorizontalAlignment(Element.ALIGN_CENTER); - - table.addCell(cell); - } - - //table.endHeaders(); - } - - while(iter.hasNext()) - { - obj = (Object[]) iter.next(); - - - for(int i = 0; i < columnCount; i++) - { - Paragraph p = new Paragraph(new Chunk(obj[i].toString(),HEADER_FONT)); - PdfPCell cell = new PdfPCell(p); - - table.addCell(cell); - } - } - - table.setWidths(columnWidth); - document.add(table); - } - catch (Exception e) - { - throw new OperationException(e); - } - } - - - protected Rectangle getDocumentDimension() - { - if(dataSource == null) return PAGE_SIZE; - - Iterator iter = dataSource.iterator(); - - int columnCount = 0; - - Object[] obj = null; - - if(iter.hasNext()) - { - obj = (Object[]) iter.next(); - - columnCount = obj.length; - columnWidth = new float[columnCount]; - - for(int i = 0; i < columnCount; i++) - { - columnWidth[i] = new Chunk(obj[i].toString(),HEADER_FONT).getWidthPoint(); - } - } - - while(iter.hasNext()) - { - obj = (Object[]) iter.next(); - - columnCount = obj.length; - - for(int i = 0; i < columnCount; i++) - { - if(obj[i] == null)obj[i] = ""; - - float dataWidth = new Chunk(obj[i].toString(),DATA_FONT).getWidthPoint(); - - if(dataWidth > columnWidth[i])columnWidth[i] = dataWidth; - } - } - - - float tableWidth = 0.0f; - - for(int j=0; j actualTableWidth) - { - float documentWidth = PAGE_SIZE.getWidth(); - float documentHeight = PAGE_SIZE.getHeight(); - - float newDocumentWidth = tableWidth + 2*MARGIN; - float newDocumentHeight = (documentHeight * newDocumentWidth)/documentWidth; - - return new Rectangle(newDocumentWidth,newDocumentHeight); - } - else - { - float scaleFactor = (actualTableWidth * tableWidth)/tableWidth; - - for(int k=0; k reportData = null; - private table tbl = new table(); - - private boolean sortable = false; - private String id = null; - private String[] headerStyle = null; - private String style = null; - private String title = null; - private String subtitle = null; - private Timestamp fromDate = null; - private Timestamp toDate = null; - - - public TabularReport(ArrayList reportData) - { - this.reportData = reportData; - } - - public TabularReport() - { - - } - - public void createReport() throws OperationException - { - - tbl = new table(); - tbl.addAttribute("border","0"); - tbl.addAttribute("width","100%"); - tbl.addAttribute("class","main"); - - td tdtitle = new td("" + title + ""); - td tdsubtitle = new td("" + subtitle + ""); - - tbl.addElement( - new tr().addElement(tdtitle.addAttribute("align","center")) - ); - - tbl.addElement( - new tr().addElement(tdsubtitle.addAttribute("align","center")) - ); - - tbl.addElement(new td(" ")); - - //////////////////////////////////////////////////////////////////////// - table displaytbl = new table(); - - if(reportData==null) - { - throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); - } - - id = RandomStringGenerator.randomstring(); - - displaytbl.addAttribute("border","1"); - //displaytbl.addAttribute("width","100%"); - - String styleClass = (style == null) ? "" : style; - if(isSortable()) - { - styleClass = styleClass + " sortable"; - } - displaytbl.addAttribute("class",styleClass.trim()); - displaytbl.addAttribute("id",id); - - Iterator iter = reportData.iterator(); - Object[] headers = iter.next(); - - int columnCount = headers.length; - - tr r = new tr(); - - for(int i=0;i i)) - { - String style = headerStyle[i]+""; - h.addAttribute("class",style); - } - - r.addElement(h); - } - - displaytbl.addElement(r); - - int count = 0; - String[] s = {"label","contentname"}; - String tdStyle = ""; - - while(iter.hasNext()) - { - count++; - - tdStyle = s[count%2]; - - Object[] data = iter.next(); - tr rr = new tr(); - - for(int i=0;i" + title + ""); - td tdsubtitle = new td("" + subtitle + ""); - - tbl.addElement( - new tr().addElement(tdtitle.addAttribute("align","center")) - ); - - tbl.addElement( - new tr().addElement(tdsubtitle.addAttribute("align","center")) - ); - - tbl.addElement(new td(" ")); - - //////////////////////////////////////////////////////////////////////// - table displaytbl = new table(); - - if(reportData==null) - { - throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); - } - - id = RandomStringGenerator.randomstring(); - - displaytbl.addAttribute("border","1"); - //displaytbl.addAttribute("width","100%"); - - String styleClass = (style == null) ? "" : style; - if(isSortable()) - { - styleClass = styleClass + " sortable"; - } - displaytbl.addAttribute("class",styleClass.trim()); - displaytbl.addAttribute("id",id); - - Iterator iter = reportData.iterator(); - Object[] headers = iter.next(); - - int columnCount = headers.length; - - tr r = new tr(); - - for(int i=0;i i)) - { - String style = headerStyle[i]+""; - h.addAttribute("class",style); - } - - r.addElement(h); - } - - displaytbl.addElement(r); - - int count = 0; - String[] s = {"label","contentname"}; - String tdStyle = ""; - int size = reportData.size(); - - - while(iter.hasNext()) - { - count++; - - tdStyle = s[count%2]; - - Object[] data = iter.next(); - - tr rr = new tr(); - for(int i=0;i2) - { - cellData = "" + data[i] + ""; - } - else - { - if (count == 1) - { - cellData = "" + data[i] + ""; - } - else - { - cellData = "" + data[i] + ""; - } - } - } - td d = new td(cellData); - d.addAttribute("class",tdStyle); - - rr.addElement(d); - } - - displaytbl.addElement(rr); - } - //////////////////////////////////////////////////////////////////////// - tbl.addElement(new tr().addElement(new td().addElement(displaytbl))); - } - - public void createReport(String action, Integer productId) throws OperationException - { - tbl = new table(); - tbl.addAttribute("border","0"); - tbl.addAttribute("width","100%"); - tbl.addAttribute("class","main"); - - td tdtitle = new td("" + title + ""); - td tdsubtitle = new td("" + subtitle + ""); - - tbl.addElement( - new tr().addElement(tdtitle.addAttribute("align","center")) - ); - - tbl.addElement( - new tr().addElement(tdsubtitle.addAttribute("align","center")) - ); - - tbl.addElement(new td(" ")); - - //////////////////////////////////////////////////////////////////////// - table displaytbl = new table(); - - if(reportData==null) - { - throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); - } - - id = RandomStringGenerator.randomstring(); - - displaytbl.addAttribute("border","1"); - //displaytbl.addAttribute("width","100%"); - - String styleClass = (style == null) ? "" : style; - if(isSortable()) - { - styleClass = styleClass + " sortable"; - } - displaytbl.addAttribute("class",styleClass.trim()); - displaytbl.addAttribute("id",id); - - Iterator iter = reportData.iterator(); - Object[] headers = iter.next(); - - int columnCount = headers.length; - - tr r = new tr(); - - for(int i=0;i i)) - { - String style = headerStyle[i]+""; - h.addAttribute("class",style); - } - - r.addElement(h); - } - - displaytbl.addElement(r); - - int count = 0; - String[] s = {"label","contentname"}; - String tdStyle = ""; - - int size = reportData.size(); - while(iter.hasNext()) - { - - tdStyle = s[count%2]; - - Object[] data = iter.next(); - tr rr = new tr(); - - String date = data[0].toString(); - String month = ""; - String[] dateSplit = date.split(" "); - - - if (dateSplit != null) - { - month= dateSplit[0]; - } - DateFormatSymbols dfs = new DateFormatSymbols(Locale.ENGLISH); - int mon = 0; - int yr = 0; - - if (count < size-1) - { - yr = Integer.parseInt(dateSplit[1]); - - String[] monthName = dfs.getMonths(); - for (int i = 0; i" + data[i] + ""; - } - if (i == 2 && ! (qty == 0f)) - { - cellData = "" + data[i] + ""; - } - if (i == 3) - { - cellData = "" + data[i] + ""; - } - } - - td d = new td(cellData); - d.addAttribute("class",tdStyle); - - rr.addElement(d); - displaytbl.addElement(rr); - } - count++; - - } - - //////////////////////////////////////////////////////////////////////// - tbl.addElement(new tr().addElement(new td().addElement(displaytbl))); - - } - - public String createPDFReport() throws DocumentException, FileNotFoundException - { - String filename = RandomStringGenerator.randomstring() + ".pdf"; - String filepath = ReportManager.getReportPath(filename); - - FileOutputStream fos = new FileOutputStream(filepath); - - Document document = new Document(PageSize.A4); - PdfWriter pdfWriter = PdfWriter.getInstance(document, fos); - - document.open(); - - Font style1 = new Font(Font.HELVETICA, 16.0f, Font.BOLD); - Font style2 = new Font(Font.HELVETICA, 12.0f); - //write content - Paragraph p = new Paragraph(new Chunk(title, style1)); - p.setAlignment(Element.ALIGN_CENTER); - document.add(p); - - p = new Paragraph(new Chunk(subtitle, style2)); - p.setAlignment(Element.ALIGN_CENTER); - document.add(p); - - p = new Paragraph("\n\n"); - document.add(p); - - Object[] headers = reportData.get(0); - - PdfPTable table = new PdfPTable(headers.length); - for(Object[] row : reportData) - { - for(Object data : row) - { - PdfPCell cell = new PdfPCell(new Phrase(data.toString())); - table.addCell(cell); - } - } - - document.add(table); - document.close(); - - - return filename; - } - - public byte[] getPDFData() throws DocumentException - { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - Document document = new Document(PageSize.A4); - PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); - - document.open(); - - // Font Syle - Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); - Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); - Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); - Font style4 = new Font(Font.TIMES_ROMAN, 9.0f, Font.BOLD); - float[] widths = { 2f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f}; - - // Table header - PdfPTable mytable = new PdfPTable(7); - mytable.setTotalWidth(widths); - mytable.setWidthPercentage(100f); - PdfPCell header = new PdfPCell(new Paragraph(getTitle() + "\n" + getSubtitle(), style1)); - header.setColspan(7); - header.setHorizontalAlignment(Element.ALIGN_CENTER); - header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); - mytable.addCell(header); - - // Table sub header - PdfPCell subheader = new PdfPCell(); - subheader = new PdfPCell(new Paragraph("")); - mytable.addCell(subheader); - - subheader = new PdfPCell(new Paragraph("QUANTITY", style2)); - subheader.setColspan(2); - subheader.setHorizontalAlignment(Element.ALIGN_CENTER); - mytable.addCell(subheader); - - subheader = new PdfPCell(new Paragraph("VALUE (Excl. VAT)", style2)); - subheader.setColspan(2); - subheader.setHorizontalAlignment(Element.ALIGN_CENTER); - mytable.addCell(subheader); - - subheader = new PdfPCell(new Paragraph("DISCREPANCY", style2)); - subheader.setColspan(2); - subheader.setHorizontalAlignment(Element.ALIGN_CENTER); - mytable.addCell(subheader); - - // Rows Header - PdfPCell rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME",style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("QTY", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("VALUE", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - document.add(mytable); - - - Object[] headers = reportData.get(0); - - PdfPTable table = new PdfPTable(headers.length); - - table.setTotalWidth(widths); - table.setWidthPercentage(100f); - for(Object[] row : reportData) - { - - for(Object data : row) - { - PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); - table.addCell(dataCell); - } - } - - document.add(table); - document.close(); - - return bos.toByteArray(); - } - - /** - * Get Selling Items Data - * @return - * @throws DocumentException - * @throws OperationException - */ - public byte[] getSellingItemsData() throws DocumentException, OperationException - { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - Document document = new Document(PageSize.A4); - PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); - - document.open(); - - // Font Syle - Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); - Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); - Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); - Font style4 = new Font(Font.TIMES_ROMAN, 9.0f, Font.BOLD); - Font style5 = new Font(Font.TIMES_ROMAN, 6.0f); - float[] widths = { 2f, 0.5f, 0.5f, 1.0f}; - - // Table header - PdfPTable mytable = new PdfPTable(4); - mytable.setTotalWidth(widths); - mytable.setWidthPercentage(100f); - PdfPCell header = new PdfPCell(new Paragraph(new Chunk(getTitle(), style1) + "\n" + new Chunk(getSubtitle(), style2) + "\n", style1)); - header.setColspan(4); - header.setHorizontalAlignment(Element.ALIGN_CENTER); - header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); - mytable.addCell(header); - - //Date Header - PdfPCell dateHeader = new PdfPCell(new Paragraph("From : " + new Chunk(TimestampConvertor.convertTimeStampToFyracleDate(fromDate), style1), style1)); - dateHeader.setColspan(1); - dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - dateHeader.setBackgroundColor(Color.GRAY); - dateHeader.setBorderColor(Color.WHITE); - mytable.addCell(dateHeader); - - dateHeader = new PdfPCell(new Paragraph("To : " +new Chunk(TimestampConvertor.convertTimeStampToFyracleDate(toDate), style1), style1)); - dateHeader.setColspan(3); - dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - dateHeader.setBackgroundColor(Color.GRAY); - dateHeader.setBorderColor(Color.WHITE); - mytable.addCell(dateHeader); - - // Info Header - PdfPCell infoHeader = new PdfPCell(new Paragraph("ALL VALUES ARE EXCLUSIVE OF VAT - SALES FIGURES ARE TAKEN AFTER DISCOUNT", style5)); - infoHeader.setColspan(4); - infoHeader.setHorizontalAlignment(Element.ALIGN_CENTER); - infoHeader.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); - mytable.addCell(infoHeader); - - // Rows Header - PdfPCell rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME",style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - - rowHeader = new PdfPCell(new Paragraph("QTY", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("VALUE", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("SUPPLIER", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - document.add(mytable); - - - Object[] headers = reportData.get(0); - - PdfPTable table = new PdfPTable(headers.length); - - table.setTotalWidth(widths); - table.setWidthPercentage(100f); - for(Object[] row : reportData) - { - - for(Object data : row) - { - PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); - table.addCell(dataCell); - } - } - - document.add(table); - document.close(); - - return bos.toByteArray(); - } - - /** - * Get Stock Enquiry Report Data - * @return - * @throws DocumentException - * @throws OperationException - */ - public byte[] getStockEnquiryData() throws DocumentException, OperationException - { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - Document document = new Document(PageSize.A4); - PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); - - document.open(); - - // Font Syle - Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); - Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); - Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); - Font style4 = new Font(Font.TIMES_ROMAN, 7.0f, Font.BOLD); - Font style5 = new Font(Font.TIMES_ROMAN, 6.0f); - float[] widths = { 1f, 2f, 0.5f, 0.5f, 0.5f, 0.5f }; - - // Table header - PdfPTable mytable = new PdfPTable(6); - mytable.setTotalWidth(widths); - mytable.setWidthPercentage(100f); - PdfPCell header = new PdfPCell(new Paragraph(new Chunk(title, style1) + "\n" + new Chunk(subtitle, style2) + "\n", style1)); - header.setColspan(6); - header.setHorizontalAlignment(Element.ALIGN_CENTER); - header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); - mytable.addCell(header); - - //Date Header - PdfPCell dateHeader = new PdfPCell(new Paragraph("From : " + new Chunk(TimestampConvertor.convertTimeStampToFyracleDate(fromDate), style1), style1)); - dateHeader.setColspan(2); - dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - dateHeader.setBackgroundColor(Color.GRAY); - dateHeader.setBorderColor(Color.WHITE); - mytable.addCell(dateHeader); - - dateHeader = new PdfPCell(new Paragraph("To : " + new Chunk(TimestampConvertor.convertTimeStampToFyracleDate(toDate), style1), style1)); - dateHeader.setColspan(4); - dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - dateHeader.setBackgroundColor(Color.GRAY); - dateHeader.setBorderColor(Color.WHITE); - mytable.addCell(dateHeader); - - // Info Header - PdfPCell infoHeader = new PdfPCell(new Paragraph("ALL VALUES ARE EXCLUSIVE OF VAT & BASED ON PURCHASE PRICES", style5)); - infoHeader.setColspan(6); - infoHeader.setHorizontalAlignment(Element.ALIGN_CENTER); - infoHeader.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); - mytable.addCell(infoHeader); - - // Rows Header - PdfPCell rowHeader = new PdfPCell(new Paragraph("BARCODE",style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - - rowHeader = new PdfPCell(new Paragraph("Opening Stock Qty", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("Opening Stock Value", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("Closing Stock Qty", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("Closing Stock Value", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - document.add(mytable); - - - Object[] headers = reportData.get(0); - - PdfPTable table = new PdfPTable(headers.length); - - table.setTotalWidth(widths); - table.setWidthPercentage(100f); - for(Object[] row : reportData) - { - - for(Object data : row) - { - PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); - table.addCell(dataCell); - } - } - - document.add(table); - document.close(); - - return bos.toByteArray(); - } - - public byte[] getInventoryData() throws DocumentException - { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - Document document = new Document(PageSize.A4); - PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); - - document.open(); - - // Font Syle - Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); - Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); - Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); - Font style4 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); - float[] widths = { 1f, 1f, 0.55f, 0.55f, 0.55f, 1f, 1f, 1f, 1f}; - - // Table header - PdfPTable mytable = new PdfPTable(9); - mytable.setTotalWidth(widths); - mytable.setWidthPercentage(100f); - PdfPCell header = new PdfPCell(new Paragraph(getTitle() + "\n" + getSubtitle(), style1)); - header.setColspan(9); - header.setHorizontalAlignment(Element.ALIGN_CENTER); - header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); - mytable.addCell(header); - - // Table sub header - PdfPCell subheader = new PdfPCell(); - subheader = new PdfPCell(new Paragraph("")); - subheader.setColspan(2); - mytable.addCell(subheader); - - subheader = new PdfPCell(new Paragraph("QUANTITY", style2)); - subheader.setColspan(3); - subheader.setHorizontalAlignment(Element.ALIGN_CENTER); - mytable.addCell(subheader); - - subheader = new PdfPCell(new Paragraph("VALUE (Excl. VAT)", style2)); - subheader.setColspan(2); - subheader.setHorizontalAlignment(Element.ALIGN_CENTER); - mytable.addCell(subheader); - - subheader = new PdfPCell(new Paragraph("DIFFERENCE", style2)); - subheader.setColspan(2); - subheader.setHorizontalAlignment(Element.ALIGN_CENTER); - mytable.addCell(subheader); - - // Rows Header - PdfPCell rowHeader = new PdfPCell(new Paragraph("BARCODE",style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("PRODUCT", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - - rowHeader = new PdfPCell(new Paragraph("CSV", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("QUANTITY", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("VALUE (Excl. VAT)", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - document.add(mytable); - - Object[] headers = reportData.get(0); - - PdfPTable table = new PdfPTable(headers.length); - - table.setTotalWidth(widths); - table.setWidthPercentage(100f); - for(Object[] row : reportData) - { - - for(Object data : row) - { - PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); - table.addCell(dataCell); - } - } - - document.add(table); - document.close(); - - return bos.toByteArray(); - } - - public String toString() - { - return tbl.toString(); - } - - public void getDataFromSQL(Properties ctx,String sql) throws OperationException - { - reportData = ReportManager.getReportData(ctx,sql); - } - - public ArrayList getReportData() { - return reportData; - } - - public void setReportData(ArrayList reportData) { - this.reportData = reportData; - } - - public table getTable() { - return tbl; - } - - public String[] getHeaderStyle() { - return headerStyle; - } - - public void setHeaderStyle(String[] headerStyle) { - this.headerStyle = headerStyle; - } - - public boolean isSortable() { - return sortable; - } - - public void setSortable(boolean sortable) { - this.sortable = sortable; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - public String getSubtitle() { - return subtitle; - } - - public void setSubtitle(String subtitle) { - this.subtitle = subtitle; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public Timestamp getFromDate() { - return fromDate; - } - - public void setFromDate(Timestamp fromDate) { - this.fromDate = fromDate; - } - - public Timestamp getToDate() { - return toDate; - } - - public void setToDate(Timestamp toDate) { - this.toDate = toDate; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/TabularReport2.java b/posterita/posterita/src/main/org/posterita/core/TabularReport2.java deleted file mode 100644 index 143a03aeea..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/TabularReport2.java +++ /dev/null @@ -1,471 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 31-Jul-2006 12:07:35 by praveen - * - */ - -package org.posterita.core; - -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.th; -import org.apache.ecs.xhtml.tr; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.exceptions.OperationException; - -import com.lowagie.text.Chunk; -import com.lowagie.text.Document; -import com.lowagie.text.DocumentException; -import com.lowagie.text.Element; -import com.lowagie.text.Font; -import com.lowagie.text.PageSize; -import com.lowagie.text.Paragraph; -import com.lowagie.text.Phrase; -import com.lowagie.text.pdf.PdfPCell; -import com.lowagie.text.pdf.PdfPTable; -import com.lowagie.text.pdf.PdfWriter; - -public class TabularReport2 -{ - private ArrayList reportData = null; - private table tbl = new table(); - - private boolean sortable = false; - private String id = null; - private String[] headerStyle = null; - private String style = null; - private String title = null; - private String subtitle = null; - private Timestamp fromDate = null; - private Timestamp toDate = null; - private boolean isSalesReport = false; - private boolean fullDetails = false; - - public TabularReport2(ArrayList reportData) - { - this.reportData = reportData; - } - - public TabularReport2() - { - - } - - public void createReport() throws OperationException - { - - tbl = new table(); - tbl.addAttribute("border","0"); - tbl.addAttribute("width","100%"); - tbl.addAttribute("class","main"); - - td tdtitle = new td("" + title + ""); - td tdsubtitle = new td("" + subtitle + ""); - - tbl.addElement( - new tr().addElement(tdtitle.addAttribute("align","center")) - ); - - tbl.addElement( - new tr().addElement(tdsubtitle.addAttribute("align","center")) - ); - - tbl.addElement(new td(" ")); - - //////////////////////////////////////////////////////////////////////// - table displaytbl = new table(); - - if(reportData==null) - { - throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); - } - - id = RandomStringGenerator.randomstring(); - - displaytbl.addAttribute("border","1"); - //displaytbl.addAttribute("width","100%"); - - String styleClass = (style == null) ? "" : style; - if(isSortable()) - { - styleClass = styleClass + " sortable"; - } - displaytbl.addAttribute("class",styleClass.trim()); - displaytbl.addAttribute("id",id); - - Iterator iter = reportData.iterator(); - Object[] headers = iter.next(); - - int columnCount = headers.length; - - tr r = new tr(); - - for(int i=0;i i)) - { - String style = headerStyle[i]+""; - h.addAttribute("class",style); - } - - r.addElement(h); - } - - displaytbl.addElement(r); - - int count = 0; - String[] s = {"label","contentname"}; - String tdStyle = ""; - - String date1 = ""; - String date2 = ""; - String temp1 = ""; - String temp2 = ""; - - while(iter.hasNext()) - { - count++; - - tdStyle = s[count%2]; - - Object[] data = iter.next(); - tr rr = new tr(); - - if (count == 1) - { - temp1 = data[0].toString(); - } - if (count == reportData.size() - 2) - { - temp2 = data[0].toString(); - } - date2 = date1 = data[0].toString(); - - if(count == reportData.size()-1) - { - date1 = temp1; - date2 = temp2; - } - - for(int i=0;i0 && i<5) - { - if (data[i]!=null) - { - qty = Double.valueOf(data[i].toString()); - } - if (qty != 0.0) - { - cellData = "" + data[i] + ""; - } - } - - - td d = new td(cellData); - - if(count == reportData.size()-1) - { - d.setAlign("left"); - } - - d.addAttribute("class",tdStyle); - - rr.addElement(d); - } - - displaytbl.addElement(rr); - } - //////////////////////////////////////////////////////////////////////// - tbl.addElement(new tr().addElement(new td().addElement(displaytbl))); - - } - - public void createReport(String action) throws OperationException - { - tbl = new table(); - tbl.addAttribute("border","0"); - tbl.addAttribute("width","100%"); - tbl.addAttribute("class","main"); - - td tdtitle = new td("" + title + ""); - td tdsubtitle = new td("" + subtitle + ""); - - tbl.addElement( - new tr().addElement(tdtitle.addAttribute("align","center")) - ); - - tbl.addElement( - new tr().addElement(tdsubtitle.addAttribute("align","center")) - ); - - tbl.addElement(new td(" ")); - - //////////////////////////////////////////////////////////////////////// - table displaytbl = new table(); - - if(reportData==null) - { - throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); - } - - id = RandomStringGenerator.randomstring(); - - displaytbl.addAttribute("border","1"); - //displaytbl.addAttribute("width","100%"); - - String styleClass = (style == null) ? "" : style; - if(isSortable()) - { - styleClass = styleClass + " sortable"; - } - displaytbl.addAttribute("class",styleClass.trim()); - displaytbl.addAttribute("id",id); - - Iterator iter = reportData.iterator(); - Object[] headers = iter.next(); - - int columnCount = headers.length; - - tr r = new tr(); - - for(int i=0;i i)) - { - String style = headerStyle[i]+""; - h.addAttribute("class",style); - } - - r.addElement(h); - } - - displaytbl.addElement(r); - - int count = 0; - String[] s = {"label","contentname"}; - String tdStyle = ""; - - while(iter.hasNext()) - { - count++; - - tdStyle = s[count%2]; - - Object[] data = iter.next(); - tr rr = new tr(); - - for(int i=0;i 0 && i < 5) - { - cellData = " getReportData() { - return reportData; - } - - public void setReportData(ArrayList reportData) { - this.reportData = reportData; - } - - public table getTable() { - return tbl; - } - - public String[] getHeaderStyle() { - return headerStyle; - } - - public void setHeaderStyle(String[] headerStyle) { - this.headerStyle = headerStyle; - } - - public boolean isSortable() { - return sortable; - } - - public void setSortable(boolean sortable) { - this.sortable = sortable; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - public String getSubtitle() { - return subtitle; - } - - public void setSubtitle(String subtitle) { - this.subtitle = subtitle; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public Timestamp getFromDate() { - return fromDate; - } - - public void setFromDate(Timestamp fromDate) { - this.fromDate = fromDate; - } - - public Timestamp getToDate() { - return toDate; - } - - public void setToDate(Timestamp toDate) { - this.toDate = toDate; - } - - public boolean isSalesReport() - { - return isSalesReport; - } - - public void setSalesReport(boolean isSalesReport) - { - this.isSalesReport = isSalesReport; - } - - public boolean isFullDetails() - { - return fullDetails; - } - - public void setFullDetails(boolean fullDetails) - { - this.fullDetails = fullDetails; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/TabularReportMerge.java b/posterita/posterita/src/main/org/posterita/core/TabularReportMerge.java deleted file mode 100644 index d3293199ea..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/TabularReportMerge.java +++ /dev/null @@ -1,633 +0,0 @@ -package org.posterita.core; - -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 31-Jul-2006 12:07:35 by praveen - * - */ - -import java.awt.Color; -import java.io.ByteArrayOutputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import org.apache.ecs.xhtml.div; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.th; -import org.apache.ecs.xhtml.tr; -import org.posterita.Constants; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.exceptions.OperationException; - -import com.lowagie.text.Chunk; -import com.lowagie.text.Document; -import com.lowagie.text.DocumentException; -import com.lowagie.text.Element; -import com.lowagie.text.Font; -import com.lowagie.text.PageSize; -import com.lowagie.text.Paragraph; -import com.lowagie.text.Phrase; -import com.lowagie.text.pdf.PdfPCell; -import com.lowagie.text.pdf.PdfPTable; -import com.lowagie.text.pdf.PdfWriter; - -public class TabularReportMerge -{ - private ArrayList reportData = null; - private table bigTable; - private div contain; - private tr bigRow; - private boolean sortable = false; - private String id = null; - private String[] headerStyle = null; - private String style = null; - private String title = null; - private String subtitle = null; - private Timestamp fromDate = null; - private Timestamp toDate = null; - private int screenWidth = 1024; - public TabularReportMerge(ArrayList reportData) - { - this.reportData = reportData; - } - - public TabularReportMerge(String title, int colspan) - { - bigTable = new table(); - bigRow = new tr(); - setTitle(title, colspan); - bigTable.addElement(bigRow); - contain = new div(); - contain.setStyle("width:" + screenWidth + ";overflow:auto;"); - contain.addElement(bigTable); - } - - public void createReport(ArrayList reportData, int type, String subtitle) throws OperationException - { - table tbl = new table(); - tbl.addAttribute("border","0"); - tbl.addAttribute("width","100%"); - tbl.addAttribute("class","main"); - - - td tdsubtitle = new td("" + subtitle + ""); - - - - tbl.addElement( - new tr().addElement(tdsubtitle.addAttribute("align","center")) - ); - - tbl.addElement(new td(" ")); - - //////////////////////////////////////////////////////////////////////// - table displaytbl = new table(); - - if(reportData==null) - { - throw new OperationException("Cannot create tabular report: cause -> dataset empty!"); - } - - id = RandomStringGenerator.randomstring(); - - displaytbl.addAttribute("border","1"); - //displaytbl.addAttribute("width","100%"); - - String styleClass = (style == null) ? "" : style; - if(isSortable()) - { - styleClass = styleClass + " sortable"; - } - displaytbl.addAttribute("class",styleClass.trim()); - displaytbl.addAttribute("id",id); - - Iterator iter = reportData.iterator(); - Object[] headers = iter.next(); - - int columnCount = headers.length; - - tr r = new tr(); - - for(int i=0;i i)) - { - String style = headerStyle[i]+""; - h.addAttribute("class",style); - } - - r.addElement(h); - } - - displaytbl.addElement(r); - - int count = 0; - String[] s = {"label","contentname"}; - String tdStyle = ""; - - while(iter.hasNext()) - { - count++; - - tdStyle = s[count%2]; - - Object[] data = iter.next(); - tr rr = new tr(); - String productName=""; - for(int i=0;i" + data[i] + ""; - } - else if (type == Constants.STOCK_TYPE) - { - total = "" + data[i] + ""; - } - d = new td(total); - } - d.addAttribute("class",tdStyle); - - rr.addElement(d); - } - - displaytbl.addElement(rr); - } - //////////////////////////////////////////////////////////////////////// - tbl.addElement(new tr().addElement(new td().addElement(displaytbl))); - - bigRow.addElement(new td().addElement(tbl)); - - } - - public String createPDFReport() throws DocumentException, FileNotFoundException - { - String filename = RandomStringGenerator.randomstring() + ".pdf"; - String filepath = ReportManager.getReportPath(filename); - - FileOutputStream fos = new FileOutputStream(filepath); - - Document document = new Document(PageSize.A4); - PdfWriter pdfWriter = PdfWriter.getInstance(document, fos); - - document.open(); - - Font style1 = new Font(Font.HELVETICA, 16.0f, Font.BOLD); - Font style2 = new Font(Font.HELVETICA, 12.0f); - //write content - Paragraph p = new Paragraph(new Chunk(title, style1)); - p.setAlignment(Element.ALIGN_CENTER); - document.add(p); - - p = new Paragraph(new Chunk(subtitle, style2)); - p.setAlignment(Element.ALIGN_CENTER); - document.add(p); - - p = new Paragraph("\n\n"); - document.add(p); - - Object[] headers = reportData.get(0); - - PdfPTable table = new PdfPTable(headers.length); - for(Object[] row : reportData) - { - for(Object data : row) - { - PdfPCell cell = new PdfPCell(new Phrase(data.toString())); - table.addCell(cell); - } - } - - document.add(table); - document.close(); - - - return filename; - } - - public byte[] getPDFData() throws DocumentException - { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - Document document = new Document(PageSize.A4); - PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); - - document.open(); - - // Font Syle - Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); - Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); - Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); - Font style4 = new Font(Font.TIMES_ROMAN, 9.0f, Font.BOLD); - float[] widths = { 2f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f}; - - // Table header - PdfPTable mytable = new PdfPTable(7); - mytable.setTotalWidth(widths); - mytable.setWidthPercentage(100f); - PdfPCell header = new PdfPCell(new Paragraph(new Chunk(title, style1) + "\n" + new Chunk(subtitle, style2) + "\n", style1)); - header.setColspan(7); - header.setHorizontalAlignment(Element.ALIGN_CENTER); - header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); - mytable.addCell(header); - - // Table sub header - PdfPCell subheader = new PdfPCell(); - subheader = new PdfPCell(new Paragraph("")); - mytable.addCell(subheader); - - subheader = new PdfPCell(new Paragraph("QUANTITY", style2)); - subheader.setColspan(2); - subheader.setHorizontalAlignment(Element.ALIGN_CENTER); - mytable.addCell(subheader); - - subheader = new PdfPCell(new Paragraph("VALUE (Excl. VAT)", style2)); - subheader.setColspan(2); - subheader.setHorizontalAlignment(Element.ALIGN_CENTER); - mytable.addCell(subheader); - - subheader = new PdfPCell(new Paragraph("DISCREPANCY", style2)); - subheader.setColspan(2); - subheader.setHorizontalAlignment(Element.ALIGN_CENTER); - mytable.addCell(subheader); - - // Rows Header - PdfPCell rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME",style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("BOOK", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("COUNT", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("QTY", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("VALUE", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - document.add(mytable); - - - Object[] headers = reportData.get(0); - - PdfPTable table = new PdfPTable(headers.length); - - table.setTotalWidth(widths); - table.setWidthPercentage(100f); - for(Object[] row : reportData) - { - - for(Object data : row) - { - PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); - table.addCell(dataCell); - } - } - - document.add(table); - document.close(); - - return bos.toByteArray(); - } - - /** - * Get Selling Items Data - * @return - * @throws DocumentException - * @throws OperationException - */ - public byte[] getSellingItemsData() throws DocumentException, OperationException - { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - Document document = new Document(PageSize.A4); - PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); - - document.open(); - - // Font Syle - Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); - Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); - Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); - Font style4 = new Font(Font.TIMES_ROMAN, 9.0f, Font.BOLD); - Font style5 = new Font(Font.TIMES_ROMAN, 6.0f); - float[] widths = { 2f, 0.5f, 0.5f, 1.0f}; - - // Table header - PdfPTable mytable = new PdfPTable(4); - mytable.setTotalWidth(widths); - mytable.setWidthPercentage(100f); - PdfPCell header = new PdfPCell(new Paragraph(new Chunk(title, style1) + "\n" + new Chunk(subtitle, style2) + "\n", style1)); - header.setColspan(4); - header.setHorizontalAlignment(Element.ALIGN_CENTER); - header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); - mytable.addCell(header); - - //Date Header - PdfPCell dateHeader = new PdfPCell(new Paragraph("From : " + new Chunk(TimestampConvertor.convertTimeStamp(fromDate, TimestampConvertor.DEFAULT_DATE_PATTERN1), style1), style1)); - dateHeader.setColspan(1); - dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - dateHeader.setBackgroundColor(Color.GRAY); - dateHeader.setBorderColor(Color.WHITE); - mytable.addCell(dateHeader); - - dateHeader = new PdfPCell(new Paragraph("To : " + new Chunk(TimestampConvertor.convertTimeStamp(toDate, TimestampConvertor.DEFAULT_DATE_PATTERN1), style1), style1)); - dateHeader.setColspan(3); - dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - dateHeader.setBackgroundColor(Color.GRAY); - dateHeader.setBorderColor(Color.WHITE); - mytable.addCell(dateHeader); - - // Info Header - PdfPCell infoHeader = new PdfPCell(new Paragraph("ALL VALUES ARE EXCLUSIVE OF VAT - SALES FIGURES ARE TAKEN AFTER DISCOUNT", style5)); - infoHeader.setColspan(4); - infoHeader.setHorizontalAlignment(Element.ALIGN_CENTER); - infoHeader.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); - mytable.addCell(infoHeader); - - // Rows Header - PdfPCell rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME",style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - - rowHeader = new PdfPCell(new Paragraph("QTY", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("VALUE", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("SUPPLIER", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - document.add(mytable); - - - Object[] headers = reportData.get(0); - - PdfPTable table = new PdfPTable(headers.length); - - table.setTotalWidth(widths); - table.setWidthPercentage(100f); - for(Object[] row : reportData) - { - - for(Object data : row) - { - PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); - table.addCell(dataCell); - } - } - - document.add(table); - document.close(); - - return bos.toByteArray(); - } - - /** - * Get Stock Enquiry Report Data - * @return - * @throws DocumentException - * @throws OperationException - */ - public byte[] getStockEnquiryData() throws DocumentException, OperationException - { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - - Document document = new Document(PageSize.A4); - PdfWriter pdfWriter = PdfWriter.getInstance(document, bos); - - document.open(); - - // Font Syle - Font style1 = new Font(Font.TIMES_ROMAN, 12.0f, Font.BOLD); - Font style2 = new Font(Font.TIMES_ROMAN, 8.0f, Font.BOLD); - Font style3 = new Font(Font.TIMES_ROMAN, 8.0f); - Font style4 = new Font(Font.TIMES_ROMAN, 7.0f, Font.BOLD); - Font style5 = new Font(Font.TIMES_ROMAN, 6.0f); - float[] widths = { 1f, 2f, 0.5f, 0.5f, 0.5f, 0.5f }; - - // Table header - PdfPTable mytable = new PdfPTable(6); - mytable.setTotalWidth(widths); - mytable.setWidthPercentage(100f); - PdfPCell header = new PdfPCell(new Paragraph(new Chunk(title, style1) + "\n" + new Chunk(subtitle, style2) + "\n", style1)); - header.setColspan(6); - header.setHorizontalAlignment(Element.ALIGN_CENTER); - header.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); - mytable.addCell(header); - - //Date Header - PdfPCell dateHeader = new PdfPCell(new Paragraph("From : " + new Chunk(TimestampConvertor.convertTimeStamp(fromDate, TimestampConvertor.DEFAULT_DATE_PATTERN1), style1), style1)); - dateHeader.setColspan(2); - dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - dateHeader.setBackgroundColor(Color.GRAY); - dateHeader.setBorderColor(Color.WHITE); - mytable.addCell(dateHeader); - - dateHeader = new PdfPCell(new Paragraph("To : " + new Chunk(TimestampConvertor.convertTimeStamp(toDate, TimestampConvertor.DEFAULT_DATE_PATTERN1), style1), style1)); - dateHeader.setColspan(4); - dateHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - dateHeader.setBackgroundColor(Color.GRAY); - dateHeader.setBorderColor(Color.WHITE); - mytable.addCell(dateHeader); - - // Info Header - PdfPCell infoHeader = new PdfPCell(new Paragraph("ALL VALUES ARE EXCLUSIVE OF VAT & BASED ON PURCHASE PRICES", style5)); - infoHeader.setColspan(6); - infoHeader.setHorizontalAlignment(Element.ALIGN_CENTER); - infoHeader.setBackgroundColor(new Color(0xC0, 0xC0, 0xC0)); - mytable.addCell(infoHeader); - - // Rows Header - PdfPCell rowHeader = new PdfPCell(new Paragraph("BARCODE",style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("PRODUCT NAME", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - - rowHeader = new PdfPCell(new Paragraph("Opening Stock Qty", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("Opening Stock Value", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("Closing Stock Qty", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - rowHeader = new PdfPCell(new Paragraph("Closing Stock Value", style4)); - rowHeader.setHorizontalAlignment(Element.ALIGN_LEFT); - mytable.addCell(rowHeader); - - document.add(mytable); - - - Object[] headers = reportData.get(0); - - PdfPTable table = new PdfPTable(headers.length); - - table.setTotalWidth(widths); - table.setWidthPercentage(100f); - for(Object[] row : reportData) - { - - for(Object data : row) - { - PdfPCell dataCell = new PdfPCell(new Phrase(data.toString(), style3)); - table.addCell(dataCell); - } - } - - document.add(table); - document.close(); - - return bos.toByteArray(); - } - - public String toString() - { - return contain.toString(); - } - - public void getDataFromSQL(Properties ctx,String sql) throws OperationException - { - reportData = ReportManager.getReportData(ctx,sql); - } - - public ArrayList getReportData() { - return reportData; - } - - public void setReportData(ArrayList reportData) { - this.reportData = reportData; - } - - public table getTable() { - return bigTable; - } - - public String[] getHeaderStyle() { - return headerStyle; - } - - public void setHeaderStyle(String[] headerStyle) { - this.headerStyle = headerStyle; - } - - public boolean isSortable() { - return sortable; - } - - public void setSortable(boolean sortable) { - this.sortable = sortable; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - public String getSubtitle() { - return subtitle; - } - - public void setSubtitle(String subtitle) { - this.subtitle = subtitle; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title, int colspan) - { - td tdtitle = new td("" + title + ""); - tdtitle.addAttribute("colspan", colspan+""); - tr trow = new tr(); - bigTable.addElement( - new tr().addElement(tdtitle.addAttribute("align","center")) - ); - } - - public Timestamp getFromDate() { - return fromDate; - } - - public void setFromDate(Timestamp fromDate) { - this.fromDate = fromDate; - } - - public Timestamp getToDate() { - return toDate; - } - - public void setToDate(Timestamp toDate) { - this.toDate = toDate; - } - - -} - diff --git a/posterita/posterita/src/main/org/posterita/core/TestStockInquiry.java b/posterita/posterita/src/main/org/posterita/core/TestStockInquiry.java deleted file mode 100644 index 117493fe74..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/TestStockInquiry.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - **/ -package org.posterita.core; - - -public class TestStockInquiry { - -} diff --git a/posterita/posterita/src/main/org/posterita/core/ThumbnailGenerator.java b/posterita/posterita/src/main/org/posterita/core/ThumbnailGenerator.java deleted file mode 100644 index 00e746c0db..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/ThumbnailGenerator.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 14, 2006 by praveen - * - */ -package org.posterita.core; - -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.image.BufferedImage; -import java.awt.image.ConvolveOp; -import java.awt.image.Kernel; -import java.io.BufferedOutputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; - -import javax.imageio.ImageIO; -import javax.swing.ImageIcon; - -import org.posterita.exceptions.ThumbnailGenerationException; - -public class ThumbnailGenerator -{ - public static byte[] getThumbnail(byte[] data, double scaleFactor) throws ThumbnailGenerationException - { - if(data == null) - throw new ThumbnailGenerationException("Imag data cannot be null"); - Image input = new ImageIcon(data).getImage(); - int imgWidth = input.getWidth(null); - int imgHeight = input.getHeight(null); - - int scaledWidth = (int)((double)imgWidth * scaleFactor); - int scaledHeight = (int)((double)imgHeight * scaleFactor); - - return getThumbnail(data, scaledWidth, scaledHeight); - } - - public static byte[] getSquareThumbnail(byte[] data, int size) throws ThumbnailGenerationException - { - Image input = new ImageIcon(data).getImage(); - int imgWidth = input.getWidth(null); - int imgHeight = input.getHeight(null); - - int thumbWidth; - int thumbHeight; - - if(imgWidth > imgHeight) - { - double scale = ((double)size/(double)imgWidth); - thumbWidth = size; - thumbHeight = (int)(scale * (double)imgHeight); - } - else - { - double scale = ((double)size/(double)imgHeight); - thumbHeight = size; - thumbWidth = (int)(scale * (double)imgWidth); - } - - return getThumbnail(data, thumbWidth, thumbHeight); - } - - static String THUMBEXT = "jpg"; - // Original Code: http://blogs.cocoondev.org/mpo/archives/003584.html - public static byte[] getThumbnail(byte data[], int maxSize) throws ThumbnailGenerationException - { - Image i = new ImageIcon(data).getImage(); - - int iWidth = i.getWidth(null); - int iHeight = i.getHeight(null); - if (iWidth > iHeight) - return getThumbnail(data, maxSize,(maxSize*iHeight)/iWidth); - else - return getThumbnail(data, (maxSize*iWidth)/iHeight,maxSize); - } - - public static byte[] getThumbnail(byte data[], int width, int height) throws ThumbnailGenerationException - { - try - { - Image i = new ImageIcon(data).getImage(); - - Image resizedImage = i.getScaledInstance(width, height, Image.SCALE_SMOOTH); - - // This code ensures that all the - // pixels in the image are loaded. - Image temp = new ImageIcon(resizedImage).getImage(); - // Create the buffered image. - BufferedImage bufferedImage = new BufferedImage(temp.getWidth(null), temp.getHeight(null), BufferedImage.TYPE_INT_RGB); - // Copy image to buffered image. - Graphics g = bufferedImage.createGraphics(); - // Clear background and paint the image. - g.setColor(Color.white); - g.fillRect(0, 0, temp.getWidth(null),temp.getHeight(null)); - g.drawImage(temp, 0, 0, null); - g.dispose(); - - // soften - float softenFactor = 0.01f; - float[] softenArray = {0, softenFactor, 0, softenFactor, 1-(softenFactor*4), softenFactor, 0, softenFactor, 0}; - Kernel kernel = new Kernel(3, 3, softenArray); - ConvolveOp cOp = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null); - bufferedImage = cOp.filter(bufferedImage, null); - - ByteArrayOutputStream outStream = new ByteArrayOutputStream(); - BufferedOutputStream bufOutStream = new BufferedOutputStream(outStream); - ImageIO.write(bufferedImage, THUMBEXT, bufOutStream); - - bufOutStream.flush(); - byte retData[] = outStream.toByteArray(); - bufOutStream.close(); - outStream.close(); - return retData; - } - catch(IOException ex) - { - throw new ThumbnailGenerationException("Could not generate thumbnail", ex); - } - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/TimeSeriesChart.java b/posterita/posterita/src/main/org/posterita/core/TimeSeriesChart.java deleted file mode 100644 index 3bc7c19b4d..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/TimeSeriesChart.java +++ /dev/null @@ -1,256 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 13-Jul-2006 09:59:29 by praveen - * - */ - -package org.posterita.core; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; - -import org.compiere.util.DB; -import org.jfree.chart.ChartFactory; -import org.jfree.chart.JFreeChart; -import org.jfree.chart.labels.StandardXYItemLabelGenerator; -import org.jfree.chart.plot.XYPlot; -import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; -import org.jfree.chart.title.TextTitle; -import org.jfree.data.time.Day; -import org.jfree.data.time.TimeSeries; -import org.jfree.data.time.TimeSeriesCollection; - -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.exceptions.OperationException; - -/** - * @author praveen - * - */ -public class TimeSeriesChart extends AbstractChart -{ - public static final String CHART_TYPE = "TimeSeries"; - - TimeSeriesCollection dataset = null; - boolean showShapes = false; - - public TimeSeriesChart(){}; - - public TimeSeriesChart(TimeSeriesCollection dataset,String title) - { - this.dataset = dataset; - this.title = title; - } - - public TimeSeriesChart(TimeSeriesCollection dataset,String title,String xLabel,String yLabel) - { - this.dataset = dataset; - this.title = title; - this.xLabel = xLabel; - this.yLabel = yLabel; - } - - public JFreeChart createChart() throws OperationException - { - if(dataset == null) - { - throw new OperationException("Cannot create Time series chart: cause -> dataset null!"); - } - - chart = ChartFactory.createTimeSeriesChart(title,xLabel,yLabel,dataset,showLegend,showTooltip,false); - - if(showShapes) - { - XYPlot plot = (XYPlot) chart.getPlot(); - XYLineAndShapeRenderer render = (XYLineAndShapeRenderer) plot.getRenderer(); - render.setBaseShapesVisible(true); - } - - //setting subtitle - if(subtitle!=null) - { - TextTitle title = new TextTitle(subtitle); - chart.addSubtitle(title); - } - - //displaying labels - if(showLabels) - { - XYPlot plot = (XYPlot) chart.getPlot(); - XYLineAndShapeRenderer render = (XYLineAndShapeRenderer) plot.getRenderer(); - render.setItemLabelGenerator(new StandardXYItemLabelGenerator()); - render.setItemLabelsVisible(true); - } - - return chart; - - } - - /** - * Takes a sql as input and generates a Timeseries that is added to - * the dataset. - * Note: The sql must return 3 columns only Series, date & value - * Column 1: Type -> String - * Column 2: Type -> String or Date. For String the format must be as dd-MM-yyyy - * Column 3: Type -> BigDecimal - * - * @param sql - */ - public void getDataSetFromSQL(String sql) throws OperationException - { - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - ArrayList dataSource = ReportManager.getReportData(pstmt); - int count = 0; - - String seriesName = null; - TimeSeries series = null; - BigDecimal value = null; - int day = 0; - int month = 0; - int year = 0; - - TimeSeriesCollection timeSeriesCollection = new TimeSeriesCollection(); - - for (Object[] data : dataSource) - { - if(data.length!=3) - throw new OperationException("Unable to generate timeseries. Cause:Invalid sql, the return resultset must have 3 columns only"); - - count++; - if(count==1) - { - continue; - } - - seriesName = (String)data[0]; - String date = (String)data[1]; - value = (BigDecimal) data[2]; - String s[] = date.split("-"); - - if(s.length!=3) - throw new OperationException("Unable to generate timeseries. " + - "Cause:Invalid date format, the date returned should have the following format 'DD-MM-YYYY'"); - - SimpleDateFormat sdf = new SimpleDateFormat(); - Calendar cal = Calendar.getInstance(); - Date d = null; - - try - { - sdf.applyPattern("DD-MM-YYYY"); - d = sdf.parse(date); - } - catch (ParseException e1) - { - try - { - sdf.applyPattern("DD-MMM-YYYY"); - d = sdf.parse(date); - } - catch (ParseException e) - { - throw new OperationException("Unable to generate timeseries. " + - "Cause:Invalid date format, the date returned should have one of the following formats 'DD-MM-YYYY' or 'DD-MMM-YYYY'",e); - } - } - - - cal.setTime(d); - - day = cal.get(Calendar.DATE); - month = cal.get(Calendar.MONTH) + 1; - year = cal.get(Calendar.YEAR); - - - series = timeSeriesCollection.getSeries(seriesName); - - if(series == null) - { - series = new TimeSeries(seriesName,Day.class); - series.add(new Day(day,month,year),value); - - timeSeriesCollection.addSeries(series); - } - else - { - series.add(new Day(day,month,year),value); - }//if - - }//for - - dataset = timeSeriesCollection; - } - - public void getTimeSeriesFromSQL(String sql,String key) throws OperationException - { - PreparedStatement pstmt = DB.prepareStatement(sql,null); - - ArrayList dataSource = ReportManager.getReportData(pstmt); - TimeSeries series = new TimeSeries(key,Day.class); - int count = 0; - - for (Object[] data : dataSource) - { - if(data.length != 2) - throw new OperationException("Unable to generate timeseries. Cause:Invalid sql, the return resultset must have 2 columns only"); - - count++; - if(count==1)continue; - - series.add(new Day((Date)data[0]),(BigDecimal)data[1]); - } - - pstmt = null; - addSeries(series); - } - - - public void addSeries(TimeSeries series) - { - if(dataset==null) - dataset = new TimeSeriesCollection(); - - dataset.addSeries(series); - } - - public TimeSeriesCollection getDataset() { - return dataset; - } - - public void setDataset(TimeSeriesCollection dataset) { - this.dataset = dataset; - } - - public boolean isShowShapes() { - return showShapes; - } - - public void setShowShapes(boolean showShapes) { - this.showShapes = showShapes; - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/TimestampConvertor.java b/posterita/posterita/src/main/org/posterita/core/TimestampConvertor.java deleted file mode 100644 index 8db3d6e2c9..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/TimestampConvertor.java +++ /dev/null @@ -1,294 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 29-Jul-2005 by alok - * - */ - -package org.posterita.core; - -import java.sql.Timestamp; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.posterita.exceptions.InvalidDateTimeException; -import org.posterita.exceptions.OperationException; - -public class TimestampConvertor -{ - - public static final String XML_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss.S"; - public static final String DEFAULT_DATE_PATTERN1 = "dd/MM/yyyy HH:mm:ss"; - public static final String DEFAULT_DATE_PATTERN2 = "dd-MMM-yyyy HH:mm:ss"; - public static final String FYRACLE_DATETIME_PATTERN = "MM-dd-yyyy HH:mm:ss"; - public static final String FYRACLE_DATE_PATTERN = "MM-dd-yyyy"; - public static final String FYRACLEDB_DATETIME_PATTERN = "dd-MM-yyyy HH:mm:ss"; - public static final String NORM_DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm"; - public static final String FLAT_DATE_PATTERN = "ddMMyyyy"; - public static final String REPORTS_DATE_PATTERN = "dd-MMM-yyyy HH:mm:ss"; - public static final String SYNC_DATE_TIME = "yyyy-MM-dd HH:mm"; - public static final String BIRTH_DATE = "dd/MM/yyyy"; - - public static Timestamp getTimestamp(String timeStr) throws OperationException - { - SimpleDateFormat sFormat = new SimpleDateFormat(XML_DATE_PATTERN); - - Date date = null; - try - { - date = sFormat.parse(timeStr); - } - catch (ParseException e) - { - throw new OperationException("Cannot convert to timestamp!" + timeStr); - } - - Timestamp stamp = new Timestamp(date.getTime()); - - return stamp; - - } - - public static Timestamp getTimestamp(String timeStr, String format) throws InvalidDateTimeException - { - SimpleDateFormat sFormat = new SimpleDateFormat(format); - - if(timeStr == null || timeStr.length() == 0) - throw new InvalidDateTimeException("String length is invalid"); - - Date date = null; - try - { - date = sFormat.parse(timeStr); - } - catch (ParseException e) - { - throw new InvalidDateTimeException("Cannot convert to timestamp!" + timeStr); - } - - Timestamp stamp = new Timestamp(date.getTime()); - - return stamp; - } - public static Timestamp getTimestampForSync(String timeStr) throws InvalidDateTimeException - { - return getTimestamp(timeStr, SYNC_DATE_TIME); - } - - public static Timestamp getTimestampFromFlatString(String timeStr) throws OperationException, InvalidDateTimeException - { - return getTimestamp(timeStr, FLAT_DATE_PATTERN); - } - - public static String getCurrentDateTime() - { - SimpleDateFormat sFormat = new SimpleDateFormat(NORM_DATE_TIME_PATTERN); - - Date now = new Date(); - - String strDate = sFormat.format(now); - - return strDate; - } - - /** - * @return Current date and time - */ - public static Timestamp getCurrentDateTimeTimestamp() - { - return new Timestamp(System.currentTimeMillis()); - } - - /** - * @return Current Date only - * @throws OperationException - */ - public static Timestamp getCurrentDateTimestamp() throws OperationException - { - // Does not clear hour - /*Calendar cal = Calendar.getInstance(); - cal.clear(Calendar.MILLISECOND); - cal.clear(Calendar.SECOND); - cal.clear(Calendar.MINUTE); - cal.clear(Calendar.HOUR);*/ - - try - { - Date now = new Date(); - SimpleDateFormat sFormat = new SimpleDateFormat(FLAT_DATE_PATTERN); - - String d = sFormat.format(now); - - Date nDate = sFormat.parse(d); - - return new Timestamp(nDate.getTime()); - } - catch(ParseException ex) - { - throw new OperationException("Could not retrieve current date"); - } - } - - - - public static String convertTimeStampToFyracle(String timeStr) throws OperationException - { - if(timeStr == null || timeStr.trim().length() == 0) - throw new OperationException("Time string cannot be null"); - - if(timeStr.length() < 8) - throw new OperationException("Time string is invalid, Time String: " + timeStr); - - int ind = timeStr.indexOf("-"); - if(ind != 2) - throw new OperationException("Time string is not good, Time String: " + timeStr); - - String timeStrSub = timeStr.substring(ind + 1); - - int ind2 = timeStrSub.indexOf("-"); - - if(ind2 == 2) - return convertTimeStampToFyracle(timeStr, DEFAULT_DATE_PATTERN1); - else if(ind2 == 3) - return convertTimeStampToFyracle(timeStr, DEFAULT_DATE_PATTERN2); - else - throw new OperationException("Time string is not valid, Time String: " + timeStr); - } - - public static String convertTimeStampToFyracle(String timeStr, String pattern) throws OperationException - { - SimpleDateFormat sFormat = new SimpleDateFormat(pattern); - SimpleDateFormat tFormat = new SimpleDateFormat(FYRACLE_DATETIME_PATTERN); - - Date date = null; - - try - { - date = sFormat.parse(timeStr); - String retVal = tFormat.format(date); - return retVal; - } - catch(ParseException ex) - { - throw new OperationException("Cannot convert to timestamp!" + timeStr); - } - } - - public static String changeTimestampPattern(String timeStr, String fromPattern, String toPattern) throws OperationException - { - SimpleDateFormat sFormat = new SimpleDateFormat(fromPattern); - SimpleDateFormat tFormat = new SimpleDateFormat(toPattern); - - Date date = null; - - try - { - date = sFormat.parse(timeStr); - String retVal = tFormat.format(date); - return retVal; - } - catch(ParseException ex) - { - throw new OperationException("Cannot convert to timestamp!" + timeStr); - } - } - - public static String convertTimeStampToFyracleDate(Timestamp tStamp) throws OperationException - { - SimpleDateFormat tFormat = new SimpleDateFormat(FYRACLE_DATE_PATTERN); - - try - { - String retVal = tFormat.format(tStamp); - return retVal; - } - catch(Exception ex) - { - throw new OperationException("Cannot convert to timestamp!" + tStamp.toString()); - } - } - - public static String convertTimeStamp(Timestamp time, String format) throws OperationException - { - try - { - SimpleDateFormat dateFormat = new SimpleDateFormat(format); - - String formatted = dateFormat.format(time); - return formatted; - } - catch (Exception e) - { - throw new OperationException("Cannot convert to timestamp!" + time.toString()); - } - } - - public static String reportTimeStampToFyracle(String timeStr) throws OperationException - { - SimpleDateFormat sFormat = new SimpleDateFormat(REPORTS_DATE_PATTERN); - SimpleDateFormat tFormat = new SimpleDateFormat(FYRACLEDB_DATETIME_PATTERN); - - Date date = null; - - try - { - date = sFormat.parse(timeStr); - String retVal = tFormat.format(date); - return retVal; - } - catch(ParseException ex) - { - throw new OperationException("Cannot convert to timestamp!" + timeStr); - } - } - - /** - * Format Timestamp according to default pattern - * @see DEFAULT_DATE_PATTERN1 - * @param timestamp - * @return formatted timestamp - */ - public static String format(Timestamp timestamp) - { - return format(timestamp, DEFAULT_DATE_PATTERN1); - } - - /** - * Format a Timestamp according to the pattern provided - * @param timestamp - * @param pattern - * @return Formated string for the Timestamp - */ - public static String format(Timestamp timestamp, String pattern) - { - if (timestamp == null) - { - throw new IllegalArgumentException("Timestamp cannot be null"); - } - - if (pattern == null) - { - throw new IllegalArgumentException("Pattern cannot be null"); - } - - SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); - return dateFormat.format(timestamp); - } -} - \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/core/TmkJSPEnv.java b/posterita/posterita/src/main/org/posterita/core/TmkJSPEnv.java deleted file mode 100644 index 1d4580f7a2..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/TmkJSPEnv.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.core; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; - -import org.compiere.util.Env; -import org.compiere.wstore.JSPEnv; -import org.posterita.exceptions.TMKRuntimeException; -import org.posterita.lib.UdiConstants; - -/** - * JSP Environment Utilities - * - * @author Jorg Janke - * @version $Id: TmkJSPEnv.java,v 1.2 2006/12/15 06:32:14 vishee Exp $ - */ -public class TmkJSPEnv -{ - public static Properties getCtx(HttpServletRequest request) - { - Properties ctx = JSPEnv.getCtx(request); - - String user_org = Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); - - if ((user_org == null) || (user_org.equals(""))) //FIXME - { - Env.setContext(ctx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM, Env.getAD_Org_ID(ctx)); - } - - try //Required since our friend Jorg hardcoded 30 mins in JSPEnv.java - { - request.getSession().setMaxInactiveInterval(5*60*60); // 5 Hours - } - catch(Exception ex) - { - throw new TMKRuntimeException("Could not figure the application type for the current session"); - } - - return ctx; - - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/TrxPrefix.java b/posterita/posterita/src/main/org/posterita/core/TrxPrefix.java deleted file mode 100644 index 001faf50bf..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/TrxPrefix.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 02-Dec-2005 - */ - - -package org.posterita.core; - - -public class TrxPrefix -{ - private static int count=0; - - public static synchronized String getPrefix() - { - count++; - return "POSTERITA"+count + "_" + System.currentTimeMillis(); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/UDIFilePropertiesManager.java b/posterita/posterita/src/main/org/posterita/core/UDIFilePropertiesManager.java deleted file mode 100644 index 3603f22a9a..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/UDIFilePropertiesManager.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 13-Oct-2005 - */ - - -package org.posterita.core; - -public class UDIFilePropertiesManager extends FilePropertiesManager -{ - static UDIFilePropertiesManager singleton; - - private UDIFilePropertiesManager() - { - - } - - public static UDIFilePropertiesManager getProperty() - { - if (singleton ==null) - singleton = new UDIFilePropertiesManager(); - - return singleton; - } - - protected String getFileName() - { - return "Udi"; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/UDIMap.java b/posterita/posterita/src/main/org/posterita/core/UDIMap.java deleted file mode 100644 index 003bbf161b..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/UDIMap.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 15, 2005 by praveen - * - */ -package org.posterita.core; - -import java.util.HashMap; - -import org.compiere.process.DocAction; - -public class UDIMap -{ - public static final HashMap docStatusMap; - - static - { - docStatusMap = new HashMap(); - docStatusMap.put(DocAction.STATUS_Approved,"Approved"); - docStatusMap.put(DocAction.STATUS_Completed,"Completed"); - docStatusMap.put(DocAction.STATUS_Closed,"Closed"); - docStatusMap.put(DocAction.STATUS_Drafted,"Drafted"); - docStatusMap.put(DocAction.STATUS_InProgress,"InProgress"); - docStatusMap.put(DocAction.STATUS_Invalid,"Invalid"); - docStatusMap.put(DocAction.STATUS_NotApproved,"Not Approved"); - docStatusMap.put(DocAction.STATUS_Reversed,"Reversed"); - docStatusMap.put(DocAction.STATUS_Unknown,"UnKnown"); - docStatusMap.put(DocAction.STATUS_Voided,"Voided"); - docStatusMap.put(DocAction.STATUS_WaitingConfirmation,"Waiting Confirmation"); - docStatusMap.put(DocAction.STATUS_WaitingPayment,"Waiting payment"); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/UDIPair.java b/posterita/posterita/src/main/org/posterita/core/UDIPair.java deleted file mode 100644 index 1699a09786..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/UDIPair.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.core; - -public class UDIPair implements Comparable -{ - private Integer ID; - private String value; - - public UDIPair(Integer ID, String value) - { - this.ID = ID; - this.value = value; - } - - public Integer getID() - { - return ID; - } - - public void setID(Integer id) - { - ID = id; - } - - public String getValue() - { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public int compareTo(Object o) - { - UDIPair pair = (UDIPair) o; - - return this.getValue().compareTo(pair.getValue()); - } - - public String toString() - { - String str ="ID:" +getID() + " Value:" +getValue(); - return str; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/UDIPropertiesManager.java b/posterita/posterita/src/main/org/posterita/core/UDIPropertiesManager.java deleted file mode 100644 index 6d1de2729f..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/UDIPropertiesManager.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 24-Jun-2005 by alok - * - */ -package org.posterita.core; - -import org.posterita.factory.DBPropertiesManager; -import org.posterita.factory.WebProperties; - -public class UDIPropertiesManager -{ - private static WebProperties singleton; - - private UDIPropertiesManager() - { - - } - - public static WebProperties getProperty() - { - if (singleton ==null) - singleton = new DBPropertiesManager(); - - - - return singleton; - } - - protected String getFileName() - { - - return "Udi"; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/UpdateUsers.java b/posterita/posterita/src/main/org/posterita/core/UpdateUsers.java deleted file mode 100644 index b73d06d212..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/UpdateUsers.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.core; - -import java.util.Properties; -import java.util.logging.Level; - -import org.compiere.Adempiere; -import org.compiere.model.MBPartner; -import org.compiere.model.MUser; -import org.compiere.util.CLogMgt; -import org.compiere.util.Env; - - -public class UpdateUsers { - - public static void main(String[] args) - { - Adempiere.startup(true); - CLogMgt.initialize(true); - CLogMgt.setLevel(Level.OFF); - - Properties ctx = Env.getCtx(); - Env.setContext(ctx, "#AD_Client_ID", "" + 1001932); - - int userIds[] = MUser.getAllIDs(MUser.Table_Name, " ad_client_id=1001932", null); - - MUser user; - MBPartner partner; - for (int i = 0; i < userIds.length; i++) - { - user = new MUser(ctx, userIds[i], null); - - if (user.getC_BPartner_ID()!=0) - { - partner = new MBPartner(ctx, user.getC_BPartner_ID(), null); - user.setName(partner.getName()); - user.save(); - } - - } - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/WebFacade.java b/posterita/posterita/src/main/org/posterita/core/WebFacade.java deleted file mode 100644 index 56b9c54770..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/WebFacade.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.core; - - -public class WebFacade -{ - -} diff --git a/posterita/posterita/src/main/org/posterita/core/action/ClientAction.java b/posterita/posterita/src/main/org/posterita/core/action/ClientAction.java deleted file mode 100644 index 6e7745c3d7..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/action/ClientAction.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Oct 30, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.core.action; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MCountry; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.posterita.Constants; -import org.posterita.beans.UserBean; -import org.posterita.businesslogic.CurrencyManager; -import org.posterita.businesslogic.POSClientManager; -import org.posterita.core.KeyNamePairUtil; -import org.posterita.core.bean.ClientBean; -import org.posterita.exceptions.ClientAlreadyExistException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - -public class ClientAction extends BaseDispatchAction -{ - - public static final String INIT_CREATE_CLIENT = "initCreateClient"; - public ActionForward initCreateClient(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx = Env.getCtx(); //--> Not using TmkJSPEnv because it may be that no store is defined - ArrayList countriesKNPair = KeyNamePairUtil.getData(ctx, MCountry.Table_Name, "IsActive='Y'"); - ArrayList currenciesKNPair = CurrencyManager.getAllCurrencies(); - - request.getSession().setAttribute(Constants.COUNTRIES, countriesKNPair); - request.getSession().setAttribute(Constants.CURRENCIES, currenciesKNPair); - - return mapping.findForward(INIT_CREATE_CLIENT); - } - - public static final String CREATE_CLIENT = "createClient"; - public ActionForward createClient(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - DefaultForm df = (DefaultForm)form; - - ClientBean clientBean = (ClientBean)df.getBean(); - - UserBean userBean = new UserBean(); - userBean.setName(clientBean.getUsername()); - userBean.setAddress1(clientBean.getAddress1()); - userBean.setCity(clientBean.getCity()); - userBean.setCountryId(clientBean.getCountryId()); - userBean.setEmail(clientBean.getEmail()); - request.getSession().setAttribute(Constants.USER_BEAN, userBean); - - /*request.setAttribute(Constants.EMAIL, clientBean.getEmail()); - request.setAttribute(Constants.USERNAME, clientBean.getUsername()); - request.setAttribute(Constants.ADDRESS1, clientBean.getAddress1()); - request.setAttribute(Constants.CITY, clientBean.getCity()); - request.setAttribute(Constants.COUNTRY_ID, clientBean.getCountryId());*/ - - - if (clientBean.getFile() == null) - { - clientBean.setFile(df.getFile()); - } - - if(!clientBean.getPassword().equals(clientBean.getConfirmPassword())) - { - postGlobalError("error.wrong.password.matching", request); - return mapping.getInputForward(); - } - - String storeContext; - try - { - storeContext = POSClientManager.createClient(clientBean); - } - catch(ClientAlreadyExistException ex) - { - postGlobalError("error.client.alreadyexist", request); - return mapping.getInputForward(); - } - catch(OperationException ex) - { - postGlobalError("error.client.create", ex.getMessage(), request); - return mapping.getInputForward(); - } - - String contextPath = "/RegisterUserAction.do?action=initRegisterUser"; - /*String contextPath = "/SetApplicationParametersAction.do?action=setApplicationParameters&applicationName=" + storeContext;*/ - return new ActionForward(contextPath); - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/action/login/GenericLoginAction.java b/posterita/posterita/src/main/org/posterita/core/action/login/GenericLoginAction.java deleted file mode 100644 index 272831ca67..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/action/login/GenericLoginAction.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.core.action.login; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.struts.login.LoginAction; - -public class GenericLoginAction extends LoginAction -{ - - public ActionForward success(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - - return super.success(mapping, form, request, response); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/bean/ClientBean.java b/posterita/posterita/src/main/org/posterita/core/bean/ClientBean.java deleted file mode 100644 index 62a423bf8d..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/bean/ClientBean.java +++ /dev/null @@ -1,173 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Oct 30, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.core.bean; - -import org.apache.struts.upload.FormFile; -import org.posterita.beans.UDIBean; - -public class ClientBean extends UDIBean -{ - public String getClientName() - { - return clientName; - } - - public void setClientName(String clientName) - { - this.clientName = clientName; - } - - public String getAddress1() - { - return address1; - } - - public void setAddress1(String address1) - { - this.address1 = address1; - } - - public Integer getCountryId() - { - return countryId; - } - - public void setCountryId(Integer countryId) - { - this.countryId = countryId; - } - - public Integer getCurrencyId() - { - return currencyId; - } - - public void setCurrencyId(Integer currencyId) - { - this.currencyId = currencyId; - } - - public String getEmail() - { - return email; - } - - public void setEmail(String email) - { - this.email = email; - } - - public String getOrgName() - { - return orgName; - } - - public void setOrgName(String orgName) - { - this.orgName = orgName; - } - - public String getPostalAddress() - { - return postalAddress; - } - - public void setPostalAddress(String postalAddress) - { - this.postalAddress = postalAddress; - } - - public String getConfirmPassword() - { - return confirmPassword; - } - - public void setConfirmPassword(String confirmPassword) - { - this.confirmPassword = confirmPassword; - } - - public String getPassword() - { - return password; - } - - public void setPassword(String password) - { - this.password = password; - } - - public String getUserPIN() - { - return userPIN; - } - - public void setUserPIN(String userPIN) - { - this.userPIN = userPIN; - } - - public String getRoleName() - { - return roleName; - } - - public void setRoleName(String roleName) - { - this.roleName = roleName; - } - - public String getUsername() - { - return username; - } - - public void setUsername(String username) - { - this.username = username; - } - - public String getCity() - { - return city; - } - - public void setCity(String city) - { - this.city = city; - } - - public FormFile getFile() - { - return file; - } - public void setFile(FormFile file) - { - this.file = file; - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/bean/ElementBean.java b/posterita/posterita/src/main/org/posterita/core/bean/ElementBean.java deleted file mode 100644 index 38eb4a3688..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/bean/ElementBean.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Nov 15, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.core.bean; - -public class ElementBean -{ - protected String name; - protected String columnName; - protected String printName; - protected String description; - protected String help; - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - public String getColumnName() - { - return columnName; - } - - public void setColumnName(String columnName) - { - this.columnName = columnName; - } - - public String getDescription() - { - return description; - } - - public void setDescription(String description) - { - this.description = description; - } - - public String getHelp() - { - return help; - } - - public void setHelp(String help) - { - this.help = help; - } - - public String getPrintName() - { - return printName; - } - - public void setPrintName(String printName) - { - this.printName = printName; - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/businesslogic/ElementManager.java b/posterita/posterita/src/main/org/posterita/core/businesslogic/ElementManager.java deleted file mode 100644 index 5336bd0c3b..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/businesslogic/ElementManager.java +++ /dev/null @@ -1,217 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Nov 15, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.core.businesslogic; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.Properties; - -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Language; -import org.compiere.util.Msg; - -import org.posterita.lib.UdiConstants; -import org.posterita.core.bean.ElementBean; - -public class ElementManager -{ - protected transient static final CLogger log = CLogger.getCLogger (ElementManager.class); - private static ElementBean getUnknownElementBean(Properties ctx, String columnName) - { - ElementBean elementBean = new ElementBean(); - elementBean.setColumnName(columnName); - elementBean.setDescription("Undefined column with name: " + columnName); - elementBean.setHelp(elementBean.getDescription()); - elementBean.setName(columnName); - elementBean.setPrintName(columnName); - return elementBean; - } - - private static String getElement_TrlSql(Properties ctx, String columnName) - { - String language = Env.getContext(ctx, UdiConstants.LANGUAGE_CTX_PARAM); - - if (language == null || language.trim().length() == 0) - { - language = Language.AD_Language_en_US; - } - - String tableName = "AD_Element"; - StringBuffer whereClause = new StringBuffer("ColumnName='"); - whereClause.append(columnName); - whereClause.append("' "); - - if (!language.equals(Language.AD_Language_en_US)) - { - tableName = "AD_Element_Trl"; - whereClause = new StringBuffer(); - whereClause.append("AD_Element_ID= (select AD_Element_ID from AD_Element where ColumnName='" + columnName + "')"); - whereClause.append(" and AD_Language='"); - whereClause.append(language); - whereClause.append("'"); - } - - StringBuffer sql = new StringBuffer(); - sql.append("Select ColumnName, Name, PrintName, Description, Help from "); - sql.append(tableName); - sql.append(" where "); - sql.append(whereClause); - - return sql.toString(); - } - - public static String getMsg_trlSql(Properties ctx, String text) - { - String language = Env.getContext(ctx, UdiConstants.LANGUAGE_CTX_PARAM); - - if (language == null || language.trim().length() == 0) - { - language = Language.AD_Language_en_US; - } - - String tableName = "AD_Message"; - StringBuffer whereClause = new StringBuffer("value='"); - whereClause.append(text); - whereClause.append("' "); - - if (!language.equals(Language.AD_Language_en_US)) - { - tableName = "AD_Element_Trl"; - whereClause = new StringBuffer(); - whereClause.append("AD_Message_ID= (select AD_Message_ID from AD_Message where value='"); - whereClause.append(text); - whereClause.append("')"); - whereClause.append(" and AD_Language='"); - whereClause.append(language); - whereClause.append("'"); - } - - StringBuffer sql = new StringBuffer(); - sql.append("Select Value, MsgText, MsgText, MsgTip, MsgTip from "); - sql.append(tableName); - sql.append(" where "); - sql.append(whereClause); - - return sql.toString(); - } - - private static ElementBean getTrl(String sql) - { - PreparedStatement pstmt = DB.prepareStatement(sql, null); - - ElementBean retElementBean = null; - try - { - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) - { - retElementBean = new ElementBean(); - retElementBean.setColumnName(rs.getString(1)); - retElementBean.setName(rs.getString(2)); - retElementBean.setPrintName(rs.getString(3)); - retElementBean.setDescription(rs.getString(4)); - retElementBean.setHelp(rs.getString(5)); - } - else - { - return null; - } - rs.close(); - } - catch (Exception ex) - { - log.severe("Could retrieve element translation with sql: " + sql); - } - finally - { - try - { - pstmt.close(); - } - catch (Exception ex){} - } - - return retElementBean; - } - - public static ElementBean getMsg1(Properties ctx, String text) - { - ElementBean elementBean = null; - - elementBean = getTrl(getElement_TrlSql(ctx, text)); - - if (elementBean == null) - { - elementBean = getTrl(getMsg_trlSql(ctx, text)); - } - - if (elementBean == null) - { - elementBean = getUnknownElementBean(ctx, text); - } - - return elementBean; - } - - public static ElementBean getMsg(Properties ctx, String text) - { - String language = Env.getContext(ctx, UdiConstants.LANGUAGE_CTX_PARAM); - - if (language == null || language.trim().length() == 0) - { - language = Language.AD_Language_en_US; - } - - String msg = Msg.getElement(language, text, true); - - if (msg == null || msg == "") - { - msg = Msg.translate(language, text); - } - - if (msg == null || msg == "") - { - msg = text; - } - - int ind = msg.indexOf(Env.NL); - if (ind != -1) - msg = msg.substring(0, ind); - - ElementBean elementBean = new ElementBean(); - elementBean.setColumnName(text); - elementBean.setDescription(msg); - elementBean.setHelp(msg); - elementBean.setName(msg); - elementBean.setPrintName(msg); - - return elementBean; - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/businesslogic/ImportManager.java b/posterita/posterita/src/main/org/posterita/core/businesslogic/ImportManager.java deleted file mode 100644 index 6a090c0d6c..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/businesslogic/ImportManager.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -/** - @author ashley - */ - -package org.posterita.core.businesslogic; - -import java.io.File; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import org.compiere.impexp.ImpFormat; -import org.compiere.process.ImportAccount; -import org.compiere.process.ProcessInfo; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.util.Trx; - -import org.posterita.businesslogic.ProcessManager; -import org.posterita.core.FileManager; -import org.posterita.exceptions.OperationException; - -public class ImportManager -{ - public static int importFile(Properties ctx, File impFile, String importFormat, String trxName) throws OperationException - { - if(impFile == null) - throw new OperationException("File to import cannot be null"); - if(!impFile.exists() || impFile.isDirectory()) - throw new OperationException("File does not exist or it is a directory, file: " + impFile); - if(importFormat == null || importFormat.trim().length() == 0) - throw new OperationException("Import format cannot be null"); - - ImpFormat impFormat = ImpFormat.load(importFormat); - - if(impFormat == null) - throw new OperationException("Could not load import format: " + importFormat); - - ArrayList fileLinesList = FileManager.readLines(impFile); - - Iterator fileLinesIter = fileLinesList.iterator(); - - int importedLines = 0; - while(fileLinesIter.hasNext()) - { - String line = fileLinesIter.next(); - if(impFormat.updateDB(ctx, line, trxName)) - importedLines++; - } - - return importedLines; - } - - public static void importAccounting(Properties ctx, int clientId, int elementId, boolean updateDefaultAccounts, boolean createNewCombination, boolean deleteOldImported, String trxName) throws OperationException - { - ImportAccount impAccount = new ImportAccount(); - int accountImportProcessId = ProcessManager.getProcessId(ImportAccount.class); - - String updDefAccts = (updateDefaultAccounts) ? "Y" : "N"; - String crNewCombinations = (createNewCombination) ? "Y" : "N"; - String delOldImp = (deleteOldImported) ? "Y" : "N"; - - ProcessInfo processInfo = new ProcessInfo("Import accounts", accountImportProcessId); - - ProcessInfoParameter clientParam = new ProcessInfoParameter("AD_Client_ID", new BigDecimal(clientId), new BigDecimal(clientId), "Client", "Client"); - ProcessInfoParameter elementParam = new ProcessInfoParameter("C_Element_ID", new BigDecimal(elementId), new BigDecimal(elementId), "Element", "Element"); - ProcessInfoParameter updDefAcctsParam = new ProcessInfoParameter("UpdateDefaultAccounts", updDefAccts, updDefAccts, "Update Default Accounts", "Update Default Accounts"); - ProcessInfoParameter createNewCombinationParam = new ProcessInfoParameter("CreateNewCombination", crNewCombinations, crNewCombinations, "Create New Combination", "Create New Combination"); - ProcessInfoParameter deleteOldParam = new ProcessInfoParameter("DeleteOldImported", delOldImp, delOldImp, "Delete Old Imported", "Delete Old Imported"); - - ProcessInfoParameter parameters[] = new ProcessInfoParameter[5]; - parameters[0] = clientParam; - parameters[1] = elementParam; - parameters[2] = updDefAcctsParam; - parameters[3] = createNewCombinationParam; - parameters[4] = deleteOldParam; - - processInfo.setParameter(parameters); - - Trx trx = null; - - if(trxName != null) - trx = Trx.get(trxName, false); - - if(!impAccount.startProcess(ctx, processInfo, trx)) - throw new OperationException("Could not run import accounting process"); - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/exception/FileOpException.java b/posterita/posterita/src/main/org/posterita/core/exception/FileOpException.java deleted file mode 100644 index 119003bbb1..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/exception/FileOpException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -package org.posterita.core.exception; - -public class FileOpException extends Exception -{ - private static final long serialVersionUID = 1L; - - public FileOpException(String msg) - { - super(msg); - } - - public FileOpException(String msg, Exception ex) - { - super(msg, ex); - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/exception/IOOperationException.java b/posterita/posterita/src/main/org/posterita/core/exception/IOOperationException.java deleted file mode 100644 index ec46611784..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/exception/IOOperationException.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -/** - @author ashley - */ - -package org.posterita.core.exception; - -import org.posterita.exceptions.OperationException; - -public class IOOperationException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public IOOperationException(String msg) - { - super(msg); - } - - public IOOperationException(String msg, Exception ex) - { - super(msg, ex); - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/form/ClientForm.java b/posterita/posterita/src/main/org/posterita/core/form/ClientForm.java deleted file mode 100644 index 6ae9f6ba25..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/form/ClientForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Oct 30, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.core.form; - -import org.posterita.struts.core.DefaultForm; -import org.posterita.core.bean.ClientBean; - -public class ClientForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public ClientForm() - { - this.setBean(new ClientBean()); - this.addRequiredFields(new String[]{"clientName", "address1", "countryId", "currencyId", "email", "orgName", "postalAddress", "confirmPassword", "password", "userPIN", "roleName", "username", "city","file"}); - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/install/EnvSettings.java b/posterita/posterita/src/main/org/posterita/core/install/EnvSettings.java deleted file mode 100644 index 62c7036bce..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/install/EnvSettings.java +++ /dev/null @@ -1,151 +0,0 @@ -package org.posterita.core.install; - -import java.io.File; -import java.net.InetAddress; -import java.net.UnknownHostException; - -import org.posterita.core.exception.FileOpException; - -public class EnvSettings -{ - public static boolean DEBUG = true; - public static final double JAVA_VERSION_1_5 = 1.5; - - public static final String PATH_SEPARATOR = System.getProperty("file.separator"); - - public static final String JAVA_HOME = "JAVA_HOME"; - public static final String COMPIERE_WEBSTORES = "COMPIERE_WEBSTORES"; - public static final String COMPIERE_DB_USER = "COMPIERE_DB_USER"; - public static final String COMPIERE_DB_NAME = "COMPIERE_DB_NAME"; - public static final String COMPIERE_DB_SYSTEM = "COMPIERE_DB_SYSTEM"; - public static final String COMPIERE_DB_PASSWORD = "COMPIERE_DB_PASSWORD"; - public static final String COMPIERE_HOME = "COMPIERE_HOME"; - public static final String COMPIERE_APPS_SERVER = "COMPIERE_APPS_SERVER"; - public static final String COMPIERE_WEB_ALIAS = "COMPIERE_WEB_ALIAS"; - public static final String COMPIERE_DB_TYPE = "COMPIERE_DB_TYPE"; - public static final String COMPIERE_DB_PORT = "COMPIERE_DB_PORT"; - public static final String COMPIERE_DB_SERVER = "COMPIERE_DB_SERVER"; - public static final String COMPIERE_DB_URL = "COMPIERE_DB_URL"; - public static final String COMPIERE_MAIL_SERVER = "COMPIERE_MAIL_SERVER"; - public static final String COMPIERE_APPS_DEPLOY = "COMPIERE_APPS_DEPLOY"; - public static final String COMPIERE_KEYSTORE = "COMPIERE_KEYSTORE"; - - public static final String TEMP_DIR = "TempDir"; - public static final String CONNECTION = "Connection"; - - public static final String OS_WINDOWS = "Windows"; - public static final String OS_LINUX = "Linux"; - - public static File getJDKHomeDir() throws FileOpException - { - String javaHome = System.getProperty("java.home"); - - if(javaHome.endsWith("jre")) // Implies running from JRE found within JDK Folder - { - int jInd = javaHome.lastIndexOf("jre"); - javaHome = javaHome.substring(0, jInd - 1); - } - - int index = javaHome.lastIndexOf(PATH_SEPARATOR); - index = index + 1; - - if(isOSWindows()) - { - javaHome = javaHome.toLowerCase(); - int pInd = javaHome.indexOf("progra~1"); - if(pInd > 0) - javaHome = javaHome.replaceAll("progra~1", "program files"); - } - - String jreFolder = javaHome.substring(index); - String jdkFolder = jreFolder.replaceAll("jre", "jdk"); - - File jdkDir = new File(javaHome.substring(0, index) + jdkFolder); - if(!jdkDir.exists()) - throw new FileOpException("JDK Folder does not exists, file: " + jdkDir.getAbsolutePath()); - if(!jdkDir.isDirectory()) - throw new FileOpException("Path is not a directory, file: " + jdkDir.getAbsolutePath()); - - return jdkDir; - } - - public static File getUserDesktopDir() throws FileOpException - { - String userHome = System.getProperty("user.home"); - - String desktopDirPath = userHome + PATH_SEPARATOR + "Desktop"; - - File desktopDir = new File(desktopDirPath); - - if(!(desktopDir.exists() && desktopDir.isDirectory())) - throw new FileOpException("Could not locate desktop directory"); - - return desktopDir; - } - - public static File getTempDir() throws FileOpException - { - String tempDirPath = System.getProperty("java.io.tmpdir"); - - File tempDir = new File(tempDirPath); - - if(!(tempDir.exists() && tempDir.isDirectory())) - throw new FileOpException("Could not locate Temporary Directory"); - - return tempDir; - } - - public static String getJavaMajorVersion() - { - String javaVersion = System.getProperty("java.version"); - javaVersion = javaVersion.substring(0, 3); - - return javaVersion; - } - - public static boolean isJavaVersionOk() - { - boolean versionOk = false; - - String javaVersion = getJavaMajorVersion(); - try - { - double version = Double.parseDouble(javaVersion); - if(version >= 1.5) - versionOk = true; - } - catch(NumberFormatException ex) - { - versionOk = false; - } - return versionOk; - } - - public static File getWorkingDir() - { - String workingDir = System.getProperty("user.dir"); - - return new File(workingDir); - } - - public static String getHostName() throws UnknownHostException - { - InetAddress iAdd = InetAddress.getLocalHost(); - return iAdd.getHostName(); - } - - public static String getHostAddress() throws UnknownHostException - { - InetAddress iAdd = InetAddress.getLocalHost(); - return iAdd.getHostAddress(); - } - - public static boolean isOSWindows() - { - String osName = System.getProperty("os.name"); - if(osName.startsWith(OS_WINDOWS)) - return true; - else - return false; - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/install/POSInstall.java b/posterita/posterita/src/main/org/posterita/core/install/POSInstall.java deleted file mode 100644 index 5e141453c8..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/install/POSInstall.java +++ /dev/null @@ -1,423 +0,0 @@ -package org.posterita.core.install; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileWriter; -import java.io.IOException; -import java.io.InputStream; -import java.net.UnknownHostException; -import java.util.Enumeration; -import java.util.Properties; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -import org.posterita.core.exception.FileOpException; - -public class POSInstall -{ - public static final boolean DEBUG = true; - private static final String DB_TYPE_ORACLE = "oracle"; -// private static final String DB_TYPE_FIREBIRD = "firebird"; - - private static final String DEFAULT_DB_NAME = "tmkpos"; - private static final String DB_PASSWORD = "compiere"; -// private static final String DB_SYSTEM_PASSWORD = "compiere"; - - private static final String START_SERVER_LINK_FILE = "Start Tamak ICT POS Server.lnk"; - private static final String STOP_SERVER_LINK_FILE = "Stop Tamak ICT POS Server.lnk"; - - private static final String INSTALLATIONSRC = "Compiere2"; - - private static final String INSTALLATION_PATH = "c:\\"; - private static final String FILE_SRC_DIR = "bin"; - - - private static void writeStream(File outFile, InputStream inStream) throws FileOpException - { - try - { - FileOutputStream fileOutStream = new FileOutputStream(outFile); - BufferedOutputStream bufferedOutStream = new BufferedOutputStream(fileOutStream); - BufferedInputStream bufferedInStream = new BufferedInputStream(inStream); - - byte buffer[] = new byte[1024]; - int read = -1; - - while((read = bufferedInStream.read(buffer)) != -1) - bufferedOutStream.write(buffer, 0, read); - bufferedOutStream.flush(); - bufferedOutStream.close(); - bufferedInStream.close(); - } - catch(IOException ex) - { - throw new FileOpException("Could not write file: " + outFile.getAbsolutePath(), ex); - } - } - - public static String getFileAsString(File inFile) throws FileOpException - { - try - { - FileInputStream fileInStream = new FileInputStream(inFile); - BufferedInputStream bufferedInStream = new BufferedInputStream(fileInStream); - ByteArrayOutputStream byteArrayOutStream = new ByteArrayOutputStream(); - - byte buffer[] = new byte[1024]; - int read; - - while((read = bufferedInStream.read(buffer)) != -1) - { - byteArrayOutStream.write(buffer, 0, read); - } - - byteArrayOutStream.flush(); - - String data = new String(byteArrayOutStream.toByteArray()); - byteArrayOutStream.close(); - bufferedInStream.close(); - fileInStream.close(); - - return data; - } - catch(IOException ex) - { - throw new FileOpException("Could not read file: " + inFile.getAbsolutePath(), ex); - } - - } - - public static void install(File srcFile, String installationPath) throws FileOpException - { - try - { - ZipFile zipFile = new ZipFile(srcFile); - - Enumeration zipEntryEnum = zipFile.entries(); - - while(zipEntryEnum.hasMoreElements()) - { - ZipEntry zipEntry = (ZipEntry)zipEntryEnum.nextElement(); - - if(zipEntry.isDirectory()) - { - File file = new File(installationPath + zipEntry.getName()); - if(DEBUG) - System.out.println("Creating directory: " + file.getAbsolutePath()); - if(!file.mkdirs()) - throw new FileOpException("Could not creat directory: " + file.getAbsolutePath()); - } - else - { - File file = new File(installationPath + zipEntry.getName()); - if(DEBUG) - System.out.println("Creating file: " + file.getAbsolutePath()); - InputStream inStream = zipFile.getInputStream(zipEntry); - writeStream(file, inStream); - inStream.close(); - } - } - } - catch(IOException ex) - { - throw new FileOpException("Could not create installation files", ex); - } - } - - /*private static void uninstall(File path) - { - File files[] = path.listFiles(); - - for(int i = 0; i < files.length; i++) - { - if(files[i].isDirectory()) - uninstall(files[i]); - else - files[i].delete(); - } - path.delete(); - }*/ - - private static void changeCompiereEnvSettings(File compEnvFile, File compHomeDir, String dbName, String dbType, String webstores) throws FileOpException - { - if(!(compEnvFile.exists() && compEnvFile.isFile())) - throw new FileOpException("Could not locate Compiere Environment settings, " + compEnvFile.getAbsolutePath()); - - Properties props = new Properties(); - FileInputStream fis = null; - FileOutputStream fileOutStream = null; - - try - { - fis = new FileInputStream(compEnvFile); - props.load(fis); - String hostName = EnvSettings.getHostName(); - - props.setProperty(EnvSettings.COMPIERE_APPS_SERVER, hostName); - props.setProperty(EnvSettings.COMPIERE_DB_SERVER, hostName); - props.setProperty(EnvSettings.COMPIERE_MAIL_SERVER, hostName); - props.setProperty(EnvSettings.COMPIERE_WEB_ALIAS, hostName); - - String jdbcConnString = ""; - if(dbType.equals(DB_TYPE_ORACLE)) - jdbcConnString = "jdbc:oracle:thin:@" + hostName + ":1521:" + dbName; - - props.setProperty(EnvSettings.COMPIERE_DB_URL, jdbcConnString); - props.setProperty(EnvSettings.COMPIERE_HOME, compHomeDir.getAbsolutePath()); - props.setProperty(EnvSettings.JAVA_HOME, EnvSettings.getJDKHomeDir().getAbsolutePath()); - props.setProperty(EnvSettings.COMPIERE_DB_TYPE, dbType); - props.setProperty(EnvSettings.COMPIERE_DB_NAME, dbName); - - String deployFolder = compHomeDir.getAbsolutePath() - + EnvSettings.PATH_SEPARATOR + "jboss" - + EnvSettings.PATH_SEPARATOR + "server" - + EnvSettings.PATH_SEPARATOR + "compiere" - + EnvSettings.PATH_SEPARATOR + "deploy"; - props.setProperty(EnvSettings.COMPIERE_APPS_DEPLOY, deployFolder); - props.setProperty(EnvSettings.COMPIERE_WEBSTORES, webstores); - - fileOutStream = new FileOutputStream(compEnvFile); - String comments = "Compiere"; - - String keystorePath = compHomeDir.getAbsolutePath() + "\\keystore\\myKeystore"; - - props.setProperty(EnvSettings.COMPIERE_KEYSTORE, keystorePath); - - props.store(fileOutStream, comments); - } - catch(IOException ex) - { - throw new FileOpException("Could not read Compiere Environment settings, " + compEnvFile.getAbsolutePath(), ex); - } - finally - { - if(fis != null) - { - try - { - fis.close(); - } - catch(Exception ex) - {} - } - - if (fileOutStream != null) - { - try - { - fileOutStream.close(); - } - catch(Exception e) - {} - } - } - } - - private static void changeEnviromentBatFile(File compEnvFile, String compHome) throws FileOpException - { - String envTemplateBatFilePath = compHome + EnvSettings.PATH_SEPARATOR + "utils" + EnvSettings.PATH_SEPARATOR + "myEnvironmentTemplate.bat"; - String oldEnvBatFilePath = compHome + EnvSettings.PATH_SEPARATOR + "utils" + EnvSettings.PATH_SEPARATOR + "myEnvironment.bat"; - FileInputStream fis = null; - - try - { - File oldEnvBatFile = new File(oldEnvBatFilePath); - oldEnvBatFile.delete(); - - Properties props = new Properties(); - fis = new FileInputStream(compEnvFile); - props.load(fis); - - String data = getFileAsString(new File(envTemplateBatFilePath)); - - Enumeration keysEnum = props.keys(); - while(keysEnum.hasMoreElements()) - { - String key = (String)keysEnum.nextElement(); - String value = (String)props.get(key); - - value = value.replaceAll("\\\\", "\\\\\\\\"); - - String fileKey = "@" + key + "@"; - data = data.replaceAll(fileKey, value); - } - - File newEnvBatFile = new File(oldEnvBatFilePath); - FileWriter fileWriter = new FileWriter(newEnvBatFile); - fileWriter.write(data); - fileWriter.flush(); - fileWriter.close(); - } - catch(IOException ex) - { - throw new FileOpException("Could not create environment settings bat file", ex); - } - - finally - { - if (fis != null) - { - try - { - fis.close(); - } - catch(Exception ex) - {} - } - } - - } - - private static void changeCompiereSettings(File compPropsFile, String dbType, String dbName) throws FileOpException - { - Properties props = new Properties(); - String dbTypeName = ""; - String dbPort = ""; - FileInputStream fis = null; - FileOutputStream fos = null; - - if(DB_TYPE_ORACLE.equals(dbType)) - { - dbTypeName = "Oracle"; - dbPort = "1521"; - } - else - { - dbTypeName = "Firebird"; - dbPort = "3050"; - } - - try - { - fis = new FileInputStream(compPropsFile); - props.load(fis); - - props.setProperty(EnvSettings.TEMP_DIR, EnvSettings.getTempDir().getAbsolutePath()); - String hostName = EnvSettings.getHostName(); - String connUrl = "xyzCConnection[name=" - + hostName + "{" + hostName + "-" + dbName + "-" + DB_PASSWORD - + "},AppsHost=" + hostName + ",AppsPort=1099,Profile=L,type=" - + dbTypeName + ",DBhost=" + hostName + ",DBport=" + dbPort + ",DBname=" - + dbName + ",BQ=false,FW=false,FWhost=,FWport=1630,UID=compiere,PWD=compiere]"; - props.setProperty(EnvSettings.CONNECTION, connUrl); - - fos = new FileOutputStream(compPropsFile); - props.store(fos, ""); - } - catch(IOException ex) - { - throw new FileOpException("Could not read data from properties file: " + compPropsFile.getAbsolutePath(), ex); - } - finally - { - if (fis != null) - { - try - { - fis.close(); - } - catch(Exception e) - {} - } - - if (fos != null) - { - try - - { - fos.close(); - } - catch(Exception e) - {} - } - } - } - - - private static void changeSettings(String installedPath) throws FileOpException - { - File compiereEnvProperties = new File(installedPath + EnvSettings.PATH_SEPARATOR + "CompiereEnv.properties"); - File compiereEnvPropertiesSave = new File(installedPath + EnvSettings.PATH_SEPARATOR + "CompiereEnv.properties.save"); - File compiereProperties = new File(installedPath + EnvSettings.PATH_SEPARATOR + "Compiere.properties"); - File compierePropertiesSave = new File(installedPath + EnvSettings.PATH_SEPARATOR + "Compiere.properties.save"); - changeCompiereEnvSettings(compiereEnvProperties, new File(installedPath), DEFAULT_DB_NAME, DB_TYPE_ORACLE, ""); - changeCompiereEnvSettings(compiereEnvPropertiesSave, new File(installedPath), DEFAULT_DB_NAME, DB_TYPE_ORACLE, ""); - changeCompiereSettings(compiereProperties, DB_TYPE_ORACLE, DEFAULT_DB_NAME); - changeCompiereSettings(compierePropertiesSave, DB_TYPE_ORACLE, DEFAULT_DB_NAME); - changeEnviromentBatFile(compiereEnvProperties, installedPath); - } - - private static void createShortcutFile() throws FileOpException, UnknownHostException - { - String desktop = EnvSettings.getUserDesktopDir().getAbsolutePath(); - String hostAddress = EnvSettings.getHostAddress(); - String shortcutFilePath = desktop + EnvSettings.PATH_SEPARATOR + "Tamak ICT POS.url"; - File outFile = new File(shortcutFilePath); - - try - { - FileWriter fileWriter = new FileWriter(outFile); - fileWriter.write("[InternetShortcut]\r\n"); - fileWriter.write("URL=http://" + hostAddress + "/posterita/" + "\r\n"); - fileWriter.flush(); - fileWriter.close(); - } - catch(IOException ex) - { - throw new FileOpException("Could not write url shortcut"); - } - - } - - private static void createShortcuts(String installedPath) throws FileOpException, UnknownHostException - { - String desktopPath = EnvSettings.getUserDesktopDir().getAbsolutePath(); - String startSeverLink = installedPath + EnvSettings.PATH_SEPARATOR + START_SERVER_LINK_FILE; - String deskStartServerLink = desktopPath + EnvSettings.PATH_SEPARATOR + START_SERVER_LINK_FILE; - String stopSeverLink = installedPath + EnvSettings.PATH_SEPARATOR + STOP_SERVER_LINK_FILE; - String deskStopServerLink = desktopPath + EnvSettings.PATH_SEPARATOR + STOP_SERVER_LINK_FILE; - - try - { - writeStream(new File(deskStartServerLink), new FileInputStream(startSeverLink)); - writeStream(new File(deskStopServerLink), new FileInputStream(stopSeverLink)); - createShortcutFile(); - } - catch(FileNotFoundException ex) - { - throw new FileOpException("Could not write shortcuts", ex); - } - } - - private static void installTamakICTPOS() throws FileOpException, UnknownHostException - { - String workingDir = EnvSettings.getWorkingDir().getAbsolutePath(); - - String srcFile = workingDir + EnvSettings.PATH_SEPARATOR + FILE_SRC_DIR + EnvSettings.PATH_SEPARATOR + INSTALLATIONSRC; - String installationPath = INSTALLATION_PATH; - install(new File(srcFile), installationPath); - String installedPath = installationPath + INSTALLATIONSRC; - changeSettings(installedPath); - createShortcuts(installedPath); - } - - public static void main(String args[]) - { - try - { - installTamakICTPOS(); - System.out.println("Installation successfull"); - } - catch(Exception ex) - { - System.out.println("Installation failed: " + ex.getMessage()); - if(DEBUG) - ex.printStackTrace(); - } - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/DisplayReportServlet.java b/posterita/posterita/src/main/org/posterita/core/utils/DisplayReportServlet.java deleted file mode 100644 index 390124de27..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/utils/DisplayReportServlet.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 03-Aug-2006 14:29:15 by praveen - * - */ - -package org.posterita.core.utils; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.util.MimeType; - -import org.posterita.businesslogic.performanceanalysis.ReportManager; - -public class DisplayReportServlet extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException - { - String reportURI = request.getRequestURI(); - int index = reportURI.lastIndexOf("/"); - String reportName = reportURI.substring(index+1); - - String reportPath = ReportManager.getReportPath(reportName); - - File f = new File(reportPath); - - if(!f.exists()) - { - throw new ServletException("Unable to load " + reportName + ". Cause file not found."); - } - - String mimeType = null; - mimeType = MimeType.getMimeType(reportName); - - try - { - response.setContentType(mimeType); - - FileInputStream fis = new FileInputStream(f); - BufferedInputStream bis = new BufferedInputStream(fis); - BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); - - //Transfer bytes from bis to bos - byte[] buf = new byte[1024]; - int len; - while ((len = bis.read(buf)) > 0) - { - bos.write(buf, 0, len); - } - bis.close(); - - bos.flush(); - bos.close(); - - } - catch (Exception e) - { - throw new ServletException(e); - } - } - - public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException - { - doGet(request,response); - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/Encrypter.java b/posterita/posterita/src/main/org/posterita/core/utils/Encrypter.java deleted file mode 100644 index 75e7a2b436..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/utils/Encrypter.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.core.utils; - -import org.posterita.core.Range; -import org.posterita.exceptions.EncryptionException; - -public class Encrypter -{ - - public static String encrypt(String str, int fromFirst, int toLast) throws EncryptionException - { - if (toLast < fromFirst) - throw new EncryptionException("To range cannot be less than from range!"); - - int strLength = str.length(); - - Range range = new Range(0, strLength); - - - if (!range.isInRange(fromFirst) || !range.isInRange(toLast)) - throw new EncryptionException("Cannot do encryption for " + str + " as the characters to encode are not in the range provided: " + fromFirst + " - " + toLast); - - String firstUnEncryptedCharacters = str.substring(0, fromFirst); - String lastUnEncryptedCharacters = str.substring(toLast, strLength); - - //String encryptedString = firstUnEncryptedCharacters; - StringBuffer encryptedString = new StringBuffer(); - encryptedString.append(firstUnEncryptedCharacters); - - - for (int i = 0; i < toLast-fromFirst; i++) - { - encryptedString.append("X"); - } - - encryptedString.append(lastUnEncryptedCharacters); - - - return encryptedString.toString(); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/FormatBigDecimal.java b/posterita/posterita/src/main/org/posterita/core/utils/FormatBigDecimal.java deleted file mode 100644 index 3e63f544d5..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/utils/FormatBigDecimal.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.core.utils; - -import java.math.BigDecimal; - -public class FormatBigDecimal -{ - public static BigDecimal currency(BigDecimal bd) - { - return bd.setScale(2, BigDecimal.ROUND_HALF_UP); - } - - public static BigDecimal currency1(BigDecimal bd) - { - return bd.setScale(2, BigDecimal.ROUND_HALF_DOWN); - } - - public static BigDecimal currency(double d) - { - BigDecimal bd = new BigDecimal(d).setScale(2, BigDecimal.ROUND_HALF_UP); - return bd; - } - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/IOUtil.java b/posterita/posterita/src/main/org/posterita/core/utils/IOUtil.java deleted file mode 100644 index f2f38d8e08..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/utils/IOUtil.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.core.utils; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.BufferedReader; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.Reader; - -import org.posterita.core.exception.IOOperationException; - -public class IOUtil -{ - - public static byte[] getByteArray(InputStream inStream) throws IOOperationException - { - try - { - BufferedInputStream bufferedInStream = new BufferedInputStream(inStream); - ByteArrayOutputStream outStream = new ByteArrayOutputStream(); - BufferedOutputStream bufferedOutStream = new BufferedOutputStream(outStream); - byte buffer[] = new byte[1024]; - int read = 0; - while((read = bufferedInStream.read(buffer)) != -1) - { - bufferedOutStream.write(buffer, 0, read); - } - - bufferedOutStream.flush(); - byte retData[] = outStream.toByteArray(); - bufferedOutStream.close(); - bufferedInStream.close(); - outStream.close(); - return retData; - } - catch(IOException ex) - { - throw new IOOperationException("Could not get data from InputStream", ex); - } - } - - public static StringBuffer getContent(Reader reader, String newLineChar) throws IOOperationException - { - try - { - StringBuffer retDataBuffer = new StringBuffer(1000); - BufferedReader bufferedReader = new BufferedReader(reader); - - String line; - - while((line = bufferedReader.readLine()) != null) - retDataBuffer.append(line + newLineChar); - - return retDataBuffer; - } - catch(IOException ex) - { - throw new IOOperationException("Could not read data from reader", ex); - } - - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/MonthConverter.java b/posterita/posterita/src/main/org/posterita/core/utils/MonthConverter.java deleted file mode 100644 index aefc6c12e9..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/utils/MonthConverter.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.core.utils; - -public class MonthConverter -{ - - public static String getMonth(Integer month) - { - - switch (month) - { - - case 1: - return "January"; - - case 2: - return "February"; - - case 3: - return "March"; - - case 4: - return "April"; - - case 5: - return "May"; - - case 6: - return "June"; - - case 7: - return "July"; - - case 8: - return "August"; - - case 9: - return "September"; - - case 10: - return "October"; - - case 11: - return "November"; - - case 12: - return "December"; - - - default: - return "January"; - } - - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/NumberUtil.java b/posterita/posterita/src/main/org/posterita/core/utils/NumberUtil.java deleted file mode 100644 index 09ba0c91ee..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/utils/NumberUtil.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.posterita.core.utils; - -public class NumberUtil -{ - public static boolean isSquareNumber(int x) - { - return isSquareNumber((double)x); - } - - public static boolean isSquareNumber(double x) - { - double num = Math.sqrt(x); - int iNum = (int)num; - - if((double)iNum == num) - return true; - else - return false; - } -} diff --git a/posterita/posterita/src/main/org/posterita/core/utils/SimpleEmailLayout.java b/posterita/posterita/src/main/org/posterita/core/utils/SimpleEmailLayout.java deleted file mode 100644 index ba81d180e0..0000000000 --- a/posterita/posterita/src/main/org/posterita/core/utils/SimpleEmailLayout.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 2004 Kaizensoft Ltd. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Kaizensoft Ltd. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Kaizensoft. - * - * KAIZENSOFT MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. KAIZENSOFT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * Created on Nov 22, 2004 - */ - -package org.posterita.core.utils; - - -public class SimpleEmailLayout -{ - - public static final String header = - - "" + - "" + - "Email" + - ""+ - - "" + - "" + - "" + - "" + - "" + - - "" + - "" + - ""; - - public static final String contentSection = - - "" + - "" + - "" + - - "" + - "" + - "" + - - "" + - "" + - "" + - - "" + - "" + - "" + - "
    " + - "" + - "\"Tamak" + - "" + - - ""; - - - public static final String closeHeaderTitle = - "" + - "
    " + - " " + - "
    " + - "" + - "" + - "" + - "" + - "
    " + - ""; - - public static final String separator = closeHeaderTitle + contentSection; - - public static final String openTagTR = ""; - public static final String closeTagTR = ""; - public static final String openTagTD = ""; - - public static final String openTagFontWhite = ""; - public static final String closeTagFont = ""; - public static final String openTagFont = ""; - - - - public static final String openTagTR_TD = - openTagTR + - openTagTD + - "" ; - - public static final String closeTagTD_TR = - "" + - closeTagTD + - closeTagTR; - - public static final String space = - "" + - "" + - ""; - - public static final String closeAndStartTagTR_TD = closeTagTD_TR + openTagTR_TD; - - public static final String closeTagTR_space_StartTagTR = closeTagTD_TR + space + openTagTR_TD; - - - public static final String footer(String str) - { - - String footer = "
    "; - public static final String closeTagTD = "
    " + - " " + - "
    " + - "
    " + - "
    " + - "" + str + "" + - "
    " + - "" + - "Tamak.com" + - "" + - "
    " + - "" + - ""; - - return footer; - } - - public static final String openInnerTable() - { - String startInnerTable = openTagTR_TD + ""; - - return startInnerTable; - } - - - public static final String closeInnerTable() - { - String closeInnerTable = "
    " + closeTagTD_TR; - - return closeInnerTable; - } - - public static final String innerTableHeader(String[] args) - { - StringBuffer strBuffer = new StringBuffer(); - - strBuffer.append(""); - - - for (int i = 0; i < args.length; i++) - { - String field = args[i]; - - strBuffer.append( - SimpleEmailLayout.openTagTD - + SimpleEmailLayout.openTagFontWhite + field + SimpleEmailLayout.closeTagFont - + SimpleEmailLayout.closeTagTD); - } - - - strBuffer.append(SimpleEmailLayout.closeTagTR); - - return strBuffer.toString(); - } - - public static final String innerTableRow(String[] args) - { - StringBuffer strBuffer = new StringBuffer(); - - strBuffer.append(""); - - for (int i = 0; i < args.length; i++) - { - String field = args[i]; - - strBuffer.append( - SimpleEmailLayout.openTagTD - + SimpleEmailLayout.openTagFont + field + SimpleEmailLayout.closeTagFont - + SimpleEmailLayout.closeTagTD); - } - - strBuffer.append(SimpleEmailLayout.closeTagTR); - - return strBuffer.toString(); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/decorator/HistoryCsvExportWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/HistoryCsvExportWrapper.java deleted file mode 100644 index 10842f2281..0000000000 --- a/posterita/posterita/src/main/org/posterita/decorator/HistoryCsvExportWrapper.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.posterita.decorator; - -import org.posterita.beans.POSHistoryBean; - -public class HistoryCsvExportWrapper extends HistoryWrapper -{ - public String getLinkPartnerName() - { - POSHistoryBean bean = (POSHistoryBean) this.getCurrentRowObject(); - - return bean.getPartnerName(); - } -} diff --git a/posterita/posterita/src/main/org/posterita/decorator/HistoryPdfExportWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/HistoryPdfExportWrapper.java deleted file mode 100644 index 39a78e9ef6..0000000000 --- a/posterita/posterita/src/main/org/posterita/decorator/HistoryPdfExportWrapper.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.decorator; - -public class HistoryPdfExportWrapper extends HistoryCsvExportWrapper -{ - -} diff --git a/posterita/posterita/src/main/org/posterita/decorator/HistoryRtfExportWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/HistoryRtfExportWrapper.java deleted file mode 100644 index 7024bea6ad..0000000000 --- a/posterita/posterita/src/main/org/posterita/decorator/HistoryRtfExportWrapper.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.decorator; - -public class HistoryRtfExportWrapper extends HistoryWrapper -{ - -} diff --git a/posterita/posterita/src/main/org/posterita/decorator/HistoryWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/HistoryWrapper.java deleted file mode 100644 index 9656ac8d39..0000000000 --- a/posterita/posterita/src/main/org/posterita/decorator/HistoryWrapper.java +++ /dev/null @@ -1,151 +0,0 @@ -package org.posterita.decorator; - -import javax.servlet.http.HttpServletRequest; - -import org.compiere.model.MOrder; -import org.compiere.process.DocAction; -import org.compiere.util.Env; -import org.displaytag.decorator.TableDecorator; -import org.posterita.Constants; -import org.posterita.beans.InventoryBean; -import org.posterita.beans.POSHistoryBean; -import org.posterita.businesslogic.POSManager; -import org.posterita.core.bean.ElementBean; -import org.posterita.core.businesslogic.ElementManager; -import org.posterita.lib.UdiConstants; - -public class HistoryWrapper extends TableDecorator -{ - - public String getLinkPartnerName() - { - POSHistoryBean bean = (POSHistoryBean) this.getCurrentRowObject(); - - String url = "POSCustomerAction.do?action=viewPOSCustomer&bpartnerId=" + bean.getBpartnerId(); - - if ("No".equals(bean.getIsCustomer())) - url = "POSVendorAction.do?action=viewVendorDetails1&bpartnerId=" + bean.getBpartnerId(); - - - String urlLink = "" + bean.getPartnerName() + ""; - - return urlLink; - } - - public String getReprint() - { - POSHistoryBean bean = (POSHistoryBean) this.getCurrentRowObject(); - - HttpServletRequest req = (HttpServletRequest) this.getPageContext().getRequest(); - - String printing = POSManager.getDataFromCookie(req, "preference.printing"); - ElementBean msgBean = ElementManager.getMsg(Env.getCtx(), "reprint"); - - String link = "" + - msgBean.getName() + - ""; - - if (printing != null && !printing.equals("")) - { - if ("true".equals(printing)) - { - link = "" + - msgBean.getName() + - ""; - } - } - - return link; - } - - public String getPaymentRule() - { - POSHistoryBean bean = (POSHistoryBean) this.getCurrentRowObject(); - - String paymentRule = bean.getPaymentRule(); - String paymentRuleMsg = ""; - - if (MOrder.PAYMENTRULE_Cash.equals(paymentRule)) - { - paymentRuleMsg = Constants.PAYMENT_RULE_CASH_MSG; - } - else if (MOrder.PAYMENTRULE_CreditCard.equals(paymentRule)) - { - paymentRuleMsg = Constants.PAYMENT_RULE_CARD_MSG; - } - else if (MOrder.PAYMENTRULE_Check.equals(paymentRule)) - { - paymentRuleMsg = Constants.PAYMENT_RULE_CHEQUE_MSG; - } - else if (UdiConstants.PAYMENTRULE_MIXED.equals(paymentRule)) - { - paymentRuleMsg = Constants.PAYMENT_RULE_MIXED_MSG; - } - else if (MOrder.PAYMENTRULE_OnCredit.equals(paymentRule)) - { - paymentRuleMsg = Constants.PAYMENT_RULE_CREDIT_MSG; - } - - ElementBean msgBean = ElementManager.getMsg(Env.getCtx(), paymentRuleMsg); - - return msgBean.getName(); - } - - public String getDocStatus() - { - POSHistoryBean bean = (POSHistoryBean) this.getCurrentRowObject(); - - String docStatus = bean.getDocStatus(); - String docStatusMsg = ""; - - if (DocAction.STATUS_Drafted.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_DRAFTED; - else - if (DocAction.STATUS_InProgress.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_INPROGRESS; - else - if (DocAction.STATUS_Completed.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_COMPLETED; - else - if (DocAction.STATUS_Closed.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_CLOSED; - else - if (DocAction.STATUS_Invalid.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_INVALID; - - ElementBean msgBean = ElementManager.getMsg(Env.getCtx(), docStatusMsg); - return msgBean.getName(); - } - - - public String getDelete() - { - InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); - - String docStatus = bean.getDocStatus(); - - String link = ""; - - if (!DocAction.STATUS_Completed.equals(docStatus)) - { - link = "" + - "Delete" + - ""; - - } - return link; - } - - - public String getInventoryNo() - { - InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); - - String link = "" + - bean.getInventoryNo() + - ""; - - return link; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/decorator/InventoryHistoryWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/InventoryHistoryWrapper.java deleted file mode 100644 index 4fc0856a2f..0000000000 --- a/posterita/posterita/src/main/org/posterita/decorator/InventoryHistoryWrapper.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.posterita.decorator; - -import org.compiere.process.DocAction; -import org.compiere.util.Env; -import org.displaytag.decorator.TableDecorator; -import org.posterita.Constants; -import org.posterita.beans.InventoryBean; -import org.posterita.core.bean.ElementBean; -import org.posterita.core.businesslogic.ElementManager; - -public class InventoryHistoryWrapper extends TableDecorator -{ - public String getDocStatus() - { - InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); - - String docStatus = bean.getDocStatus(); - String docStatusMsg = ""; - - if (DocAction.STATUS_Drafted.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_DRAFTED; - else - if (DocAction.STATUS_InProgress.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_INPROGRESS; - else - if (DocAction.STATUS_Completed.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_COMPLETED; - else - if (DocAction.STATUS_Closed.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_CLOSED; - else - if (DocAction.STATUS_Invalid.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_INVALID; - else - if (DocAction.STATUS_Voided.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_VOID; - - ElementBean msgBean = ElementManager.getMsg(Env.getCtx(), docStatusMsg); - return msgBean.getName(); - } - - - public String getDelete() - { - InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); - - String docStatus = bean.getDocStatus(); - - String link = ""; - - if (!DocAction.STATUS_Completed.equals(docStatus) && !DocAction.STATUS_Closed.equals(docStatus)) - { - link = "" + - "Delete" + - ""; - - } - return link; - } - - public String getSelect() - { - InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); - - String docStatus = bean.getDocStatus(); - - String link = ""; - - if (DocAction.STATUS_Drafted.equals(docStatus)) - { - link = ""; - - } - return link; - } - - - public String getInventoryNo() - { - InventoryBean bean = (InventoryBean) this.getCurrentRowObject(); - - String link = "" + - bean.getInventoryNo() + - ""; - - return link; - } -} diff --git a/posterita/posterita/src/main/org/posterita/decorator/InventoryMoveHistoryWrapper.java b/posterita/posterita/src/main/org/posterita/decorator/InventoryMoveHistoryWrapper.java deleted file mode 100644 index 6b9b3357da..0000000000 --- a/posterita/posterita/src/main/org/posterita/decorator/InventoryMoveHistoryWrapper.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.posterita.decorator; - -import org.compiere.process.DocAction; -import org.compiere.util.Env; -import org.displaytag.decorator.TableDecorator; -import org.posterita.Constants; -import org.posterita.beans.StockMovementBean; -import org.posterita.core.bean.ElementBean; -import org.posterita.core.businesslogic.ElementManager; - -public class InventoryMoveHistoryWrapper extends TableDecorator -{ - public String getDocStatus() - { - StockMovementBean bean = (StockMovementBean) this.getCurrentRowObject(); - - String docStatus = bean.getDocStatus(); - String docStatusMsg = ""; - - if (DocAction.STATUS_Drafted.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_DRAFTED; - else - if (DocAction.STATUS_InProgress.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_INPROGRESS; - else - if (DocAction.STATUS_Completed.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_COMPLETED; - else - if (DocAction.STATUS_Closed.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_CLOSED; - else - if (DocAction.STATUS_Invalid.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_INVALID; - else - if (DocAction.STATUS_Voided.equals(docStatus)) - docStatusMsg = Constants.DOC_STATUS_VOID; - - ElementBean msgBean = ElementManager.getMsg(Env.getCtx(), docStatusMsg); - return msgBean.getName(); - } - - public String getDelete() - { - StockMovementBean bean = (StockMovementBean) this.getCurrentRowObject(); - - String docStatus = bean.getDocStatus(); - - String link = ""; - - if (!DocAction.STATUS_Completed.equals(docStatus) && !DocAction.STATUS_Closed.equals(docStatus)) - { - link = "" + - "Delete" + - ""; - - } - return link; - } - - public String getEdit() - { - StockMovementBean bean = (StockMovementBean) this.getCurrentRowObject(); - - String docStatus = bean.getDocStatus(); - - String link = ""; - - if (!DocAction.STATUS_Completed.equals(docStatus)) - { - link = "" + - "Edit" + - ""; - - } - return link; - } - - public String getDocumentNo() - { - StockMovementBean bean = (StockMovementBean) this.getCurrentRowObject(); - - String link = "" + - bean.getDocumentNo() + - ""; - - return link; - } -} diff --git a/posterita/posterita/src/main/org/posterita/decorator/PaymentDecorator.java b/posterita/posterita/src/main/org/posterita/decorator/PaymentDecorator.java deleted file mode 100644 index 44cb9b40ca..0000000000 --- a/posterita/posterita/src/main/org/posterita/decorator/PaymentDecorator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.posterita.decorator; - -import javax.servlet.jsp.PageContext; - -import org.compiere.model.MOrder; -import org.compiere.util.Env; -import org.displaytag.decorator.DisplaytagColumnDecorator; -import org.displaytag.exception.DecoratorException; -import org.displaytag.properties.MediaTypeEnum; -import org.posterita.Constants; -import org.posterita.core.bean.ElementBean; -import org.posterita.core.businesslogic.ElementManager; -import org.posterita.lib.UdiConstants; - -public class PaymentDecorator implements DisplaytagColumnDecorator -{ - - public Object decorate(Object columnValue, PageContext pageContext, MediaTypeEnum media) throws DecoratorException - { - String paymentRule = (String) columnValue; - - ElementBean bean = ElementManager.getMsg(Env.getCtx(), getPaymentRuleDisplayMessage(paymentRule)); - - return bean.getName(); - } - - - public static String getPaymentRuleDisplayMessage(String paymentRule) - { - if (MOrder.PAYMENTRULE_Cash.equals(paymentRule)) - return Constants.PAYMENT_RULE_CASH_MSG; - else - if (MOrder.PAYMENTRULE_CreditCard.equals(paymentRule)) - return Constants.PAYMENT_RULE_CARD_MSG; - else - if (MOrder.PAYMENTRULE_Check.equals(paymentRule)) - return Constants.PAYMENT_RULE_CHEQUE_MSG; - else - if (UdiConstants.PAYMENTRULE_MIXED.equals(paymentRule)) - return Constants.PAYMENT_RULE_MIXED_MSG; - else - if (MOrder.PAYMENTRULE_OnCredit.equals(paymentRule)) - return Constants.PAYMENT_RULE_CREDIT_MSG; - - return ""; - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSO.java b/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSO.java deleted file mode 100644 index 33535a4a90..0000000000 --- a/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSO.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 26, 2006 - */ -package org.posterita.doctype; - -public interface UDIDocSubTypeSO -{ - public String getDocTypeSubSO(); -} diff --git a/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSOValues.java b/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSOValues.java deleted file mode 100644 index fe3427774b..0000000000 --- a/posterita/posterita/src/main/org/posterita/doctype/UDIDocSubTypeSOValues.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 26, 2006 - */ - -package org.posterita.doctype; - -import org.compiere.model.MDocType; - -public class UDIDocSubTypeSOValues -{ - private UDIDocSubTypeSOValues() - { - - } - - - public static UDIDocSubTypeSO DOCTYPESO_OnCreditOrder = new OnCreditOrder(); - public static UDIDocSubTypeSO DOCTYPESO_POSOrder = new POSOrder(); - public static UDIDocSubTypeSO DOCTYPESO_PrepayOrder = new PrepayOrder(); - public static UDIDocSubTypeSO DOCTYPESO_Proposal = new Proposal(); - public static final UDIDocSubTypeSO DOCTYPESO_Quotation = new Quotation(); - public static UDIDocSubTypeSO DOCTYPESO_ReturnMaterial = new ReturnMaterial(); - public static UDIDocSubTypeSO DOCTYPESO_StandardOrder = new StandardOrder(); - public static UDIDocSubTypeSO DOCTYPESO_WarehouseOrder = new WarehouseOrder(); - - public static class OnCreditOrder implements UDIDocSubTypeSO - { - - public String getDocTypeSubSO() - { - return MDocType.DOCSUBTYPESO_OnCreditOrder; - } - - } - - public static class POSOrder implements UDIDocSubTypeSO - { - - public String getDocTypeSubSO() - { - return MDocType.DOCSUBTYPESO_POSOrder; - } - - } - - public static class PrepayOrder implements UDIDocSubTypeSO - { - - public String getDocTypeSubSO() - { - return MDocType.DOCSUBTYPESO_PrepayOrder; - } - - } - - public static class Proposal implements UDIDocSubTypeSO - { - - public String getDocTypeSubSO() - { - return MDocType.DOCSUBTYPESO_Proposal; - } - - } - - public static class Quotation implements UDIDocSubTypeSO - { - - public String getDocTypeSubSO() - { - return MDocType.DOCSUBTYPESO_Quotation; - } - - } - - public static class ReturnMaterial implements UDIDocSubTypeSO - { - - public String getDocTypeSubSO() - { - return MDocType.DOCSUBTYPESO_ReturnMaterial; - } - - } - - public static class StandardOrder implements UDIDocSubTypeSO - { - - public String getDocTypeSubSO() - { - return MDocType.DOCSUBTYPESO_StandardOrder; - } - - } - - public static class WarehouseOrder implements UDIDocSubTypeSO - { - - public String getDocTypeSubSO() - { - return MDocType.DOCSUBTYPESO_WarehouseOrder; - } - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AllocatedAmtMoreThanOpenAmtException.java b/posterita/posterita/src/main/org/posterita/exceptions/AllocatedAmtMoreThanOpenAmtException.java deleted file mode 100644 index 3e96d1da3c..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/AllocatedAmtMoreThanOpenAmtException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 26, 2006 - */ - - -package org.posterita.exceptions; - - -public class AllocatedAmtMoreThanOpenAmtException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public AllocatedAmtMoreThanOpenAmtException(String message) - { - super(message); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AllocationAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/AllocationAlreadyExistsException.java deleted file mode 100644 index e87c04d3bc..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/AllocationAlreadyExistsException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.exceptions; - - -public class AllocationAlreadyExistsException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public AllocationAlreadyExistsException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ApplicationException.java b/posterita/posterita/src/main/org/posterita/exceptions/ApplicationException.java deleted file mode 100644 index 1dc5f8b2b4..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ApplicationException.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -package org.posterita.exceptions; - - - -/** - * @author fred - * - *To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class ApplicationException extends Exception -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public ApplicationException() - { - super(); - } - - public ApplicationException(String message) - { - super(message); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AttachmentInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/AttachmentInvalidException.java deleted file mode 100644 index b4094edd1d..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/AttachmentInvalidException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Mar 29, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -import org.posterita.exceptions.DataException; - -public class AttachmentInvalidException extends DataException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public AttachmentInvalidException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AttachmentNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/AttachmentNotFoundException.java deleted file mode 100644 index cb0be51656..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/AttachmentNotFoundException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 8, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class AttachmentNotFoundException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public AttachmentNotFoundException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AttributeValueAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/AttributeValueAlreadyExistsException.java deleted file mode 100644 index aa2c77d09b..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/AttributeValueAlreadyExistsException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 3, 2005 by praveen - * - */ -package org.posterita.exceptions; - -public class AttributeValueAlreadyExistsException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public AttributeValueAlreadyExistsException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/AttributeValuesDifferentException.java b/posterita/posterita/src/main/org/posterita/exceptions/AttributeValuesDifferentException.java deleted file mode 100644 index af6766413b..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/AttributeValuesDifferentException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 17, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class AttributeValuesDifferentException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public AttributeValuesDifferentException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPGroupException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPGroupException.java deleted file mode 100644 index bd2d39c825..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/BPGroupException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Apr 5, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class BPGroupException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public BPGroupException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistException.java deleted file mode 100644 index 86ce0792ab..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Apr 5, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - - -public class BPartnerAlreadyExistException extends BPartnerException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public BPartnerAlreadyExistException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistsException.java deleted file mode 100644 index e0dd70a7d0..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerAlreadyExistsException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 01-Aug-2005 by alok - * - */ -package org.posterita.exceptions; - - -public class BPartnerAlreadyExistsException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public BPartnerAlreadyExistsException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerException.java deleted file mode 100644 index 09c29d6db5..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Apr 17, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class BPartnerException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public BPartnerException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerInvalidException.java deleted file mode 100644 index 991cc13d2b..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerInvalidException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Mar 29, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -import org.posterita.exceptions.DataException; - -public class BPartnerInvalidException extends DataException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public BPartnerInvalidException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNoLocationException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNoLocationException.java deleted file mode 100644 index 20256de4e2..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNoLocationException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Nov 8, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class BPartnerNoLocationException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public BPartnerNoLocationException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNotFoundException.java deleted file mode 100644 index 92b717a4dc..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerNotFoundException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Apr 17, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - - -public class BPartnerNotFoundException extends BPartnerException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public BPartnerNotFoundException(String msg) - { - super(msg); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerOverCreditLimitException.java b/posterita/posterita/src/main/org/posterita/exceptions/BPartnerOverCreditLimitException.java deleted file mode 100644 index 81f484d04b..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/BPartnerOverCreditLimitException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 1, 2006 - */ - - -package org.posterita.exceptions; - - -public class BPartnerOverCreditLimitException extends OperationException -{ - - private static final long serialVersionUID = 1L; - - public BPartnerOverCreditLimitException(String exception) - { - super(exception); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BankAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/BankAlreadyExistException.java deleted file mode 100644 index 0d16eb05f6..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/BankAlreadyExistException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 01-Aug-2005 by alok - * - */ -package org.posterita.exceptions; - - -public class BankAlreadyExistException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public BankAlreadyExistException(String exception) - { - super(exception); - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BarcodeAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/BarcodeAlreadyExistsException.java deleted file mode 100644 index afb50bc2f1..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/BarcodeAlreadyExistsException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 10, 2006 - */ - - -package org.posterita.exceptions; - - -public class BarcodeAlreadyExistsException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public BarcodeAlreadyExistsException(String exception) - { - super(exception); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/BirtEngineException.java b/posterita/posterita/src/main/org/posterita/exceptions/BirtEngineException.java deleted file mode 100644 index 0072b40462..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/BirtEngineException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 17-Aug-2005 by Fred - **/ -package org.posterita.exceptions; - -import org.posterita.exceptions.ApplicationException; - - -public class BirtEngineException extends ApplicationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public BirtEngineException(String message) - { - super(message); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CSVDataInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/CSVDataInvalidException.java deleted file mode 100644 index d19aa75d5d..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CSVDataInvalidException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Nov 26, 2005 by ashley -* -*/ - -package org.posterita.exceptions; - - -public class CSVDataInvalidException extends DataException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CSVDataInvalidException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CSVFileException.java b/posterita/posterita/src/main/org/posterita/exceptions/CSVFileException.java deleted file mode 100644 index e5366a71aa..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CSVFileException.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 14-Sep-2005 - */ - - -package org.posterita.exceptions; - - -public class CSVFileException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public CSVFileException(String exception) - { - super(exception); - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CanNotAjdustTillException.java b/posterita/posterita/src/main/org/posterita/exceptions/CanNotAjdustTillException.java deleted file mode 100644 index e3d79424e0..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CanNotAjdustTillException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 10, 2006 - */ - - -package org.posterita.exceptions; - - -public class CanNotAjdustTillException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CanNotAjdustTillException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CanNotCloseTillException.java b/posterita/posterita/src/main/org/posterita/exceptions/CanNotCloseTillException.java deleted file mode 100644 index 066f699b8a..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CanNotCloseTillException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 3, 2006 - */ - - -package org.posterita.exceptions; - - -public class CanNotCloseTillException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public CanNotCloseTillException(String xception) - { - super(xception); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CanNotCreatePaymentAllocationException.java b/posterita/posterita/src/main/org/posterita/exceptions/CanNotCreatePaymentAllocationException.java deleted file mode 100644 index 294ec79bce..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CanNotCreatePaymentAllocationException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 8, 2006 - */ - - -package org.posterita.exceptions; - - -public class CanNotCreatePaymentAllocationException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CanNotCreatePaymentAllocationException(String message) - { - super(message); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CanNotDeleteOrderException.java b/posterita/posterita/src/main/org/posterita/exceptions/CanNotDeleteOrderException.java deleted file mode 100644 index dfd6a383aa..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CanNotDeleteOrderException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 20-Feb-2006 - */ - - -package org.posterita.exceptions; - - -public class CanNotDeleteOrderException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CanNotDeleteOrderException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CanNotMoveStockException.java b/posterita/posterita/src/main/org/posterita/exceptions/CanNotMoveStockException.java deleted file mode 100644 index 7adc000681..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CanNotMoveStockException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 08-Feb-2006 - */ - - -package org.posterita.exceptions; - - -public class CanNotMoveStockException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CanNotMoveStockException(String exception) - { - super(exception); - } -} - diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CannotCreateInventoryLineException.java b/posterita/posterita/src/main/org/posterita/exceptions/CannotCreateInventoryLineException.java deleted file mode 100644 index b959509a3e..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CannotCreateInventoryLineException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jan 22, 2007 - */ - - -package org.posterita.exceptions; - - - -public class CannotCreateInventoryLineException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CannotCreateInventoryLineException(String exception) - { - super(exception); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CannotDeactivatePaymentTermException.java b/posterita/posterita/src/main/org/posterita/exceptions/CannotDeactivatePaymentTermException.java deleted file mode 100644 index 10399d89c4..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CannotDeactivatePaymentTermException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jan 26, 2007 - */ - - -package org.posterita.exceptions; - - - -public class CannotDeactivatePaymentTermException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CannotDeactivatePaymentTermException(String msg) - { - super(msg); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateProductException.java b/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateProductException.java deleted file mode 100644 index 80c4df0527..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateProductException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 17, 2006 - */ - - -package org.posterita.exceptions; - - -public class CannotInactivateProductException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CannotInactivateProductException(String exception) - { - super(exception); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateTaxException.java b/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateTaxException.java deleted file mode 100644 index 381fed3b50..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CannotInactivateTaxException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - - -package org.posterita.exceptions; - - -public class CannotInactivateTaxException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CannotInactivateTaxException(String exception) - { - super(exception); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CashBookAlreadyAssignedException.java b/posterita/posterita/src/main/org/posterita/exceptions/CashBookAlreadyAssignedException.java deleted file mode 100644 index f4edb834aa..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CashBookAlreadyAssignedException.java +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.exceptions; - -/** - * @author ashley - * Jun 4, 2008 - */ -public class CashBookAlreadyAssignedException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = -1803904020197127096L; - - public CashBookAlreadyAssignedException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ClientAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/ClientAlreadyExistException.java deleted file mode 100644 index 191d507790..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ClientAlreadyExistException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Oct 30, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class ClientAlreadyExistException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public ClientAlreadyExistException(String msg) - { - super(msg); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CloseStatusNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/CloseStatusNotFoundException.java deleted file mode 100644 index a1cf09a8d1..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CloseStatusNotFoundException.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class CloseStatusNotFoundException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CloseStatusNotFoundException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardExpiryInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardExpiryInvalidException.java deleted file mode 100644 index 26419f6c43..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardExpiryInvalidException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -**/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class CreditCardExpiryInvalidException extends DataException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public CreditCardExpiryInvalidException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardNumberException.java b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardNumberException.java deleted file mode 100644 index db30b15611..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardNumberException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * -**/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class CreditCardNumberException extends DataException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CreditCardNumberException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardTypeNotSupportedException.java b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardTypeNotSupportedException.java deleted file mode 100644 index 3605a2a8f7..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardTypeNotSupportedException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class CreditCardTypeNotSupportedException extends DataException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CreditCardTypeNotSupportedException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardVVInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/CreditCardVVInvalidException.java deleted file mode 100644 index 3a5e5e31ec..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CreditCardVVInvalidException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class CreditCardVVInvalidException extends DataException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CreditCardVVInvalidException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/CustomerNotImportedException.java b/posterita/posterita/src/main/org/posterita/exceptions/CustomerNotImportedException.java deleted file mode 100644 index 6824605c18..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/CustomerNotImportedException.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.posterita.exceptions; - -public class CustomerNotImportedException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 4763042516279622902L; - - public CustomerNotImportedException() - { - super(); - } - - public CustomerNotImportedException(Exception exception) - { - super(exception); - } - - public CustomerNotImportedException(String msg, Exception exception) - { - super(msg, exception); - } - - public CustomerNotImportedException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DataException.java b/posterita/posterita/src/main/org/posterita/exceptions/DataException.java deleted file mode 100644 index 26a1452c55..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/DataException.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.exceptions; - - -public class DataException extends ApplicationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public DataException(String msg) - { - super(msg); - } - - public DataException(String message, Exception ex) - { - super(message); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DefaultStoreException.java b/posterita/posterita/src/main/org/posterita/exceptions/DefaultStoreException.java deleted file mode 100644 index 1bd20369f2..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/DefaultStoreException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Oct 12, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class DefaultStoreException extends ApplicationException -{ - private static final long serialVersionUID = 1L; - - public DefaultStoreException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DeleteAttachmentException.java b/posterita/posterita/src/main/org/posterita/exceptions/DeleteAttachmentException.java deleted file mode 100644 index 1ec70942f5..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/DeleteAttachmentException.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.exceptions; - -public class DeleteAttachmentException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public DeleteAttachmentException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DescriptionNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/DescriptionNotFoundException.java deleted file mode 100644 index b20d468b97..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/DescriptionNotFoundException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 23, 2005 by praveen - * - */ -package org.posterita.exceptions; - -public class DescriptionNotFoundException extends Exception -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public DescriptionNotFoundException(String msg) - { - super(msg); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DiscountLimitException.java b/posterita/posterita/src/main/org/posterita/exceptions/DiscountLimitException.java deleted file mode 100644 index 74834a22e5..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/DiscountLimitException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 19-Oct-2006 11:16:04 by praveen - * - */ - -package org.posterita.exceptions; - -public class DiscountLimitException extends Exception { - - private static final long serialVersionUID = 1L; - - public DiscountLimitException(String msg) - { - super(msg); - } - - public DiscountLimitException(Exception exception) - { - super(exception); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DocumentDoesNotBelongToYouException.java b/posterita/posterita/src/main/org/posterita/exceptions/DocumentDoesNotBelongToYouException.java deleted file mode 100644 index 37cbbf0335..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/DocumentDoesNotBelongToYouException.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.posterita.exceptions; - -public class DocumentDoesNotBelongToYouException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public DocumentDoesNotBelongToYouException(String message) - { - super(message); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DuplicatePINException.java b/posterita/posterita/src/main/org/posterita/exceptions/DuplicatePINException.java deleted file mode 100644 index bb82f3291d..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/DuplicatePINException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Sep 25, 2006 - */ - - -package org.posterita.exceptions; - - -public class DuplicatePINException extends OperationException -{ - - private static final long serialVersionUID = 1L; - - public DuplicatePINException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DuplicateRoleException.java b/posterita/posterita/src/main/org/posterita/exceptions/DuplicateRoleException.java deleted file mode 100644 index 35170d7ed7..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/DuplicateRoleException.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.posterita.exceptions; - -public class DuplicateRoleException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public DuplicateRoleException(String ex) - { - super(ex); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUOMException.java b/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUOMException.java deleted file mode 100644 index eca882dcd0..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUOMException.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.posterita.exceptions; - -public class DuplicateUOMException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public DuplicateUOMException(String msg) - { - super(msg); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUserPinException.java b/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUserPinException.java deleted file mode 100644 index e6e32f4e4f..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/DuplicateUserPinException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 6, 2006 - */ - - -package org.posterita.exceptions; - - -public class DuplicateUserPinException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public DuplicateUserPinException(String msg) - { - super(msg); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailInvalidException.java deleted file mode 100644 index 2fd8cbcca6..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/EMailInvalidException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Jan 17, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class EMailInvalidException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public EMailInvalidException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageException.java deleted file mode 100644 index 3b33350901..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageException.java +++ /dev/null @@ -1,47 +0,0 @@ -/* -* -* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* UDI Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with UDI. -* -* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -* Created on Jun 1, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class EMailMessageException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public EMailMessageException(String msg) - { - super(msg); - } - - public EMailMessageException(String msg, Exception ex) - { - super(msg, ex); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageParsingException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageParsingException.java deleted file mode 100644 index 145702c829..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/EMailMessageParsingException.java +++ /dev/null @@ -1,47 +0,0 @@ -/* -* -* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* UDI Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with UDI. -* -* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -* Created on Jun 5, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class EMailMessageParsingException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public EMailMessageParsingException(String msg) - { - super(msg); - } - - public EMailMessageParsingException(String msg, Exception ex) - { - super(msg, ex); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailNotSentException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailNotSentException.java deleted file mode 100644 index 5007734756..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/EMailNotSentException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Jan 17, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class EMailNotSentException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public EMailNotSentException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailServerConnectionException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailServerConnectionException.java deleted file mode 100644 index 62d44ea5d7..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/EMailServerConnectionException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* -* -* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* UDI Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with UDI. -* -* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -* Created on May 31, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class EMailServerConnectionException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public EMailServerConnectionException(String msg) - { - super(msg); - } - - public EMailServerConnectionException(String msg, Exception ex) - { - super(msg, ex); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailServerLoginException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailServerLoginException.java deleted file mode 100644 index ae6fb0199b..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/EMailServerLoginException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* -* -* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* UDI Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with UDI. -* -* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -* Created on May 31, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class EMailServerLoginException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public EMailServerLoginException(String msg) - { - super(msg); - } - - public EMailServerLoginException(String msg, Exception ex) - { - super(msg, ex); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EMailServerMessageException.java b/posterita/posterita/src/main/org/posterita/exceptions/EMailServerMessageException.java deleted file mode 100644 index 785b83c98f..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/EMailServerMessageException.java +++ /dev/null @@ -1,47 +0,0 @@ -/* -* -* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* UDI Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with UDI. -* -* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -* Created on Jun 1, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class EMailServerMessageException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public EMailServerMessageException(String msg) - { - super(msg); - } - - public EMailServerMessageException(String msg, Exception ex) - { - super(msg, ex); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EmailAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/EmailAlreadyExistsException.java deleted file mode 100644 index b411cdff59..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/EmailAlreadyExistsException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.exceptions; - - -public class EmailAlreadyExistsException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public EmailAlreadyExistsException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EmailNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/EmailNotFoundException.java deleted file mode 100644 index 3f2cad84a9..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/EmailNotFoundException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 17-Feb-2005 by fred - * - */ -package org.posterita.exceptions; - - -public class EmailNotFoundException extends ApplicationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EmptyCartException.java b/posterita/posterita/src/main/org/posterita/exceptions/EmptyCartException.java deleted file mode 100644 index c55a2145e7..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/EmptyCartException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 8, 2006 - */ - -package org.posterita.exceptions; - -public class EmptyCartException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public EmptyCartException(String string) - { - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/EncryptionException.java b/posterita/posterita/src/main/org/posterita/exceptions/EncryptionException.java deleted file mode 100644 index 1ce7041f31..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/EncryptionException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.exceptions; - -public class EncryptionException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public EncryptionException(String message) - { - super(message); - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/FormattingException.java b/posterita/posterita/src/main/org/posterita/exceptions/FormattingException.java deleted file mode 100644 index 28069d0e52..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/FormattingException.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 26, 2006 - */ - -package org.posterita.exceptions; - -import org.posterita.formatter.Formatter; - - - -public class FormattingException extends RuntimeException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - private Throwable cause; - private Formatter formatter; - - public FormattingException(String message) - { - super(message); - } - - public FormattingException(String message, Throwable cause) - { - super(message); - - this.cause = cause; - } - - public Formatter getFormatter() - { - return formatter; - } - - public void setFormatter(Formatter formatter) - { - this.formatter = formatter; - } - - public void setCause(Throwable cause) - { - this.cause = cause; - } - - public Throwable getCause() - { - return cause; - } - - public String toString() - { - return super.toString() +(cause == null? "" : "\n Original Cause: \n" + cause.toString()); - } - - public void printStackTrace() - { - super.printStackTrace(); - - if (cause != null) - { - System.out.println("\n Original Cause: \n"); - cause.printStackTrace(); - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ImageAttachmentException.java b/posterita/posterita/src/main/org/posterita/exceptions/ImageAttachmentException.java deleted file mode 100644 index b13eb4e68b..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ImageAttachmentException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Mar 29, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class ImageAttachmentException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ImageAttachmentException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ImportFileAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/ImportFileAlreadyExistException.java deleted file mode 100644 index 9f26a4e450..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ImportFileAlreadyExistException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Feb 28, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class ImportFileAlreadyExistException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public ImportFileAlreadyExistException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ImportFileNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/ImportFileNotFoundException.java deleted file mode 100644 index a47db3c5b8..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ImportFileNotFoundException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Feb 28, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class ImportFileNotFoundException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public ImportFileNotFoundException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ImportProductException.java b/posterita/posterita/src/main/org/posterita/exceptions/ImportProductException.java deleted file mode 100644 index b27fc51f47..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ImportProductException.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.posterita.exceptions; - -public class ImportProductException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public ImportProductException(String msg) - { - super(msg); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InputQuantityLessThanZeroException.java b/posterita/posterita/src/main/org/posterita/exceptions/InputQuantityLessThanZeroException.java deleted file mode 100644 index c0aa3be9a1..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InputQuantityLessThanZeroException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.exceptions; - - -public class InputQuantityLessThanZeroException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InputQuantityLessThanZeroException(String exception) - { - super(exception); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InsufficientQtyException.java b/posterita/posterita/src/main/org/posterita/exceptions/InsufficientQtyException.java deleted file mode 100644 index 1bfe60930c..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InsufficientQtyException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 26, 2006 - */ - - -package org.posterita.exceptions; - - -public class InsufficientQtyException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InsufficientQtyException(String message) - { - super(message); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidAddressException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidAddressException.java deleted file mode 100644 index b92826841e..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidAddressException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 4, 2006 - */ - - -package org.posterita.exceptions; - - -public class InvalidAddressException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidAddressException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBPartnerException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBPartnerException.java deleted file mode 100644 index 5265b65930..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBPartnerException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Apr 5, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class InvalidBPartnerException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidBPartnerException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankAccountException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankAccountException.java deleted file mode 100644 index 385c001434..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankAccountException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 11, 2005 by din - */ - -package org.posterita.exceptions; - -public class InvalidBankAccountException extends ApplicationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidBankAccountException(String message) - { - - super(message); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankException.java deleted file mode 100644 index a6d30e4406..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBankException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 24, 2005 by praveen - * - */ -package org.posterita.exceptions; - -public class InvalidBankException extends ApplicationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidBankException(String message) - { - super(message); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBarcodeException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidBarcodeException.java deleted file mode 100644 index 2bed731a29..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidBarcodeException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jun 6, 2006 - */ - - -package org.posterita.exceptions; - - -public class InvalidBarcodeException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - -public InvalidBarcodeException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidConfirmPasswordException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidConfirmPasswordException.java deleted file mode 100644 index af9be0f748..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidConfirmPasswordException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jun 6, 2006 - */ - - -package org.posterita.exceptions; - - -public class InvalidConfirmPasswordException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidConfirmPasswordException(String msg) - { - super(msg); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidContentTypeException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidContentTypeException.java deleted file mode 100644 index 0c75055d54..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidContentTypeException.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 16, 2006 by praveen - * - */ -package org.posterita.exceptions; - -public class InvalidContentTypeException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidContentTypeException(Exception e) - { - super(e); - } - - public InvalidContentTypeException(String msg) - { - super(msg); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidDateTimeException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidDateTimeException.java deleted file mode 100644 index 8f35a5629e..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidDateTimeException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class InvalidDateTimeException extends DataException -{ - private static final long serialVersionUID = 1L; - - public InvalidDateTimeException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidEmailException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidEmailException.java deleted file mode 100644 index ddbb4cd8a2..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidEmailException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Created on 2005/03/11 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.posterita.exceptions; - -/** - * @author jane - * - *To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class InvalidEmailException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public InvalidEmailException(String exception) - { - super(exception); - } - - public InvalidEmailException(String msg, Exception ex) - { - super(msg, ex); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidInvokeOrderStatusException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidInvokeOrderStatusException.java deleted file mode 100644 index 1ef8bc3dd9..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidInvokeOrderStatusException.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 31-Aug-2006 17:23:19 by praveen - * - */ - -package org.posterita.exceptions; - -public class InvalidInvokeOrderStatusException extends OperationException -{ - private static final long serialVersionUID = 1L; - private String status = null; - - public InvalidInvokeOrderStatusException(String xception,String status) - { - super(xception); - this.status = status; - } - - public InvalidInvokeOrderStatusException(String xception) - { - super(xception); - } - - public InvalidInvokeOrderStatusException(Exception exception) - { - super(exception); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidMessageStatusException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidMessageStatusException.java deleted file mode 100644 index 1919198ff2..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidMessageStatusException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 1, 2005 by din - */ - -package org.posterita.exceptions; - -public class InvalidMessageStatusException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidMessageStatusException(String xception) - { - super(xception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidMonthException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidMonthException.java deleted file mode 100644 index 0a91d6c615..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidMonthException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 26, 2006 - */ -package org.posterita.exceptions; - - -public class InvalidMonthException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidMonthException(String xception) - { - super("Invalid month"); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidNetDaysException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidNetDaysException.java deleted file mode 100644 index 95e129f656..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidNetDaysException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 11, 2006 - */ - - -package org.posterita.exceptions; - - -public class InvalidNetDaysException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - public InvalidNetDaysException(String ex) - { - super(ex); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderIDException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderIDException.java deleted file mode 100644 index 69abe0c5ea..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderIDException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 31-Aug-2006 17:22:39 by praveen - * - */ - -package org.posterita.exceptions; - -public class InvalidOrderIDException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public InvalidOrderIDException(String xception) - { - super(xception); - } - - public InvalidOrderIDException(Exception exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderTypeException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderTypeException.java deleted file mode 100644 index 94e8b8f1bf..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrderTypeException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 09-Oct-2006 13:59:43 by praveen - * - */ - -package org.posterita.exceptions; - -public class InvalidOrderTypeException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public InvalidOrderTypeException(){} - - public InvalidOrderTypeException(String message){ - super(message); - } - - public InvalidOrderTypeException(Exception exception){ - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrganisationTypeException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrganisationTypeException.java deleted file mode 100644 index 7ebcaee8de..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidOrganisationTypeException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 14-Sep-2005 by vishee - * - */ - -package org.posterita.exceptions; - -public class InvalidOrganisationTypeException extends ApplicationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidOrganisationTypeException(String message) - { - super(message); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidPINException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidPINException.java deleted file mode 100644 index 4bcd8a0ce1..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidPINException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Sep 25, 2006 - */ - - -package org.posterita.exceptions; - - -public class InvalidPINException extends OperationException -{ - - private static final long serialVersionUID = 1L; - - public InvalidPINException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidPasswordLengthException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidPasswordLengthException.java deleted file mode 100644 index 8d5dc91cf5..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidPasswordLengthException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jun 6, 2006 - */ - - -package org.posterita.exceptions; - - -public class InvalidPasswordLengthException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - -public InvalidPasswordLengthException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidPeriodException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidPeriodException.java deleted file mode 100644 index 6b7910f5cf..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidPeriodException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.exceptions; - - -public class InvalidPeriodException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidPeriodException(String xception) - { - super(xception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidProductQuantityException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidProductQuantityException.java deleted file mode 100644 index 69214157a5..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidProductQuantityException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.exceptions; - - -public class InvalidProductQuantityException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidProductQuantityException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidRequestUpdateException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidRequestUpdateException.java deleted file mode 100644 index 5eb2466ded..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidRequestUpdateException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* -* -* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* UDI Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with UDI. -* -* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -* Created on Jun 23, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -import org.posterita.exceptions.DataException; - -public class InvalidRequestUpdateException extends DataException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidRequestUpdateException(String msg) - { - super(msg); - } - - public InvalidRequestUpdateException(String msg, Exception ex) - { - super(msg, ex); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidRoleException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidRoleException.java deleted file mode 100644 index ebddf68dd3..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidRoleException.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 26, 2006 - */ -package org.posterita.exceptions; - - -/** - * @author vickram - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class InvalidRoleException extends ApplicationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidTenderedAmountException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidTenderedAmountException.java deleted file mode 100644 index 94eee71214..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidTenderedAmountException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 4, 2006 - */ - - -package org.posterita.exceptions; - - -public class InvalidTenderedAmountException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidTenderedAmountException(String message) - { - super(message); - } -} - diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidTerminalCashBookException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidTerminalCashBookException.java deleted file mode 100644 index 6f30ef5a77..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidTerminalCashBookException.java +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.exceptions; - -/** - * @author ashley - * Jun 4, 2008 - */ -public class InvalidTerminalCashBookException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1968761385207764766L; - - public InvalidTerminalCashBookException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidURLException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidURLException.java deleted file mode 100644 index 9d9cc0e928..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidURLException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* -* -* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* UDI Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with UDI. -* -* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -* Created on May 31, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -import org.posterita.exceptions.DataException; - -public class InvalidURLException extends DataException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvalidURLException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/InvalidYearException.java b/posterita/posterita/src/main/org/posterita/exceptions/InvalidYearException.java deleted file mode 100644 index fc7ad9d856..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/InvalidYearException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 9, 2005 by praveen - * - */ -package org.posterita.exceptions; - -public class InvalidYearException extends ApplicationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - /** - * - */ - public InvalidYearException(String message) - { - super(message); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/KeywordsRequiredException.java b/posterita/posterita/src/main/org/posterita/exceptions/KeywordsRequiredException.java deleted file mode 100644 index fe26e2d3aa..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/KeywordsRequiredException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 16, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class KeywordsRequiredException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public KeywordsRequiredException(String msg) - { - super(msg); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/LimitPriceViolatedException.java b/posterita/posterita/src/main/org/posterita/exceptions/LimitPriceViolatedException.java deleted file mode 100644 index e7cd51580c..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/LimitPriceViolatedException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jan 9, 2007 - */ - - -package org.posterita.exceptions; - - -public class LimitPriceViolatedException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public LimitPriceViolatedException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/LogoException.java b/posterita/posterita/src/main/org/posterita/exceptions/LogoException.java deleted file mode 100644 index e170191da5..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/LogoException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Sep 22, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class LogoException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public LogoException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/MandatoryException.java b/posterita/posterita/src/main/org/posterita/exceptions/MandatoryException.java deleted file mode 100644 index 6d17b468d2..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/MandatoryException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 30, 2006 - */ - - -package org.posterita.exceptions; - - -public class MandatoryException extends BPartnerException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public MandatoryException(String msg) - { - super(msg); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/MandatoryNameException.java b/posterita/posterita/src/main/org/posterita/exceptions/MandatoryNameException.java deleted file mode 100644 index a75ef6b107..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/MandatoryNameException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 30, 2006 - */ - - -package org.posterita.exceptions; - - -public class MandatoryNameException extends BPartnerException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public MandatoryNameException(String msg) - { - super(msg); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoAccessToEditObjectException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoAccessToEditObjectException.java deleted file mode 100644 index 6575dd1ed9..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoAccessToEditObjectException.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.posterita.exceptions; - -public class NoAccessToEditObjectException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public NoAccessToEditObjectException(String msg) - { - super(msg); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoAllocateeInvoiceException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoAllocateeInvoiceException.java deleted file mode 100644 index 0ec57dc200..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoAllocateeInvoiceException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 12, 2006 - */ - - -package org.posterita.exceptions; - - -public class NoAllocateeInvoiceException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public NoAllocateeInvoiceException(String message) - { - super(message); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoCashJournalPresentException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoCashJournalPresentException.java deleted file mode 100644 index 819f1ff437..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoCashJournalPresentException.java +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.exceptions; - -/** - * @author ashley - * Jun 3, 2008 - */ -public class NoCashJournalPresentException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = -2697421713715152354L; - - public NoCashJournalPresentException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoCheckBoxSelectedException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoCheckBoxSelectedException.java deleted file mode 100644 index 965e9104b8..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoCheckBoxSelectedException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jan 26, 2007 - */ - - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - - -public class NoCheckBoxSelectedException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public NoCheckBoxSelectedException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoClientFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoClientFoundException.java deleted file mode 100644 index e9a4889bdd..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoClientFoundException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - **/ -package org.posterita.exceptions; - - -public class NoClientFoundException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public NoClientFoundException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoCustomerFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoCustomerFoundException.java deleted file mode 100644 index 84be45a422..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoCustomerFoundException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 14-Dec-2006 13:02:58 by praveen - * - */ - -package org.posterita.exceptions; - -public class NoCustomerFoundException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public NoCustomerFoundException(String xception) - { - super(xception); - } - - public NoCustomerFoundException(Exception xception) - { - super(xception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoLocationFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoLocationFoundException.java deleted file mode 100644 index 7975cb417f..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoLocationFoundException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 26, 2006 - */ - -package org.posterita.exceptions; - -public class NoLocationFoundException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public NoLocationFoundException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineFoundException.java deleted file mode 100644 index 96dafdbd75..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineFoundException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 31-Aug-2006 17:21:30 by praveen - * - */ - -package org.posterita.exceptions; - -public class NoOrderLineFoundException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public NoOrderLineFoundException(String xception) - { - super(xception); - } - - public NoOrderLineFoundException(Exception exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineSelectedException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineSelectedException.java deleted file mode 100644 index 03d172a537..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoOrderLineSelectedException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.exceptions; - - -public class NoOrderLineSelectedException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public NoOrderLineSelectedException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoPaymentAmountException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoPaymentAmountException.java deleted file mode 100644 index a26e69b9fb..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoPaymentAmountException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 22, 2006 - */ - - -package org.posterita.exceptions; - - -public class NoPaymentAmountException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public NoPaymentAmountException(String message) - { - super(message); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoProductImageException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoProductImageException.java deleted file mode 100644 index 9f588d97a6..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoProductImageException.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.posterita.exceptions; - -public class NoProductImageException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public NoProductImageException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoProductSelectedException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoProductSelectedException.java deleted file mode 100644 index 41c65c77d1..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoProductSelectedException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 09-Aug-2005 by alok - * - */ -package org.posterita.exceptions; - - -public class NoProductSelectedException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public NoProductSelectedException(String str) - { - super(str); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NoStockAvailableException.java b/posterita/posterita/src/main/org/posterita/exceptions/NoStockAvailableException.java deleted file mode 100644 index 068ee3aa6a..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NoStockAvailableException.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 26-Sep-2005 - */ - - -package org.posterita.exceptions; - - -public class NoStockAvailableException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - private Object[] args; - - public NoStockAvailableException(String msg) - { - super(msg); - } - - public Object[] getArgs() - { - return args; - } - - - - public void setArgs(Object[] args) - { - this.args = args; - } - - public NoStockAvailableException(Object args[]) - { - setArgs(args); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NotLoggedInException.java b/posterita/posterita/src/main/org/posterita/exceptions/NotLoggedInException.java deleted file mode 100644 index 4f5efb013e..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NotLoggedInException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 16-Feb-2005 by fred - * - */ -package org.posterita.exceptions; - -public class NotLoggedInException extends ApplicationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/NullTransferAmountException.java b/posterita/posterita/src/main/org/posterita/exceptions/NullTransferAmountException.java deleted file mode 100644 index dda3366ee2..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/NullTransferAmountException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 14, 2006 - */ - - -package org.posterita.exceptions; - - -public class NullTransferAmountException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - -public NullTransferAmountException(String xception) - { - super(xception); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/OperationException.java b/posterita/posterita/src/main/org/posterita/exceptions/OperationException.java deleted file mode 100644 index 3429376a14..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/OperationException.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -package org.posterita.exceptions; - -public class OperationException extends Exception -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public OperationException() - { - - } - - public OperationException(String xception) - { - super(xception); - } - - public OperationException(Exception exception) - { - super(exception); - } - - public OperationException(String msg, Exception exception) - { - super(msg,exception); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/OrganisationAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/OrganisationAlreadyExistsException.java deleted file mode 100644 index b2831bf7e2..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/OrganisationAlreadyExistsException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.exceptions; - - -public class OrganisationAlreadyExistsException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public OrganisationAlreadyExistsException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/POException.java b/posterita/posterita/src/main/org/posterita/exceptions/POException.java deleted file mode 100644 index 7311dd53ef..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/POException.java +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.exceptions; - -/** - * @author ashley - */ -public class POException extends RuntimeException -{ - private static final long serialVersionUID = 4178407778052352481L; - - /** - * - */ - public POException() - { - super(); - } - - /** - * @param message - * @param cause - */ - public POException(String message, Throwable cause) - { - super(message, cause); - } - - /** - * @param message - */ - public POException(String message) - { - super(message); - } - - /** - * @param cause - */ - public POException(Throwable cause) - { - super(cause); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/POSTerminalException.java b/posterita/posterita/src/main/org/posterita/exceptions/POSTerminalException.java deleted file mode 100644 index 120dd679fd..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/POSTerminalException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class POSTerminalException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public POSTerminalException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/PayAmtNotEqualToAllocateAmtException.java b/posterita/posterita/src/main/org/posterita/exceptions/PayAmtNotEqualToAllocateAmtException.java deleted file mode 100644 index 6eb96ae608..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/PayAmtNotEqualToAllocateAmtException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 26, 2006 - */ - - -package org.posterita.exceptions; - - -public class PayAmtNotEqualToAllocateAmtException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public PayAmtNotEqualToAllocateAmtException(String message) - { - super(message); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/PaymentTermAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/PaymentTermAlreadyExistsException.java deleted file mode 100644 index a0eb290fa5..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/PaymentTermAlreadyExistsException.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 1, 2006 - */ - - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - - -public class PaymentTermAlreadyExistsException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public PaymentTermAlreadyExistsException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/PriceListAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/PriceListAlreadyExistsException.java deleted file mode 100644 index 47b8eda1bf..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/PriceListAlreadyExistsException.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.posterita.exceptions; - -public class PriceListAlreadyExistsException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = -8563966310534861141L; - - public PriceListAlreadyExistsException(String exception) - { - super(exception); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductAlreadyExistException.java deleted file mode 100644 index b7ce33d666..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ProductAlreadyExistException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 09-Aug-2005 by alok - * - */ -package org.posterita.exceptions; - - -public class ProductAlreadyExistException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductAlreadyExistException(String exception) - { - super(exception); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductImageInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductImageInvalidException.java deleted file mode 100644 index 1b6d596262..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ProductImageInvalidException.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 2, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class ProductImageInvalidException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductImageInvalidException(String msg) - { - super(msg); - } - - public ProductImageInvalidException(String msg, Exception ex) - { - super(msg, ex); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductInStockException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductInStockException.java deleted file mode 100644 index 42666b2dea..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ProductInStockException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 09-Aug-2005 by alok - * - */ -package org.posterita.exceptions; - - -public class ProductInStockException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductInStockException(String exception) - { - super(exception); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductNotFoundException.java deleted file mode 100644 index ae5dca8e64..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ProductNotFoundException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Feb 24, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class ProductNotFoundException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductNotFoundException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductNotImportedException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductNotImportedException.java deleted file mode 100644 index 92fffd14e6..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ProductNotImportedException.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.posterita.exceptions; - -public class ProductNotImportedException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 4111958312107421807L; - - public ProductNotImportedException() - { - super(); - } - - public ProductNotImportedException(Exception exception) - { - super(exception); - } - - public ProductNotImportedException(String msg, Exception exception) - { - super(msg, exception); - } - - public ProductNotImportedException(String exception) - { - super(exception); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ProductNotOnPriceListException.java b/posterita/posterita/src/main/org/posterita/exceptions/ProductNotOnPriceListException.java deleted file mode 100644 index 1518325f8b..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ProductNotOnPriceListException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on May 30, 2006 - */ - - -package org.posterita.exceptions; - - -public class ProductNotOnPriceListException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductNotOnPriceListException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/QuantityNotAvailableException.java b/posterita/posterita/src/main/org/posterita/exceptions/QuantityNotAvailableException.java deleted file mode 100644 index 267224c0de..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/QuantityNotAvailableException.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.exceptions; - - -public class QuantityNotAvailableException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - private String message; - - public QuantityNotAvailableException() - { - - } - - public QuantityNotAvailableException(String exception) - { - super(exception); - } - - public void setMessage(String message) - { - this.message = message; - } - - public String getMessage() - { - return message; - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ReloadFactoryException.java b/posterita/posterita/src/main/org/posterita/exceptions/ReloadFactoryException.java deleted file mode 100644 index ad6ed267c4..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ReloadFactoryException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Nov 14, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class ReloadFactoryException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public ReloadFactoryException(String msg, Exception ex) - { - super(msg, ex); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/RequestOwnerNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/RequestOwnerNotFoundException.java deleted file mode 100644 index 998cd8ed2c..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/RequestOwnerNotFoundException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* -* -* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* UDI Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with UDI. -* -* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -* Created on Jun 26, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class RequestOwnerNotFoundException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public RequestOwnerNotFoundException(String msg) - { - super(msg); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/RoleAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/RoleAlreadyExistsException.java deleted file mode 100644 index 98f7219c1e..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/RoleAlreadyExistsException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 14, 2005 by praveen - * - */ -package org.posterita.exceptions; - -public class RoleAlreadyExistsException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public RoleAlreadyExistsException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/SequenceUpdateException.java b/posterita/posterita/src/main/org/posterita/exceptions/SequenceUpdateException.java deleted file mode 100644 index 29f6881b14..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/SequenceUpdateException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 17, 2006 - */ - - -package org.posterita.exceptions; - - -public class SequenceUpdateException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public SequenceUpdateException(String msg) - { - super(msg); - } -} - diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ShipmentAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/ShipmentAlreadyExistsException.java deleted file mode 100644 index 147efe23a2..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ShipmentAlreadyExistsException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Sep-2005 by Vishee - * - */ - -package org.posterita.exceptions; - -public class ShipmentAlreadyExistsException extends ApplicationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public ShipmentAlreadyExistsException(String message) - { - super(message); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ShipperAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/ShipperAlreadyExistsException.java deleted file mode 100644 index f46836f76b..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ShipperAlreadyExistsException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.exceptions; - - -public class ShipperAlreadyExistsException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ShipperAlreadyExistsException(String exception) - { - super(exception); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/StoreException.java b/posterita/posterita/src/main/org/posterita/exceptions/StoreException.java deleted file mode 100644 index d0d3bce666..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/StoreException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class StoreException extends OperationException -{ - private static final long serialVersionUID = 1L; - - public StoreException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/SurnameNotPresentException.java b/posterita/posterita/src/main/org/posterita/exceptions/SurnameNotPresentException.java deleted file mode 100644 index cbeae83506..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/SurnameNotPresentException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 16-Dec-2005 - */ - - -package org.posterita.exceptions; - - -public class SurnameNotPresentException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public SurnameNotPresentException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/SystemException.java b/posterita/posterita/src/main/org/posterita/exceptions/SystemException.java deleted file mode 100644 index f3e1100204..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/SystemException.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -package org.posterita.exceptions; - - -public class SystemException extends Exception -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public SystemException(Exception e) - { - super(e); - } - - public SystemException(String xception) - { - super(xception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TMKRuntimeException.java b/posterita/posterita/src/main/org/posterita/exceptions/TMKRuntimeException.java deleted file mode 100644 index fed6b51a5f..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/TMKRuntimeException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.exceptions; - - -public class TMKRuntimeException extends RuntimeException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public TMKRuntimeException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TaxNameAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/TaxNameAlreadyExistsException.java deleted file mode 100644 index 644ca5a447..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/TaxNameAlreadyExistsException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 28, 2006 - */ - - -package org.posterita.exceptions; - - -public class TaxNameAlreadyExistsException extends BPartnerException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public TaxNameAlreadyExistsException(String msg) - { - super(msg); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TaxRateAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/TaxRateAlreadyExistsException.java deleted file mode 100644 index 7e206f3571..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/TaxRateAlreadyExistsException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 28, 2006 - */ - - -package org.posterita.exceptions; - - -public class TaxRateAlreadyExistsException extends BPartnerException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public TaxRateAlreadyExistsException(String msg) - { - super(msg); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TaxRateNotDefineException.java b/posterita/posterita/src/main/org/posterita/exceptions/TaxRateNotDefineException.java deleted file mode 100644 index 496a02e515..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/TaxRateNotDefineException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Sep 26, 2006 - */ - - -package org.posterita.exceptions; - - -public class TaxRateNotDefineException extends OperationException -{ - - private static final long serialVersionUID = 1L; - - public TaxRateNotDefineException(String exception) - { - super(exception); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TerminalInactivateException.java b/posterita/posterita/src/main/org/posterita/exceptions/TerminalInactivateException.java deleted file mode 100644 index 39a166d442..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/TerminalInactivateException.java +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.exceptions; - -/** - * @author ashley - * Jun 4, 2008 - */ -public class TerminalInactivateException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = -4346728923232617443L; - - public TerminalInactivateException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TerminalLockedException.java b/posterita/posterita/src/main/org/posterita/exceptions/TerminalLockedException.java deleted file mode 100644 index ca02096104..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/TerminalLockedException.java +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.exceptions; - -/** - * @author ashley - * May 30, 2008 - */ -public class TerminalLockedException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 2773108392278785974L; - - public TerminalLockedException(String message) - { - super(message); - } - - public TerminalLockedException(String message, Exception exception) - { - super(message, exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TerminalNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/TerminalNotFoundException.java deleted file mode 100644 index d3d5e88792..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/TerminalNotFoundException.java +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.exceptions; - -/** - * @author Ashley G Ramdass - * Apr 24, 2008 - */ -public class TerminalNotFoundException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = -4008118103736618982L; - - public TerminalNotFoundException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/ThumbnailGenerationException.java b/posterita/posterita/src/main/org/posterita/exceptions/ThumbnailGenerationException.java deleted file mode 100644 index 0a66b811fd..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/ThumbnailGenerationException.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 3, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class ThumbnailGenerationException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public ThumbnailGenerationException(String msg) - { - super(msg); - } - - public ThumbnailGenerationException(String msg, Exception ex) - { - super(msg, ex); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TooManyAllocateInvoiceException.java b/posterita/posterita/src/main/org/posterita/exceptions/TooManyAllocateInvoiceException.java deleted file mode 100644 index ebdb6ebfea..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/TooManyAllocateInvoiceException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 8, 2006 - */ - - -package org.posterita.exceptions; - - -public class TooManyAllocateInvoiceException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public TooManyAllocateInvoiceException(String message) - { - super(message); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TotalQuantityLessThanZeroException.java b/posterita/posterita/src/main/org/posterita/exceptions/TotalQuantityLessThanZeroException.java deleted file mode 100644 index 532a7f29fd..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/TotalQuantityLessThanZeroException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.exceptions; - - -public class TotalQuantityLessThanZeroException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public TotalQuantityLessThanZeroException(String exception) - { - super(exception); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TrackingNumberNotfoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/TrackingNumberNotfoundException.java deleted file mode 100644 index a38b0dc048..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/TrackingNumberNotfoundException.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jun 9, 2006 - */ - - -package org.posterita.exceptions; - - -public class TrackingNumberNotfoundException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - -public TrackingNumberNotfoundException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/TransferAmountExceedsTotalAmountException.java b/posterita/posterita/src/main/org/posterita/exceptions/TransferAmountExceedsTotalAmountException.java deleted file mode 100644 index aaac0aec08..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/TransferAmountExceedsTotalAmountException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 14, 2006 - */ - - -package org.posterita.exceptions; - - -public class TransferAmountExceedsTotalAmountException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public TransferAmountExceedsTotalAmountException(String xception) - { - super(xception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UOMNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/UOMNotFoundException.java deleted file mode 100644 index 2901f58923..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/UOMNotFoundException.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.posterita.exceptions; - - -public class UOMNotFoundException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - - public UOMNotFoundException(String str) - { - super(str); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UOMValuePrecisionNotValidException.java b/posterita/posterita/src/main/org/posterita/exceptions/UOMValuePrecisionNotValidException.java deleted file mode 100644 index a70ba8953e..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/UOMValuePrecisionNotValidException.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.posterita.exceptions; - -/** - * This Exception corresponds to the situation where the entered - * value for some field has a precision which exceeds that field's UOM precision. - * - * @author sendy - * - */ -public class UOMValuePrecisionNotValidException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public UOMValuePrecisionNotValidException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UnitNumberAlreadyExistException.java b/posterita/posterita/src/main/org/posterita/exceptions/UnitNumberAlreadyExistException.java deleted file mode 100644 index ab8c9b2e76..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/UnitNumberAlreadyExistException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Jan 16, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class UnitNumberAlreadyExistException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public UnitNumberAlreadyExistException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UnsupportedDatabaseException.java b/posterita/posterita/src/main/org/posterita/exceptions/UnsupportedDatabaseException.java deleted file mode 100644 index 67e27be7a4..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/UnsupportedDatabaseException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -public class UnsupportedDatabaseException extends RuntimeException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public UnsupportedDatabaseException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UserAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/UserAlreadyExistsException.java deleted file mode 100644 index 8f431ee3dd..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/UserAlreadyExistsException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.exceptions; - - -public class UserAlreadyExistsException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public UserAlreadyExistsException(String exception) - { - super(exception); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UserException.java b/posterita/posterita/src/main/org/posterita/exceptions/UserException.java deleted file mode 100644 index 257cc85f73..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/UserException.java +++ /dev/null @@ -1,48 +0,0 @@ -/* -* -* Copyright (c) 2006 Tamak ICT Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* UDI Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with UDI. -* -* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -* Created on Jun 5, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.exceptions; - -import org.posterita.exceptions.OperationException; - -public class UserException extends OperationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public UserException(String msg) - { - super(msg); - } - - public UserException(String msg, Exception ex) - { - super(msg, ex); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UserInactiveException.java b/posterita/posterita/src/main/org/posterita/exceptions/UserInactiveException.java deleted file mode 100644 index 12ae6a798f..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/UserInactiveException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 07-Apr-2005 by fred - * - */ -package org.posterita.exceptions; - - -public class UserInactiveException extends ApplicationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UserInvalidException.java b/posterita/posterita/src/main/org/posterita/exceptions/UserInvalidException.java deleted file mode 100644 index b7911b2677..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/UserInvalidException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Mar 29, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -import org.posterita.exceptions.DataException; - -public class UserInvalidException extends DataException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public UserInvalidException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/UserNotFoundException.java b/posterita/posterita/src/main/org/posterita/exceptions/UserNotFoundException.java deleted file mode 100644 index 95eb36b39a..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/UserNotFoundException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 17-Feb-2005 by fred - * - */ -package org.posterita.exceptions; - - -public class UserNotFoundException extends ApplicationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/WarehouseAlreadyExistsException.java b/posterita/posterita/src/main/org/posterita/exceptions/WarehouseAlreadyExistsException.java deleted file mode 100644 index feb781e945..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/WarehouseAlreadyExistsException.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.exceptions; - - -public class WarehouseAlreadyExistsException extends Exception -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public WarehouseAlreadyExistsException(String exception) - { - super(exception); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/WebstoreOrderProcessingException.java b/posterita/posterita/src/main/org/posterita/exceptions/WebstoreOrderProcessingException.java deleted file mode 100644 index bd20ea6fce..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/WebstoreOrderProcessingException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Jan 16, 2006 by ashley -* -*/ - -package org.posterita.exceptions; - -public class WebstoreOrderProcessingException extends OperationException -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public WebstoreOrderProcessingException(String msg) - { - super(msg); - } -} diff --git a/posterita/posterita/src/main/org/posterita/exceptions/WrongPasswordException.java b/posterita/posterita/src/main/org/posterita/exceptions/WrongPasswordException.java deleted file mode 100644 index 8d14d0042f..0000000000 --- a/posterita/posterita/src/main/org/posterita/exceptions/WrongPasswordException.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Created on 2005/03/09 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.posterita.exceptions; - -/** - * @author jane - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates - */ -public class WrongPasswordException extends ApplicationException -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/factory/AbstractFactory.java b/posterita/posterita/src/main/org/posterita/factory/AbstractFactory.java deleted file mode 100644 index 2a9479216c..0000000000 --- a/posterita/posterita/src/main/org/posterita/factory/AbstractFactory.java +++ /dev/null @@ -1,242 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 11, 2005 by vishee - */ - -package org.posterita.factory; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Properties; -import java.util.Set; - -import org.compiere.model.PO; -import org.compiere.util.Env; - -import org.posterita.businesslogic.ClientManager; -import org.posterita.core.FactoryPropertiesManager; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ReloadFactoryException; -import org.posterita.lib.UdiConstants; - -public abstract class AbstractFactory -{ - private static final String KEY_SEPARATOR = "_"; - protected HashMap map; - protected static int[] clients; - - public static final String MENU_POSITION_TOP = "TOP"; - public static final String MENU_POSITION_LEFT = "LEFT"; - public static final String MENU_POSITION_RIGHT = "RIGHT"; - public static final String MENU_POSITION_DOWN = "DOWN"; - - - static - { - clients = ClientManager.getAvailableClientIds(); - } - - WebProperties pm = FactoryPropertiesManager.getProperty(); - - protected void initFactory(Properties ctx, AbstractFactory factory) throws OperationException - { - clients = ClientManager.getAvailableClientIds(); - if (Env.getAD_Client_ID(ctx) == 0) //--> Client Independent PO - { - if (factory == null) - { - loadFactory(ctx); - } - else - { - loadFactory(ctx, factory); - } - } - else - { - // Catering for multiple clients. All clients should have factory objects loaded. - for (int i = 0; i < clients.length; i++) - { - Properties nCtx = getCtxClone(ctx, clients[i]); - if (factory == null) - { - loadFactory(nCtx); - } - else - { - loadFactory(nCtx, factory); - } - } - } - } - - protected abstract void loadFactory(Properties ctx) throws OperationException; - - protected abstract void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException; - - public static void reloadFactory(Properties ctx) throws ReloadFactoryException - { - - } - - /*private static Properties getCtxClone(Properties ctx) - { - return getCtxClone(ctx, Env.getAD_Client_ID(ctx)); - }*/ - - private static Properties getCtxClone(Properties ctx, int adClientId) - { - Properties nCtx = (Properties)ctx.clone(); - Env.setContext(nCtx, UdiConstants.CLIENT_ID_CTX_PARAM, adClientId); - Env.setContext(nCtx, UdiConstants.ORG_ID_CTX_PARAM, 0); - Env.setContext(nCtx, UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM, 0); - Env.setContext(nCtx, UdiConstants.USER_ID_CTX_PARAM, 100); - return nCtx; - } - - protected void add(Properties ctx, String key, PO po) throws OperationException - { - if (map == null) - { - map = new HashMap(); - } - - String idStr = pm.get(ctx, key); - - if (idStr == null) - { - po.save(); // UDIPO - pm.put(ctx, key, ""+po.get_ID()); - } - else - { - Class cl; - Class params[]; - Constructor constructor; - Object[] args; - PO loadedPO; - try - { - cl = Class.forName(po.getClass().getName()); - params = new Class[]{Properties.class, int.class, String.class}; - - constructor = cl.getConstructor(params); - args = new Object[]{ctx,Integer.valueOf(idStr),null}; - loadedPO = (PO) constructor.newInstance(args); - setFields(ctx, po, loadedPO); - loadedPO.save(); - } - catch (ClassNotFoundException e) - { - throw new OperationException(e.getMessage()); - } - catch (SecurityException e) - { - throw new OperationException(e.getMessage()); - } - catch (NoSuchMethodException e) - { - throw new OperationException(e.getMessage()); - } - catch (IllegalArgumentException e) - { - throw new OperationException(e.getMessage()); - } - catch (InstantiationException e) - { - throw new OperationException(e.getMessage()); - } - catch (IllegalAccessException e) - { - throw new OperationException(e.getMessage()); - } - catch (InvocationTargetException e) - { - throw new OperationException(e.getMessage()); - } - - - if (loadedPO == null || loadedPO.get_ID() == 0) - { - po.save(); - pm.put(ctx, key, ""+po.get_ID()); - } - else - { - po = loadedPO; - } - } - - put(ctx, key, po); - } - - private void put(Properties ctx, String key, PO po) - { - int adClientId = Env.getAD_Client_ID(ctx); - String nKey = key + KEY_SEPARATOR + String.valueOf(adClientId); - map.put(nKey, po); - } - - public PO get(Properties ctx, String key) throws OperationException - { - if (map == null) - { - initFactory(ctx, null); - } - - int adClientId = Env.getAD_Client_ID(ctx); - String nKey = key + KEY_SEPARATOR + String.valueOf(adClientId); - PO retPO = map.get(nKey); - - if (retPO == null) - throw new OperationException("Could not get PO with key: " + key); - - return retPO; - } - - protected void setFields(Properties ctx, PO fromPO, PO toPO) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException - { - - } - - public ArrayList getAllKeys(Properties ctx) throws OperationException - { - if (map == null) - loadFactory(ctx); - - Set keySet = map.keySet(); - - ArrayList keyList = new ArrayList(); - - for(Object objKey : keySet) - { - String key = (String)objKey; - int ind = key.lastIndexOf(KEY_SEPARATOR); - if(ind > 0) - { - key = key.substring(0, ind); - } - keyList.add(key); - } - - return keyList; - } -} diff --git a/posterita/posterita/src/main/org/posterita/factory/DBPropertiesManager.java b/posterita/posterita/src/main/org/posterita/factory/DBPropertiesManager.java deleted file mode 100644 index 63b87340dd..0000000000 --- a/posterita/posterita/src/main/org/posterita/factory/DBPropertiesManager.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 12-Oct-2005 - */ - - -package org.posterita.factory; - -import java.util.Properties; - -import org.compiere.util.Env; - -import org.posterita.exceptions.OperationException; -import org.compiere.model.MWebProperties; - - -public class DBPropertiesManager implements WebProperties -{ - - public void put(Properties ctx, String key, String value) - { - int [] propertieIds = MWebProperties.getAllIDs(MWebProperties.Table_Name," U_KEY='"+key+"' and AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx),null); - - if(propertieIds.length==0) - { - MWebProperties webProperties = new MWebProperties(ctx,0,null); - webProperties.setU_Key(key); - webProperties.setU_Value(value); - webProperties.save(); - } - else - { - MWebProperties webProperties = new MWebProperties(ctx,propertieIds[0],null); - webProperties.setU_Value(value); - webProperties.save(); - } - } - - - public String get(Properties ctx, String key) throws OperationException - { - - int [] values; - - values = MWebProperties.getAllIDs(MWebProperties.Table_Name,"u_key ='"+key+"' and AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx),null); - - if (values.length == 0) - { - return null; - } - - - MWebProperties webProperties = new MWebProperties(ctx,values[0],null); - - return webProperties.getU_Value(); - } - -// private boolean iskeyPresent(Properties ctx,String key) -// { -// boolean keyPresent = true; -// int [] propertieIds = MWebProperties.getAllIDs(MWebProperties.Table_Name," U_KEY='"+key+"' and AD_CLIENT_ID = "+Env.getAD_Client_ID(ctx),null); -// -// if(propertieIds.length==0) -// keyPresent = false; -// -// return keyPresent; -// } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/factory/DunningFactory.java b/posterita/posterita/src/main/org/posterita/factory/DunningFactory.java deleted file mode 100644 index c23c1125d5..0000000000 --- a/posterita/posterita/src/main/org/posterita/factory/DunningFactory.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 30, 2006 - */ - - -package org.posterita.factory; - -import java.util.Properties; - -import org.posterita.businesslogic.administration.DunningManager; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ReloadFactoryException; - - -public class DunningFactory extends AbstractFactory -{ - public static final String DUNNING_ID = "dunning.id"; - public static final String DUNNING_NAME="Dunning"; - public static final String DESCRIPTION="Include due an non-due invoices"; - public static final String DUNNING_LEVEL_NAME="Statement"; - public static final String PRINT_TEXT = "Statement "; - public static final String PRINT_NOTE="Please review your statement and submit due payments."; - - - private static DunningFactory singleton; - private DunningFactory() throws OperationException - { - - } - - public static DunningFactory getFactoryInstance(Properties ctx) throws OperationException - { - if (singleton == null) - singleton = new DunningFactory(); - - Properties nCtx = (Properties)ctx.clone(); - singleton.loadFactory(nCtx); - - return singleton; - } - - protected void loadFactory(Properties ctx) throws OperationException - { - loadFactory(ctx, singleton); - } - - protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException - { - factory.add(ctx,DUNNING_ID, - DunningManager.createDunningAndLevel - (ctx,DUNNING_NAME,DESCRIPTION,DUNNING_LEVEL_NAME,PRINT_TEXT,PRINT_NOTE,-9999)); - - } - - public static void reloadFactory(Properties ctx) throws ReloadFactoryException - { - try - { - DunningFactory nFactory = new DunningFactory(); - nFactory.initFactory(ctx, nFactory); - singleton = nFactory; - } - catch(OperationException ex) - { - throw new ReloadFactoryException("Could not reload DunningFactory", ex); - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/factory/GenericSystemObjectsFactory.java b/posterita/posterita/src/main/org/posterita/factory/GenericSystemObjectsFactory.java deleted file mode 100644 index 87590a4ba8..0000000000 --- a/posterita/posterita/src/main/org/posterita/factory/GenericSystemObjectsFactory.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - **/ -package org.posterita.factory; - -import java.util.Properties; - -import org.compiere.model.MAssetGroup; -import org.compiere.model.MDiscountSchema; -import org.compiere.model.MDiscountSchemaLine; -import org.compiere.model.MProductCategory; -import org.compiere.model.MTax; -import org.compiere.model.MTaxCategory; -import org.posterita.core.SystemObjects; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ReloadFactoryException; -import org.posterita.lib.UdiConstants; - - -public class GenericSystemObjectsFactory extends AbstractFactory -{ - - public static final String PRODUCT_CATEGORY_ID = "product.category.id"; - public static final String TAX_CATEGORY_DEFAULT_ID = "tax.category.default.id"; - - public static final String ASSET_GROUP_ID = "asset.group.id"; - public static final String TAX_DEFAULT_ID = "tax.default.id"; - public static final String DISCOUNT_SCHEMA_ID = "discount.schema.id"; - public static final String DISCOUNT_SCHEMA_LINE_ID = "discount.schema.line.id"; - - private static GenericSystemObjectsFactory genericSystemsObjectFactory; - private GenericSystemObjectsFactory() - { - - } - - public static GenericSystemObjectsFactory getFactoryInstance() - { - if (genericSystemsObjectFactory == null) - genericSystemsObjectFactory = new GenericSystemObjectsFactory(); - - return genericSystemsObjectFactory; - } - - protected void loadFactory(Properties ctx) throws OperationException - { - loadFactory(ctx, genericSystemsObjectFactory); - } - - protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException - { - MAssetGroup assetGroup = SystemObjects.getAssetGroup(ctx, "Posterita Asset Group"); - factory.add(ctx, ASSET_GROUP_ID, assetGroup); - assetGroup = (MAssetGroup)factory.get(ctx, ASSET_GROUP_ID); - - MProductCategory productCategory = SystemObjects.getProductCategory(ctx, "Posterita Product Category"); - factory.add(ctx, PRODUCT_CATEGORY_ID, productCategory); - productCategory = (MProductCategory) factory.get(ctx, GenericSystemObjectsFactory.PRODUCT_CATEGORY_ID); - productCategory.setA_Asset_Group_ID(assetGroup.get_ID()); - productCategory.save(); - - factory.add(ctx, TAX_CATEGORY_DEFAULT_ID, SystemObjects.getTaxCategory(ctx, "Posterita Tax Category")); - MTaxCategory taxCategory = (MTaxCategory) factory.get(ctx, TAX_CATEGORY_DEFAULT_ID); - - MTax tax = SystemObjects.getTax(ctx, "Posterita TAx", UdiConstants.COUNTRY_MAURITIUS, "Posterita Tax"); - tax.setC_TaxCategory_ID(taxCategory.getC_TaxCategory_ID()); - tax.setIsTaxExempt(true); - tax.setSOPOType(MTax.SOPOTYPE_SalesTax); - factory.add(ctx, TAX_DEFAULT_ID, tax); - - MDiscountSchema discountSchema = SystemObjects.getDiscountSchema(ctx, "Posterita Discount Schema"); - factory.add(ctx, DISCOUNT_SCHEMA_ID, discountSchema); - discountSchema = (MDiscountSchema) factory.get(ctx, GenericSystemObjectsFactory.DISCOUNT_SCHEMA_ID); - - MDiscountSchemaLine discountSchemaLine = SystemObjects.getDiscountSchemaLine(ctx, discountSchema.getM_DiscountSchema_ID()); - factory.add(ctx, DISCOUNT_SCHEMA_LINE_ID, discountSchemaLine); - discountSchemaLine = (MDiscountSchemaLine)factory.get(ctx, GenericSystemObjectsFactory.DISCOUNT_SCHEMA_LINE_ID); - } - - public static void reloadFactory(Properties ctx) throws ReloadFactoryException - { - try - { - GenericSystemObjectsFactory nFactory = new GenericSystemObjectsFactory(); - nFactory.initFactory(ctx, nFactory); - genericSystemsObjectFactory = nFactory; - } - catch(OperationException ex) - { - throw new ReloadFactoryException("Could not reload GenericSystemObjectsFactory", ex); - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/factory/MenuGenerator.java b/posterita/posterita/src/main/org/posterita/factory/MenuGenerator.java deleted file mode 100644 index 345a225e10..0000000000 --- a/posterita/posterita/src/main/org/posterita/factory/MenuGenerator.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.factory; - -import java.util.Properties; - -import org.compiere.model.MRole; -import org.compiere.model.X_U_RoleMenu; -import org.compiere.util.Env; -import org.posterita.businesslogic.MenuManager; -import org.posterita.exceptions.OperationException; -import org.compiere.model.MRoleMenu; -import org.posterita.util.PoManager; - - -public class MenuGenerator -{ - public static void createMenus(Properties ctx, MRole role) throws OperationException - { - int menuIds[] = MenuManager.getMenuIdForOrganisation(ctx); - int roleId = role.get_ID(); - - for(int i = 0; i < menuIds.length; i++) - { - if(MenuGenerator.isRoleMenuPresent(ctx, roleId, menuIds[i])) - continue; - MRoleMenu roleMenu = new MRoleMenu(ctx, 0, null); - - roleMenu.setAD_Role_ID(roleId); - roleMenu.setU_WebMenu_ID(menuIds[i]); - PoManager.save(roleMenu); - } - } - - private static boolean isRoleMenuPresent(Properties ctx, int roleId, int menuId) - { - boolean present = true; - - String sqlWhereClause = ""; - int adClientId = Env.getAD_Client_ID(ctx); - int adOrgId = Env.getAD_Org_ID(ctx); - - sqlWhereClause += "AD_CLIENT_ID=" + adClientId + " and AD_ORG_ID=" + adOrgId + " and U_WEBMENU_ID=" + menuId + " and AD_ROLE_ID=" + roleId; - int ids[] = X_U_RoleMenu.getAllIDs(X_U_RoleMenu.Table_Name, sqlWhereClause, null); - - if(ids.length == 0) - present = false; - - return present; - } - - /** - * @param ctx - * @param role - * @throws OperationException - */ - public static void createSuperUserMenus(Properties ctx, MRole role) throws OperationException - { - int menuIds[] = MenuManager.getMenuIdForSuperUser(ctx); - - int roleId = role.get_ID(); - - for(int i = 0; i < menuIds.length; i++) - { - if(MenuGenerator.isRoleMenuPresent(ctx, roleId, menuIds[i])) - continue; - MRoleMenu roleMenu = new MRoleMenu(ctx, 0, null); - - roleMenu.setAD_Role_ID(roleId); - roleMenu.setU_WebMenu_ID(menuIds[i]); - PoManager.save(roleMenu); - } - } -} diff --git a/posterita/posterita/src/main/org/posterita/factory/POSMenuFactory.java b/posterita/posterita/src/main/org/posterita/factory/POSMenuFactory.java deleted file mode 100644 index d9fe8a7742..0000000000 --- a/posterita/posterita/src/main/org/posterita/factory/POSMenuFactory.java +++ /dev/null @@ -1,736 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** -* @author ashley -* @author mjudd - BF2319969 - https://sourceforge.net/tracker/index.php?func=detail&aid=2319969&group_id=176962&atid=879332 -*/ - -package org.posterita.factory; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MProcess; -import org.compiere.model.PO; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.businesslogic.MenuManager; -import org.posterita.businesslogic.performanceanalysis.POSReportManager; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.compiere.model.MWebMenu; -import org.posterita.order.UDIOrderTypes; - -public class POSMenuFactory extends AbstractFactory -{ - - public static final String MENU_POSITION_TOP = "TOP"; - public static final String MENU_POSITION_LEFT = "LEFT"; - public static final String MENU_POSITION_RIGHT = "RIGHT"; - public static final String MENU_POSITION_DOWN = "DOWN"; - - public static final String PMENU_SALES_ID = "pmenu.order.id"; - - public static final String PMENU_CREDITSALES_ID = "pmenu.creditsales.id"; - public static final String PMENU_PURCHASES_ID = "pmenu.purchases.id"; - public static final String PMENU_STOCK_ID = "pmenu.stock.id"; - - - public static final String SMENU_POSORDER_ID = "smenu.posorder.id"; - public static final String SMENU_POSORDERWA_ID="smenu.posorderwa.id"; - public static final String SMENU_POSPARTIALORDER_ID = "smenu.pospartialorder.id"; - public static final String SMENU_INVOKEPOSPARTIALORDER_ID = "smenu.invokepospartialorder.id"; - public static final String SMENU_POSGOODRECNOTE_ID = "smenu.posgoodrecnote.id"; - public static final String SMENU_POSGOODRETNOTE_ID= "smenu.posgoodretnote.id"; - public static final String SMENU_CUSTRETORDER_ID="smenu.custretorder.id"; - public static final String SMENU_POSPARTIALHISTORYORDER_ID="smenu.pospartialposhistory.id"; - public static final String SMENU_CUSTRETOREDRFROMPOS_ID="smenu.custretorderfrompos.id"; - public static final String SMENU_POSORDERQUICK="smenu.posorderquick.id"; - public static final String SMENU_POSORDERCUSTOMERCOMPULSORY="smenu.posordercustomercompulsory.id"; - public static final String SMENU_CREDITORDER_ID = "smenu.creditorder.id"; - public static final String SMENU_SETTLE_PAYMENT_ID = "smenu.settlepayment.id"; - public static final String SMENU_CUSTOMER_RETURN_HISTORY_ID="smenu.customer.return.history.id"; - - - public static final String PMENU_REPORTS_ID="pmenu.reports.id"; - public static final String SMENU_POSSTOCKMOV="smenu.posstockmov.id"; - public static final String SMENU_SALESANALREP="smenu.salesanalrep.id"; - public static final String SMENU_FASTMOVITEMS="smenu.fastmovitems.id"; - public static final String SMENU_SLOWMOVITEMS="smenu.slowmovitems.id"; - public static final String SMENU_CUSTSALESREPORT="smenu.custsalesreport.id"; - public static final String SMENU_CASHBOOKREPORT="smenu.cashbookreport.id"; - public static final String SMENU_PERIODICASHBOOKDETAILS="smenu.periodiccashbookdetails.id"; - public static final String SMENU_NOIMAGEREPORT="smenu.noimagereport.id"; - - public static final String PMENU_ADMINISTRATION_ID="pmenu.administration.id"; - public static final String SMENU_USER_ID="smenu.user.id"; - - public static final String SMENU_VIEWROLE_ID="smenu.viewrole.id"; - public static final String SMENU_CREATEVENDOR_ID="smenu.createvendor.id"; - - public static final String SMENU_CURRENTTILLAMOUNT_ID="smenu.currenttillamout.id"; - public static final String SMENU_CLOSECASHBOOK_ID="smenu.closecashbook.id"; - public static final String SMENU_POSINFO_ID="smenu.posinfo.id"; - public static final String SMENU_MYSTOCK_ID="smenu.mystock.id"; - - public static final String SMENU_ORDERHISTORY_ID="smenu.orderhistory.id"; - public static final String SMENU_DOCUMENTHISTORY_ID="smenu.documenthistory.id"; - - public static final String SMENU_PRODUCTS="smenu.products.id"; - public static final String SMENU_BARCODE_PRINTING = "smenu.barcode.printing"; - public static final String SMENU_VIEW_BPINFO="smenu.view.bp.info.id"; - public static final String SMENU_CUSTOMER="smenu.customer.id"; - public static final String SMENU_EDIT_BULK_PRODUCT="smenu.edit.bulk.product.id"; - public static final String SMENU_EDIT_BULK_PRICE="smenu.edit.bulk.price.id"; - public static final String SMENU_EDIT_ATTRIBUTE_VALUE="smenu.edit.attribute.value.id"; - public static final String SMENU_ADJUST_CASH_BOOK="smenu.adjust.cashbook.id"; - public static final String SMENU_SYNCHRONIZE_COLLECTIONS="smenu.synchronize.collections.id"; - public static final String PMENU_LOGOUT_ID="pmenu.logout.id"; - public static final String SMENU_CLOSE_POS_TILL="smenu.close.pos.till.id"; - public static final String SMENU_OPEN_CASH_DRAWER = "smenu.opencashdrawer.id"; - public static final String SMENU_UPDATE_PRODUCT_BY_CSV = "smenu.update.produc.csv.id"; - - public static final String SMENU_CHECK_SEQUENCE = "smenu.checkSequence.id"; - public static final String SMENU_PRINT_DUNNING_LETTERS_ID = "smenu.printDunningLetters.id"; - public static final String SMENU_VIEW_PAYMENT_ALLOCATION = "smenu.viewpaymentallocation.id"; - public static final String SMENU_VIEW_PAYMENT_TERM = "smenu.viewpaymentterm.id"; - public static final String SMENU_GENERATE_COMMISSION_ID = "smenu.generatecommission.id"; - public static final String SMENU_VIEW_GENERATED_COMMISSION_ID = "smenu.viewgeneratedcommission.id"; - public static final String SMENU_VIEW_TAX="smenu.tax.id"; - public static final String SMENU_CREDITMEMOFROMPOS_ID="smenu.creditmemo.from.creditorder.id"; - public static final String SMENU_CREATE_UNALLOCATED_PAYMENT_ID="smenu.create.unallocated.payment.id"; - public static final String SMENU_CREDIT_MEMO_HISTORY_ID="smenu.credit.memo.history.id"; - - public static final String MODULE_NAME = "POS"; - - private static final String SMENU_CASH_SALES_NEW_ID = "smenu.cash.sales.new.id"; - private static final String SMENU_CASH_SALES_HISTORY_ID = "smenu.cash.sales.history.id"; - private static final String SMENU_CREDIT_SALES_HISTORY_ID = "smenu.credit.sales.history.id"; - private static final String SMENU_GOODSRECNOTEHISTORY_HISTORY_ID = "smenu.goods.received.note.history.id"; - private static final String SMENU_GOODSRETNOTEHISTORY_HISTORY_ID = "smenu.goods.returned.note.history.id"; - - private static final String SMENU_ADJUST_STOCK_ID = "smenu.adjust.stock.id"; - private static final String SMENU_INVENTORY_HISTORY_ID = "smenu.inventory.history.id"; - private static final String SMENU_ADJUST_INVENTORY_ID = "smenu.adjust.inventory.id"; - private static final String SMENU_TRANSFER_STOCK = "smenu.transfer.stock"; - private static final String SMENU_VIEW_PREFERENCES = "smenu.viewpreferences.id"; - private static final String SMENU_VIEW_BPARTNERS = "smenu.bpartners.id"; - private static final String SMENU_PRICE_CHECK = "smenu.price.check"; - private static final String SMENU_ORGANISATION = "smenu.organisation"; - - private static final String SMENU_POS_SALES_REPORT_ID = "smenu.pos.sales.report.id"; - private static final String SMENU_POS_PURCHASE_REPORT = "smenu.pos.purchase.report"; - private static final String SMENU_INVENTORY_MOVE = "smenu.inventory.move"; - private static final String SMENU_MOVE_CONFIRMATION = "smenu.move.confirmation"; - public static final String SMENU_BEST_SELLING_ITEMS = "smenu.best.selling.items"; - - public static final String SMENU_STOCK_SALES_REPORT = "smenu.stock.sales.report"; - - public static final String PMENU_HELP_ID="pmenu.help.id"; - public static final String SMENU_USER_MANUAL="smenu.user.manual"; - public static final String SMENU_CONTACTUS="smenu.contactus"; - private static final String SMENU_PRICE_LIST = "smenu.price.list"; - - private static final String PMENU_NEW_REPORTS_ID = "pmenu.new.reports.id"; - private static final String SMENU_REPORTS = "smenu.reports."; - - private static final String SMENU_CURRENCY = "smenu.currency"; - private static final String SMENU_DELETE_PRICE_ON_PRICELIST = "smenu.delete.price.on.pricelist"; - - public static final String SMENU_CASHBOOK = "smenu.cashbook"; - public static final String SMENU_TERMINAL = "smenu.terminal"; - - public static final String SMENU_SETTLE_GRN_PAYMENT_ID = "smenu.settle.grn.payment"; - public static final String SMENU_DEBTORS_ID = "smenu.debtors.id"; - public static final String SMENU_CREDITORS_ID = "smenu.creditors.id"; - private static final String SMENU_CREATE_UNALLOCATED_AP_PAYMENT_ID = "smenu.create.unallocated.ap.payment.id"; - public static final String SMENU_VIEW_AP_PAYMENT_ALLOCATION = "smenu.view.ap.payment.allocation.id"; - - - private static POSMenuFactory singleton; - - protected void loadFactory(Properties ctx) throws OperationException - { - loadFactory(ctx, singleton); - } - - @Override - protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException - { - loadCashSalesMenu(ctx, factory); - // new configuration functionality requires only one screen for all types of orders. :( - loadCreditSalesMenu(ctx, factory); - loadPurchasesMenu(ctx, factory); - loadPerformanceAnalysisMenu(ctx, factory); - loadStockMenu(ctx, factory); - loadAdministrationMenu(ctx, factory); - loadHelpMenu(ctx, factory); - loadReportsMenu(ctx, factory); - - } - - - public static POSMenuFactory getFactoryInstance(Properties ctx) throws OperationException - { - if (singleton == null) - singleton = new POSMenuFactory(); - - Properties nCtx = (Properties)ctx.clone(); - nCtx.setProperty(UdiConstants.CLIENT_ID_CTX_PARAM, "0"); - nCtx.setProperty(UdiConstants.ORG_ID_CTX_PARAM, "0"); - singleton.loadFactory(nCtx); - - return singleton; - } - - - private void loadCashSalesMenu(Properties ctx, AbstractFactory factory) throws OperationException - { - MWebMenu pmenu_sales = MenuManager.createParentMenu(ctx, "pmenu.cash.sales", MODULE_NAME, 1000); - pmenu_sales.setPosition(MENU_POSITION_TOP); - pmenu_sales.setImageLink("images/pos/buttons/button_order.gif"); - - factory.add(ctx, PMENU_SALES_ID, pmenu_sales); - pmenu_sales = (MWebMenu)factory.get(ctx, PMENU_SALES_ID); - - /*factory.add(ctx, SMENU_POSORDER_ID, - MenuManager.createSubMenu(ctx, "smenu.cash.sales.multiple.payments", - "CreatePOSOrder.do", - MODULE_NAME, pmenu_sales.get_ID(), 1010, "sales.order")); - */ - factory.add(ctx, SMENU_POSORDERWA_ID, - MenuManager.createSubMenu(ctx, "smenu.cash.sales", - "LoadOrderScreen.do?action=loadOrderScreen&"+Constants.IS_SOTRX+"=true&orderType=POS%20Order", - MODULE_NAME, pmenu_sales.get_ID(), 1010, "sales.order")); - - /*factory.add(ctx, SMENU_POSORDERQUICK, - MenuManager.createSubMenu(ctx, "smenu.quick.cash.sales", - "CreatePOSOrder3.do", - MODULE_NAME, pmenu_sales.get_ID(), 1030, "sales.order")); - - - factory.add(ctx, SMENU_POSORDERCUSTOMERCOMPULSORY, - MenuManager.createSubMenu(ctx, "smenu.cash.sales.customer.complusory", - "CreatePOSOrder2.do", - MODULE_NAME, pmenu_sales.get_ID(), 1040, "sales.order"));*/ - - factory.add(ctx, SMENU_CASH_SALES_HISTORY_ID, - MenuManager.createSubMenu(ctx, "smenu.cash.sales.history", - "ViewPOSHistoryAction.do?action=getPOSHistory&orderType="+UDIOrderTypes.POS_ORDER.getOrderType(), - MODULE_NAME, pmenu_sales.get_ID(), 1050, "sales.order")); - - /*factory.add(ctx, SMENU_CASH_SALES_NEW_ID, - MenuManager.createSubMenu(ctx, "smenu.cash.sales.new", - "CreatePOSOrderScreen.do", - factory.add(ctx, SMENU_POSPARTIALORDER_ID, - MenuManager.createSubMenu(ctx, "smenu.prepare.order", - "CreatePartialPOSOrder.do", - MODULE_NAME, pmenu_sales.get_ID(), 1060, "prepared.order")); - - factory.add(ctx, SMENU_INVOKEPOSPARTIALORDER_ID, - MenuManager.createSubMenu(ctx, "smenu.complete.prepared.order", - "InvokePartialPOSOrder.do", - MODULE_NAME, pmenu_sales.get_ID(), 1070, "prepared.order")); - - factory.add(ctx, SMENU_POSPARTIALHISTORYORDER_ID, - MenuManager.createSubMenu(ctx, "smenu.prepared.order.history", - "ViewPartialPOSOrderHistoryAction.do?action=initPartialPOSHistory", - MODULE_NAME, pmenu_sales.get_ID(), 1080, "prepared.order")); - ;*/ - - factory.add(ctx, SMENU_CUSTRETORDER_ID, - MenuManager.createSubMenu(ctx, "smenu.customer.returned.order", - "LoadOrderScreen.do?action=loadOrderScreen&"+Constants.IS_SOTRX+"=true&orderType=Customer%20Returned%20Order", - MODULE_NAME, pmenu_sales.get_ID(), 1090,"returned.order")); - - factory.add(ctx, SMENU_CUSTOMER_RETURN_HISTORY_ID, - MenuManager.createSubMenu(ctx, "smenu.customer.return.history.id", - "ViewPOSHistoryAction.do?action=getPOSHistory&orderType=Customer%20Returned%20Order", - MODULE_NAME, pmenu_sales.get_ID(), 1170, "returned.order")); - - factory.add(ctx, SMENU_CUSTRETOREDRFROMPOS_ID, - MenuManager.createSubMenu(ctx, "smenu.invoke.customer.returned.order", - "GetCustomerReturnFromPOS.do", - MODULE_NAME, pmenu_sales.get_ID(), 1100,"returned.order")); - - - factory.add(ctx, SMENU_CURRENTTILLAMOUNT_ID, - MenuManager.createSubMenu(ctx, "smenu.current.money.in.terminal", - "GetCurrentTillAmount.do?action=getCurrentTillAmount", - MODULE_NAME, pmenu_sales.get_ID(), 1110,"till.management")); - - factory.add(ctx, SMENU_ADJUST_CASH_BOOK, - MenuManager.createSubMenu(ctx, "smenu.adjust.cashbook", - "AdjustCashBook.do", - MODULE_NAME, pmenu_sales.get_ID(), 1120,"cash.book")); - - factory.add(ctx, SMENU_PERIODICASHBOOKDETAILS, - MenuManager.createSubMenu(ctx, "smenu.cashbook.report", - "CashSummaryDate.do", - MODULE_NAME, pmenu_sales.get_ID(), 1130,"cash.book")); - - factory.add(ctx, SMENU_CASHBOOKREPORT, - MenuManager.createSubMenu(ctx, "smenu.cashbook.history", - "CashReportAction.do?action=initGetCashDetailsHistory", - MODULE_NAME, pmenu_sales.get_ID(), 1140,"cash.book")); - - factory.add(ctx, SMENU_CLOSE_POS_TILL, - MenuManager.createSubMenu(ctx, "smenu.close.till", - "InitClosePOSTillAction.do?action=initCloseTill", - MODULE_NAME, pmenu_sales.get_ID(), 1150,"till.management")); - - factory.add(ctx, SMENU_OPEN_CASH_DRAWER, - MenuManager.createSubMenu(ctx, "smenu.open.cashdrawer", - "javascript:openCashDrawer();", - MODULE_NAME, pmenu_sales.get_ID(), 1160,"till.management")); - - - } - - private void loadCreditSalesMenu(Properties ctx, AbstractFactory factory) throws OperationException - { - MWebMenu pmenu_creditsales = MenuManager.createParentMenu(ctx, "pmenu.credit.sales", MODULE_NAME, 2000); - pmenu_creditsales.setPosition(MENU_POSITION_TOP); - pmenu_creditsales.setImageLink("images/pos/buttons/button_order.gif"); - - factory.add(ctx, PMENU_CREDITSALES_ID, pmenu_creditsales); - pmenu_creditsales = (MWebMenu)factory.get(ctx, PMENU_CREDITSALES_ID); - - /*factory.add(ctx, SMENU_CREDITORDER_ID, - MenuManager.createSubMenu(ctx, "smenu.credit.sales", - "CreditSales.do", - MODULE_NAME, pmenu_creditsales.get_ID(), 2010));*/ - - factory.add(ctx, SMENU_CREDITMEMOFROMPOS_ID, - MenuManager.createSubMenu(ctx, "smenu.creditmemo.from.creditorder.id", - "InvokeCreditOrder.do", - MODULE_NAME, pmenu_creditsales.get_ID(), 2010)); - - factory.add(ctx, SMENU_CREDIT_MEMO_HISTORY_ID, - MenuManager.createSubMenu(ctx, "smenu.credit.memo.history.id", - "ViewPOSHistoryAction.do?action=getPOSHistory&orderType="+UDIOrderTypes.CREDIT_MEMO.getOrderType(), - MODULE_NAME, pmenu_creditsales.get_ID(), 2020)); - - factory.add(ctx, SMENU_SETTLE_PAYMENT_ID, - MenuManager.createSubMenu(ctx, "smenu.settle.payment.credit.sales", - "InitGetBpartnerPaymentStatus.do?action=initGetBpartnerPaymentStatus", - MODULE_NAME, pmenu_creditsales.get_ID(), 2030)); - - factory.add(ctx, SMENU_PRINT_DUNNING_LETTERS_ID, - MenuManager.createSubMenu(ctx, "smenu.dunning.letters", - "InitPrintDunningAction.do?action=initPrintDunning", - MODULE_NAME, pmenu_creditsales.get_ID(), 2040)); - - - factory.add(ctx, SMENU_VIEW_PAYMENT_ALLOCATION, - MenuManager.createSubMenu(ctx, "smenu.payment.allocation.history", - "ViewPaymentAllocation.do", - MODULE_NAME, pmenu_creditsales.get_ID(), 2050)); - - factory.add(ctx, SMENU_CREDIT_SALES_HISTORY_ID, - MenuManager.createSubMenu(ctx, "smenu.credit.sales.history", - "ViewPOSHistoryAction.do?action=getPOSHistory&orderType=" + UDIOrderTypes.CREDIT_ORDER.getOrderType(), - MODULE_NAME, pmenu_creditsales.get_ID(), 2060)); - - factory.add(ctx, SMENU_CREATE_UNALLOCATED_PAYMENT_ID, - MenuManager.createSubMenu(ctx, "smenu.create.unallocated.payment.id", - "CreateUnallocatedPayment.do", - MODULE_NAME, pmenu_creditsales.get_ID(), 2070)); - - factory.add(ctx, SMENU_DEBTORS_ID, - MenuManager.createSubMenu(ctx, "smenu.debtors.id", - "CreditorDebtorAction.do?action=getDebtors", - MODULE_NAME, pmenu_creditsales.get_ID(), 2080)); - } - - - private void loadPurchasesMenu(Properties ctx, AbstractFactory factory) throws OperationException - { - MWebMenu pmenu_purchases = MenuManager.createParentMenu(ctx, "pmenu.purchases", MODULE_NAME, 3000); - pmenu_purchases.setPosition(MENU_POSITION_TOP); - pmenu_purchases.setImageLink("images/pos/buttons/button_order.gif"); - - factory.add(ctx, PMENU_PURCHASES_ID, pmenu_purchases); - pmenu_purchases = (MWebMenu)factory.get(ctx, PMENU_PURCHASES_ID); - - factory.add(ctx, SMENU_POSGOODRECNOTE_ID, - MenuManager.createSubMenu(ctx, "smenu.goods.received.note", - "LoadOrderScreen.do?action=loadOrderScreen&"+Constants.IS_SOTRX+"=false&orderType=POS%20Goods%20Receive%20Note", - MODULE_NAME, pmenu_purchases.get_ID(), 3010)); - - factory.add(ctx, SMENU_POSGOODRETNOTE_ID, - MenuManager.createSubMenu(ctx, "smenu.goods.returned.note", - "LoadOrderScreen.do?action=loadOrderScreen&"+Constants.IS_SOTRX+"=false&orderType=POS%20Goods%20Returned%20Note", - MODULE_NAME, pmenu_purchases.get_ID(), 3020)); - - factory.add(ctx, SMENU_GOODSRECNOTEHISTORY_HISTORY_ID, - MenuManager.createSubMenu(ctx, "smenu.goods.received.note.history", - "ViewPOSHistoryAction.do?action=getPOSHistory&orderType=POS%20Goods%20Receive%20Note", - MODULE_NAME, pmenu_purchases.get_ID(), 3030)); - - factory.add(ctx, SMENU_GOODSRETNOTEHISTORY_HISTORY_ID, - MenuManager.createSubMenu(ctx, "smenu.goods.returned.note.history", - "ViewPOSHistoryAction.do?action=getPOSHistory&orderType=POS%20Goods%20Returned%20Note", - MODULE_NAME, pmenu_purchases.get_ID(), 3040)); - - factory.add(ctx, SMENU_SETTLE_GRN_PAYMENT_ID, - MenuManager.createSubMenu(ctx, "smenu.settle.payment.credit.purchase", - "InitGetBpartnerPaymentStatus.do?action=initGetCreditorPaymentStatus", - MODULE_NAME, pmenu_purchases.get_ID(), 3050)); - - factory.add(ctx, SMENU_CREDITORS_ID, - MenuManager.createSubMenu(ctx, "smenu.creditors.id", - "CreditorDebtorAction.do?action=getCreditors", - MODULE_NAME, pmenu_purchases.get_ID(), 3060)); - - factory.add(ctx, SMENU_CREATE_UNALLOCATED_AP_PAYMENT_ID, - MenuManager.createSubMenu(ctx, "smenu.create.unallocated.ap.payment.id", - "CreateUnallocatedAPPayment.do", - MODULE_NAME, pmenu_purchases.get_ID(), 3070)); - - factory.add(ctx, SMENU_VIEW_AP_PAYMENT_ALLOCATION, - MenuManager.createSubMenu(ctx, "smenu.ap.payment.allocation.history", - "ViewAPPaymentAllocation.do", - MODULE_NAME, pmenu_purchases.get_ID(), 3080)); - - - } - - - - private void loadPerformanceAnalysisMenu(Properties ctx, AbstractFactory factory) throws OperationException - { - MWebMenu pmenu_reports = MenuManager.createParentMenu(ctx, "pmenu.performance.analysis", MODULE_NAME, 4000); - pmenu_reports.setPosition(MENU_POSITION_TOP); - pmenu_reports.setImageLink("images/pos/buttons/button_reports.gif"); - - factory.add(ctx, PMENU_REPORTS_ID, pmenu_reports); - pmenu_reports = (MWebMenu)factory.get(ctx, PMENU_REPORTS_ID); - - factory.add(ctx, SMENU_CUSTSALESREPORT, - MenuManager.createSubMenu(ctx, "smenu.performance.analysis.report", - "CustomPOSReportAction.do?action=initCustomReport", - MODULE_NAME, pmenu_reports.get_ID(), 4010)); - - - factory.add(ctx, SMENU_POSINFO_ID, - MenuManager.createSubMenu(ctx, "smenu.sales.report.per.terminal", - "POSInfoReport.do", - MODULE_NAME, pmenu_reports.get_ID(), 4020)); - - factory.add(ctx, SMENU_ORDERHISTORY_ID, - MenuManager.createSubMenu(ctx, "smenu.order.history", - "InitPOSHistoryAction.do?action=initPOSHistory", - MODULE_NAME, pmenu_reports.get_ID(), 4030)); - - - factory.add(ctx, SMENU_DOCUMENTHISTORY_ID, - MenuManager.createSubMenu(ctx, "smenu.document.history", - "DocumentHistoryAction.do?action=initHistory", - MODULE_NAME, pmenu_reports.get_ID(), 4040)); - - factory.add(ctx, SMENU_VIEW_BPINFO, - MenuManager.createSubMenu(ctx, "smenu.bpartner.sales.details", - "ViewBPartnerInfoAction.do?action=getBpartnerInfo", - MODULE_NAME, pmenu_reports.get_ID(), 4050)); - - factory.add(ctx, SMENU_POS_SALES_REPORT_ID, - MenuManager.createSubMenu(ctx, "smenu.sales.report", - "SalesReport.do?action=getSalesReport&isSalesReport=true", - MODULE_NAME, pmenu_reports.get_ID(), 4060)); - - factory.add(ctx, SMENU_BEST_SELLING_ITEMS, - MenuManager.createSubMenu(ctx, SMENU_BEST_SELLING_ITEMS, - "POSReportAction.do?action=initBestSellingReport", - MODULE_NAME, pmenu_reports.get_ID(), 4070)); - - factory.add(ctx, SMENU_STOCK_SALES_REPORT, - MenuManager.createSubMenu(ctx, SMENU_STOCK_SALES_REPORT, - "ViewStockSales.do", - MODULE_NAME, pmenu_reports.get_ID(), 4080)); - - factory.add(ctx, SMENU_POS_PURCHASE_REPORT, - MenuManager.createSubMenu(ctx, SMENU_POS_PURCHASE_REPORT, - "SalesReport.do?action=getSalesReport&isSalesReport=false", - MODULE_NAME, pmenu_reports.get_ID(), 4090)); - - } - - - - private void loadStockMenu(Properties ctx, AbstractFactory factory) throws OperationException - { - MWebMenu pmenu_stock = MenuManager.createParentMenu(ctx, "pmenu.stock", MODULE_NAME, 5000); - pmenu_stock.setPosition(MENU_POSITION_TOP); - pmenu_stock.setImageLink("images/pos/buttons/button_order.gif"); - - factory.add(ctx, PMENU_STOCK_ID, pmenu_stock); - pmenu_stock = (MWebMenu)factory.get(ctx, PMENU_STOCK_ID); - - factory.add(ctx, SMENU_POSSTOCKMOV, - MenuManager.createSubMenu(ctx, "smenu.stock.movement", - "StockMovementReport.do", - MODULE_NAME, pmenu_stock.get_ID(), 5010)); - - - factory.add(ctx, SMENU_MYSTOCK_ID, - MenuManager.createSubMenu(ctx, "smenu.stock", - "GetPOSStockAction.do?action=initPOSStock", - MODULE_NAME, pmenu_stock.get_ID(), 5020)); - - - factory.add(ctx, SMENU_FASTMOVITEMS, - MenuManager.createSubMenu(ctx, "smenu.fast.moving.items", - "CustomFastMovingItemsReport.do", - MODULE_NAME, pmenu_stock.get_ID(), 5030)); - - factory.add(ctx, SMENU_SLOWMOVITEMS, - MenuManager.createSubMenu(ctx, "smenu.slow.moving.items", - "CustomSlowMovingItemsReport.do", - MODULE_NAME, pmenu_stock.get_ID(), 5040)); - - factory.add(ctx, SMENU_ADJUST_STOCK_ID, - MenuManager.createSubMenu(ctx, "smenu.adjust.stock.id", - "InventoryCartAction.do?action=newInventoryCart", - MODULE_NAME, pmenu_stock.get_ID(), 5040)); - - factory.add(ctx, SMENU_INVENTORY_HISTORY_ID, - MenuManager.createSubMenu(ctx, "smenu.inventory.history.id", - "ViewInventoryHistoryAction.do?action=viewInventoryHistory", - MODULE_NAME, pmenu_stock.get_ID(), 5050)); - - factory.add(ctx, SMENU_TRANSFER_STOCK, - MenuManager.createSubMenu(ctx, "smenu.transfer.stock", - "ViewStock.do?action=viewStock", - MODULE_NAME, pmenu_stock.get_ID(), 5060)); - - factory.add(ctx, SMENU_INVENTORY_MOVE, - MenuManager.createSubMenu(ctx, "smenu.inventory.move", - "StockMovementAction.do?action=viewMMovementHistory", - MODULE_NAME, pmenu_stock.get_ID(), 5070)); - - factory.add(ctx, SMENU_MOVE_CONFIRMATION, - MenuManager.createSubMenu(ctx, "smenu.move.confirmation", - "StockMovementAction.do?action=viewMoveConfirm", - MODULE_NAME, pmenu_stock.get_ID(), 5080)); - - } - - - private void loadAdministrationMenu(Properties ctx, AbstractFactory factory) throws OperationException - { - MWebMenu pmenu_administration = MenuManager.createParentMenu(ctx, "pmenu.administration", MODULE_NAME, 6000); - pmenu_administration.setPosition(MENU_POSITION_TOP); - pmenu_administration.setImageLink("images/pos/buttons/button_administration.gif"); - - factory.add(ctx, PMENU_ADMINISTRATION_ID, pmenu_administration); - pmenu_administration = (MWebMenu)factory.get(ctx, PMENU_ADMINISTRATION_ID); - - factory.add(ctx, SMENU_CUSTOMER, - MenuManager.createSubMenu(ctx, "smenu.customers", - //"ViewAllCustomers.do", - "POSCustomerAction.do?action=initSearchPOSCustomer", - MODULE_NAME, pmenu_administration.get_ID(), 6010)); - - factory.add(ctx, SMENU_CREATEVENDOR_ID, - MenuManager.createSubMenu(ctx, "smenu.vendors", - "SearchVendor.do?action=initSearchVendors", - MODULE_NAME, pmenu_administration.get_ID(), 6020)); - - - factory.add(ctx, SMENU_USER_ID, - MenuManager.createSubMenu(ctx, "smenu.users", - "ListPOSUsers.do", - MODULE_NAME, pmenu_administration.get_ID(), 6030)); - - - factory.add(ctx, SMENU_VIEWROLE_ID, - MenuManager.createSubMenu(ctx, "smenu.role", - "ListPOSRoles.do", - MODULE_NAME, pmenu_administration.get_ID(), 6040)); - - - factory.add(ctx, SMENU_PRODUCTS, - MenuManager.createSubMenu(ctx, "smenu.products", - "ViewAllPOSProduct.do", - MODULE_NAME, pmenu_administration.get_ID(), 6050)); - - factory.add(ctx, SMENU_BARCODE_PRINTING, - MenuManager.createSubMenu(ctx, SMENU_BARCODE_PRINTING, - "initProductBarcodeCart.do", - MODULE_NAME, pmenu_administration.get_ID(), 6060)); - - factory.add(ctx, SMENU_EDIT_ATTRIBUTE_VALUE, - MenuManager.createSubMenu(ctx, "smenu.edit.product.attribute.value", - "InitViewAttributesAction.do?action=initViewAttributeValues", - MODULE_NAME, pmenu_administration.get_ID(), 6070)); - - - factory.add(ctx, SMENU_CHECK_SEQUENCE, - MenuManager.createSubMenu(ctx, "smenu.check.repair.database.integrity", - "CheckSequenceAction.do?action=checkSequence", - MODULE_NAME, pmenu_administration.get_ID(), 6080)); - - - factory.add(ctx, SMENU_GENERATE_COMMISSION_ID, - MenuManager.createSubMenu(ctx, "smenu.generate.commission", - "GenerateCommission.do", - MODULE_NAME, pmenu_administration.get_ID(), 6090)); - - factory.add(ctx, SMENU_VIEW_GENERATED_COMMISSION_ID, - MenuManager.createSubMenu(ctx, "smenu.view.last.generated.commission", - "ViewCommissionAction.do?action=viewCommission", - MODULE_NAME, pmenu_administration.get_ID(), 6100)); - - factory.add(ctx, SMENU_VIEW_PAYMENT_TERM, - MenuManager.createSubMenu(ctx, "smenu.payment.term", - "ViewAllPaymentTermAction.do?action=viewAllPaymentTerms", - MODULE_NAME, pmenu_administration.get_ID(), 6110)); - - factory.add(ctx, SMENU_VIEW_TAX, - MenuManager.createSubMenu(ctx, "smenu.tax", - "TaxAction.do?action=viewAllTax", - MODULE_NAME, pmenu_administration.get_ID(), 6120)); - - factory.add(ctx, SMENU_VIEW_PREFERENCES, - MenuManager.createSubMenu(ctx, "smenu.preferences", - "ViewPreferences.do", - MODULE_NAME, pmenu_administration.get_ID(), 6130)); - - factory.add(ctx, SMENU_VIEW_BPARTNERS, - MenuManager.createSubMenu(ctx, "smenu.bpartners", - "BusinessPartners.do", - MODULE_NAME, pmenu_administration.get_ID(), 6140)); - - factory.add(ctx, SMENU_PRICE_CHECK, - MenuManager.createSubMenu(ctx, "smenu.price.check", - "PriceCheck.do", - MODULE_NAME, pmenu_administration.get_ID(), 6150)); - - factory.add(ctx, SMENU_ORGANISATION, - MenuManager.createSubMenu(ctx, "smenu.organisation", - "ListOrgs.do", - MODULE_NAME, pmenu_administration.get_ID(), 6160)); - - factory.add(ctx, SMENU_PRICE_LIST, - MenuManager.createSubMenu(ctx, SMENU_PRICE_LIST, - "ListPriceLists.do", - MODULE_NAME, pmenu_administration.get_ID(), 6170)); - - factory.add(ctx, SMENU_CURRENCY, - MenuManager.createSubMenu(ctx, SMENU_CURRENCY, - "ListCurrencies.do", - MODULE_NAME, pmenu_administration.get_ID(), 6180)); - - factory.add(ctx, SMENU_DELETE_PRICE_ON_PRICELIST, - MenuManager.createSubMenu(ctx, SMENU_DELETE_PRICE_ON_PRICELIST, - "PriceListAction.do?action=fromDeletePriceOnPriceList", - MODULE_NAME, pmenu_administration.get_ID(), 6190)); - - factory.add(ctx, SMENU_CASHBOOK, - MenuManager.createSubMenu(ctx, SMENU_CASHBOOK, - "SearchCashBookAction.do?action=initSearchCashBook", - MODULE_NAME, pmenu_administration.get_ID(), 6200)); - - factory.add(ctx, SMENU_TERMINAL, - MenuManager.createSubMenu(ctx, SMENU_TERMINAL, - "SearchTerminalAction.do?action=initSearchTerminal", - MODULE_NAME, pmenu_administration.get_ID(), 6210)); - } - - //---------------------------------------------------------------------// - private void loadHelpMenu(Properties ctx, AbstractFactory factory) throws OperationException - { - MWebMenu pmenu_help = MenuManager.createParentMenu(ctx, "pmenu.help", MODULE_NAME, 7000); - pmenu_help.setPosition(MENU_POSITION_TOP); - pmenu_help.setImageLink("images/pos/buttons/button_order.gif"); - - factory.add(ctx, PMENU_HELP_ID, pmenu_help); - pmenu_help = (MWebMenu)factory.get(ctx, PMENU_HELP_ID); - - factory.add(ctx, SMENU_USER_MANUAL, - MenuManager.createSubMenu(ctx, SMENU_USER_MANUAL, - "javascript:void window.open(\"http://www.posterita.org/mediawiki/index.php/User%60s_Manual\")", - MODULE_NAME, pmenu_help.get_ID(), 7010)); - - - factory.add(ctx, SMENU_CONTACTUS, - MenuManager.createSubMenu(ctx, SMENU_CONTACTUS, - "POSHelpAction.do?action=initContactUs", - MODULE_NAME, pmenu_help.get_ID(), 7020)); - } - - /** - * Reports are loaded based on the process access defined for a particular role. - * @param ctx context - * @param factory abstract factory - * @throws OperationException - */ - private void loadReportsMenu(Properties ctx, AbstractFactory factory) throws OperationException - { - MWebMenu pmenu_reports= MenuManager.createParentMenu(ctx, "pmenu.new.reports", MODULE_NAME, 8000); - pmenu_reports.setPosition(MENU_POSITION_TOP); - pmenu_reports.setImageLink("images/pos/buttons/button_order.gif"); - - factory.add(ctx,PMENU_NEW_REPORTS_ID, pmenu_reports); - pmenu_reports = (MWebMenu)factory.get(ctx, PMENU_NEW_REPORTS_ID); - - ArrayList processIds = POSReportManager.loadReports(ctx); - int sequence = 8010; - for (Integer id: processIds) - { - MProcess process = MProcess.get(ctx, id); - String menuName = process.getName(); - - factory.add(ctx, menuName, MenuManager.createSubMenu(ctx, menuName, - "GenerateReportAction.do?action=generateReportInput&processId=" + id, - MODULE_NAME, pmenu_reports.get_ID(), sequence)); - sequence += 10; - } -} - - public PO get(Properties ctx, String key) throws OperationException - { - Properties nCtx = (Properties)ctx.clone(); - Env.setContext(nCtx, UdiConstants.CLIENT_ID_CTX_PARAM, "0"); - Env.setContext(nCtx, UdiConstants.ORG_ID_CTX_PARAM, "0"); - return super.get(nCtx, key); - } - - protected void setFields(Properties ctx, PO fromPO, PO toPO) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException - { - MWebMenu fromUMenu = (MWebMenu)fromPO; - MWebMenu toUMenu = (MWebMenu)toPO; - - toUMenu.setMenuLink(fromUMenu.getMenuLink()); - toUMenu.setName(fromUMenu.getName()); - toUMenu.setHasSubMenu(fromUMenu.isHasSubMenu()); - toUMenu.setModule(fromUMenu.getModule()); - toUMenu.setParentMenu_ID(fromUMenu.getParentMenu_ID()); - toUMenu.setImageLink(fromUMenu.getImageLink()); - toUMenu.setIsActive(fromUMenu.isActive()); - toUMenu.setPosition(fromUMenu.getPosition()); - toUMenu.setCategory(fromUMenu.getCategory()); - toUMenu.setSequence(fromUMenu.getSequence()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/factory/ProcessFactory.java b/posterita/posterita/src/main/org/posterita/factory/ProcessFactory.java deleted file mode 100644 index 6f995b8c7a..0000000000 --- a/posterita/posterita/src/main/org/posterita/factory/ProcessFactory.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 6, 2005 by vishee - */ - -package org.posterita.factory; - -import java.util.Properties; - -import org.compiere.model.MProcess; -import org.compiere.process.SvrProcess; -import org.posterita.exceptions.OperationException; - - - -public class ProcessFactory extends AbstractFactory -{ - - - private static ProcessFactory singleton; - - - private ProcessFactory() throws OperationException - { - super(); - - } - - public static ProcessFactory getFactoryInstance(Properties ctx) throws Exception - { - if (singleton ==null) - singleton = new ProcessFactory(); - - return singleton; - } - - - protected void loadFactory(Properties ctx) throws OperationException - { - loadFactory(ctx, singleton); - } - - - - /* - * key - the value retrieved from properties file for the name of the process - * className - the class from which the process will run (eg com.mu.process.MyProcess where MyProcess is the java file) - */ - private MProcess createProcess(Properties ctx, String className) throws OperationException - { - - MProcess mProcess = new MProcess(ctx,0, null); - mProcess.setClassname(className); - mProcess.setDescription(className); - mProcess.setName(className); - mProcess.setValue(className); - - - return mProcess; - - } - - public SvrProcess getSvrProcess(Properties ctx,String key) throws Exception - { - MProcess p = (MProcess) singleton.get(ctx, key); - Object arr[] = {}; - SvrProcess process = (SvrProcess) Class.forName(p.getClass().getName()).getConstructors()[0].newInstance(arr); // use better reflection - return process; - } - - @Override - protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException - { - // TODO Auto-generated method stub - - } -} diff --git a/posterita/posterita/src/main/org/posterita/factory/SystemObjectsFactory.java b/posterita/posterita/src/main/org/posterita/factory/SystemObjectsFactory.java deleted file mode 100644 index 26af960e4a..0000000000 --- a/posterita/posterita/src/main/org/posterita/factory/SystemObjectsFactory.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.factory; - -import java.util.Properties; - -import org.compiere.model.MTax; -import org.compiere.model.MTaxCategory; -import org.posterita.core.SystemObjects; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ReloadFactoryException; -import org.posterita.lib.UdiConstants; - - -public class SystemObjectsFactory extends AbstractFactory -{ - public static final String DEFAULT_TAX_ID = "tax.default.id"; - public static final String TAX_CATEGORY_DEFAULT_ID = "taxCategory.default.id"; - private static SystemObjectsFactory systemObjectsFactory; - - private SystemObjectsFactory() throws OperationException - { - - } - - public static SystemObjectsFactory getFactoryInstance() throws OperationException - { - if (systemObjectsFactory == null) - systemObjectsFactory = new SystemObjectsFactory(); - - return systemObjectsFactory; - } - - - protected void loadFactory(Properties ctx) throws OperationException - { - loadFactory(ctx, systemObjectsFactory); - } - - protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException - { - factory.add(ctx, TAX_CATEGORY_DEFAULT_ID, SystemObjects.getTaxCategory(ctx, "Default Tax Category")); - MTaxCategory taxCategory = (MTaxCategory) factory.get(ctx, TAX_CATEGORY_DEFAULT_ID); - - MTax tax = SystemObjects.getTax(ctx, "Udi tax", UdiConstants.COUNTRY_MAURITIUS, "default udi tax"); - tax.setC_TaxCategory_ID(taxCategory.get_ID()); - factory.add(ctx, DEFAULT_TAX_ID, tax); - } - - public static void reloadFactory(Properties ctx) throws ReloadFactoryException - { - try - { - SystemObjectsFactory nFactory = new SystemObjectsFactory(); - nFactory.initFactory(ctx, nFactory); - systemObjectsFactory = nFactory; - } - catch(OperationException ex) - { - throw new ReloadFactoryException("Could not reload SystemObjectsFactory", ex); - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/factory/UserFactory.java b/posterita/posterita/src/main/org/posterita/factory/UserFactory.java deleted file mode 100644 index dea71b99b6..0000000000 --- a/posterita/posterita/src/main/org/posterita/factory/UserFactory.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.factory; - -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MOrg; -import org.compiere.model.MUser; -import org.compiere.model.PO; -import org.compiere.util.Env; -import org.posterita.core.SystemObjects; -import org.posterita.exceptions.OperationException; - - -public class UserFactory extends AbstractFactory -{ - private static UserFactory singleton; - - public static final String SUPER_USER_ID = "superUser.id"; - public static String UDI_ADMIN_ID = "udiAdmin.id"; - public static String HSAFAUTO_ADMIN_ID = "hsafAuto.admin.id"; - public static String HSAFWING_ADMIN_ID = "hsafWing.Admin.id"; - - private UserFactory() throws OperationException - { - - } - - public static UserFactory getFactoryInstance() throws OperationException - { - if (singleton == null) - singleton = new UserFactory(); - - return singleton; - } - - protected void loadFactory(Properties ctx) throws OperationException - { - loadFactory(ctx, singleton); - } - - protected void loadFactory(Properties ctx, AbstractFactory factory) throws OperationException - { - factory.add(ctx, SUPER_USER_ID, createUser(ctx, SystemObjects.getSuperUser(ctx))); - // singleton.add(UDI_ADMIN_ID, createUser(ctx, SystemObjects.getUdiAdmin(ctx))); - // singleton.add(HSAFAUTO_ADMIN_ID, createUser(ctx, SystemObjects.getHsafAuto(ctx))); - // singleton.add(HSAFWING_ADMIN_ID, createUser(ctx, SystemObjects.getHsafWing(ctx))); - - } - - private PO createUser(Properties ctx, MUser mUser) throws OperationException - { - MUser user = new MUser(ctx, 0, null); - user.setName(mUser.getName()); - user.setPassword(mUser.getPassword()); - user.setEMail(mUser.getEMail()); - - int ad_org_id = Env.getAD_Org_ID(ctx); - MOrg org = new MOrg(ctx, ad_org_id, null); - - // Is it necessary, taking business partner of the organisation. - // Should create a bpartner for this user. - // DefaultUser, Should maybe call a manager here. - MBPartner bpartner = new MBPartner(ctx, org.getLinkedC_BPartner_ID(null), null); - - user.setC_BPartner_ID(bpartner.get_ID()); - - return user; - } -} diff --git a/posterita/posterita/src/main/org/posterita/factory/WebComponentFactory.java b/posterita/posterita/src/main/org/posterita/factory/WebComponentFactory.java deleted file mode 100644 index 11b787595f..0000000000 --- a/posterita/posterita/src/main/org/posterita/factory/WebComponentFactory.java +++ /dev/null @@ -1,290 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -package org.posterita.factory; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.apache.ecs.Element; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.label; -import org.apache.ecs.xhtml.option; -import org.apache.ecs.xhtml.script; -import org.apache.ecs.xhtml.select; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.Lookup; -import org.compiere.model.MProcessPara; -import org.compiere.model.MRefList; -import org.compiere.model.MRefTable; -import org.compiere.model.PO; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.ValueNamePair; -import org.posterita.businesslogic.administration.RoleManager; - -/** - * Factory to load a web component which corresponds to the display - * type of a process parameter and populates it with the appropriate - * values as per the constraints of the parameter. - * - * @author sendy - * - */ -public class WebComponentFactory -{ - - public static org.apache.ecs.Element getWebComponent(Properties ctx, MProcessPara parameter) throws Exception - { - Element element = null; - label name = new label().addElement(parameter.getName()); - td label = new td().addElement(name); - td editor = new td().setAlign("left"); - - - input textFrom = new input(input.TYPE_TEXT, parameter.getColumnName()+ "From", ""); - input textTo = new input(input.TYPE_TEXT, parameter.getColumnName() + "To", ""); - input text = new input(input.TYPE_TEXT, parameter.getColumnName(), ""); - - int displayType = parameter.getAD_Reference_ID(); - - if (DisplayType.isLookup(displayType) || DisplayType.isID(displayType)) - { - option[] options = getOptions(ctx, parameter); - select select = new select(parameter.getColumnName(), options); - editor = editor.addElement(select); - } - else if (displayType == DisplayType.YesNo) - { - input inputCheck = new input(input.TYPE_CHECKBOX, parameter.getColumnName(), "Y"); - editor = editor.addElement(inputCheck); - } - else if (DisplayType.isNumeric(displayType) - || displayType == DisplayType.String) // SENDYFIXME need to add calculator for numeric - { - if (parameter.isRange()) - { - editor = editor.addElement(textFrom).addElement("-").addElement(textTo); - } - else - { - editor = editor.addElement(text); - } - } - else if (DisplayType.isDate(displayType)) - { - if (parameter.isRange()) - { - String idFrom = textFrom.getAttribute("name"); - textFrom.setID(idFrom); - script scriptFrom = getScript(idFrom); - input calendarFromBtn = getCalendarBtn(idFrom); - editor = editor.addElement(textFrom).addElement(calendarFromBtn).addElement(scriptFrom).addElement("-"); - - String idTo = textTo.getAttribute("name"); - textTo.setID(idTo); - script scriptTo = getScript(idTo); - input calendarToBtn = getCalendarBtn(idTo); - - editor = editor.addElement(textTo).addElement(calendarToBtn).addElement(scriptTo); - } - else - { - String id = text.getAttribute("name"); - text.setID(id); - script script = getScript(id); - input calendarBtn = getCalendarBtn(id); - - editor = editor.addElement(text).addElement(calendarBtn).addElement(script); - } - } - else // FIXME need to cater for other display types such as locator, location, etc - { - editor = editor.addElement(text); - } - - td tdContent = label.addElement(editor); - element = new tr().addElement(tdContent); - return element; - } - - private static option[] getOptions(Properties ctx, MProcessPara parameter) - throws Exception - { - int displayType = parameter.getAD_Reference_ID(); - String columnName = parameter.getColumnName(); - String tableName = null; - String whereClause = null; - String orderBy = null; - option[] options = null; - - Lookup lookup = parameter.getLookup(); - if (displayType == DisplayType.Table || displayType == DisplayType.Search) - { - int refValueId = parameter.getAD_Reference_Value_ID(); - - if (refValueId != 0) - { - MRefTable refTable = getRefTable(ctx, parameter.getAD_Reference_Value_ID(), null); - tableName = refTable.getAD_Table().getTableName(); - whereClause = refTable.getWhereClause(); - String validation = lookup.getValidation(); - - if (validation != null && !validation.equals("")) - { - whereClause += " AND " + validation; - } - orderBy = refTable.getOrderByClause(); - } - else - { - tableName = columnName.substring(0, columnName.length() - 3); - } - } - else if (displayType == DisplayType.TableDir - || displayType == DisplayType.Locator - || displayType == DisplayType.Location) - { - tableName = columnName.substring(0, columnName.length() - 3); - } - - if (displayType != DisplayType.List) // get key name pair from table - { - ArrayList keyNamePair = getKeyNamePair(ctx, parameter, - tableName, whereClause, orderBy, null); - options = new option[keyNamePair.size() + 1]; - int count = 1; - options[0] = new option(null); - - for (KeyNamePair pair : keyNamePair) - { - options[count] = new option(pair.getName(), pair.getKey()); - options[count].addElement(pair.getName()); - count++; - } - } - else // get value name list - { - ValueNamePair[] refListVNP = MRefList.getList(ctx, parameter - .getAD_Reference_Value_ID(), false); - options = new option[refListVNP.length + 1]; - int count = 1; - options[0] = new option(null); - - for (ValueNamePair pair : refListVNP) - { - options[count] = new option(pair.getName(), pair.getValue()); - options[count].addElement(pair.getName()); - count++; - } - } - - return options; - } - - private static input getCalendarBtn(String id) - { - input calendarBtn = new input(input.TYPE_BUTTON, "", ""); - calendarBtn.setID(id + "Btn"); - calendarBtn.setClass("calendar-icon float-left"); - - return calendarBtn; - } - - private static script getScript(String id) - { - script s = new script("function setDate(calendar){};" - + "Calendar.setup({ inputField : '" + id - + "', ifFormat : '%Y-%m-%d',showTime : true," + "button : '" - + id + "Btn', onUpdate : setDate });"); - return s; - } - - private static MRefTable getRefTable(Properties ctx, - int reference_Value_ID, String trxName) - { - String sql = "SELECT * from AD_Ref_Table where AD_Reference_ID = " - + reference_Value_ID; - - PreparedStatement pstmt = null; - ResultSet rs = null; - MRefTable refTable = null; - try - { - pstmt = DB.prepareStatement(sql, trxName); - rs = pstmt.executeQuery(); - - if (rs.next()) - { - refTable = new MRefTable(ctx, rs, trxName); - } - } - catch (SQLException e) - { - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - return refTable; - } - - private static ArrayList getKeyNamePair(Properties ctx, - MProcessPara parameter, String tableName, String whereClause, - String orderBy, String trxName) - { - String orgs = RoleManager.getRoleViewableOrgAccess(ctx); - StringBuffer sql = new StringBuffer(); - - if (whereClause != null && !whereClause.equals("")) - { - sql.append(whereClause + " AND"); - } - sql.append(" isActive = 'Y'").append( - " AND AD_Client_ID IN (0," + Env.getAD_Client_ID(ctx) + ")") - .append(" AND AD_Org_ID IN (" + orgs + ")"); - - if (orderBy != null && !orderBy.equals("")) - { - sql.append(" Order by " + orderBy); - } - - int ids[] = PO.getAllIDs(tableName, sql.toString(), trxName); - ArrayList list = new ArrayList(); - - for (int id : ids) - { - Lookup lookup = parameter.getLookup(); - String value = lookup.getDisplay(id); - KeyNamePair pair = new KeyNamePair(id, value); - list.add(pair); - } - return list; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/factory/WebProperties.java b/posterita/posterita/src/main/org/posterita/factory/WebProperties.java deleted file mode 100644 index f8e18d3df8..0000000000 --- a/posterita/posterita/src/main/org/posterita/factory/WebProperties.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 12-Oct-2005 - */ - - -package org.posterita.factory; - -import java.util.Properties; - -import org.posterita.exceptions.OperationException; - -public interface WebProperties -{ - public void put(Properties ctx, String key, String value) throws OperationException; - public String get(Properties ctx, String key) throws OperationException; - -} diff --git a/posterita/posterita/src/main/org/posterita/form/AttachmentForm.java b/posterita/posterita/src/main/org/posterita/form/AttachmentForm.java deleted file mode 100644 index 2fc2a45925..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/AttachmentForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Aug-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.AttachmentBean; -import org.posterita.struts.core.DefaultForm; - -public class AttachmentForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public AttachmentForm() - { - setBean(new AttachmentBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/AttributeForm.java b/posterita/posterita/src/main/org/posterita/form/AttributeForm.java deleted file mode 100644 index 15b0de8ca3..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/AttributeForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jun 15, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.AttributeBean; -import org.posterita.struts.core.DefaultForm; - - -public class AttributeForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public AttributeForm() - { - setBean(new AttributeBean()); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/AttributeValuesForm.java b/posterita/posterita/src/main/org/posterita/form/AttributeValuesForm.java deleted file mode 100644 index d838092163..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/AttributeValuesForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 23, 2006 by ashley -* -*/ - -package org.posterita.form; - -import org.posterita.beans.AttributeValueDetailBean; -import org.posterita.struts.core.DefaultForm; - -public class AttributeValuesForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public AttributeValuesForm() - { - setBean(new AttributeValueDetailBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/BPartnerForm.java b/posterita/posterita/src/main/org/posterita/form/BPartnerForm.java deleted file mode 100644 index 0629144804..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/BPartnerForm.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. POSTERITA SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * Aug 12, 2008 11:01:56 PM by praveen - * - */ - -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.BPartnerBean; -import org.posterita.struts.bPartner.BPartnerAction; -import org.posterita.struts.core.DefaultForm; - -public class BPartnerForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 7530406406407900075L; - - public BPartnerForm() - { - setBean(new BPartnerBean()); - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - if(BPartnerAction.GET_CREDITOR_HISTORY.equals(this.action)) - { - // add required fields here - } - - return super.validate(mapping, request); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/BPartnerInfoForm.java b/posterita/posterita/src/main/org/posterita/form/BPartnerInfoForm.java deleted file mode 100644 index 948ba2c066..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/BPartnerInfoForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 26, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.BPartnerInfoBean; -import org.posterita.struts.core.DefaultForm; - - -public class BPartnerInfoForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public BPartnerInfoForm() - { - setBean(new BPartnerInfoBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/BankForm.java b/posterita/posterita/src/main/org/posterita/form/BankForm.java deleted file mode 100644 index eea521bcd6..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/BankForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Jul-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.BankBean; -import org.posterita.struts.core.DefaultForm; - - -public class BankForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public BankForm() - { - setBean(new BankBean()); - addRequiredFields(new String[]{"bankName"}); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/BlackListForm.java b/posterita/posterita/src/main/org/posterita/form/BlackListForm.java deleted file mode 100644 index 1fada75b88..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/BlackListForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Jul-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.BlackListedBean; -import org.posterita.struts.core.DefaultForm; - - -public class BlackListForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public BlackListForm() - { - setBean(new BlackListedBean()); - //addRequiredFields(new String[] {"bankName", "chequeNo"}); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/CashBookDetailForm.java b/posterita/posterita/src/main/org/posterita/form/CashBookDetailForm.java deleted file mode 100644 index b236ffca39..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CashBookDetailForm.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 5, 2006 - */ - - -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.CashBookDetailBean; -import org.posterita.struts.core.DefaultForm; -import org.posterita.struts.pos.CashBookAction; - - -public class CashBookDetailForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public CashBookDetailForm() - { - setBean(new CashBookDetailBean()); - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - // Add validation to the form for cash book adjustment - if(CashBookAction.ADJUST_CASH_BOOK_ACTION.equals(action)) - { - addRequiredFields(new String[]{"adjustmentAmount", "transferType", "description"}); - } - - return super.validate(mapping, request); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/CashBookForm.java b/posterita/posterita/src/main/org/posterita/form/CashBookForm.java deleted file mode 100644 index 1a4c5b373a..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CashBookForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.form; - -import org.posterita.beans.CashBookBean; -import org.posterita.struts.core.DefaultForm; - -/** - * @author Ashley G Ramdass - * May 27, 2008 - */ -public class CashBookForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 5517080823330724822L; - - public CashBookForm() - { - super.setBean(new CashBookBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/CashForm.java b/posterita/posterita/src/main/org/posterita/form/CashForm.java deleted file mode 100644 index 9598d89877..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CashForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Sep 11, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.form; - -import org.posterita.beans.CashBean; -import org.posterita.struts.core.DefaultForm; - -public class CashForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public CashForm() - { - this.setBean(new CashBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/ChangeDocumentStatusForm.java b/posterita/posterita/src/main/org/posterita/form/ChangeDocumentStatusForm.java deleted file mode 100644 index 1ed9047bda..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ChangeDocumentStatusForm.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.form; - -import org.posterita.beans.ChangeDocumentStatusBean; -import org.posterita.struts.core.DefaultForm; - - -public class ChangeDocumentStatusForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ChangeDocumentStatusForm() - { - setBean(new ChangeDocumentStatusBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/ChangePasswordForm.java b/posterita/posterita/src/main/org/posterita/form/ChangePasswordForm.java deleted file mode 100644 index be5ac9d6be..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ChangePasswordForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 29, 2005 by din - */ - -package org.posterita.form; - -import org.posterita.beans.ChangePasswordBean; -import org.posterita.struts.core.DefaultForm; - -public class ChangePasswordForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public ChangePasswordForm() - { - setBean(new ChangePasswordBean()); - addRequiredFields(new String[] {"oldPassword","newPassword","confirmPassword"}); - addMatchFields("newPassword","confirmPassword"); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/CheckoutForm.java b/posterita/posterita/src/main/org/posterita/form/CheckoutForm.java deleted file mode 100644 index 30eeba0f46..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CheckoutForm.java +++ /dev/null @@ -1,310 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * Mar 21, 2008 10:32:47 AM by praveen - * - */ - -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.config.ActionConfig; -import org.posterita.beans.CheckoutBean; -import org.posterita.struts.core.DefaultForm; - -public class CheckoutForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1512494983524778853L; - private String amountTendered; - private String amountRefunded; - private String cardNo; - private String chequeNo; - private String cashAmt; - private String chequeAmt; - private String cardAmt; - private String bpartnerId; - private String tenderType; - private String[] discount; - private String[] discountedPrice; - private String[] isDiscOnInclUnitPrice; - private String[] discInclUnitPrice; - private String orderType; - private String discountLimit; - private String priceListId; - private String toBeShipped = "true"; - private String discountedTotal; - private String discountOnTotal; - private String discountOnTotalPercent; - private String overridePriceLimit; - private String totalDiscount; - private String[] isDiscOnPerc; - private String[] isDiscOnTotal; - private String[] qtyPerLine; - private String m_productId; - private String grandTotal; - - public CheckoutForm() - { - setBean(new CheckoutBean()); - } - - public void setRoleId(String roleId) { - this.roleId = roleId; - } - public String getRoleId() { - return roleId; - } - - public String getAmountTendered() { - return amountTendered; - } - public void setAmountTendered(String amountTendered) { - this.amountTendered = amountTendered; - } - public String getCardNo() { - return cardNo; - } - public void setCardNo(String cardNo) { - this.cardNo = cardNo; - } - public String getChequeNo() { - return chequeNo; - } - public void setChequeNo(String chequeNo) { - this.chequeNo = chequeNo; - } - public String getCashAmt() { - return cashAmt; - } - public void setCashAmt(String cashAmt) { - this.cashAmt = cashAmt; - } - public String getChequeAmt() { - return chequeAmt; - } - public void setChequeAmt(String chequeAmt) { - this.chequeAmt = chequeAmt; - } - public String getBpartnerId() { - return bpartnerId; - } - public void setBpartnerId(String bpartnerId) { - this.bpartnerId = bpartnerId; - } - public String getTenderType() { - return tenderType; - } - public void setTenderType(String tenderType) { - this.tenderType = tenderType; - } - - public String getOrderType() { - return orderType; - } - public void setOrderType(String orderType) { - this.orderType = orderType; - } - - public String getDiscountLimit() { - return discountLimit; - } - - public void setDiscountLimit(String discountLimit) { - this.discountLimit = discountLimit; - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - ActionConfig config = (ActionConfig) request.getAttribute("org.apache.struts.action.mapping.instance"); - if(config != null && input != null) - { - config.setInput(input); - } - - ActionErrors errors = super.validate(mapping, request); - - if(errors!=null && !errors.isEmpty()) - { - reset(mapping, request); - } - - return errors; - } - - public String[] getDiscount() { - return discount; - } - - public void setDiscount(String[] discount) { - this.discount = discount; - } - - public String getAmountRefunded() { - return amountRefunded; - } - - public void setAmountRefunded(String amountRefunded) { - this.amountRefunded = amountRefunded; - } - - public String getCardAmt() { - return cardAmt; - } - - public void setCardAmt(String cardAmt) { - this.cardAmt = cardAmt; - } - - public String[] getDiscountedPrice() { - return discountedPrice; - } - - public void setDiscountedPrice(String[] discountedPrice) { - this.discountedPrice = discountedPrice; - } - - public String getPriceListId() { - return priceListId; - } - - public void setPriceListId(String priceListId) { - this.priceListId = priceListId; - } - - public String getToBeShipped() { - return toBeShipped; - } - - public void setToBeShipped(String toBeShipped) { - this.toBeShipped = toBeShipped; - } - - public String getDiscountedTotal() { - return discountedTotal; - } - - public void setDiscountedTotal(String discountedTotal) { - this.discountedTotal = discountedTotal; - } - - public String getDiscountOnTotal() { - return discountOnTotal; - } - - public void setDiscountOnTotal(String discountOnTotal) { - this.discountOnTotal = discountOnTotal; - } - - public String getOverridePriceLimit() { - return overridePriceLimit; - } - - public void setOverridePriceLimit(String overridePriceLimit) { - this.overridePriceLimit = overridePriceLimit; - } - - public String getTotalDiscount() { - return totalDiscount; - } - - public void setTotalDiscount(String totalDiscount) { - this.totalDiscount = totalDiscount; - } - - public String[] getIsDiscOnInclUnitPrice() { - return isDiscOnInclUnitPrice; - } - - public void setIsDiscOnInclUnitPrice(String[] isDiscOnInclUnitPrice) { - this.isDiscOnInclUnitPrice = isDiscOnInclUnitPrice; - } - - public String[] getDiscInclUnitPrice() { - return discInclUnitPrice; - } - - public void setDiscInclUnitPrice(String[] discInclUnitPrice) { - this.discInclUnitPrice = discInclUnitPrice; - } - - public String[] getIsDiscOnPerc() - { - return isDiscOnPerc; - } - - public void setIsDiscOnPerc(String[] isDiscOnPerc) - { - this.isDiscOnPerc = isDiscOnPerc; - } - - public String[] getIsDiscOnTotal() - { - return isDiscOnTotal; - } - - public void setIsDiscOnTotal(String[] isDiscOnTotal) - { - this.isDiscOnTotal = isDiscOnTotal; - } - - public String[] getQtyPerLine() - { - return qtyPerLine; - } - - public void setQtyPerLine(String[] qtyPerLine) - { - this.qtyPerLine = qtyPerLine; - } - - public String getDiscountOnTotalPercent() { - return discountOnTotalPercent; - } - - public void setDiscountOnTotalPercent(String discountOnTotalPercent) { - this.discountOnTotalPercent = discountOnTotalPercent; - } - - public String getM_productId() - { - return m_productId; - } - - public void setM_productId(String id) - { - m_productId = id; - } - - public String getGrandTotal() - { - return grandTotal; - } - - public void setGrandTotal(String grandTotal) - { - this.grandTotal = grandTotal; - } - - - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/CommissionForm.java b/posterita/posterita/src/main/org/posterita/form/CommissionForm.java deleted file mode 100644 index a46ae818aa..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CommissionForm.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 7, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.CommissionBean; -import org.posterita.struts.core.DefaultForm; - - -public class CommissionForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public CommissionForm() - { - this.setBean(new CommissionBean()); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/CreateBPartnerForm.java b/posterita/posterita/src/main/org/posterita/form/CreateBPartnerForm.java deleted file mode 100644 index 6316cc2c5c..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CreateBPartnerForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.BPartnerBean; -import org.posterita.struts.core.DefaultForm; - - -public class CreateBPartnerForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public CreateBPartnerForm() - { - setBean( new BPartnerBean()); - addRequiredFields(new String[]{"partnerName","name2","address1"}); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/CreateBankAccountForm.java b/posterita/posterita/src/main/org/posterita/form/CreateBankAccountForm.java deleted file mode 100644 index 6ad931862f..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CreateBankAccountForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 26, 2005 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.BankAccountBean; -import org.posterita.struts.core.DefaultForm; - -public class CreateBankAccountForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CreateBankAccountForm() - { - setBean(new BankAccountBean()); - addRequiredFields(new String[]{"bankId","accountNo","accountType","currentBalance"}); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/CreateLocatorForm.java b/posterita/posterita/src/main/org/posterita/form/CreateLocatorForm.java deleted file mode 100644 index 9f6718e330..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CreateLocatorForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Jul-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.LocatorBean; -import org.posterita.struts.core.DefaultForm; - - -public class CreateLocatorForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CreateLocatorForm() - { - setBean(new LocatorBean()); - addRequiredFields(new String[]{"aisle","bin","level"}); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeForm.java b/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeForm.java deleted file mode 100644 index 14527546f7..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 28, 2005 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.ProductAttributeBean; -import org.posterita.struts.core.DefaultForm; - -public class CreateProductAttributeForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CreateProductAttributeForm() - { - setBean(new ProductAttributeBean()); - //addRequiredFields(new String[]{"attributeValue"}); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeValueForm.java b/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeValueForm.java deleted file mode 100644 index 8bf7f3d4a7..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CreateProductAttributeValueForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 28, 2005 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.ProductAttributeBean; -import org.posterita.struts.core.DefaultForm; - -public class CreateProductAttributeValueForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CreateProductAttributeValueForm() - { - setBean(new ProductAttributeBean()); - addRequiredFields(new String[]{"attributeValue"}); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/CreateUserForm.java b/posterita/posterita/src/main/org/posterita/form/CreateUserForm.java deleted file mode 100644 index ebfe66e927..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CreateUserForm.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 29, 2005 by din - */ - -package org.posterita.form; - -import org.posterita.beans.UserBean; -import org.posterita.struts.core.DefaultForm; - - - -public class CreateUserForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CreateUserForm() - { - setBean(new UserBean()); - addRequiredFields(new String[]{"username", "password", "confirmPassword","userPIN", "orgId"}); - addMatchFields("password","confirmPassword"); - //addEmailValidation("email"); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/CreditCardForm.java b/posterita/posterita/src/main/org/posterita/form/CreditCardForm.java deleted file mode 100644 index 9264cc421c..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CreditCardForm.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 02-Sep-2005 - */ - - -package org.posterita.form; - -import org.posterita.beans.CustomerBean; -import org.posterita.struts.core.DefaultForm; - - -public class CreditCardForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CreditCardForm() - { - - setBean(new CustomerBean()); - addRequiredFields(new String[]{"creditCardNumber", "cvv", "creditCardExpMonth", "creditCardExpYear"}); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/CurrencyForm.java b/posterita/posterita/src/main/org/posterita/form/CurrencyForm.java deleted file mode 100644 index 3ebe2cf503..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CurrencyForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Servansingh - * */ - -package org.posterita.form; - -import org.posterita.beans.CurrencyBean; -import org.posterita.struts.core.DefaultForm; - - - -public class CurrencyForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public CurrencyForm() - { - setBean(new CurrencyBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/CurrenrPOSBalanceForm.java b/posterita/posterita/src/main/org/posterita/form/CurrenrPOSBalanceForm.java deleted file mode 100644 index ab3c68060f..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CurrenrPOSBalanceForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 5, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.CurrentTillAmountBean; -import org.posterita.struts.core.DefaultForm; - - -public class CurrenrPOSBalanceForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - -public CurrenrPOSBalanceForm() - { - setBean(new CurrentTillAmountBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/CustomerAndCreditCardForm.java b/posterita/posterita/src/main/org/posterita/form/CustomerAndCreditCardForm.java deleted file mode 100644 index b5e2ed6a84..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CustomerAndCreditCardForm.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 02-Sep-2005 - */ - - -package org.posterita.form; - -import org.posterita.beans.CustomerBean; -import org.posterita.struts.core.DefaultForm; - - -public class CustomerAndCreditCardForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CustomerAndCreditCardForm() - { - setBean(new CustomerBean()); - - addRequiredFields(new String[]{"creditCardPayment","username","userSurname", "email", "address1","address2","city","countryId"}); - addCreditCardFieldsValidation("creditCardPayment"); - addCVVFieldsValidation("creditCardPayment"); - addCreditCardExpiryDateFieldsValidation("creditCardPayment"); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/CustomerForm.java b/posterita/posterita/src/main/org/posterita/form/CustomerForm.java deleted file mode 100644 index 49d9e1daea..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/CustomerForm.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 02-Sep-2005 - */ - - -package org.posterita.form; - -import org.posterita.beans.CustomerBean; -import org.posterita.struts.core.DefaultForm; - - -public class CustomerForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public CustomerForm() - { - - setBean(new CustomerBean()); - addRequiredFields(new String[]{ - "partnerName" - ,"surname" - ,"address1" - }); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/DateFilterForm.java b/posterita/posterita/src/main/org/posterita/form/DateFilterForm.java deleted file mode 100644 index b7a829e6da..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/DateFilterForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Sep 11, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.form; - -import org.posterita.beans.DateFilterBean; -import org.posterita.struts.core.DefaultForm; - -public class DateFilterForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public DateFilterForm() - { - this.setBean(new DateFilterBean()); - addRequiredFields(new String[]{"fromDate", "toDate"}); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/DocumentForm.java b/posterita/posterita/src/main/org/posterita/form/DocumentForm.java deleted file mode 100644 index 6bb16182a6..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/DocumentForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 12-Aug-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.DocumentBean; -import org.posterita.struts.core.DefaultForm; - - -public class DocumentForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public DocumentForm() - { - setBean(new DocumentBean()); - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/DocumentHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/DocumentHistoryForm.java deleted file mode 100644 index 53d4883285..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/DocumentHistoryForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.DocumentHistoryBean; -import org.posterita.struts.core.DefaultForm; - - -public class DocumentHistoryForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public DocumentHistoryForm() - { - setBean( new DocumentHistoryBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/DunningForm.java b/posterita/posterita/src/main/org/posterita/form/DunningForm.java deleted file mode 100644 index 276ca021b0..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/DunningForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 27, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.DunningBean; -import org.posterita.struts.core.DefaultForm; - - -public class DunningForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public DunningForm() - { - setBean( new DunningBean()); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/EditAttributeForm.java b/posterita/posterita/src/main/org/posterita/form/EditAttributeForm.java deleted file mode 100644 index b5677fbd66..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/EditAttributeForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 24, 2006 by ashley -* -*/ - -package org.posterita.form; - -import org.posterita.beans.AttributeValueDetailBean; -import org.posterita.struts.core.DefaultForm; - -public class EditAttributeForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public EditAttributeForm() - { - this.setBean(new AttributeValueDetailBean()); - this.addRequiredFields(new String[]{"newName"}); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/EditPriceListForm.java b/posterita/posterita/src/main/org/posterita/form/EditPriceListForm.java deleted file mode 100644 index 715f9472a1..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/EditPriceListForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 20, 2005 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.EditPriceBean; -import org.posterita.struts.core.DefaultForm; - -public class EditPriceListForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public EditPriceListForm() - { - setBean(new EditPriceBean()); - addRequiredFields(new String[]{"price"}); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/EditProductForm.java b/posterita/posterita/src/main/org/posterita/form/EditProductForm.java deleted file mode 100644 index 4f186b1ec3..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/EditProductForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 4, 2005 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.ProductBean; -import org.posterita.struts.core.DefaultForm; - -public class EditProductForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public EditProductForm() - { - setBean(new ProductBean()); - //addRequiredFields(new String[] {"productName","revenueRecognition","description"}); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/GarmentForm.java b/posterita/posterita/src/main/org/posterita/form/GarmentForm.java deleted file mode 100644 index 4113912497..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/GarmentForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jun 30, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.ProductBean; -import org.posterita.struts.core.DefaultForm; - - -public class GarmentForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public GarmentForm() - { - setBean(new ProductBean()); - addRequiredFields(new String[] {"description","brandName","modelName","revenueRecognition","designName","colourName","purchasePriceStandard","salesPriceStandard"}); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/GeneralPaymentForm.java b/posterita/posterita/src/main/org/posterita/form/GeneralPaymentForm.java deleted file mode 100644 index adc5196f6d..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/GeneralPaymentForm.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.posterita.form; - -import org.posterita.beans.PaymentBean; -import org.posterita.struts.core.DefaultForm; - -public class GeneralPaymentForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public GeneralPaymentForm() - { - setBean(new PaymentBean()); - addRequiredFields(new String[]{"amount","bpartnerId"}); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/GenericProductForm.java b/posterita/posterita/src/main/org/posterita/form/GenericProductForm.java deleted file mode 100644 index 83622e125d..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/GenericProductForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.posterita.form; - -import org.posterita.beans.GenericProductBean; -import org.posterita.struts.core.DefaultForm; - - -public class GenericProductForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public GenericProductForm() - { - setBean(new GenericProductBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/InOutHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/InOutHistoryForm.java deleted file mode 100644 index 7e53bc3d30..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/InOutHistoryForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 16, 2005 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.InOutHistoryBean; -import org.posterita.struts.core.DefaultForm; - -public class InOutHistoryForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InOutHistoryForm() - { - setBean(new InOutHistoryBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/InitCustomerForm.java b/posterita/posterita/src/main/org/posterita/form/InitCustomerForm.java deleted file mode 100644 index 939e980658..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/InitCustomerForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jan 16, 2007 - */ - - -package org.posterita.form; - -import org.posterita.beans.CustomerBean; -import org.posterita.struts.core.DefaultForm; - - -public class InitCustomerForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InitCustomerForm() - { - setBean(new CustomerBean()); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/InventoryForm.java b/posterita/posterita/src/main/org/posterita/form/InventoryForm.java deleted file mode 100644 index acd773bb0f..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/InventoryForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 8, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.InventoryBean; -import org.posterita.struts.core.DefaultForm; - - -public class InventoryForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public InventoryForm() - { - setBean( new InventoryBean()); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/InventoryLineForm.java b/posterita/posterita/src/main/org/posterita/form/InventoryLineForm.java deleted file mode 100644 index a56b44f223..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/InventoryLineForm.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.posterita.form; - -import org.posterita.beans.InventoryLineBean; -import org.posterita.struts.core.DefaultForm; - -public class InventoryLineForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InventoryLineForm() - { - setBean( new InventoryLineBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/InvoiceHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/InvoiceHistoryForm.java deleted file mode 100644 index ec6ce344c5..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/InvoiceHistoryForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 15, 2005 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.InvoiceHistoryBean; -import org.posterita.struts.core.DefaultForm; - -public class InvoiceHistoryForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvoiceHistoryForm() - { - setBean(new InvoiceHistoryBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/InvokeOrderForm.java b/posterita/posterita/src/main/org/posterita/form/InvokeOrderForm.java deleted file mode 100644 index 71849dd110..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/InvokeOrderForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 11-Aug-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.OrderLineBean; -import org.posterita.struts.core.DefaultForm; - - -public class InvokeOrderForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public InvokeOrderForm() - { - setBean(new OrderLineBean()); - addRequiredFields(new String[]{"documentNo"}); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/ItemForm.java b/posterita/posterita/src/main/org/posterita/form/ItemForm.java deleted file mode 100644 index 0f68c2d794..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ItemForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.form; - -import org.posterita.beans.ItemBean; -import org.posterita.struts.core.DefaultForm; - - -public class ItemForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ItemForm() - { - setBean(new ItemBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/LoginForm.java b/posterita/posterita/src/main/org/posterita/form/LoginForm.java deleted file mode 100644 index f876931e07..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/LoginForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.form; - -import org.posterita.beans.LoginBean; -import org.posterita.struts.core.DefaultForm; - - -public class LoginForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public LoginForm() - { - setBean(new LoginBean()); - //addRequiredFields(new String[] {"username", "password"}); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/form/MenuItemForm.java b/posterita/posterita/src/main/org/posterita/form/MenuItemForm.java deleted file mode 100644 index 8b2648220c..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/MenuItemForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Jul-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.MenuItemBean; -import org.posterita.struts.core.DefaultForm; - - -public class MenuItemForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public MenuItemForm() - { - setBean(new MenuItemBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/OpenItemForm.java b/posterita/posterita/src/main/org/posterita/form/OpenItemForm.java deleted file mode 100644 index 70b0e723c2..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/OpenItemForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 17, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.OpenItemBean; -import org.posterita.struts.core.DefaultForm; - - -public class OpenItemForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public OpenItemForm() - { - setBean( new OpenItemBean()); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/OrderForm.java b/posterita/posterita/src/main/org/posterita/form/OrderForm.java deleted file mode 100644 index 2189fdcb17..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/OrderForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.form; - -import org.posterita.beans.OrderBean; -import org.posterita.struts.core.DefaultForm; - -public class OrderForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public OrderForm() - { - this.setBean(new OrderBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/OrderHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/OrderHistoryForm.java deleted file mode 100644 index c95be9b137..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/OrderHistoryForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 04-Aug-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.OrderHistoryBean; -import org.posterita.struts.core.DefaultForm; - - -public class OrderHistoryForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public OrderHistoryForm() - { - setBean(new OrderHistoryBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/OrderLineForm.java b/posterita/posterita/src/main/org/posterita/form/OrderLineForm.java deleted file mode 100644 index 1fcb12f9ea..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/OrderLineForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 11-Aug-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.OrderLineBean; -import org.posterita.struts.core.DefaultForm; - - -public class OrderLineForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public OrderLineForm() - { - setBean(new OrderLineBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/OrgForm.java b/posterita/posterita/src/main/org/posterita/form/OrgForm.java deleted file mode 100644 index 1f536a0f62..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/OrgForm.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.OrgBean; -import org.posterita.struts.admin.OrganisationAction; -import org.posterita.struts.core.DefaultForm; - - -public class OrgForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public OrgForm() - { - setBean(new OrgBean()); - - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - if(OrganisationAction.UPDATE_OR_CREATE_ORG.equals(action)) - { - addRequiredFields(new String[]{"orgName"}); - } - - return super.validate(mapping, request); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/POSDescriptionForm.java b/posterita/posterita/src/main/org/posterita/form/POSDescriptionForm.java deleted file mode 100644 index bc8553015f..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/POSDescriptionForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 5, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.POSDescriptionBean; -import org.posterita.struts.core.DefaultForm; - - -public class POSDescriptionForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public POSDescriptionForm() - { - setBean(new POSDescriptionBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/POSForm.java b/posterita/posterita/src/main/org/posterita/form/POSForm.java deleted file mode 100644 index 487b69f68a..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/POSForm.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 22-Mar-2006 - */ - - -package org.posterita.form; - - -import org.posterita.beans.POSBean; -import org.posterita.struts.core.DefaultForm; - - -public class POSForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - -public POSForm() - { - setBean(new POSBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/POSHelpForm.java b/posterita/posterita/src/main/org/posterita/form/POSHelpForm.java deleted file mode 100644 index a3468d3526..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/POSHelpForm.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * 6 Feb 2008 18:02:07 by shameem - * - */ - -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.POSHelpBean; -import org.posterita.pos.help.POSHelpAction; -import org.posterita.struts.core.DefaultForm; - -public class POSHelpForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public POSHelpForm() - { - setBean(new POSHelpBean()); - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - if(POSHelpAction.INIT_CONTACT_US.equals(action)) - { - // no validation required - } - else if(POSHelpAction.SEND_EMAIL.equals(action)) - { - addRequiredFields(new String[] {"fromAddress","subject","textMessage"}); - } - else - { - - } - - return super.validate(mapping, request); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/POSHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/POSHistoryForm.java deleted file mode 100644 index 14d4be6ec0..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/POSHistoryForm.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on May 15, 2006 - */ - - -package org.posterita.form; - -import java.util.Calendar; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.POSHistoryBean; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.DefaultForm; -import org.posterita.struts.pos.CashAction; - - -public class POSHistoryForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public POSHistoryForm() throws OperationException - { - setBean(new POSHistoryBean()); - initForm(); - } - - private void initForm() throws OperationException - { - try - { - Calendar cal = Calendar.getInstance(); - POSHistoryBean bean = (POSHistoryBean) getBean(); - - bean.setMonth(Integer.valueOf(cal.get(Calendar.MONTH) + 1)); - bean.setYear(Integer.valueOf(cal.get(Calendar.YEAR))); - - month = bean.getMonth().toString(); - year = bean.getYear().toString(); - } - catch (ApplicationException e) - { - throw new OperationException(e); - } - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - if( CashAction.GET_CASH_DETAILS_HISTORY.equals(action)) - { - addRequiredFields(new String[] {"cashBookId"}); - } - return super.validate(mapping, request); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/POSInfoForm.java b/posterita/posterita/src/main/org/posterita/form/POSInfoForm.java deleted file mode 100644 index 0d0c343b1f..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/POSInfoForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 5, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.POSInfoBean; -import org.posterita.struts.core.DefaultForm; - - -public class POSInfoForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - -public POSInfoForm() - { - setBean(new POSInfoBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/POSOrderLineForm2.java b/posterita/posterita/src/main/org/posterita/form/POSOrderLineForm2.java deleted file mode 100644 index d54f0dba31..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/POSOrderLineForm2.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 11-Aug-2005 by alok - * - */ -package org.posterita.form; - -import org.posterita.beans.OrderLineBean; -import org.posterita.struts.core.DefaultForm; - - -public class POSOrderLineForm2 extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public POSOrderLineForm2() - { - setBean(new OrderLineBean()); - - addRequiredFields(new String[] {"bpartnerId"}); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/POSProductForm.java b/posterita/posterita/src/main/org/posterita/form/POSProductForm.java deleted file mode 100644 index 6f9b08ad18..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/POSProductForm.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.ProductBean; -import org.posterita.struts.core.DefaultForm; -import org.posterita.struts.pos.POSProductAction; - -public class POSProductForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public POSProductForm() - { - setBean(new ProductBean()); - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - if(POSProductAction.VIEW_PRODUCT.equals(action) || POSProductAction.GET_CREATE_PRODUCT_FORM.equals(action)) - { - - } - else if (POSProductAction.CREATE_OR_UPDATE_PRODUCT.equals(action)) - { - addRequiredFields(new String[] {"productName","revenueRecognition","description"}); - } - else - { - addRequiredFields(new String[] {"productName","purchasePriceStandard","description","salesPriceStandard","salesPriceLimit","salesPriceList"}); - } - - return super.validate(mapping, request); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/POSReportForm.java b/posterita/posterita/src/main/org/posterita/form/POSReportForm.java deleted file mode 100644 index 912dfdc0aa..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/POSReportForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 11, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.POSReportBean; -import org.posterita.struts.core.DefaultForm; - - -public class POSReportForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public POSReportForm() - { - setBean(new POSReportBean()); - } - - } diff --git a/posterita/posterita/src/main/org/posterita/form/POSStockForm.java b/posterita/posterita/src/main/org/posterita/form/POSStockForm.java deleted file mode 100644 index 9e976155ea..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/POSStockForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 8, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.POSStockBean; -import org.posterita.struts.core.DefaultForm; - - -public class POSStockForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public POSStockForm() - { - setBean(new POSStockBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/POSSupplierForm.java b/posterita/posterita/src/main/org/posterita/form/POSSupplierForm.java deleted file mode 100644 index 7992f1ccc9..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/POSSupplierForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 8, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.POSSupplierBean; -import org.posterita.struts.core.DefaultForm; - - -public class POSSupplierForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public POSSupplierForm() - { - setBean(new POSSupplierBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/PaymentAllocationForm.java b/posterita/posterita/src/main/org/posterita/form/PaymentAllocationForm.java deleted file mode 100644 index 5dc9f3bede..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/PaymentAllocationForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 30, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.PaymentAllocationBean; -import org.posterita.struts.core.DefaultForm; - - -public class PaymentAllocationForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public PaymentAllocationForm() - { - setBean( new PaymentAllocationBean()); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/PaymentForm.java b/posterita/posterita/src/main/org/posterita/form/PaymentForm.java deleted file mode 100644 index f7c492fbf4..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/PaymentForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 08-Dec-2006 14:08:03 by praveen - * - */ - -package org.posterita.form; - -import org.posterita.beans.PaymentBean; -import org.posterita.struts.core.DefaultForm; - -public class PaymentForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public PaymentForm() - { - setBean(new PaymentBean()); - addRequiredFields(new String[]{"amount", "allocateAmount"}); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/PaymentHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/PaymentHistoryForm.java deleted file mode 100644 index da7e594264..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/PaymentHistoryForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 15, 2005 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.PaymentHistoryBean; -import org.posterita.struts.core.DefaultForm; - -public class PaymentHistoryForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public PaymentHistoryForm() - { - setBean(new PaymentHistoryBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/PaymentTermForm.java b/posterita/posterita/src/main/org/posterita/form/PaymentTermForm.java deleted file mode 100644 index 3f17a3610f..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/PaymentTermForm.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 1, 2006 - */ - - -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; - -import org.posterita.beans.PaymentTermBean; -import org.posterita.struts.core.DefaultForm; - - -public class PaymentTermForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public PaymentTermForm() - { - setBean(new PaymentTermBean()); - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - //some custom validation - - if("true".equalsIgnoreCase(getFixedDueDate())) - { - addRequiredFields(new String[]{"paymentTermName","fixedMonthDay","fixedMonthOffset","fiedMonthCutoff"}); - } - else - { - addRequiredFields(new String[]{"paymentTermName","netDays"}); - } - - return super.validate(mapping, request); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/PaymentTermForm2.java b/posterita/posterita/src/main/org/posterita/form/PaymentTermForm2.java deleted file mode 100644 index 92e81d4d56..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/PaymentTermForm2.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 28, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.PaymentTermBean; -import org.posterita.struts.core.DefaultForm; - - -public class PaymentTermForm2 extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public PaymentTermForm2() - { - setBean(new PaymentTermBean()); - } - - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/PriceCheckForm.java b/posterita/posterita/src/main/org/posterita/form/PriceCheckForm.java deleted file mode 100644 index 50efbb09cc..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/PriceCheckForm.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -package org.posterita.form; - -import org.posterita.struts.core.DefaultForm; - -public class PriceCheckForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public PriceCheckForm() - { - addRequiredFields(new String[]{"barCode"}); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/PriceListForm.java b/posterita/posterita/src/main/org/posterita/form/PriceListForm.java deleted file mode 100644 index 6830c1878c..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/PriceListForm.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 19, 2005 by praveen - * - */ -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.PriceListBean; -import org.posterita.struts.core.DefaultForm; -import org.posterita.struts.pos.PriceListAction; - -public class PriceListForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public PriceListForm() - { - setBean(new PriceListBean()); - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - if(PriceListAction.CREATE_OR_UPDATE_PRICE_LIST.equalsIgnoreCase(action)) - { - addRequiredFields(new String[] {"name"}); - } - - return super.validate(mapping, request); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductAttributeForm.java b/posterita/posterita/src/main/org/posterita/form/ProductAttributeForm.java deleted file mode 100644 index d52b076249..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ProductAttributeForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 1, 2005 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.ProductAttributeBean; -import org.posterita.struts.core.DefaultForm; - -public class ProductAttributeForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductAttributeForm() - { - setBean(new ProductAttributeBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductAttributeValueForm.java b/posterita/posterita/src/main/org/posterita/form/ProductAttributeValueForm.java deleted file mode 100644 index fb77ea3732..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ProductAttributeValueForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 1, 2005 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.ProductAttributeBean; -import org.posterita.struts.core.DefaultForm; - -public class ProductAttributeValueForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductAttributeValueForm() - { - setBean(new ProductAttributeBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductDetailInfoForm.java b/posterita/posterita/src/main/org/posterita/form/ProductDetailInfoForm.java deleted file mode 100644 index 5450c915a6..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ProductDetailInfoForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -/** - @author ashley - */ - -package org.posterita.form; - -import org.posterita.beans.ProductDetailsBean; -import org.posterita.struts.core.DefaultForm; - -public class ProductDetailInfoForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public ProductDetailInfoForm() - { - this.setBean(new ProductDetailsBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductImageForm.java b/posterita/posterita/src/main/org/posterita/form/ProductImageForm.java deleted file mode 100644 index b756529f8a..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ProductImageForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 14, 2006 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.ProductImageBean; -import org.posterita.struts.core.DefaultForm; - -public class ProductImageForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductImageForm() - { - setBean(new ProductImageBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductKeywordsForm.java b/posterita/posterita/src/main/org/posterita/form/ProductKeywordsForm.java deleted file mode 100644 index 31a9a5e036..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ProductKeywordsForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 12, 2006 by ashley -* -*/ - -package org.posterita.form; - -import org.posterita.beans.ProductKeywordsBean; -import org.posterita.struts.core.DefaultForm; - -public class ProductKeywordsForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductKeywordsForm() - { - setBean(new ProductKeywordsBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductRestrictionForm.java b/posterita/posterita/src/main/org/posterita/form/ProductRestrictionForm.java deleted file mode 100644 index 78e03dc431..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ProductRestrictionForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 30, 2005 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.ProductRestrictionBean; -import org.posterita.struts.core.DefaultForm; - -public class ProductRestrictionForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductRestrictionForm() - { - setBean(new ProductRestrictionBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductSearchForm.java b/posterita/posterita/src/main/org/posterita/form/ProductSearchForm.java deleted file mode 100644 index 15521f2867..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ProductSearchForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 17, 2006 by ashley -* -*/ - -package org.posterita.form; - -import org.posterita.beans.ProductSearchBean; -import org.posterita.struts.core.DefaultForm; - -public class ProductSearchForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductSearchForm() - { - //this.setIsActive("true"); - //this.setIsWebstoreFeatured("true"); - setBean(new ProductSearchBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/ProductStatusForm.java b/posterita/posterita/src/main/org/posterita/form/ProductStatusForm.java deleted file mode 100644 index 3d60c8af3a..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ProductStatusForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Feb 9, 2006 by praveen - * - */ -package org.posterita.form; - -import org.posterita.beans.ProductStatusBean; -import org.posterita.struts.core.DefaultForm; - -public class ProductStatusForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ProductStatusForm() - { - setBean(new ProductStatusBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/RemoveSessionForm.java b/posterita/posterita/src/main/org/posterita/form/RemoveSessionForm.java deleted file mode 100644 index 6aeabffa14..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/RemoveSessionForm.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jan 26, 2007 - */ - - -package org.posterita.form; - -import org.posterita.beans.RemoveSessionBean; -import org.posterita.struts.core.DefaultForm; - - - -public class RemoveSessionForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public RemoveSessionForm() - { - setBean(new RemoveSessionBean()); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/ReportForm.java b/posterita/posterita/src/main/org/posterita/form/ReportForm.java deleted file mode 100644 index 856209ec8e..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ReportForm.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.ReportBean; -import org.posterita.struts.core.DefaultForm; -import org.posterita.struts.pos.POSReportAction; - - -public class ReportForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ReportForm() - { - //initForm(); - setBean(new ReportBean()); - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - if (!POSReportAction.GET_STOCK_SALES_REPORT.equals(action) && !POSReportAction.CLEAR_STOCK_SALES_REPORT.equals(action)) - { - addRequiredFields(new String[]{"fromDate", "toDate"}); - } - - return super.validate(mapping, request); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/ReportImageForm.java b/posterita/posterita/src/main/org/posterita/form/ReportImageForm.java deleted file mode 100644 index 3d8f00dc34..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ReportImageForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.form; - -import org.posterita.beans.ReportImageBean; -import org.posterita.struts.core.DefaultForm; - - -public class ReportImageForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ReportImageForm() - { - setBean(new ReportImageBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/ReportSummaryHistoryForm.java b/posterita/posterita/src/main/org/posterita/form/ReportSummaryHistoryForm.java deleted file mode 100644 index 4297ae1311..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ReportSummaryHistoryForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Sep 11, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.form; - -import org.posterita.struts.core.DefaultForm; - -public class ReportSummaryHistoryForm extends DefaultForm -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - -} diff --git a/posterita/posterita/src/main/org/posterita/form/RoleForm.java b/posterita/posterita/src/main/org/posterita/form/RoleForm.java deleted file mode 100644 index bb01b0390c..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/RoleForm.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 16, 2005 by praveen - * - */ -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.RoleBean; -import org.posterita.struts.core.DefaultForm; -import org.posterita.struts.pos.POSRoleAction; - -public class RoleForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public RoleForm() - { - setBean(new RoleBean()); - } - - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - if(POSRoleAction.CREATE_ROLE.equals(action) || POSRoleAction.EDIT_ROLE.equals(action)) - { - addRequiredFields(new String[]{"name"}); - } - - return super.validate(mapping, request); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/SalesAnalysisReportForm.java b/posterita/posterita/src/main/org/posterita/form/SalesAnalysisReportForm.java deleted file mode 100644 index a13a3b9c26..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/SalesAnalysisReportForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 14-Jul-2006 13:57:30 by praveen - * - */ - -package org.posterita.form; - -import org.posterita.beans.SalesAnalysisReportBean; -import org.posterita.struts.core.DefaultForm; - -public class SalesAnalysisReportForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public SalesAnalysisReportForm() - { - setBean(new SalesAnalysisReportBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/SalesDetailsForm.java b/posterita/posterita/src/main/org/posterita/form/SalesDetailsForm.java deleted file mode 100644 index 7bc6763b2f..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/SalesDetailsForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.form; - -import org.posterita.beans.SalesDetailsBean; -import org.posterita.struts.core.DefaultForm; - - -public class SalesDetailsForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public SalesDetailsForm() - { - //initForm(); - setBean(new SalesDetailsBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/SalesReportForm.java b/posterita/posterita/src/main/org/posterita/form/SalesReportForm.java deleted file mode 100644 index bf61183015..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/SalesReportForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.form; - -import org.posterita.beans.ReportBean; -import org.posterita.struts.core.DefaultForm; - - -public class SalesReportForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public SalesReportForm() - { - //initForm(); - setBean(new ReportBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/SearchProductForm.java b/posterita/posterita/src/main/org/posterita/form/SearchProductForm.java deleted file mode 100644 index 910b99de31..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/SearchProductForm.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Apr 27, 2006 by ashley -* -*/ - -package org.posterita.form; - -import org.posterita.beans.StockBean; -import org.posterita.struts.core.DefaultForm; - -public class SearchProductForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public SearchProductForm() - { - setBean(new StockBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/SellingItemForm.java b/posterita/posterita/src/main/org/posterita/form/SellingItemForm.java deleted file mode 100644 index 94926e8bb6..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/SellingItemForm.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * 16 Jan 2008 13:10:40 by shameem - * - */ - -package org.posterita.form; - -import org.posterita.beans.ReportBean; -import org.posterita.struts.core.DefaultForm; - -public class SellingItemForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public SellingItemForm() - { - setBean(new ReportBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/SetApplicationParametersForm.java b/posterita/posterita/src/main/org/posterita/form/SetApplicationParametersForm.java deleted file mode 100644 index 3645e1cbc7..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/SetApplicationParametersForm.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * */ -package org.posterita.form; - -import org.posterita.beans.ApplicationParametersBean; -import org.posterita.struts.core.DefaultForm; - - -public class SetApplicationParametersForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public SetApplicationParametersForm() - { - setBean(new ApplicationParametersBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/SingleDateFilterForm.java b/posterita/posterita/src/main/org/posterita/form/SingleDateFilterForm.java deleted file mode 100644 index 7f1a64ce5e..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/SingleDateFilterForm.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 7, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.ReportBean; -import org.posterita.struts.core.DefaultForm; - - -public class SingleDateFilterForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public SingleDateFilterForm() - { - //initForm(); - setBean(new ReportBean()); - addRequiredFields(new String[]{"fromDate"}); - - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/StockEnquiryForm.java b/posterita/posterita/src/main/org/posterita/form/StockEnquiryForm.java deleted file mode 100644 index f970b739bb..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/StockEnquiryForm.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * 16 Jan 2008 13:12:10 by shameem - * - */ - -package org.posterita.form; - -import org.posterita.beans.ReportBean; -import org.posterita.struts.core.DefaultForm; - -public class StockEnquiryForm extends DefaultForm -{ - - private static final long serialVersionUID = 1L; - - public StockEnquiryForm() - { - setBean(new ReportBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/StockForm.java b/posterita/posterita/src/main/org/posterita/form/StockForm.java deleted file mode 100644 index 1b83cd5022..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/StockForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.form; - -import org.posterita.beans.StockBean; -import org.posterita.struts.core.DefaultForm; - - -public class StockForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public StockForm() - { - setBean(new StockBean()); - addRequiredFields(new String[] {"checkbox"}); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/StockMovementForm.java b/posterita/posterita/src/main/org/posterita/form/StockMovementForm.java deleted file mode 100644 index b2bf7f0c8f..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/StockMovementForm.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.posterita.form; - -import org.posterita.beans.StockMovementBean; -import org.posterita.struts.core.DefaultForm; - -public class StockMovementForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public StockMovementForm() - { - setBean(new StockMovementBean()); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/SynchronizeCollectionsForm.java b/posterita/posterita/src/main/org/posterita/form/SynchronizeCollectionsForm.java deleted file mode 100644 index b3dcb5654a..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/SynchronizeCollectionsForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -/** - @author ashley - */ - -package org.posterita.form; - -import org.posterita.beans.SynchronizeCollectionBean; -import org.posterita.struts.core.DefaultForm; - -public class SynchronizeCollectionsForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public SynchronizeCollectionsForm() - { - this.setBean(new SynchronizeCollectionBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/TaxForm.java b/posterita/posterita/src/main/org/posterita/form/TaxForm.java deleted file mode 100644 index c4c8b5869c..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/TaxForm.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 28, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.TaxBean; -import org.posterita.struts.core.DefaultForm; - - -public class TaxForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public TaxForm() - { - setBean(new TaxBean()); - // addRequiredFields(new String[] {"taxName","taxRate"}); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/form/TerminalForm.java b/posterita/posterita/src/main/org/posterita/form/TerminalForm.java deleted file mode 100644 index 280d87c305..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/TerminalForm.java +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.TerminalBean; -import org.posterita.struts.core.DefaultForm; -import org.posterita.struts.pos.TerminalAction; - -/** - * @author Ashley G Ramdass - * Apr 14, 2008 - */ -public class TerminalForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 4655061866594868989L; - - public TerminalForm() - { - super.setBean(new TerminalBean()); - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - if(TerminalAction.CREATE_TERMINAL.equals(action) || TerminalAction.SAVE_TERMINAL.equals(action)) - { - addRequiredFields(new String[]{"name", "orgId", "bpartnerId", "purchasePriceListId", "salesPriceListId", "warehouseId", "cashBookId", "cardBankAccountId", "checkBankAccountId", "cashbookTransferType"}); - } - - return super.validate(mapping, request); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/UserForm.java b/posterita/posterita/src/main/org/posterita/form/UserForm.java deleted file mode 100644 index 252bd11d89..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/UserForm.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.Constants; -import org.posterita.beans.UserBean; -import org.posterita.struts.core.DefaultForm; - - -public class UserForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public UserForm() - { - setBean(new UserBean()); - - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - if(Constants.PASSWORD.equals(action)) - { - addRequiredFields(new String[]{"username"}); - } - else - { - addRequiredFields(new String[]{"password", "confirmPassword","userPIN", "orgId"}); - addMatchFields("password","confirmPassword"); - } - - return super.validate(mapping, request); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/form/UserRegistrationForm.java b/posterita/posterita/src/main/org/posterita/form/UserRegistrationForm.java deleted file mode 100644 index 02003363bb..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/UserRegistrationForm.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Servansingh - * */ - -package org.posterita.form; - -import javax.servlet.http.HttpServletRequest; -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.UserBean; -import org.posterita.struts.core.DefaultForm; -import org.posterita.struts.user.UserRegistrationAction; - - - -public class UserRegistrationForm extends DefaultForm -{ - private static final long serialVersionUID = 1L; - - public UserRegistrationForm() - { - setBean(new UserBean()); - } - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - if(UserRegistrationAction.REGISTER_USER.equals(action)) - { - addRequiredFields(new String[]{"name", "userSurname", "address1","city", "email"}); - } - - return super.validate(mapping, request); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/VendorForm.java b/posterita/posterita/src/main/org/posterita/form/VendorForm.java deleted file mode 100644 index d728dea7de..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/VendorForm.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.posterita.form; - -import org.posterita.beans.VendorBean; -import org.posterita.struts.core.DefaultForm; - -public class VendorForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public VendorForm() - { - setBean(new VendorBean()); - addRequiredFields(new String[]{"partnerName"}); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/ViewBPartnerForm.java b/posterita/posterita/src/main/org/posterita/form/ViewBPartnerForm.java deleted file mode 100644 index d1efc12b0a..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ViewBPartnerForm.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 22, 2005 by din - */ - -package org.posterita.form; - -import org.posterita.beans.BPartnerBean; -import org.posterita.struts.core.DefaultForm; - -public class ViewBPartnerForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ViewBPartnerForm() - { - setBean(new BPartnerBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/ViewProductForm.java b/posterita/posterita/src/main/org/posterita/form/ViewProductForm.java deleted file mode 100644 index e8b0280e9f..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ViewProductForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 17, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.ProductBean; -import org.posterita.struts.core.DefaultForm; - - -public class ViewProductForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ViewProductForm() - { - setBean(new ProductBean()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/form/ViewTaxForm.java b/posterita/posterita/src/main/org/posterita/form/ViewTaxForm.java deleted file mode 100644 index bb83285f8d..0000000000 --- a/posterita/posterita/src/main/org/posterita/form/ViewTaxForm.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 30, 2006 - */ - - -package org.posterita.form; - -import org.posterita.beans.TaxBean; -import org.posterita.struts.core.DefaultForm; - - -public class ViewTaxForm extends DefaultForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - public ViewTaxForm() - { - setBean(new TaxBean()); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/formatter/ArrayListFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/ArrayListFormatter.java deleted file mode 100644 index d5804b57dd..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/ArrayListFormatter.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Aug-2005 by alok - * - */ - -package org.posterita.formatter; - -import java.util.ArrayList; - - -public class ArrayListFormatter extends Formatter -{ - - public Object format(Object target) - { - if (target == null) - return new ArrayList(); - - return target; - } - - public Object unformat(Object target) - { - ArrayList temp = (ArrayList) target; - - if (target == null || temp.size() == 0 ) - return null; - - return target; - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/BigDecimalArrayFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/BigDecimalArrayFormatter.java deleted file mode 100644 index 64ff52d949..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/BigDecimalArrayFormatter.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.posterita.formatter; - -import java.math.BigDecimal; - -public class BigDecimalArrayFormatter extends Formatter -{ - // return String[] - public Object format(Object value) - { - if (value == null) - return new String[]{}; - - BigDecimal values[] = (BigDecimal[])value; - - String retVal[] = new String[values.length]; - - for (int i = 0; i < values.length; i++) - { - retVal[i] = values[i].toPlainString(); - } - - return retVal; - } - - // return BigDecimal[] - public Object unformat(Object object) - { - if (object == null) - { - return null; - } - - String values[] = (String[])object; - - if (values.length == 0) - { - return null; - } - - BigDecimal retVal[] = new BigDecimal[values.length]; - - for (int i = 0; i < values.length; i++) - { - retVal[i] = new BigDecimal(values[i]); - } - - return retVal; - } -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/BigDecimalFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/BigDecimalFormatter.java deleted file mode 100644 index 643787eb65..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/BigDecimalFormatter.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 18-Aug-2006 16:45:26 by praveen - * - */ - -package org.posterita.formatter; - -import java.math.BigDecimal; - -public class BigDecimalFormatter extends Formatter -{ - - //converts a BigDecimal to String - public Object format(Object value) - { - if(value == null) - { - return ""; - } - - BigDecimal valuebd = (BigDecimal) value; - - BigDecimal db = valuebd.setScale(4, BigDecimal.ROUND_HALF_UP); - - return db.toString(); - } - - //converts a String to BigDecimal - public Object unformat(Object object) - { - String string = (String) object; - if(string == null || string.trim().length() <1) - return null; - - BigDecimal bd = new BigDecimal(string).setScale(4, BigDecimal.ROUND_HALF_UP); - - return bd; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/BooleanArrayFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/BooleanArrayFormatter.java deleted file mode 100644 index 5135e61d21..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/BooleanArrayFormatter.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.posterita.formatter; - - -public class BooleanArrayFormatter extends Formatter -{ - - public Object format(Object value) - { - if (value == null) - return new String[]{}; - - Boolean values[] = (Boolean[])value; - - String retVal[] = new String[values.length]; - - for (int i = 0; i < values.length; i++) - { - retVal[i] = values[i].toString(); - } - - return retVal; - } - - // return Boolean[] - public Object unformat(Object object) - { - if (object == null) - { - return null; - } - - String values[] = (String[])object; - - if (values.length == 0) - { - return null; - } - - Boolean retVal[] = new Boolean[values.length]; - - for (int i = 0; i < values.length; i++) - { - retVal[i] = new Boolean(values[i]); - } - - return retVal; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/BooleanFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/BooleanFormatter.java deleted file mode 100644 index 69221d258e..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/BooleanFormatter.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Jul-2005 by alok - * - */ -package org.posterita.formatter; - - -public class BooleanFormatter extends Formatter -{ - - //converts Boolean to String - public Object format(Object target) - { - if (target == null) - return Boolean.toString(false); - - Boolean bool = (Boolean) target; - return bool.toString(); - } - - //convert String to Boolean - public Object unformat(Object target) - { - String string = (String) target; - - if(string == null || string.trim().length() <1) - return Boolean.valueOf(false); - - return Boolean.valueOf(string); - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/DefaultFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/DefaultFormatter.java deleted file mode 100644 index 2bde2bb1bc..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/DefaultFormatter.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Aug-2005 by alok - * - */ - -package org.posterita.formatter; - - -public class DefaultFormatter extends Formatter -{ - - public Object format(Object target) - { - if (target == null) - return ""; - else - return target.toString(); - } - - public Object unformat(Object target) - { - return target; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/DoubleFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/DoubleFormatter.java deleted file mode 100644 index 5329fbe5c1..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/DoubleFormatter.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Aug-2005 by alok - * - */ -package org.posterita.formatter; - - -public class DoubleFormatter extends Formatter -{ - - public Object format(Object value) - { - if (value == null) - return ""; - - Double dbl = (Double) value; - return dbl.toString(); - - - } - - public Object unformat(Object object) - { - String string = (String) object; - if(string == null || string.trim().length() <1) - return null; - - return new Double(string); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/Formatter.java b/posterita/posterita/src/main/org/posterita/formatter/Formatter.java deleted file mode 100644 index 5d806a317f..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/Formatter.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Aug-2005 by alok - * - */ -package org.posterita.formatter; - -import java.math.BigDecimal; -import java.util.ArrayList; - -import org.posterita.core.JulianDate; -import org.posterita.core.SimpleCalendarDate; -import org.posterita.exceptions.FormattingException; - - -public abstract class Formatter -{ - - public String getErrorKey() - { - return "error.key"; - } - - public static Formatter getFormatter(Class type) - { - if (type == null) - return new DefaultFormatter(); - if (String.class.isAssignableFrom(type)) - return new StringFormatter(); - if (Integer.class.isAssignableFrom(type)) - return new IntegerFormatter(); - if (Long.class.isAssignableFrom(type)) - return new LongFormatter(); - if (ArrayList.class.isAssignableFrom(type)) - return new ArrayListFormatter(); - if (Double.class.isAssignableFrom(type)) - return new DoubleFormatter(); - if (String[].class.isAssignableFrom(type)) - return new StringArrayFormatter(); - if (JulianDate.class.isAssignableFrom(type)) - return new JulianDateFormatter(); - if (SimpleCalendarDate.class.isAssignableFrom(type)) - return new SimpleCalendarDateFormatter(); - if (Boolean.class.isAssignableFrom(type)) - return new BooleanFormatter(); - if (Boolean[].class.isAssignableFrom(type)) - return new BooleanArrayFormatter(); - if (BigDecimal.class.isAssignableFrom(type)) - return new BigDecimalFormatter(); - if (BigDecimal[].class.isAssignableFrom(type)) - return new BigDecimalArrayFormatter(); - - return new DefaultFormatter(); - } - - public abstract Object format(Object target) throws FormattingException; - - public abstract Object unformat(Object target) throws FormattingException; - -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/IntegerFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/IntegerFormatter.java deleted file mode 100644 index 13a4f77767..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/IntegerFormatter.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Aug-2005 by alok - * - */ -package org.posterita.formatter; - - -public class IntegerFormatter extends Formatter -{ - - public Object format(Object value) - { - if (value == null) - return ""; - - Integer integer = (Integer) value; - - return integer.toString(); - } - - public Object unformat(Object value) throws NumberFormatException - { - if (value != null) - { - String string = value.toString(); - - if (string.trim().length() <1) - { - return null; - } - return Integer.valueOf(string); - } - else - { - return value; - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/JulianDateFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/JulianDateFormatter.java deleted file mode 100644 index 6179d6ba17..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/JulianDateFormatter.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Aug-2005 by alok - * - */ - -package org.posterita.formatter; - -import java.text.DateFormat; -import java.text.ParseException; -import java.util.Date; - -import org.posterita.core.JulianDate; - - -public class JulianDateFormatter extends Formatter -{ - public Object format(Object value) - { - if (value==null) - return ""; - - JulianDate julianDate = (JulianDate) value; - - DateFormat mediumDF = DateFormat.getDateInstance(DateFormat.MEDIUM); - - String string = mediumDF.format(julianDate.getJavaDate()); - - return string; - } - - - - /* (non-Javadoc) - * @see com.shortletting.formatter.Formatter#unformat(java.lang.Object) - */ - public Object unformat(Object target) - { - if (target == null) - return null; - String value = (String) target; - - DateFormat mediumDF = DateFormat.getDateInstance(DateFormat.MEDIUM); - - Date date = new Date(); - - try - { - date = mediumDF.parse(value); - } - catch (ParseException e) - { - //throw new RunTimeException("Fatal Error converting dates"); - /* - * @TODO silent exception needs to be logged. - */ - e.printStackTrace(); - } - - JulianDate julDate = new JulianDate(date); - - return julDate; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/LongFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/LongFormatter.java deleted file mode 100644 index 71ea4d7ae9..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/LongFormatter.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Aug-2005 by alok - * - */ -package org.posterita.formatter; - - -public class LongFormatter extends Formatter -{ - - public Object format(Object value) - { - if (value == null) - return ""; - - Long dbl = (Long) value; - return dbl.toString(); - - - } - - public Object unformat(Object object) - { - String string = (String) object; - if(string == null || string.trim().length() <1) - return null; - - return new Long(string); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/PriceFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/PriceFormatter.java deleted file mode 100644 index a785f63a8b..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/PriceFormatter.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Feb 3, 2006 by ashley -* -*/ - -package org.posterita.formatter; - -import java.math.BigDecimal; -import java.text.DecimalFormat; - -public class PriceFormatter -{ - - - public static String format(BigDecimal price, String priceFormat) - { - DecimalFormat format = new DecimalFormat(priceFormat); - - double dblPrice = price.doubleValue(); - - String strPrice = format.format(dblPrice); - - return strPrice; - } -} diff --git a/posterita/posterita/src/main/org/posterita/formatter/PrintFormatter.java b/posterita/posterita/src/main/org/posterita/formatter/PrintFormatter.java deleted file mode 100644 index 737d037120..0000000000 --- a/posterita/posterita/src/main/org/posterita/formatter/PrintFormatter.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 24, 2006 - */ - - -package org.posterita.formatter; - -import java.util.Properties; - -import org.compiere.model.MAttributeInstance; -import org.compiere.model.MAttributeValue; -import org.compiere.model.MProduct; - - -public class PrintFormatter extends Formatter -{ - - public Object format(Object target) - { - if(target==null) - return null; - - MProduct product = (MProduct)target; - int attributeSetInstanceId = product.getM_AttributeSetInstance_ID(); - Properties ctx = product.getCtx(); - - String whereClause="AD_CLIENT_ID="+product.getAD_Client_ID()+" and M_ATTRIBUTESETINSTANCE_ID="+attributeSetInstanceId; - int [] attributeValuesIds = MAttributeInstance.getAllIDs(MAttributeInstance.Table_Name,whereClause,null); - - MAttributeValue attrValue=null; - - String productName=""; - - for(int i=0;i getKeyPairs(Properties ctx, String attributeName) throws OperationException, SystemException - { - ArrayList keyNamePairs = new ArrayList(); - - int ad_client_id = Env.getAD_Client_ID(ctx); - - String sql = "select attrIns.m_attributevalue_id,attrVal.name ATTRIBUTE_VALUE " + - "from M_PRODUCT prod,M_ATTRIBUTEINSTANCE attrIns ,M_attribute attr,M_attributeValue attrVal " + - "where prod.M_ATTRIBUTESETINSTANCE_id = attrIns.M_ATTRIBUTESETINSTANCE_id " + - "and attr.m_attribute_id = attrIns.m_attribute_id " + - "and attrIns.m_attributevalue_id = attrVal.m_attributevalue_id " + - "and attr.name = '" + attributeName + "' " + - "and attr.AD_CLIENT_ID = " + ad_client_id; - - PreparedStatement pstmt = null; - - System.out.println("Query for attributeValueKeyNamePair : " + sql); - - try - { - pstmt = DB.prepareStatement(sql, null); - ResultSet rs = pstmt.executeQuery(); - KeyNamePair pair = null; - - - while(rs.next()) - { - pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); - keyNamePairs.add(pair); - } - - rs.close(); - } - catch (SQLException e) - { - throw new SystemException(e); - } - finally - { - try - { - pstmt.close(); - } - catch (Exception ex) - { - } - - pstmt = null; - } - - return keyNamePairs; - } -} diff --git a/posterita/posterita/src/main/org/posterita/keyname/BPartnerKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/BPartnerKeyNamePair.java deleted file mode 100644 index ddae3243c3..0000000000 --- a/posterita/posterita/src/main/org/posterita/keyname/BPartnerKeyNamePair.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 6, 2005 by praveen - * - */ -package org.posterita.keyname; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.util.Env; - -import org.posterita.core.KeyNamePairUtil; -import org.posterita.exceptions.OperationException; - - -public class BPartnerKeyNamePair extends KeyNamePairUtil -{ - public static ArrayList getKeyNamePairs(Properties ctx) throws OperationException - { - String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ad_org_id=" + Env.getAD_Org_ID(ctx) + " and isactive = 'Y'"; - - try - { - return getData(ctx, MBPartner.Table_Name, sql); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - } - -} - diff --git a/posterita/posterita/src/main/org/posterita/keyname/BankKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/BankKeyNamePair.java deleted file mode 100644 index ad1ec99afe..0000000000 --- a/posterita/posterita/src/main/org/posterita/keyname/BankKeyNamePair.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.keyname; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; - -import org.posterita.core.KeyNamePairUtil; -import org.posterita.exceptions.OperationException; -import org.compiere.model.MBank; - - -public class BankKeyNamePair extends KeyNamePairUtil -{ - public static ArrayList getKeyNamePairs(Properties ctx) throws OperationException - { - String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and ad_org_id=" + Env.getAD_Org_ID(ctx) + " and isactive = 'Y'"; - - try - { - return getData(ctx, MBank.Table_Name, sql); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - } -} diff --git a/posterita/posterita/src/main/org/posterita/keyname/CBPartnerKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/CBPartnerKeyNamePair.java deleted file mode 100644 index 7e93c70cf0..0000000000 --- a/posterita/posterita/src/main/org/posterita/keyname/CBPartnerKeyNamePair.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 6, 2005 by praveen - * - */ -package org.posterita.keyname; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MOrg; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; - -import org.posterita.exceptions.SystemException; - - -public class CBPartnerKeyNamePair -{ - public static ArrayList getKeyNamePairs(Properties ctx) throws SystemException - { - ArrayList bpList = new ArrayList(); - - int ad_client_id = Env.getAD_Client_ID(ctx); - int ad_org_id = Env.getAD_Org_ID(ctx); - - MOrg org = new MOrg(ctx,ad_org_id,null); - - String orgType = ""; - - /* if(org.isAutomobile()) - { - orgType = " and isAutomobile = 'Y'"; - } - else - { - orgType = " and isMotorcycle = 'Y'"; - }*/ - - String sql = "select bp.C_BPARTNER_ID,bp.NAME" + - " from AD_ORG org, C_BPARTNER bp" + - " where org.AD_CLIENT_ID = " + ad_client_id + - " and org.isRetailer = 'Y'" + - " and org.AD_CLIENT_ID = bp.AD_CLIENT_ID" + - " and org.AD_ORG_ID = bp.AD_ORG_ID" + - " and bp.isactive = 'Y'"; - - sql = sql + orgType; - - PreparedStatement pstmt = null; - - pstmt = DB.prepareStatement(sql,null); - ResultSet rs; - KeyNamePair pair = null; - - try - { - rs = pstmt.executeQuery(); - - while (rs.next()) - { - pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); - bpList.add(pair); - } - - rs.close(); - } - catch (SQLException e) - { - throw new SystemException(e.getMessage()); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return bpList; - } - -} - diff --git a/posterita/posterita/src/main/org/posterita/keyname/LocatorKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/LocatorKeyNamePair.java deleted file mode 100644 index 7d87f0af41..0000000000 --- a/posterita/posterita/src/main/org/posterita/keyname/LocatorKeyNamePair.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Sep 22, 2005 by ashley -* -*/ - -package org.posterita.keyname; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MLocator; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; - -import org.posterita.exceptions.OperationException; - -public class LocatorKeyNamePair -{ - public static ArrayList getKeyNamePair(Properties ctx) throws OperationException - { - ArrayList list = new ArrayList(); - - PreparedStatement prepStmt = null; - - try - { - int adOrgId = Env.getAD_Org_ID(ctx); - int adClientId = Env.getAD_Client_ID(ctx); - - String sqlStatement = "select M_LOCATOR_ID, VALUE from " + MLocator.Table_Name + " where AD_ORG_ID=" + adOrgId + " and AD_CLIENT_ID=" + adClientId + " and isactive = 'Y'"; - - prepStmt = DB.prepareStatement(sqlStatement, null); - ResultSet rs = prepStmt.executeQuery(); - - while(rs.next()) - { - int id = rs.getInt(1); - String name = rs.getString(2); - - KeyNamePair keyPair = new KeyNamePair(id, name); - list.add(keyPair); - } - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - - return list; - } - - public static KeyNamePair getKeyNamePair(Properties ctx, int locatorId) throws OperationException - { - PreparedStatement prepStmt = null; - KeyNamePair keyPair = null; - try - { - int adOrgId = Env.getAD_Org_ID(ctx); - int adClientId = Env.getAD_Client_ID(ctx); - - String sqlStatement = "select M_LOCATOR_ID, VALUE from " + MLocator.Table_Name + " where AD_ORG_ID=" + adOrgId + " and AD_CLIENT_ID=" + adClientId + " and M_LOCATOR_ID=" + locatorId; - - prepStmt = DB.prepareStatement(sqlStatement, null); - ResultSet rs = prepStmt.executeQuery(); - - while(rs.next()) - { - int id = rs.getInt(1); - String name = rs.getString(2); - - keyPair = new KeyNamePair(id, name); - } - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - - return keyPair; - } -} diff --git a/posterita/posterita/src/main/org/posterita/keyname/MenuKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/MenuKeyNamePair.java deleted file mode 100644 index cebd24433e..0000000000 --- a/posterita/posterita/src/main/org/posterita/keyname/MenuKeyNamePair.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on Jul 28, 2005 by Fred - */ - -package org.posterita.keyname; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.X_U_WebMenu; -import org.compiere.util.Env; - -import org.posterita.core.KeyNamePairUtil; -import org.posterita.exceptions.OperationException; - -public class MenuKeyNamePair extends KeyNamePairUtil -{ - public static ArrayList getKeyNamePairs(Properties ctx) throws OperationException - - { - String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) + "and ad_org_id="+ Env.getAD_Org_ID(ctx) + " and parentmenu_id is not null order by parentmenu_id"; - //+ " and isClosable= 'Y' "; - try - { - return getData(ctx, X_U_WebMenu.Table_Name,sql); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/keyname/OrgKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/OrgKeyNamePair.java deleted file mode 100644 index b8c4e45965..0000000000 --- a/posterita/posterita/src/main/org/posterita/keyname/OrgKeyNamePair.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 2, 2005 by din - */ - -package org.posterita.keyname; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.X_AD_Org; -import org.compiere.util.Env; - -import org.posterita.core.KeyNamePairUtil; -import org.posterita.exceptions.OperationException; - -public class OrgKeyNamePair extends KeyNamePairUtil -{ - public static ArrayList getKeyNamePairs(Properties ctx) throws OperationException - { - String isAuto = "N"; - String isMoto = "N"; - - /* if(OrganisationManager.getMyOrg(ctx).isAutomobile()) - { - isAuto = "Y"; - } - - if(OrganisationManager.getMyOrg(ctx).isMotorcycle()) - { - isMoto = "Y"; - }*/ - - String sql = "AD_CLIENT_ID =" + Env.getAD_Client_ID(ctx) + "and ISAUTOMOBILE ='"+ isAuto +"' and ISMOTORCYCLE ='"+ isMoto +"'" + " and isactive = 'Y'"; - try - { - return getData(ctx, X_AD_Org.Table_Name,sql); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - } -} diff --git a/posterita/posterita/src/main/org/posterita/keyname/PriceListVersionKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/PriceListVersionKeyNamePair.java deleted file mode 100644 index c71ccd146a..0000000000 --- a/posterita/posterita/src/main/org/posterita/keyname/PriceListVersionKeyNamePair.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 19, 2005 by praveen - * - */ -package org.posterita.keyname; - -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MPriceListVersion; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; - -public class PriceListVersionKeyNamePair -{ - public static ArrayList getKeyNamePairs(Properties ctx) - { - ArrayList list = new ArrayList(); - int id[] = MPriceListVersion.getAllIDs(MPriceListVersion.Table_Name,"AD_Client_id = "+Env.getAD_Client_ID(ctx),null); - - for(int i=0; i getKeyNamePairs(Properties ctx, int attributeId, int productcategoryId) throws OperationException - { - String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) + " and m_attribute_id=" + attributeId + " and m_product_category_id=" + productcategoryId + " and isactive = 'Y'"; - - try - { - return getData(ctx, MAttributeValue.Table_Name, sql); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/keyname/RegionKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/RegionKeyNamePair.java deleted file mode 100644 index aba9278260..0000000000 --- a/posterita/posterita/src/main/org/posterita/keyname/RegionKeyNamePair.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.keyname; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MRegion; - -import org.posterita.core.KeyNamePairUtil; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; - - -public class RegionKeyNamePair extends KeyNamePairUtil -{ - public static ArrayList getKeyNamePairs(Properties ctx) throws OperationException - { - String sql = "c_country_id = " + UdiConstants.COUNTRY_SOUTH_AFRICA + " and isactive = 'Y'"; - - try - { - return getData(ctx, MRegion.Table_Name,sql); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - } -} diff --git a/posterita/posterita/src/main/org/posterita/keyname/RoleKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/RoleKeyNamePair.java deleted file mode 100644 index 8ced214270..0000000000 --- a/posterita/posterita/src/main/org/posterita/keyname/RoleKeyNamePair.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 1, 2005 by din - */ - -package org.posterita.keyname; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MRole; -import org.compiere.util.Env; - -import org.posterita.core.KeyNamePairUtil; -import org.posterita.exceptions.OperationException; - -public class RoleKeyNamePair extends KeyNamePairUtil -{ - public static ArrayList getKeyName(Properties ctx) throws OperationException - { - String sql = "ad_client_id=" + Env.getAD_Client_ID(ctx) + "and ad_org_id=" + Env.getAD_Org_ID(ctx) + " and isactive = 'Y'"; - - try - { - return getData(ctx, MRole.Table_Name,sql); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - - } -} diff --git a/posterita/posterita/src/main/org/posterita/keyname/SalesRepKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/SalesRepKeyNamePair.java deleted file mode 100644 index 024fbe8172..0000000000 --- a/posterita/posterita/src/main/org/posterita/keyname/SalesRepKeyNamePair.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 6, 2005 by praveen - * - */ -package org.posterita.keyname; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MOrg; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; - -import org.posterita.exceptions.SystemException; - - -public class SalesRepKeyNamePair -{ - /** - * returns an arraylist of keyname pairs. - * key -> user_id - * name -> username - */ - public static ArrayList getKeyNamePairs(Properties ctx) throws SystemException - { - ArrayList srList = new ArrayList(); - - int ad_client_id = Env.getAD_Client_ID(ctx); - int ad_org_id = Env.getAD_Org_ID(ctx); - - new MOrg(ctx,ad_org_id,null); - - - String sql = "select c_bpartner_id,name " + - "from c_bpartner " + - "where issalesrep = 'Y' " + - "and isactive = 'Y' " + - "and ad_client_id = ? " + - "and ad_org_id = ? "; - - - PreparedStatement pstmt = null; - - pstmt = DB.prepareStatement(sql, null); - ResultSet rs; - KeyNamePair pair = null; - - try - { - pstmt.setInt(1,ad_client_id); - pstmt.setInt(2,ad_org_id); - - rs = pstmt.executeQuery(); - - while (rs.next()) - { - pair = new KeyNamePair(rs.getInt(1),rs.getString(2)); - srList.add(pair); - } - - rs.close(); - } - catch (SQLException e) - { - throw new SystemException(e.getMessage()); - } - finally - { - try - { - pstmt.close(); - } - catch(Exception e) - {} - - pstmt = null; - } - - return srList; - } - -} - diff --git a/posterita/posterita/src/main/org/posterita/keyname/WarehouseKeyNamePair.java b/posterita/posterita/src/main/org/posterita/keyname/WarehouseKeyNamePair.java deleted file mode 100644 index 9f44840e5c..0000000000 --- a/posterita/posterita/src/main/org/posterita/keyname/WarehouseKeyNamePair.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 29-Jul-2005 by alok - * - */ -package org.posterita.keyname; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.util.Env; - -import org.posterita.core.KeyNamePairUtil; -import org.posterita.exceptions.OperationException; - - -public class WarehouseKeyNamePair extends KeyNamePairUtil -{ - public static ArrayList getKeyNamePair(Properties ctx) throws OperationException - { - ArrayList list = new ArrayList(); - - try - { - list = getData(ctx,"M_WAREHOUSE","AD_ORG_ID="+ Env.getAD_Org_ID(ctx) + " and ad_client_Id=" + Env.getAD_Client_ID(ctx)+ " and isactive = 'Y'"); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - - return list; - - } - - public static ArrayList getKeyNamePair(Properties ctx,int warehouseId) throws OperationException - { - ArrayList list = new ArrayList(); - - - - try - { - list = getData(ctx,"M_WAREHOUSE","AD_ORG_ID="+ Env.getAD_Org_ID(ctx) + " and ad_client_Id=" + Env.getAD_Client_ID(ctx)+ " and isactive = 'Y' and m_warehouse_id<>"+warehouseId); - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - - return list; - - } -} diff --git a/posterita/posterita/src/main/org/posterita/lib/PropertiesConstant.java b/posterita/posterita/src/main/org/posterita/lib/PropertiesConstant.java deleted file mode 100644 index bf9766a6e1..0000000000 --- a/posterita/posterita/src/main/org/posterita/lib/PropertiesConstant.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Mar-2005 by fred - * - */ -package org.posterita.lib; - - -public class PropertiesConstant -{ - public static final String LOGO_HOME="logo.home"; - public static final String UDI_HOME = "udi.home"; - -/* public static final String CLIENT_NAME = "client.name"; - public static final String CLIENT_ID = "client.id"; - public static final String NTIER_HOME = "ntier.home"; - public static final String DCS_HOME = "dcs.home"; - //public static final String HONDA_HEAD_OFFICE_AUTO_ID = "honda.headoffice.auto.id"; - public static final String HONDA_HEAD_OFFICE_MOTO_ID = "honda.headoffice.moto.id"; - - public static final String AUTO_METALLIC_PRICE_ID = "auto.metallic.price.list.id"; - public static final String MOTO_METALLIC_PRICE_ID = "wing.metallic.price.list.id"; - public static final String PRODUCT_CATEGORY_CAR = "productCategory.car.id"; - public static final String FACTORY_HOME = "factory.home"; - - - public static final String CSV_HOME="csv.home"; - - public static final String ATTRIBUTE_SET_CAR = "car.attributeSet.id"; - public static final String BPARTNER_HSAF_ID = "bpartner.hsaf.id"; - public static final String USER_ROLE_SUPER_USER_ID = "user.role.superUser.id"; - public static final String ROLE_MENU_SUPER_USER_ID = "role.menu.superUser.id"; - public static final String SUPER_USER_ID = "superUser.id"; - public static final String USER_ROLE_UDI_ADMIN_ID = "user.role.udiAdmin.id"; - public static final String ROLE_MENU_UDI_ADMIN_ID = "role.menu.udiAdmin.id"; - public static final String UDI_ADMIN_ID = "udiAdmin.id"; - //public static final String HSAFAUTO_ADMIN_ID = "hsafAuto.admin.id"; - public static final String HSAFWING_ADMIN_ID = "hsafWing.Admin.id"; - public static final String ATTRIBUTE_SET_VIN_NO="vinNo.attributeVinNo.id"; - public static final String MODEL_ATTRIBUTE = "attribute.model.id"; - public static final String COLOUR_ATTRIBUTE = "attribute.colour.id"; - public static final String TRX_ATTRIBUTE = "attribute.transmisson.id"; - public static final String YEAR_ATTRIBUTE = "attribute.year.id"; - public static final String VIN_NO_ATTRIBUTE = "attribute.vinNo.id"; - public static final String UOM_EACH = "uom.each"; - public static final String TAX_CATEGORY_DEFAULT = "taxCategory.default.id"; - public static final String DEFAULT_BPGROUP = "default.bpartner.group"; - - //ROLES - public static final String ROLE_DEALER_PRINCIPAL_ID = "role.dealer.principal.id"; - public static final String ROLE_SALES_MANAGER_ID = "role.sales.manager.id"; - public static final String ROLE_SALES_PERSON_ID = "role.sales.person.id"; - public static final String ROLE_STOCK_CONTROLLER_ID = "role.stock.controller.id"; - public static final String ROLE_TEST_ID = "role.test.id"; - public static final String ROLE_SYSTEM_ADMINISTRATOR_ID = "role.system.administrator.id"; - public static final String ROLE_UDI_ADMIN_ID = "role.udiAdmin.id"; - public static final String ROLE_HSAFAUTO_ADMIN_ID = "role.hsafAutoAdmin.id"; - public static final String ROLE_HSAFWING_ADMIN_ID = "role.hsafWingAdmin.id"; - //MENUS - public static final String PMENU_HOME_ID = "pmenu.home.id"; - public static final String PMENU_CREATEMENU_ID = "pmenu.createmenu.id"; - //testing - public static final String SMENU_ORGANISATION_ID = "smenu.organisation.id"; - //end of test - public static final String SMENU_WAREHOUSE_ID= "smenu.warehouse.id"; - public static final String SMENU_CREATEUSER_ID= "smenu.createuser.id"; - public static final String PMENU_STOCK_INQUIRY_ID = "pmenu.stock.inquiry.id"; - public static final String SMENU_INQUIRY_ID = "smenu.inquiry.id"; - public static final String SMENU_MY_STOCK_ID = "smenu.my.stock.id"; - - public static final String PMENU_DEALER_ORDER_ID = "pmenu.dealer.order.id"; - public static final String SMENU_CREATE_ORDER_ID = "smenu.create.order.id"; - - public static final String PMENU_NATIS_RELEASE_ID = "pmenu.natis.release.id"; - public static final String SMENU_RELEASE_VEHICLE_ID = "smenu.release.vehicle.id"; - - public static final String PMENU_ALLOCATIONS_ID = "pmenu.allocations.id"; - - public static final String PMENU_DEALER_TRANSFER_ID = "pmenu.dealer.transfer.id"; - public static final String PMENU_DEALER_ADMIN_ID = "pmenu.dealer.admin.id"; - public static final String PMENU_MESSAGES_ID = "pmenu.messages.id"; - public static final String SMENU_MESSAGESINBOX_ID="smenu.messagesinbox.id"; - public static final String SMENU_MESSAGESSENT_ID = "smenu.messagessent.id"; - public static final String SMENU_MESSAGESCOMPOSE_ID = "smenu.messagescompose.id"; - public static final String PMENU_LOGOUT_ID = "pmenu.logout.id"; - public static final String CAR_ASSET_GRP = "car.assetgroup.id"; - - public static final String SSL_CERT_PATH = "ssl.cert.path"; - public static final String NATIS_POST_PROCESSOR = "natis.post.processor"; - public static final String NATIS_OPERATIONAL_MODE = "natis.operational.mode"; - public static final String NATIS_URL = "natis.url"; - public static final String SMTP_SERVER = "smtp.server"; - - public static final String FTP_SERVER_URL = "ftp.server.url"; - public static final String FTP_USERNAME = "ftp.user.name"; - public static final String FTP_PASSWORD = "ftp.user.password"; - - public static final String NATIS_AUTOMATION_TIME = "natis.automation.time"; - - public static final String FTP_IMPORT_AUTOMATION = "ftp.import.automation"; - public static final String FTP_IMPORT_TIME = "ftp.import.time"; - - public static final String WEBSTORE_AUTOMATED_IMPORT = "webstore.automated.import"; - public static final String WEBSTORE_AUTOMATED_TIME = "webstore.automated.time"; - public static final String WEBSTORE_IMAGE_FOLDER_TOBEPROCESSED = "webstore.folder.tobeprocessed"; - public static final String WEBSTORE_IMAGE_FOLDER_PROCESSED = "webstore.folder.processed"; - public static final String WEBSTORE_IMAGE_FOLDER_ERRORS = "webstore.folder.errors"; - public static final String WEBSTORE_IMAGE_COLLECTION_FOLDER = "webstore.collection.folder"; - public static final String WEBSTORE_IMAGE_INACTIVE_FOLDER = "webstore.inactive.folder"; - - public static final String APPLICATION_TYPE = "application.type"; - public static final String SMTP_AUTH = "smtp.authorisation"; - public static final String SMTP_USERNAME = "smtp.username"; - public static final String SMTP_PASSWORD = "smtp.password"; -*/} diff --git a/posterita/posterita/src/main/org/posterita/lib/UdiConstants.java b/posterita/posterita/src/main/org/posterita/lib/UdiConstants.java deleted file mode 100644 index b8e7afd4c8..0000000000 --- a/posterita/posterita/src/main/org/posterita/lib/UdiConstants.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.lib; - -import org.compiere.util.Env; - - -public class UdiConstants -{ - public static final String ACCOUNTING_FILE="/config/accounting/AccountingUS.csv"; - //public static int CURRENCY_EURO=102; - public static final int CURRENCY_USD=100; - public static final int COUNTRY_SOUTH_AFRICA=305; - public static final int COUNTRY_MAURITIUS = 245; - public static final int COUNTRY_US = 100; - public static final int CURRENCY_RUPEES = 280; - - public static final int UOM_EACH_ID = 100; - - public static String POS_VERSION = ""; - public static String INVALID_LICENSING_REASON = ""; - - public static final String THUMBNAIL_IMAGE_PREFIX = "THUMB-"; - public static final String FULL_IMAGE_PREFIX = "FULL-"; - public static final String FULL_IMAGE = "fullImage"; - public static final String THUMBNAIL = "thumbnail"; - public static final String DEFAULT_IMAGE = "Default"; - public static final String IMAGE_EXTENSION = ".jpg"; - public static final String IMPORT_AUTOMATATION_ON = "ON"; - - public static final String CLIENT_ID_CTX_PARAM = "#AD_Client_ID"; - public static final String ORG_ID_CTX_PARAM = "#AD_Org_ID"; - public static final String AD_ROLE_ID = "#AD_Role_ID"; - public static final String CSS = "webParam5"; - public static final String FORWARD = "webParam6"; - public static final String MODULE_NAME_CTX_PARAM = "#ModuleName"; - //public static final String WEBPARAM6 = "webParam6"; - public static final String PRICELIST_CTX_PARAM = "#M_PriceList_ID"; - public static final String PRICELIST_VERSION_CTX_PARAM = "#M_Pricelist_Version_ID"; - public static final String PRODUCT_CATEGORY_CTX_PARAM = "#M_Product_Category_ID"; - public static final String USER_ID_CTX_PARAM = "#AD_User_ID"; - public static final String ROLE_EDITABLE_ORGS_CTX_PARAM = "#Role_Editable_Org_Access"; - public static final String ROLE_VIEWABLE_ORGS_CTX_PARAM = "#Role_Viewable_Org_Access"; - public static final String LANGUAGE_CTX_PARAM = "#AD_Language"; - public static final String WSTORE_CTX_PARAM = "#W_Store_ID"; - - public static final String DEFAULT_FORWARD = "pos"; - - public static final String WEBSTORE_DEFAULT_AD_ORG_ID_CTX_PARAM = "#AD_Org_ID_WebStoreDefault"; - - public static final String WAREHOUSE_CTX_PARAM = "#M_Warehouse_ID"; - - public static final String WEBSTORE_APP_SUFFIX = "WEBSTORE"; - - public static final String REQUEST_UPDATE_EMAIL_PREFIX = "`EMAIL`"; - public static final String REQUEST_UPDATE_EMAIL_EXT = ".txt"; - - public static final String PRINTFORMAT_ITEM_LOGO = "Logo"; - public static final String FIDELITY_BACKGROUND_IMAGE = "Fidelity"; - - - public static final String PAYMENTRULE_MIXED = "M"; - - - public static final String SHIPMENT_CHARGE = "Shipment Charge"; - - public static final String TERMINAL_ID = Env.POS_ID; - public static final String U_POSTERMINAL_ID = "#U_POSTerminal_ID"; - public static final String POS_PURCHASE_PL = "#POSPurchasePL"; - public static final String POS_PURCHASE_PL_VERSION = "#POSPurchasePLVersion"; - public static final String WEB_USER_ROLE = "WebStoreUserRole"; - public static final String ORIGINAL_IMAGE = "originalImage"; - public static final String TAMAK_ADMIN_ROLE = "posterita Admin"; - public static final String TAMAK_USER_ROLE = "posterita User"; - public static final String WEBSTORE_USER_ROLE = "WebStoreUserRole"; - - - public static final String EMAIL_FOOTER_MESSAGE = "Powered by Tamak ICT - CRM Module for Compiere ERP/CRM"; - -} diff --git a/posterita/posterita/src/main/org/posterita/model/MMAttachment.java b/posterita/posterita/src/main/org/posterita/model/MMAttachment.java deleted file mode 100644 index 025b781b01..0000000000 --- a/posterita/posterita/src/main/org/posterita/model/MMAttachment.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 10, 2006 by ashley -* -*/ - -package org.posterita.model; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.Properties; - -import org.compiere.model.MAttachment; -import org.compiere.util.DB; - -import org.posterita.exceptions.OperationException; - -public class MMAttachment extends MAttachment -{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - private MMAttachment(Properties ctx, int AD_Table_ID, int Record_ID, String trxName) - { - super(ctx, AD_Table_ID, Record_ID, trxName); - } - - public static MAttachment get (Properties ctx, int AD_Table_ID, int Record_ID, String trxName) throws OperationException - { - MAttachment retValue = null; - PreparedStatement pstmt = null; - String sql = "SELECT * FROM AD_Attachment WHERE AD_Table_ID=? AND Record_ID=?"; - try - { - pstmt = DB.prepareStatement (sql, trxName); - pstmt.setInt (1, AD_Table_ID); - pstmt.setInt (2, Record_ID); - ResultSet rs = pstmt.executeQuery (); - if (rs.next ()) - retValue = new MAttachment (ctx, rs, trxName); - rs.close (); - pstmt.close (); - pstmt = null; - } - catch (Exception e) - { - throw new OperationException("Cannot get attachment!!!", e); - } - try - { - if (pstmt != null) - pstmt.close (); - pstmt = null; - } - catch (Exception e) - { - pstmt = null; - } - return retValue; - } // get -} diff --git a/posterita/posterita/src/main/org/posterita/order/UDIOrderType.java b/posterita/posterita/src/main/org/posterita/order/UDIOrderType.java deleted file mode 100644 index a29436670a..0000000000 --- a/posterita/posterita/src/main/org/posterita/order/UDIOrderType.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.order; - - -public interface UDIOrderType -{ - public String getOrderType(); -} diff --git a/posterita/posterita/src/main/org/posterita/order/UDIOrderTypes.java b/posterita/posterita/src/main/org/posterita/order/UDIOrderTypes.java deleted file mode 100644 index 61f4c4d524..0000000000 --- a/posterita/posterita/src/main/org/posterita/order/UDIOrderTypes.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.order; - - -public class UDIOrderTypes -{ - private UDIOrderTypes() - { - - } - - public static final UDIOrderType CREDIT_ORDER = new CreditOrder(); - - public static final UDIOrderType CREDIT_ORDER_NO_SHIPMENT = new CreditOrderNoShipment(); - - public static final UDIOrderType CUSTOMER_RETURN_ORDER = new CustomerReturnOrder(); - - public static final UDIOrderType POS_ORDER = new POSOrder(); - - public static final UDIOrderType POS_GOODS_RECEIVE_NOTE = new POSGoodsReceiveNote(); - - public static final UDIOrderType POS_GOODS_RETURN_NOTE = new POSGoodsReturnNote(); - - public static final UDIOrderType WEBSTORE_ORDER = new WebstoreOrder(); - - public static final UDIOrderType CREDIT_MEMO = new CreditMemo(); - - - - public static class POSGoodsReceiveNote implements UDIOrderType - { - - public String getOrderType() - { - return "POS Goods Receive Note"; - } - - } - - public static class CreditMemo implements UDIOrderType - { - - public String getOrderType() - { - return "Credit Memo"; - } - - } - - public static class POSGoodsReturnNote implements UDIOrderType - { - - public String getOrderType() - { - return "POS Goods Returned Note"; - } - - } - - public static class POSOrder implements UDIOrderType - { - - public String getOrderType() - { - return "POS Order"; - } - - } - - public static class CustomerOrder implements UDIOrderType - { - - public String getOrderType() - { - return "Customer Order"; - } - - } - - public static class AllocationOrder implements UDIOrderType - { - public String getOrderType() - { - return "Allocation Order"; - } - - } - - public static class CreditOrder implements UDIOrderType - { - public String getOrderType() - { - return "Credit Order"; - } - } - - public static class CreditOrderNoShipment implements UDIOrderType - { - public String getOrderType() - { - return "Credit Order no Shipment"; - } - } - - public static class CustomerReturnOrder implements UDIOrderType - { - - public String getOrderType() - { - return "Customer Returned Order"; - } - - } - - public static class WebstoreOrder implements UDIOrderType - { - - public String getOrderType() - { - return "Webstore Order"; - } - - } -} diff --git a/posterita/posterita/src/main/org/posterita/pos/help/POSHelpAction.java b/posterita/posterita/src/main/org/posterita/pos/help/POSHelpAction.java deleted file mode 100644 index 3bd9fac91e..0000000000 --- a/posterita/posterita/src/main/org/posterita/pos/help/POSHelpAction.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * 6 Feb 2008 17:25:51 by shameem - * - */ - -package org.posterita.pos.help; - -import java.io.FileNotFoundException; -import java.text.ParseException; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.beans.POSHelpBean; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.form.POSHelpForm; -import org.posterita.struts.core.BaseDispatchAction; - -import com.lowagie.text.DocumentException; - -public class POSHelpAction extends BaseDispatchAction -{ - public static final String INIT_CONTACT_US= "initContactUs"; - public ActionForward initContactUs(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, ParseException, FileNotFoundException, DocumentException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(INIT_CONTACT_US); - } - - public static final String SEND_EMAIL = "sendEmail"; - - public ActionForward sendEmail(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, ParseException, FileNotFoundException, DocumentException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - boolean Ok = false; - - POSHelpForm hf = (POSHelpForm) form; - POSHelpBean bean = (POSHelpBean) hf.getBean(); - - if(bean.getFromAddress().equals("")) - { - postGlobalError("error.required.email",request); - return mapping.getInputForward(); - } - - if(bean.getSubject().equals("")) - { - postGlobalError("email.subject.error",request); - return mapping.getInputForward(); - } - - if(bean.getTextMessage().equals("")) - { - postGlobalError("email.message.error",request); - return mapping.getInputForward(); - } - - - Ok = POSHelpManager.sendEmail(ctx, bean.getFromAddress(), bean.getToAddresses(), bean.getSubject(), bean.getTextMessage()); - - if(Ok == false) - { - postGlobalError("email.send.error",request); - return mapping.getInputForward(); - } - else - { - return mapping.findForward(SEND_EMAIL); - } - - } -} diff --git a/posterita/posterita/src/main/org/posterita/pos/help/POSHelpManager.java b/posterita/posterita/src/main/org/posterita/pos/help/POSHelpManager.java deleted file mode 100644 index 50227edbad..0000000000 --- a/posterita/posterita/src/main/org/posterita/pos/help/POSHelpManager.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * Copyright (c) 2008 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * 11 Feb 2008 10:20:44 by shameem - * - */ - -package org.posterita.pos.help; - -import java.util.Properties; -import java.util.logging.Level; - -import org.compiere.model.MClient; -import org.compiere.util.EMail; - -public class POSHelpManager -{ - - public static boolean sendEmail(Properties ctx, String from, String to, String subject, String body) - { - String emailAddress = to; - - MClient client = MClient.get(ctx); - - EMail email = client.createEMail(emailAddress, subject, body); - email.setFrom(from); - if (email != null) - { - if (EMail.SENT_OK.equals (email.send ())) - { - return true; - } - } - - client.get_Logger().log(Level.SEVERE, "Unable to sent email"); - - return false; - - } -} diff --git a/posterita/posterita/src/main/org/posterita/pos/taglib/AjaxTag.java b/posterita/posterita/src/main/org/posterita/pos/taglib/AjaxTag.java deleted file mode 100644 index 6eae32e6ba..0000000000 --- a/posterita/posterita/src/main/org/posterita/pos/taglib/AjaxTag.java +++ /dev/null @@ -1,34 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.pos.taglib; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author Ashley G Ramdass - * Apr 28, 2008 - */ -public interface AjaxTag -{ - public static final String AJAX_ACTION = "AjaxAction.do"; - - public abstract void processRequest(HttpServletRequest request, HttpServletResponse response); -} diff --git a/posterita/posterita/src/main/org/posterita/pos/taglib/BPartnerSearchTag.java b/posterita/posterita/src/main/org/posterita/pos/taglib/BPartnerSearchTag.java deleted file mode 100644 index c649ba6471..0000000000 --- a/posterita/posterita/src/main/org/posterita/pos/taglib/BPartnerSearchTag.java +++ /dev/null @@ -1,427 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.pos.taglib; - -import java.io.OutputStream; -import java.io.PrintWriter; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.ArrayList; -import java.util.Properties; -import java.util.logging.Level; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.JspWriter; -import javax.servlet.jsp.tagext.TagSupport; - -import org.apache.commons.beanutils.BeanUtils; -import org.apache.ecs.xhtml.div; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.script; -import org.compiere.model.I_C_BPartner; -import org.compiere.model.MBPartner; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.businesslogic.ElementManager; -import org.posterita.struts.core.AjaxAction; - -/** - * @author Ashley G Ramdass - * Apr 22, 2008 - */ -public class BPartnerSearchTag extends TagSupport implements AjaxTag -{ - /** - * - */ - private static final long serialVersionUID = 8706630531517614664L; - private static final CLogger log = CLogger.getCLogger(BPartnerSearchTag.class); - private static final String REQUEST_PARAM = "bpValue"; - private String name = ""; - private String property = ""; - private boolean disabled = false; - private boolean isCustomer = false; - private boolean isVendor = false; - private boolean isEmployee = false; - private boolean showNonActive = false; - private int size = 20; - private String queryId = ""; - private String resultId = ""; - private String searchTerm; - private int bpartnerId = 0; - private String bpartnerValue = ""; - - - public int doStartTag() throws JspException - { - JspWriter out = pageContext.getOut(); - bpartnerId = 0; - bpartnerValue = ""; - try - { - HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); - - Object form = request.getAttribute(name); - - if (form == null) - { - form = request.getSession().getAttribute(name); - } - - String value = (String)BeanUtils.getSimpleProperty(form, property); - if (value != null && value.trim().length() > 0) - { - bpartnerId = Integer.parseInt(value); - } - - if (bpartnerId > 0) - { - MBPartner bPartner = new MBPartner(TmkJSPEnv.getCtx((HttpServletRequest)pageContext.getRequest()), bpartnerId, null); - bpartnerValue = bPartner.getName(); - } - } - catch (Exception ex) - { - log.log(Level.SEVERE, "Could not get value of BPartner", ex); - bpartnerId = -1; - } - - queryId = property + "Query"; - resultId = property + "SearchResult"; - - input bpInput = new input(); - bpInput.setID(property); - bpInput.setName(property); - bpInput.setType(input.TYPE_HIDDEN); - if (bpartnerId > 0) - { - bpInput.setValue(bpartnerId); - } - - input queryInput = new input(); - queryInput.setType(input.TYPE_TEXT); - queryInput.setID(queryId); - queryInput.setValue(bpartnerValue); - queryInput.setDisabled(disabled); - queryInput.setSize(size); - - div resultDiv = new div(); - resultDiv.setID(resultId); - resultDiv.setClass("autocomplete"); - - div mainDiv = new div(); - mainDiv.addElement(bpInput); - mainDiv.addElement(queryInput); - mainDiv.addElement(resultDiv); - mainDiv.addElement(getAjaxScript()); - - try - { - out.write(mainDiv.toString()); - } - catch (Exception ex) - { - throw new JspException(ex); - } - - return SKIP_BODY; - } - - public int doEndTag() throws JspException - { - return EVAL_PAGE; - } - - private script getAjaxScript() - { - script ajaxScript = new script(); - - StringBuffer src = new StringBuffer(400); - src.append("// auto complete for customer\n"); - src.append("$('").append(queryId).append("').Autocompleter = new Ajax.Autocompleter('") - .append(queryId).append("','").append(resultId).append("',\n"); - src.append("'").append(AJAX_ACTION).append("',{\n"); - src.append("paramName:'").append(REQUEST_PARAM).append("',\n"); - src.append("parameters: 'action=processRequest&").append(AjaxAction.PROCESS_REQUEST_PARAM).append("=BPartnerSearchTag") - .append("&isCustomer=").append(isCustomer).append("&isVendor=").append(isVendor).append("&isEmployee=").append(isEmployee).append("',\n"); - src.append("frequency:TROTTLE_TIME,\n"); - src.append("onShow:function(element, update){\n"); - src.append(" if(!update.style.position || update.style.position=='absolute') {\n"); - src.append(" update.style.position = 'absolute';\n"); - src.append(" Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight});\n"); - src.append(" }\n"); - src.append(" update.style.display = 'block';\n"); - src.append("},\n"); - src.append("afterUpdateElement:function(e1,e2) {\n"); - src.append(" var id = $('").append(property).append("');\n"); - src.append(" var text = $('").append(queryId).append("');\n"); - src.append(" if(e2.value != '-1')\n"); - src.append(" {\n"); - src.append(" if(e2.value)\n"); - src.append(" {\n"); - //src.append(" alert(e2.value);"); - src.append(" id.value = e2.value;\n"); - src.append(" text.value = e2.getAttribute('name');\n"); - src.append(" }\n"); - src.append(" else\n"); - src.append(" {\n"); - //src.append(" alert('Setting blank');"); - src.append(" id.value = '';\n"); - src.append(" }\n"); - src.append(" }\n"); - src.append(" else\n"); - src.append(" {\n"); - //src.append(" alert('set blank');"); - src.append(" id.value = '';\n"); - src.append(" text.value = '';\n"); - src.append(" }//if\n"); - src.append("}\n"); - src.append("});\n"); - - ajaxScript.setTagText(src.toString()); - return ajaxScript; - } - - - private ArrayList getBPartnerList(Properties ctx) - { - ArrayList bpartnerList = new ArrayList(); - - StringBuffer sqlStmt = new StringBuffer(); - sqlStmt.append("SELECT * FROM C_BPartner WHERE AD_Client_ID=? AND IsActive='Y' AND IsCustomer=? "); - sqlStmt.append("AND IsVendor=? AND IsEmployee=? "); - - if (searchTerm != null && searchTerm.trim().length() != 0) - { - sqlStmt.append("AND UPPER(Name) LIKE '%").append(searchTerm.toUpperCase()).append("%' "); - } - - sqlStmt.append("ORDER BY Name"); - - PreparedStatement pstmt = null; - ResultSet rs = null; - - try - { - int param = 1; - pstmt = DB.prepareStatement(sqlStmt.toString(), null); - pstmt.setInt(param++, Env.getAD_Client_ID(ctx)); - pstmt.setString(param++, isCustomer ? "Y" : "N"); - pstmt.setString(param++, isVendor ? "Y" : "N"); - pstmt.setString(param++, isEmployee ? "Y" : "N"); - - rs = pstmt.executeQuery(); - - while (rs.next()) - { - MBPartner bPartner = new MBPartner(ctx, rs, null); - bpartnerList.add(bPartner); - } - } - catch (Exception ex) - { - log.log(Level.SEVERE, "Could not retrieve BPartners", ex); - } - finally - { - DB.close(rs, pstmt); - } - return bpartnerList; - } - - private void writeOutput(Properties ctx, OutputStream outStream, ArrayList bpartnerList) - { - PrintWriter writer = new PrintWriter(outStream); - - if (bpartnerList == null || bpartnerList.size() == 0) - { - writer.write("
      "); - writer.write("
    • "); - writer.write("
    "); - writer.write("
    "); - } - else - { - writer.write("
      "); - for (I_C_BPartner bpartner : bpartnerList) - { - writer.write("
    • "); - writer.write(bpartner.getName()); - writer.write("
    • "); - } - writer.write("
    "); - } - - writer.flush(); - writer.close(); - } - - public void processRequest(HttpServletRequest request, HttpServletResponse response) - { - Properties ctx = TmkJSPEnv.getCtx(request); - isCustomer = Boolean.parseBoolean(request.getParameter("isCustomer")); - isVendor = Boolean.parseBoolean(request.getParameter("isVendor")); - isEmployee = Boolean.parseBoolean(request.getParameter("isEmployee")); - searchTerm = request.getParameter(REQUEST_PARAM); - - try - { - ArrayList bpartnerList = getBPartnerList(ctx); - writeOutput(ctx, response.getOutputStream(), bpartnerList); - response.getOutputStream().flush(); - } - catch (Exception ex) - { - log.log(Level.SEVERE, "Could not write output", ex); - } - } - - /** - * @return the isCustomer - */ - public boolean getIsCustomer() - { - return isCustomer; - } - - /** - * @param isCustomer the isCustomer to set - */ - public void setIsCustomer(boolean isCustomer) - { - this.isCustomer = isCustomer; - } - - /** - * @return the isVendor - */ - public boolean getIsVendor() - { - return isVendor; - } - - /** - * @param isVendor the isVendor to set - */ - public void setIsVendor(boolean isVendor) - { - this.isVendor = isVendor; - } - - /** - * @return the isEmployee - */ - public boolean getIsEmployee() - { - return isEmployee; - } - - /** - * @param isEmployee the isEmployee to set - */ - public void setIsEmployee(boolean isEmployee) - { - this.isEmployee = isEmployee; - } - - /** - * @return the showNonActive - */ - public boolean getIsShowNonActive() - { - return showNonActive; - } - - /** - * @param showNonActive the showNonActive to set - */ - public void setIsShowNonActive(boolean showNonActive) - { - this.showNonActive = showNonActive; - } - - /** - * @return the id - */ - public String getProperty() - { - return property; - } - - /** - * @param id the id to set - */ - public void setProperty(String id) - { - this.property = id; - } - - /** - * @return the name - */ - public String getName() - { - return name; - } - - /** - * @param name the name to set - */ - public void setName(String name) - { - this.name = name; - } - - /** - * @return the disabled - */ - public boolean isDisabled() - { - return disabled; - } - - /** - * @param disabled the disabled to set - */ - public void setDisabled(boolean disabled) - { - this.disabled = disabled; - } - - /** - * @return the size - */ - public int getSize() - { - return size; - } - - /** - * @param size the size to set - */ - public void setSize(int size) - { - this.size = size; - } -} diff --git a/posterita/posterita/src/main/org/posterita/pos/taglib/MessageTag.java b/posterita/posterita/src/main/org/posterita/pos/taglib/MessageTag.java deleted file mode 100644 index 84908ebfdd..0000000000 --- a/posterita/posterita/src/main/org/posterita/pos/taglib/MessageTag.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on Nov 15, 2006 by ashley - */ - -/** - * @author ashley - */ - -package org.posterita.pos.taglib; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.jsp.JspException; -import javax.servlet.jsp.JspWriter; -import javax.servlet.jsp.tagext.TagSupport; - -import org.compiere.wstore.JSPEnv; - -import org.posterita.core.bean.ElementBean; -import org.posterita.core.businesslogic.ElementManager; - -public class MessageTag extends TagSupport -{ - private static final long serialVersionUID = 1L; - - private String key; - private boolean printing = false; - private boolean textOnly = false; - - public int doStartTag() throws JspException - { - Properties ctx = JSPEnv.getCtx((HttpServletRequest)pageContext.getRequest()); - - ElementBean elementBean = ElementManager.getMsg(ctx, key); - - String disp = ""; - - if (isPrinting()) - { - disp = elementBean.getPrintName(); - } - else - { - disp = elementBean.getName(); - } - - try - { - JspWriter out = pageContext.getOut(); - if (this.isTextOnly()) - { - out.write(elementBean.getName()); - } - else - { - String help = ((elementBean.getHelp() != null) ? elementBean.getHelp() : ""); - out.print(""); - out.print(disp); - out.print(""); - } - } - catch (Exception e) - { - throw new JspException(e); - } - - return (SKIP_BODY); - } - - public int doEndTag() throws JspException - { - return EVAL_PAGE; - } - - public String getKey() - { - return key; - } - - public void setKey(String key) - { - this.key = key; - } - - public boolean isPrinting() - { - return printing; - } - - public void setPrinting(boolean printing) - { - this.printing = printing; - } - - public boolean isTextOnly() - { - return textOnly; - } - - public void setTextOnly(boolean textOnly) - { - this.textOnly = textOnly; - } -} diff --git a/posterita/posterita/src/main/org/posterita/process/SetupWebPOS.java b/posterita/posterita/src/main/org/posterita/process/SetupWebPOS.java deleted file mode 100644 index ccff41bfa1..0000000000 --- a/posterita/posterita/src/main/org/posterita/process/SetupWebPOS.java +++ /dev/null @@ -1,341 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - * Autor: Victor Perez victor.perez@e-evolution.con www.e-evolution.com * - *****************************************************************************/ - -package org.posterita.process; - -import java.math.BigDecimal; -import java.util.Iterator; -import java.util.logging.Level; - -import org.compiere.model.MRole; -import org.compiere.model.MRoleMenu; -import org.compiere.model.MUser; -import org.compiere.process.ProcessInfoParameter; -import org.compiere.process.SvrProcess; -import org.compiere.util.Env; -import org.posterita.factory.POSMenuFactory; -import org.compiere.model.MWebMenu; -import org.posterita.util.PoManager; - - - - -/** - * Setup Web POS in Adempiere - * @author victor.perez@e-evolution - */ -public class SetupWebPOS extends SvrProcess -{ - - - private int p_AD_Org_ID = 0; - private int p_C_CashBook_ID = 0; - private int p_M_PriceList_Version_ID = 0; - private int p_PriceList_Version_ID = 0; - private int p_M_DiscountSchema_ID = 0; - private int p_C_Bank_ID = 0; - private int p_C_BankAccount_ID = 0 ; - private int p_C_TaxCategory_ID = 0 ; - private int p_M_Locator_ID = 0; - private int p_C_BPartner_ID = 0; - private int p_SalesRep_ID = 0; - private int p_AD_Role_ID = 0; - private String p_userPIN = ""; - private String p_POS_Name = "Terminal 1"; - private String p_HostAddress = ""; - - private int AD_Client_ID = 0; - - - - /** - * Prepare - */ - protected void prepare() - { - AD_Client_ID = Env.getAD_Client_ID(getCtx()); - ProcessInfoParameter[] para = getParameter(); - for (int i = 0; i < para.length; i++) - { - String name = para[i].getParameterName(); - - if (para[i].getParameter() == null) - ; - else if (name.equals("AD_Org_ID")) - { - p_AD_Org_ID = para[i].getParameterAsInt(); - } - else if (name.equals("C_CashBook_ID")) - { - p_C_CashBook_ID = para[i].getParameterAsInt(); - } - else if (name.equals("M_PriceList_Version_ID")) - { - p_M_PriceList_Version_ID = para[i].getParameterAsInt(); - } - else if (name.equals("PriceList_Version_ID")) - { - p_PriceList_Version_ID = para[i].getParameterAsInt(); - } - else if (name.equals("M_DiscountSchema_ID")) - { - p_M_DiscountSchema_ID = para[i].getParameterAsInt(); - } - else if (name.equals("C_Bank_ID")) - { - p_C_Bank_ID = para[i].getParameterAsInt(); - } - else if (name.equals("C_BankAccount_ID")) - { - p_C_BankAccount_ID = para[i].getParameterAsInt(); - } - else if (name.equals("C_TaxCategory_ID")) - { - p_C_TaxCategory_ID = para[i].getParameterAsInt(); - } - else if (name.equals("M_Locator_ID")) - { - p_M_Locator_ID = para[i].getParameterAsInt(); - } - else if (name.equals("C_BPartner_ID")) - { - p_C_BPartner_ID = para[i].getParameterAsInt(); - } - else if (name.equals("SalesRep_ID")) - { - p_SalesRep_ID = para[i].getParameterAsInt(); - } - else if (name.equals("AD_Role_ID")) - { - p_AD_Role_ID = para[i].getParameterAsInt(); - } - else if (name.equals("UserPIN")) - { - p_userPIN = (String)para[i].getParameter(); - } - else if (name.equals("Name")) - { - p_POS_Name = (String)para[i].getParameter(); - } - else if (name.equals("HostAddress")) - { - p_HostAddress = (String)para[i].getParameter(); - } - else - { - log.log(Level.SEVERE, "Unknown Parameter: " + name); - } - } - - } - - - /** - * Process create a new Terminal POS - * @return info - * @throws Exception - */ - protected String doIt() throws Exception - { - CreatePOS(); - createAdmin(); - return "@OK@"; - } - - /** - * Create new terminal web POS - */ - public void CreatePOS() throws Exception - { - // Need to refactor correctly with new terminal @ashley - /*log.info("Creating POS Terminal..."); - MPriceListVersion purchasepricelistversion = new MPriceListVersion(getCtx(), p_PriceList_Version_ID, get_TrxName()); - MPOS posTerminal = null; - int pos_id = DB.getSQLValue(get_TrxName(), "SELECT C_POS_ID FROM C_POS WHERE AD_Client_ID=" + AD_Client_ID + " AND Name='"+p_POS_Name + "'"); - if(pos_id != 0) - { - posTerminal = new MPOS(getCtx(), pos_id , get_TrxName()); - } - else - { - posTerminal = new MPOS(getCtx(), 0 , get_TrxName()); - } - - - posTerminal = new MPOS(getCtx(), 0, get_TrxName()); - posTerminal.setName(p_POS_Name); - posTerminal.setAD_Org_ID(p_AD_Org_ID); - posTerminal.setC_CashBook_ID(p_C_CashBook_ID); - MPriceListVersion pricelistversion = new MPriceListVersion(getCtx(), p_M_PriceList_Version_ID, get_TrxName()); - posTerminal.setM_PriceList_ID(pricelistversion.getM_PriceList_ID()); - MLocator locator = new MLocator (getCtx(), p_M_Locator_ID, get_TrxName()); - posTerminal.setM_Warehouse_ID(locator.getM_Warehouse_ID()); - posTerminal.setC_BPartnerCashTrx_ID(p_C_BPartner_ID); - posTerminal.setSalesRep_ID(p_SalesRep_ID); - posTerminal.setM_PriceList_ID(purchasepricelistversion.getM_PriceList_ID()); - if(!posTerminal.save()) - throw new IllegalArgumentException("can not create POS Terminal"); - - log.info("Creating Web store configuration..."); - MClient client = new MClient(getCtx(), AD_Client_ID, get_TrxName()); - MStore store = null; - int store_id = DB.getSQLValue(get_TrxName(), "SELECT W_STORE_ID FROM W_STORE WHERE AD_Client_ID=" + AD_Client_ID + " AND IsActive='Y' AND Name='"+client.getName() + " POS" + "'"); - if(store_id != 0) - { - store = new MStore(getCtx(), store_id , get_TrxName()); - } - else - { - store = new MStore(getCtx(), 0, get_TrxName()); - } - - store.setName(client.getName() + " POS"); - store.setM_PriceList_ID(purchasepricelistversion.getM_PriceList_ID()); - store.setWebContext(client.getName() + "pos"); - store.setSalesRep_ID(p_SalesRep_ID); - store.setAD_Org_ID(p_AD_Org_ID); - store.setWebParam5("posteritaWarmsCSS.jsp"); - store.setWebParam6("pos"); - store.setURL(p_HostAddress); - store.setM_Warehouse_ID(locator.getM_Warehouse_ID()); - if(!store.save()) - throw new IllegalArgumentException("can not create Web Store");*/ - - return ; - - } - - /** - * Create Admin Role POS web - */ - public void createAdmin() throws Exception - { - - MRole role = new MRole(getCtx(), p_AD_Role_ID, get_TrxName()); - role.setUserDiscount(BigDecimal.valueOf(0.00)); - role.setIsPersonalAccess(true); - role.setIsAccessAllOrgs(false); - role.setUserLevel(MRole.USERLEVEL_Organization); - role.save(); - - /*if(!role.isAccessAllOrgs()) - { - MRoleOrgAccess orgAccess = new MRoleOrgAccess(role,Env.getAD_Org_ID(getCtx())); - orgAccess.save(); - }*/ - - - - MUser user = new MUser(getCtx(), p_SalesRep_ID, get_TrxName()); - user.setIsFullBPAccess(true); - if(p_userPIN!=null) - { - int id[] = MUser.getAllIDs(MUser.Table_Name," AD_Client_ID=" + Env.getAD_Client_ID(getCtx()) + " and userPin='"+p_userPIN + "'",null); - - if(id.length>0) - throw new IllegalArgumentException("User Pin Already exists"); - else - user.setUserPIN(p_userPIN); - } - - user.save(); - - /*int [] commissionIds = MCommission.getAllIDs(MCommission.Table_Name," AD_CLIENT_ID="+Env.getAD_Client_ID(getCtx())+" and C_BPARTNER_ID="+user.getC_BPartner_ID()+" and isActive='Y'",null); - if(commissionIds!=null && commissionIds.length>1) - throw new IllegalArgumentException("Sales rep has more than one commission"+ commissionIds.length); - - MCommission com; - MCommissionLine comLine; - if(commissionIds==null || commissionIds.length<1) - { - com = new MCommission(getCtx(),0,get_TrxName()); - comLine = new MCommissionLine(getCtx(),0,get_TrxName()); - } - else - { - com = new MCommission(getCtx(),commissionIds[0],get_TrxName()); - MCommissionLine [] line =com.getLines(); - if(line.length!=1) - throw new IllegalArgumentException("either No commissionLine or more than One commission Line has bean defined for this bPartner"); - comLine = new MCommissionLine(getCtx(),line[0].get_ID(),get_TrxName()); - } - int [] chargeIds = MCharge.getAllIDs(MCharge.Table_Name, " AD_Client_ID = " + AD_Client_ID + " AND IsDefault='Y'", get_TrxName()); - if(chargeIds.length<1) - { - MCharge charge = new MCharge(getCtx(),0,get_TrxName()); - charge.setName(Msg.translate(getCtx(), "Commission")); - charge.setChargeAmt(new BigDecimal(0)); - //charge.setC_TaxCategory_ID(); - charge.save(); - com.setC_Charge_ID( charge.getC_Charge_ID()); - } - else - { - com.setC_Charge_ID( chargeIds[0]); - } - - - - com.setC_Charge_ID( chargeIds[0]); - com.setName(user.getName()); - com.setC_BPartner_ID(user.getC_BPartner_ID()); - com.setFrequencyType(com.FREQUENCYTYPE_Monthly); - MClient client = new MClient(getCtx(), AD_Client_ID , get_TrxName()); - com.setC_Currency_ID(client.getAcctSchema().getC_Currency_ID()); - com.setDocBasisType(com.DOCBASISTYPE_Receipt); - com.setListDetails(true); - com.save(); - - - - comLine.setC_Commission_ID(com.get_ID()); - comLine.setAmtMultiplier(Env.ZERO); - comLine.setDescription(Msg.translate(getCtx(), "Commission")); - comLine.setCommissionOrders(true); - comLine.setIsPositiveOnly(true); - comLine.setAmtSubtract(Env.ZERO); - comLine.save();*/ - - - String whereClause = " AD_Role_ID=" + role.get_ID(); - - int roleMenuIds[] = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, whereClause, get_TrxName()); - - for(int i = 0; i < roleMenuIds.length; i++) - { - MRoleMenu roleMenu = new MRoleMenu(getCtx(), roleMenuIds[i], get_TrxName()); - roleMenu.delete(true); - } - - - POSMenuFactory posMFactory = POSMenuFactory.getFactoryInstance(getCtx()); - Iterator keyIter = posMFactory.getAllKeys(getCtx()).iterator(); - - while(keyIter.hasNext()) - { - String key = (String)keyIter.next(); - MWebMenu menu = (MWebMenu)posMFactory.get(getCtx(), key); - MRoleMenu roleMenu = new MRoleMenu(getCtx(), 0, get_TrxName()); - roleMenu.setAD_Role_ID(role.get_ID()); - roleMenu.setU_WebMenu_ID(menu.get_ID()); - PoManager.save(roleMenu); - } - - return; - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/admin/CheckSequenceAction.java b/posterita/posterita/src/main/org/posterita/struts/admin/CheckSequenceAction.java deleted file mode 100644 index 6100034d93..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/admin/CheckSequenceAction.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 09-Feb-2006 - */ - - -package org.posterita.struts.admin; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.core.TmkJSPEnv; - -import org.posterita.businesslogic.administration.CheckSequenceManager; -import org.posterita.exceptions.SequenceUpdateException; -import org.posterita.struts.core.BaseDispatchAction; - - -public class CheckSequenceAction extends BaseDispatchAction -{ - public static final String CHECK_SEQUENCE="checkSequence"; - public ActionForward checkSequence(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - try - { - CheckSequenceManager.runProcess(ctx); - } - catch(SequenceUpdateException e) - { - postGlobalError("error.update.sequence",request); - return mapping.getInputForward(); - } - - - return mapping.findForward(CHECK_SEQUENCE); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/admin/OrganisationAction.java b/posterita/posterita/src/main/org/posterita/struts/admin/OrganisationAction.java deleted file mode 100644 index 6050fc8aef..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/admin/OrganisationAction.java +++ /dev/null @@ -1,139 +0,0 @@ -package org.posterita.struts.admin; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.OrgBean; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.WarehouseAlreadyExistsException; -import org.posterita.form.OrgForm; -import org.posterita.struts.core.BaseDispatchAction; - -public class OrganisationAction extends BaseDispatchAction -{ - - public static final String UPDATE_OR_CREATE_ORG = "updateOrCreateOrg"; - public ActionForward updateOrCreateOrg(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, SQLException, WarehouseAlreadyExistsException - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - OrgForm of = (OrgForm) form; - OrgBean bean = (OrgBean) of.getBean(); - - Trx trx = Trx.get(Trx.createTrxName(), true); - - try - { - trx.start(); - OrganisationManager.updateOrCreateOrganisation(ctx, bean, trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.process", e.getMessage(), request); - } - finally - { - trx.close(); - } - ArrayList list = OrganisationManager.getOrganisations(ctx, bean.getOrgName(), null); - - request.getSession().setAttribute(Constants.ALL_ORGS, list); - return mapping.findForward(LIST_ORGS); - } - - public static final String LIST_ORGS = "listOrgs"; - public ActionForward listOrgs(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, SQLException - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - OrgForm of = (OrgForm) form; - OrgBean bean = (OrgBean) of.getBean(); - - String orgName = bean.getOrgName(); - ArrayList list = OrganisationManager.getOrganisations(ctx, orgName, null); - - request.getSession().setAttribute(Constants.ALL_ORGS, list); - return mapping.findForward(LIST_ORGS); - } - - public static final String ACTIVATE_ORG = "activateOrg"; - public ActionForward activateOrg(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - OrgForm of = (OrgForm) form; - OrgBean bean = (OrgBean) of.getBean(); - - Trx trx = Trx.get(Trx.createTrxName(), true); - - try - { - trx.start(); - OrganisationManager.activateOrganisation(ctx, bean, trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.process", e.getMessage(), request); - } - finally - { - trx.close(); - } - ArrayList list = new ArrayList(); - list.add(OrganisationManager.getOrganisation(ctx, bean.getOrgId())); - - request.getSession().setAttribute(Constants.ALL_ORGS, list); - return mapping.findForward(LIST_ORGS); - } - - public static final String VIEW_ORG = "viewOrg"; - public ActionForward viewOrg(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, SQLException - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - OrgForm of = (OrgForm) form; - - OrgBean bean = (OrgBean) of.getBean(); - bean = OrganisationManager.getOrganisation(ctx, bean.getOrgId()); - of.populate(bean); - - request.getSession().setAttribute(Constants.ORG_ID,bean.getOrgId()); - return mapping.findForward(UPDATE_OR_CREATE_ORG); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/admin/RoleAction.java b/posterita/posterita/src/main/org/posterita/struts/admin/RoleAction.java deleted file mode 100644 index 3eec984603..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/admin/RoleAction.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 16, 2005 by praveen - * - */ -package org.posterita.struts.admin; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MRole; -import org.compiere.util.Trx; -import org.posterita.core.TmkJSPEnv; - -import org.posterita.Constants; -import org.posterita.beans.RoleBean; -import org.posterita.businesslogic.MenuManager; -import org.posterita.businesslogic.administration.RoleManager; -import org.posterita.core.MenuItem; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.RoleAlreadyExistsException; -import org.posterita.exceptions.SystemException; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - -public class RoleAction extends BaseDispatchAction -{ - public static final String CREATE_ROLE = "createRole"; - public static final String INIT_ROLE = "initRole"; - public static final String LIST_ROLES = "listRoles"; - public static final String VIEW_ROLE = "viewRole"; - public static final String DELETE_ROLE = "deleteRole"; - - public ActionForward createRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - RoleBean bean = (RoleBean) df.getBean(); - - - //Create Role and assign menus - MRole role; - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - trx.start(); - try - { - role = RoleManager.createRole(ctx,bean.getOrgId(), bean.getName(),bean.getIsAccessAllOrgs(), bean.getCheckBox(), bean.getUserDiscount(), bean.getIsOverwritePriceLimit() , bean.getIsDiscountAllowedOnTotal(), bean.getIsDiscountUptoLimitPrice(), bean.getCanCreateOrder(), bean.getCanAlterOrder(), bean.getCanViewOrder(), trx.getTrxName()); - ArrayList menus = MenuManager.getMenus(ctx, role.get_ID()); - MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); - - request.getSession().setAttribute(Constants.ROLE,bean); - request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); - trx.commit(); - } - catch (RoleAlreadyExistsException e) - { - trx.rollback(); - postGlobalError("error.role.already.exists",request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return mapping.findForward(CREATE_ROLE); - - } - - public ActionForward initRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - //ArrayList menuList = MenuKeyNamePair.getKeyNamePairs(ctx); - - //String menu = MenuItem.getMenu(ctx, null); - - //request.getSession().setAttribute(Constants.MENUS,menu); - - ArrayList menus = MenuManager.getMenusForOrganisationType(ctx); - MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); - - //request.getSession().setAttribute(Constants.ROLE,bean); - request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); - - return mapping.findForward(CREATE_ROLE); - - } - - public ActionForward listRoles(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList roles = RoleManager.getAllRoles(ctx); - - request.getSession().setAttribute(Constants.ALL_ROLES,roles); - - return mapping.findForward(LIST_ROLES); - - } - - public ActionForward deleteRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - Integer roleId = Integer.valueOf(df.getRoleId()); - - RoleManager.deleteRole(ctx,roleId.intValue()); - - return mapping.findForward(DELETE_ROLE); - } - - - public ActionForward viewRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - Integer roleId = Integer.valueOf(df.getRoleId()); - - RoleBean bean = RoleManager.getRole(ctx,roleId.intValue()); - - //ArrayList menus = MenuItem.getMenu(ctx,roleId.intValue()); - - //request.getSession().setAttribute(Constants.MENUS,menus); - - ArrayList menus = MenuManager.getMenus(ctx, roleId.intValue()); - MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); - - request.getSession().setAttribute(Constants.ROLE,bean); - request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); - - request.getSession().setAttribute(Constants.ROLE,bean); - - return mapping.findForward(VIEW_ROLE); - - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/attachment/AttachmentAction.java b/posterita/posterita/src/main/org/posterita/struts/attachment/AttachmentAction.java deleted file mode 100644 index 1f16aaa74d..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/attachment/AttachmentAction.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Aug-2005 by alok - * - */ -package org.posterita.struts.attachment; - -import java.io.FileNotFoundException; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.upload.FormFile; -import org.compiere.util.Trx; -import org.posterita.core.TmkJSPEnv; - -import org.posterita.Constants; -import org.posterita.beans.AttachmentBean; -import org.posterita.businesslogic.core.AttachmentManager; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - -public class AttachmentAction extends BaseDispatchAction -{ - public static final String CREATE_ATTACHMENT = "createAttachment"; - public ActionForward createAttachment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - - AttachmentBean bean = (AttachmentBean) df.getBean(); - - FormFile logo = (FormFile) df.getLogo(); - - Trx trx = Trx.get(Trx.createTrxName(TrxPrefix.getPrefix()), true); - - - try - { - trx.start(); - AttachmentManager.attachImage(ctx,logo,bean.getLogoName()); - trx.commit(); - } - catch (FileNotFoundException e) - { - trx.rollback(); - postGlobalError("error.source.file.notpresent", request); - mapping.getInputForward(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.file.save", request); - mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return mapping.findForward(CREATE_ATTACHMENT); - - } - - public static final String GET_ATTACHMENT = "getAttachment"; - - public ActionForward getAttachment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - AttachmentBean bean = (AttachmentBean) df.getBean(); - String logo = AttachmentManager.getImage(ctx,bean.getLogoName()); - - request.getSession().setAttribute(Constants.GET_LOGO,logo); - - return mapping.findForward(GET_ATTACHMENT); - - } - -} - - - - - - - - - - - - - - diff --git a/posterita/posterita/src/main/org/posterita/struts/attachment/ImageAttachmentAction.java b/posterita/posterita/src/main/org/posterita/struts/attachment/ImageAttachmentAction.java deleted file mode 100644 index 07e5a51c3b..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/attachment/ImageAttachmentAction.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Mar 13, 2006 by praveen - * - */ -package org.posterita.struts.attachment; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.exceptions.ApplicationException; -import org.posterita.struts.core.BaseDispatchAction; - -public class ImageAttachmentAction extends BaseDispatchAction -{ - public ActionForward getImage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return null; - } - - public ActionForward getThumbnailImage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return null; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/attributes/AttributesAction.java b/posterita/posterita/src/main/org/posterita/struts/attributes/AttributesAction.java deleted file mode 100644 index 57faaeb1f4..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/attributes/AttributesAction.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 26-Aug-2005 by alok - * - */ - -package org.posterita.struts.attributes; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.util.KeyNamePair; -import org.posterita.Constants; -import org.posterita.beans.AttributeValueDetailBean; -import org.posterita.businesslogic.AttributeValuesManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - -public class AttributesAction extends BaseDispatchAction -{ - public static final String INIT_VIEW_ATTRIBUTEVALUES = "initViewAttributeValues"; - public ActionForward initViewAttributeValues(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList attributeList = AttributeValuesManager.getAttributes(ctx); - - request.getSession().setAttribute(Constants.ATTRIBUTE_LIST, attributeList); - - return mapping.findForward(INIT_VIEW_ATTRIBUTEVALUES); - } - - public static final String LIST_ATTRIBUTEVALUES = "listAttributeValues"; - public ActionForward listAttributeValues(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm)form; - - AttributeValueDetailBean attrValBean = (AttributeValueDetailBean)df.getBean(); - - ArrayList attributeValuesList =null; - if(attrValBean.getAttributeId()!=null) - { - attributeValuesList= AttributeValuesManager.getAttributeValues(ctx, attrValBean.getAttributeId().intValue()); - request.setAttribute(Constants.ATTRIBUTE_VALUES_LIST, attributeValuesList); - } - - return mapping.findForward(LIST_ATTRIBUTEVALUES); - } - - - - public static final String INITEDIT_ATTRIBUTEVALUE = "initEditAttributeValue"; - public ActionForward initEditAttributeValue(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(INITEDIT_ATTRIBUTEVALUE); - } - - /*public static final String EDIT_ATTRIBUTEVALUE = "editAttributeValue"; - public ActionForward editAttributeValue(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm)form; - - AttributeValueDetailBean attrBean = (AttributeValueDetailBean)df.getBean(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - trx.start(); - - try - { - int newAttrValueId = AttributeValuesManager.changeAttributeValue(ctx, attrBean.getAttributeValueId().intValue(), attrBean.getNewName(), trx.getTrxName()); - WBProductManager.updateProductsAttribute(ctx, attrBean.getAttributeValueId().intValue(), newAttrValueId, attrBean.getAttributeId().intValue(), trx.getTrxName()); - trx.commit(); - } - catch(Exception ex) - { - trx.rollback(); - postGlobalError("error.updating.attribute", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - - return mapping.findForward(EDIT_ATTRIBUTEVALUE); - } */ - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/bPartner/BPartnerAction.java b/posterita/posterita/src/main/org/posterita/struts/bPartner/BPartnerAction.java deleted file mode 100644 index b27ac9904f..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/bPartner/BPartnerAction.java +++ /dev/null @@ -1,301 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ -package org.posterita.struts.bPartner; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MOrg; -import org.compiere.util.Trx; - -import org.posterita.Constants; -import org.posterita.beans.BPartnerBean; -import org.posterita.beans.StatementOfAccountBean; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.BPartnerAlreadyExistsException; -import org.posterita.exceptions.OperationException; -import org.posterita.form.BPartnerForm; -import org.posterita.form.CreateBPartnerForm; -import org.posterita.keyname.RegionKeyNamePair; -import org.posterita.lib.UdiConstants; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - - -public class BPartnerAction extends BaseDispatchAction -{ - public static final String CREATE_BPARTNER = "createBPartner"; - public static final String GET_REGION = "getRegion"; - - public ActionForward getRegion(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList region = RegionKeyNamePair.getKeyNamePairs(ctx); - request.getSession().setAttribute(Constants.REGIONS,region); - - return mapping.findForward(GET_REGION); - - } - - public ActionForward createBPartner(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - DefaultForm df = (DefaultForm) form; - - BPartnerBean bean = (BPartnerBean) df.getBean(); - - Properties ctx = TmkJSPEnv.getCtx(request); - - MOrg parentOrg = OrganisationManager.getMyOrg(ctx); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - trx.start(); - - try - { - int countryId =UdiConstants.COUNTRY_SOUTH_AFRICA; - BPartnerManager.createBPartner(ctx, parentOrg.get_ID(), parentOrg.getLinkedC_BPartner_ID(null), bean.getPartnerName(),bean.getName2(),bean.getIsCustomer().booleanValue(),bean.getIsVendor().booleanValue(),bean.getIsEmployee().booleanValue(),bean.getIsSalesRep().booleanValue(),bean.getAddress1(),bean.getAddress2(),bean.getPostalAddress(), bean.getRegionId(), bean.getCity(),bean.getPhone(),bean.getFax(),countryId, true, true, trx.getTrxName()); - - request.getSession().setAttribute(Constants.BUSINESSPARTNER,bean); - trx.commit(); - } - catch(BPartnerAlreadyExistsException exp) - { - trx.rollback(); - postGlobalError("error.bp.alreadyexist", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - - return mapping.findForward(CREATE_BPARTNER); - } - - - - //------------------------------------------------------------------------------------------------------- - - public static final String INIT_EDIT_BPARTNER_DETAILS = "initEditBpartnerDetails"; - public ActionForward initEditBpartnerDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - CreateBPartnerForm bPf = (CreateBPartnerForm) form; - - int bPartnerId = Integer.parseInt(bPf.getBpartnerId()); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - BPartnerBean bean = new BPartnerBean(); - - try - { - trx.start(); - bean = BPartnerManager.getBpartner(ctx,bPartnerId, trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.get.partner.detail", request); - mapping.getInputForward(); - } - finally - { - trx.close(); - } - - bPf.populate(bean); - - ArrayList region = RegionKeyNamePair.getKeyNamePairs(ctx); - request.getSession().setAttribute(Constants.REGIONS,region); - - return mapping.findForward(INIT_EDIT_BPARTNER_DETAILS); - } - - public static final String EDIT_BPARTNER_DETAILS = "editBpartnerDetails"; - public ActionForward editBpartnerDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - BPartnerBean bean = (BPartnerBean) df.getBean(); - - - BPartnerManager.editBPartner(ctx, bean.getOrgId() , bean.getBpartnerId().intValue(), bean.getPartnerName(),bean.getName2(),bean.getIsCustomer().booleanValue(),bean.getIsVendor().booleanValue(),bean.getIsEmployee().booleanValue(),bean.getIsSalesRep().booleanValue(),bean.getAddress1(),bean.getAddress2(),bean.getPostalAddress(),bean.getCity(),bean.getPhone(),null,bean.getFax(),0,null); - - - return mapping.findForward(EDIT_BPARTNER_DETAILS); - } - - public static final String ACTIVATE_BPARTNER = "activateBPartner"; - public ActionForward activateBPartner(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - int bpartnerId = Integer.parseInt(df.getBpartnerId()); - boolean isActive = Boolean.parseBoolean(df.getIsActive()); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - - try - { - trx.start(); - BPartnerManager.activateBPartner(ctx,bpartnerId,isActive,trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.activate.partner", request); - mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return mapping.findForward(ACTIVATE_BPARTNER); - } - - public static final String SEARCH_BPARTNER = "searchBPartner"; - public ActionForward searchBPartner(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - - ArrayList bplist = new ArrayList(); - - bplist = BPartnerManager.searchBpartners(ctx,df.getName(),null); - - request.getSession().setAttribute(Constants.ALLBUSINESSPARTNERS,bplist); - return mapping.findForward(SEARCH_BPARTNER); - } - - public static final String GET_CREDITORS = "getCreditors"; - public ActionForward getCreditors(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList bplist = BPartnerManager.getCreditorsDebtors(ctx, true, null); - - request.getSession().setAttribute(Constants.CREDITORS,bplist); - return mapping.findForward(GET_CREDITORS); - } - - public static final String GET_DEBTORS = "getDebtors"; - public ActionForward getDebtors(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList bplist = BPartnerManager.getCreditorsDebtors(ctx, false, null); - - request.getSession().setAttribute(Constants.DEBTORS,bplist); - return mapping.findForward(GET_DEBTORS); - } - - public static final String GET_CREDITOR_HISTORY = "getCreditorHistory"; - public ActionForward getCreditorHistory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - BPartnerForm pf = (BPartnerForm) form; - BPartnerBean bean = (BPartnerBean)pf.getBean(); - - int c_bpartner_id = bean.getBpartnerId(); - - ArrayList history = BPartnerManager.getCreditorsHistory(ctx, c_bpartner_id, null, null, null); - request.getSession().setAttribute(Constants.CREDITOR_HISTORY, history); - request.getSession().setAttribute(Constants.BPARTNER, bean); - - return mapping.findForward(GET_CREDITOR_HISTORY); - } - - public static final String GET_DEBTOR_HISTORY = "getDebtorHistory"; - public ActionForward getDebtorHistory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - BPartnerForm pf = (BPartnerForm) form; - BPartnerBean bean = (BPartnerBean)pf.getBean(); - - int c_bpartner_id = bean.getBpartnerId(); - - ArrayList history = BPartnerManager.getDebtorsHistory(ctx, c_bpartner_id, null, null, null); - request.getSession().setAttribute(Constants.DEBTOR_HISTORY, history); - request.getSession().setAttribute(Constants.BPARTNER, bean); - - return mapping.findForward(GET_DEBTOR_HISTORY); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/bPartner/ViewBPartnerAction.java b/posterita/posterita/src/main/org/posterita/struts/bPartner/ViewBPartnerAction.java deleted file mode 100644 index 55a2ce36fb..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/bPartner/ViewBPartnerAction.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 18, 2005 by Alok - */ - -package org.posterita.struts.bPartner; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.util.Trx; -import org.posterita.core.TmkJSPEnv; - -import org.posterita.Constants; -import org.posterita.beans.BPartnerBean; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - -public class ViewBPartnerAction extends BaseDispatchAction -{ - public static final String GET_ALL_BPARTNERS = "getAllBpartners"; - public ActionForward getAllBpartners(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - - ArrayList bpartners = new ArrayList(); - - try - { - trx.start(); - bpartners = BPartnerManager.getAllBpartners(ctx, trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.getall.partners", request); - mapping.getInputForward(); - } - finally - { - trx.close(); - } - - request.getSession().setAttribute(Constants.ALLBUSINESSPARTNERS, bpartners); - - return mapping.findForward(GET_ALL_BPARTNERS); - - } - - public static final String VIEW_BPARTNER_DETAILS = "viewBpartnerDetails"; - public ActionForward viewBpartnerDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - BPartnerBean bean = (BPartnerBean) df.getBean(); - - ArrayList bpartners = (ArrayList) request.getSession().getAttribute(Constants.ALLBUSINESSPARTNERS); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - - try - { - trx.start(); - - if(bpartners == null) - bpartners = BPartnerManager.getAllBpartners(ctx, trx.getTrxName()); - - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.get.partner.detail", request); - mapping.getInputForward(); - } - finally - { - trx.close(); - } - - try - { - bean = BPartnerManager.getBpartner(ctx, bean.getBpartnerId(), trx.getTrxName()); - } - catch (OperationException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - request.getSession().setAttribute(Constants.BUSINESSPARTNERSDETAILS, bean); - - - return mapping.findForward(VIEW_BPARTNER_DETAILS); - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/core/AjaxAction.java b/posterita/posterita/src/main/org/posterita/struts/core/AjaxAction.java deleted file mode 100644 index 35a426f8a6..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/core/AjaxAction.java +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.struts.core; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.pos.taglib.AjaxTag; - -/** - * @author Ashley G Ramdass - * Apr 22, 2008 - */ -public class AjaxAction extends BaseDispatchAction -{ - public static final String PROCESS_REQUEST_PARAM = "RequestProcessor"; - public static final String AJAX_TAG_PACKAGE = "org.posterita.pos.taglib"; - - public ActionForward processRequest(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - { - try - { - String tagClass = request.getParameter(PROCESS_REQUEST_PARAM); - AjaxTag tag = (AjaxTag)Class.forName(AJAX_TAG_PACKAGE + "." + tagClass).newInstance(); - tag.processRequest(request, response); - } - catch (Exception ex) - { - - } - return null; - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/core/BaseAction.java b/posterita/posterita/src/main/org/posterita/struts/core/BaseAction.java deleted file mode 100644 index 1c7342dcf6..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/core/BaseAction.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - -package org.posterita.struts.core; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.Globals; -import org.apache.struts.action.Action; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; -import org.apache.struts.action.ActionServlet; -import org.apache.struts.config.ModuleConfig; -import org.apache.struts.util.RequestUtils; - -import org.posterita.exceptions.ApplicationException; -import org.posterita.user.WebUserInfo; - - -public class BaseAction extends Action -{ - - public static final String LOGIN_HOME = "loginHome"; - public ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - WebUserInfo userInfo = (WebUserInfo) request.getSession().getAttribute(WebUserInfo.NAME); - - if (userInfo == null) - return mapping.findForward(LOGIN_HOME); - else - return null; - - - - } - - protected void postGlobalError(String errorKey, HttpServletRequest request) - { - postGlobalError(errorKey, null, request); - } - - protected void postComplexGlobalError(String errorKey, Object[] args,HttpServletRequest request) - { - - ActionMessage message = (args.length == 0 ? - new ActionMessage(errorKey): - new ActionMessage(errorKey, args)); - - ActionMessages messages = new ActionMessages(); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - saveErrors(request, messages); - - - - } - - protected void postGlobalError(String errorKey, Object arg, HttpServletRequest request) - { - //TODO Replace this code - ActionMessage message = (arg == null ? - new ActionMessage(errorKey): - new ActionMessage(errorKey, arg)); - - ActionMessages messages = new ActionMessages(); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - saveErrors(request, messages); - - // workflow - //TODO Integrate this code when workflow works - //WorkFlowManager.removeLastWorkFlowAction(request); - } - - protected void postGlobalMessage(String msgKey, Object arg, HttpServletRequest request) - { - //TODO Replace this code - ActionMessage message = (arg == null ? - new ActionMessage(msgKey): - new ActionMessage(msgKey, arg)); - - ActionMessages messages = new ActionMessages(); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - saveMessages(request, messages); - - // workflow - //TODO Integrate this code when workflow works - //WorkFlowManager.removeLastWorkFlowAction(request); - } - - protected ActionForm getForm(String formName, String path, HttpServletRequest request) - { - return getForm(formName, path, request, getServlet()); - } - - protected ActionForm getForm(String formName, String path, HttpServletRequest request, ActionServlet servlet) - { - // check if the form is in the request scope - ActionForm form = (ActionForm) request.getAttribute(formName); - - // check if the form is in the session scope - if (form == null) - { - form = (ActionForm) request.getSession().getAttribute(formName); - } - // if not found in any of these create one and set it in the appropriate scope. - if(form == null) - { - ModuleConfig appConfig = (ModuleConfig) request.getAttribute(Globals.MODULE_KEY); - - ActionMapping mapping = (ActionMapping) appConfig.findActionConfig(path); - - form = RequestUtils.createActionForm(request,mapping,appConfig, servlet); - - String key = mapping.getAttribute(); - - if (!key.equals(formName)) - throw new RuntimeException("error.baseAction.InvalidFormName"); - - if(mapping.getScope().equals("request")) - request.setAttribute(key, form); - else - request.getSession().setAttribute(key, form); - - } - return form; - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/core/BaseDispatchAction.java b/posterita/posterita/src/main/org/posterita/struts/core/BaseDispatchAction.java deleted file mode 100644 index 858dca9b12..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/core/BaseDispatchAction.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - -package org.posterita.struts.core; - -import java.util.ArrayList; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; -import org.apache.struts.actions.DispatchAction; -import org.compiere.util.WebSessionCtx; -import org.displaytag.tags.TableTagParameters; -import org.displaytag.util.ParamEncoder; -import org.posterita.Constants; -import org.posterita.core.MenuItem; -import org.posterita.exceptions.ApplicationException; - -public class BaseDispatchAction extends DispatchAction -{ - BaseAction act = new BaseAction(); - - public static final String LOGIN_HOME = "loginHome"; - public static final String APPLICATION_ERROR = "applicationError"; - public static final String CHOOSE_APPLICATION = "chooseApplication"; - public ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - Object webSessionCtx = request.getSession().getAttribute(WebSessionCtx.NAME); - - DefaultForm df = (DefaultForm) form; - - if (df != null) - if ((request.getSession().getAttribute(Constants.MENUS) != null) && (df.getMenuId() != null)) - { - MenuItem menuItem = (MenuItem) request.getSession().getAttribute(Constants.MENUS); - - Integer menuId = Integer.valueOf(df.getMenuId()); - ArrayList list = menuItem.getBreadCrumb(menuId.intValue()); - - request.getSession().setAttribute(Constants.BREADCRUMB, list); - } - - - if (webSessionCtx == null) // Session Timeout - { - return mapping.findForward(CHOOSE_APPLICATION); - } - else - return null; - } - - - - protected void postGlobalError(String errorKey, HttpServletRequest request) - { - act.postGlobalError(errorKey, null, request); - } - - protected void postGlobalError(String errorKey, Object arg, HttpServletRequest request) - { - act.postGlobalError(errorKey, arg, request); - } - - protected void postGlobalMessage(String msgKey, HttpServletRequest request) - { - act.postGlobalMessage(msgKey, null, request); - } - - protected ActionForm getForm(String formName, String path, HttpServletRequest request) - { - return act.getForm(formName, path, request, getServlet()); - } - - - public Object getAttribute(HttpServletRequest request, Class vo) - { - Object object = request.getSession().getAttribute(getClass().getName()+vo.getName()); - request.getSession().setAttribute(getClass().getName()+vo.getName(),null); - return object; - } - - protected void postComplexGlobalError(String errorKey, Object[] args,HttpServletRequest request) - { - - ActionMessage message = (args.length == 0 ? - new ActionMessage(errorKey): - new ActionMessage(errorKey, args)); - - ActionMessages messages = new ActionMessages(); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - saveErrors(request, messages); - } - - /** - * Checks whether the request is an action on the display tag table (Paging, sorting) - * @param request Server Request - * @return True if the request is a display tag action - */ - protected boolean isDisplayTagAction(HttpServletRequest request) - { - String tableId = request.getParameter(Constants.DISPLAYTAG_TABLE_ID); - - if (tableId == null || tableId.trim().length() == 0) - { - return false; - } - - String strOrder = request.getParameter(new ParamEncoder(tableId).encodeParameterName(TableTagParameters.PARAMETER_ORDER)); - String strPage = request.getParameter(new ParamEncoder(tableId).encodeParameterName(TableTagParameters.PARAMETER_PAGE)); - String strSort = request.getParameter(new ParamEncoder(tableId).encodeParameterName(TableTagParameters.PARAMETER_SORT)); - - return ((strOrder != null && strOrder.trim().length() > 0) - || (strPage != null && strPage.trim().length() > 0) - || (strSort != null && strSort.trim().length() > 0)); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/core/BaseForm.java b/posterita/posterita/src/main/org/posterita/struts/core/BaseForm.java deleted file mode 100644 index 8131b328f9..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/core/BaseForm.java +++ /dev/null @@ -1,983 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ -package org.posterita.struts.core; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.commons.beanutils.PropertyUtils; -import org.apache.struts.Globals; -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.util.MessageResources; -import org.compiere.model.MPayment; - -import org.posterita.core.EmailValidator; -import org.posterita.core.JulianDate; -import org.posterita.core.Range; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.FormattingException; -import org.posterita.formatter.Formatter; - - - -/** - * An abstract base class for ActionForms that adds support for automatic formatting - * and unformatting of string values and for the transfer of the resulting values - * between itself and the given bean. The populate() method provides - * and entry point to this functionality, while the keysToSkip method allows - * subclasses to specify fields that should not be populated. - *

    - * - * Additional methods are provided to allow subclasses to override formatting defaults. - * The DefaultString() method allows callers to specify overrides for the default - * string used to represent a null for a given property. Similarly, - * the setFormatterype() method allows callers to specify a - * formatting type other than the default for a given property. - *

    - * Developers can also specify validation rules by invoking addRange() - * to add a range validation or addRequiredFields() to add required field validations - * for an array of property names. - * - */ -public class BaseForm extends ActionForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - private Map defaultStringMap = new HashMap(); - private Map formatMap = new HashMap(); - MessageResources resources = null; - - public final static int TO_OBJECT = 0; - public final static int TO_STRING = 1; - public final static int MIN_LENGTH = 6; - - public final static String REQUIRED = "required"; - public final static String RANGE = "range"; - public final static String STRING_NUMBER="stringNumber"; - public final static String EMAIL_VALID = "emailValid"; - public final static String MIN_LENGTH_VALID = "minLengthValid"; - public final static String MATCH_FIELDS = "matchFields"; - public final static String DATE_FIELDS_VALID = "dateValid"; - public final static String IMAGE_FILE_EXT_VALID = "imageFileValid"; - public static final String YEAR_VALID = "yearValid"; - public static final String CREDITCARD_VALID = "creditcardValid"; - public static final String CVV_VALID = "cvvValid"; - public static final String EXPIRY_DATE_VALID = "expiryDateValid"; - private static final String ACCOUNT_VALID = "accountValid"; - private int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); - private int currentMonth = java.util.Calendar.getInstance().get(java.util.Calendar.MONTH) + 1; - - private transient Object bean; - private Map validationMap = new HashMap(); - - public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) - { - /* - * This is where you need to get the country specific details. - */ - - resources = (MessageResources)request.getAttribute(Globals.MESSAGES_KEY); - - ActionErrors errors = populate(this.bean, TO_OBJECT); - return errors; - - } - - public ActionErrors populate(Object vo) - { - return populate(vo,TO_STRING); - } - - /* - * field1 does not contain the value of the field but contains the name of the field. - */ - public void addMatchFields(String key, String otherFieldName) - { - addValidationRule(key, MATCH_FIELDS, otherFieldName); - } - - public void addDateFieldsValidation(String key, String otherKey) - { - addValidationRule(key, DATE_FIELDS_VALID, otherKey); - } - - public void addCreditCardFieldsValidation(String key) - { - addValidationRule(key, CREDITCARD_VALID, Boolean.TRUE); - } - - public void addAccountFieldValidation(String key) - { - addValidationRule(key, ACCOUNT_VALID, Boolean.TRUE); - } - - public void addCVVFieldsValidation(String key) - { - addValidationRule(key, CVV_VALID, Boolean.TRUE); - } - - public void addCreditCardExpiryDateFieldsValidation(String key) - { - addValidationRule(key, EXPIRY_DATE_VALID, Boolean.TRUE); - } - - @SuppressWarnings("unchecked") - public void addValidationRule(String key, String rule, Object value) - { - Map values =(Map) validationMap.get(key); - if (values == null) - { - values = new HashMap(); - validationMap.put(key,values); - } - - values.put(rule, value); - } - - - public void addRequiredFields(String[] keys) - { - for (int i=0; i< keys.length; i++) - { - addValidationRule(keys[i],REQUIRED, Boolean.TRUE); - } - } - - - public void addRange(String key, Comparable min, Comparable max) - { - Range range = new Range(min,max); - addValidationRule(key,RANGE, range); - } - - public void addEmailValidation(String key) - { - addValidationRule(key,EMAIL_VALID,Boolean.TRUE); - } - - public void addYearValidation(String key) - { - addValidationRule(key, YEAR_VALID, Boolean.TRUE ); - } - - public void addValidateCustomerNumber(String key) - { - addValidationRule(key,STRING_NUMBER,Boolean.TRUE); - } - - - public void addImageFileExtensionValidation(String key) - { - addValidationRule(key, IMAGE_FILE_EXT_VALID, Boolean.TRUE); - } - - public void addMinLengthValidation(String key, Integer min, Integer max) - { - Range range = new Range(min, max); - addValidationRule(key,MIN_LENGTH_VALID,range); - } - - public Object getBean() throws ApplicationException - { - return bean; - } - - public void setBean(Object bean) - { - this.bean = bean; - } - - - - public ActionErrors populate(Object vo, int mode) - { - String errorMsg = "Unable to format values from bean: "+ vo; - - //Object source = (mode == TO_STRING ? bean : this); - Object target = (mode == TO_STRING ? vo : this); - - - Map valueMap = mapRepresentation(target, mode); - - ActionErrors errors = new ActionErrors(); - - - if(mode == TO_STRING) - { - setBean(vo); - } - - Iterator keyIter = valueMap.keySet().iterator(); - - while(keyIter.hasNext()) - { - String currKey = (String) keyIter.next(); - Object currValue = valueMap.get(currKey); - - try - { - ActionErrors currErrors = populateProperty(vo,currKey, currValue, mode, valueMap); - errors.add(currErrors); - - } - catch(InstantiationException ie) - { - throw new FormattingException(errorMsg, ie); - } - catch(IllegalAccessException iae) - { - throw new FormattingException(errorMsg, iae); - } - catch(InvocationTargetException ite) - { - throw new FormattingException(errorMsg,ite); - } - catch(NoSuchMethodException nsme) - { - //throw new FormattingException(errorMsg,nsme); - // There can be some assymetry in the form and the bean so do not treat this as an exception. - } - } - - return errors; - } - - /** - * @param target - * @param mode - * @return - */ - public Map mapRepresentation(Object vo, int mode) - { - String errorMsg = "Unable to format values from bean: "+ vo; - - - Map valueMap = null; - - try - { - valueMap = PropertyUtils.describe(vo); - } - catch(IllegalAccessException iae) - { - throw new FormattingException(errorMsg, iae); - } - catch(InvocationTargetException ite) - { - throw new FormattingException(errorMsg, ite); - } - catch(NoSuchMethodException nsme) - { - throw new FormattingException(errorMsg,nsme); - } - - Iterator keyIter = keysToSkip().iterator(); - - while(keyIter.hasNext()) - { - String key = (String) keyIter.next(); - valueMap.remove(key); - } - - return valueMap; - } - - protected Object convert(Class type, String key, Object obj, int mode) - throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, NumberFormatException - { - Object convertedObj = null; - Formatter formatter = getFormatter(key, type); - - try - { - switch(mode) - { - case TO_OBJECT: - convertedObj = formatter.unformat(obj); - break; - case TO_STRING: - if (obj == null) - convertedObj = (String) defaultStringMap.get(key); - else - convertedObj = formatter.format(obj); - - /** - * This let's the toDate being converted into endDay, endMonth and endYear - * note that the String here are sensitive. - */ - - if (key.equals("toDate")) - { - JulianDate dateValue = (JulianDate) obj; - if (dateValue != null) - { - PropertyUtils.setSimpleProperty(this, "endDay", ""+dateValue.getDay()); - PropertyUtils.setSimpleProperty(this, "endMonth", ""+dateValue.getMonth()); - PropertyUtils.setSimpleProperty(this, "endYear", ""+dateValue.getYear()); - } - else - { - PropertyUtils.setSimpleProperty(this, "endDay", ""); - PropertyUtils.setSimpleProperty(this, "endMonth", ""); - PropertyUtils.setSimpleProperty(this, "endYear", ""); - } - - } - if (key.equals("fromDate")) - { - JulianDate dateValue = (JulianDate) obj; - if (dateValue != null) - { - PropertyUtils.setSimpleProperty(this, "startDay", ""+dateValue.getDay()); - PropertyUtils.setSimpleProperty(this, "startMonth", ""+dateValue.getMonth()); - PropertyUtils.setSimpleProperty(this, "startYear", ""+dateValue.getYear()); - } - else - { - PropertyUtils.setSimpleProperty(this, "startDay", ""); - PropertyUtils.setSimpleProperty(this, "startMonth", ""); - PropertyUtils.setSimpleProperty(this, "startYear", ""); - } - } - - break; - - default: - throw new RuntimeException("Unknown mode:" + mode); - - } - } - catch(FormattingException e) - { - e.setFormatter(formatter); - throw e; - } - - return convertedObj; - } - - - protected Object getKeyStringValue(String key, int mode) - { - Object target = (mode == TO_STRING ? this.bean : this); - Map valueMap = mapRepresentation(target, mode); - - Object currValue = valueMap.get(key); - - return currValue; - - } - - - protected ActionErrors populateProperty(Object vo, String key, Object obj, int mode, Map valueMap) - throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException - { - - Object target = (mode == TO_STRING? this : vo); - Class type = PropertyUtils.getPropertyType(vo, key); - ActionErrors errors = new ActionErrors(); - - Object value = null; - - if (mode == TO_STRING) - { - value = convert(type, key, obj, mode); - } - else - { - try - { - String errorKey = null; - - value = convert(type, key, obj, mode); - - errorKey = validateRequired(key, obj); - - if (errorKey == null) - errorKey = validateRange(key, value); - if (errorKey == null) - errorKey = validateEmail(key,value); - if (errorKey == null) - errorKey = validateLength(key, obj); - if (errorKey == null) - errorKey = validateImageFileExtension(key, obj); - if (errorKey == null) - errorKey = validateMatchFields(key,value, vo, valueMap); - if (errorKey == null) - errorKey = validateCustomerNumber(key, value); - if (errorKey == null) - errorKey = validateMatchFields(key,value, vo, valueMap); - if (errorKey == null) - errorKey = validateDateFields(key,value, vo, valueMap); - if (errorKey == null) - errorKey = validateCreditCardExpiryDateFields(key,value, vo, valueMap); - if (errorKey !=null) - errors.add(key, new ActionMessage(errorKey,key)); - - //This part is placed here because validateCreditCardField method may return an errorKey - //As we are reusing the same variable to store an error message - //the error is added above in the ActionMessage and then variable errorKey is reused here - errorKey = validateCVVField(key,value, vo, valueMap); - if (errorKey !=null) - errors.add(key, new ActionMessage(errorKey,key)); - - errorKey = validateAccountField(key,value, vo, valueMap); - if (errorKey !=null) - errors.add(key, new ActionMessage(errorKey,key)); - - errorKey = validateCreditCardField(key,value, vo, valueMap); - if (errorKey !=null) - errors.add(key, new ActionMessage(errorKey,key)); - - - } - catch(FormattingException e) - { - String errorKey = e.getFormatter().getErrorKey(); - errors.add(key, new ActionMessage(errorKey, key)); - } - catch (NumberFormatException nfe) - { - String errorKey; - - if (resources.getMessage("error.numberformatexception."+key) == null) - errorKey = "error.numberformatexception"; - else - errorKey = "error.numberformatexception."+key; - - errors.add(key, new ActionMessage(errorKey,key)); - } - - } - - PropertyUtils.setSimpleProperty(target, key, value); - - return errors; - - } - - private String validateAccountField(String key, Object value, Object vo, Map valueMap) - { - Map rules = (Map) validationMap.get(key); - - if (rules == null) - return null; - - if (!rules.containsKey(ACCOUNT_VALID)) - return null; - - if (value == null) - return null; - - - if (value.equals(MPayment.TENDERTYPE_CreditCard)) - { - String accountName = (String) valueMap.get("accountName"); - - if (accountName == null || accountName.equals("")) - return "error.required.accountName"; - } - - return null; - - - } - - private String validateCreditCardExpiryDateFields(String key, Object value, Object vo, Map valueMap) - { - Map rules = (Map) validationMap.get(key); - - if (rules == null) - return null; - - if (!rules.containsKey(EXPIRY_DATE_VALID)) - return null; - - if (value == null) - return null; - - - if (value.equals(MPayment.TENDERTYPE_CreditCard)) - { - String creditCardExpYear = (String) valueMap.get("creditCardExpYear"); - - if (creditCardExpYear == null || creditCardExpYear.equals("")) - return "error.required.creditCardExpYear"; - - if (Integer.parseInt(creditCardExpYear) == currentYear) - { - - - String creditCardExpMonth = (String) valueMap.get("creditCardExpMonth"); - - if (creditCardExpMonth == null || creditCardExpMonth.equals("")) - return "error.required.creditCardExpMonth"; - - if (Integer.parseInt(creditCardExpMonth) < currentMonth) - return "error.creditCardExpMonth"; - } - - } - - return null; - - } - - private String validateCustomerNumber(String key, Object value) - { - - Map rules = (Map) validationMap.get(key); - - if(rules == null) - return null; - - Boolean bool = (Boolean) rules.get(STRING_NUMBER); - - if (bool == null) - { - return null; - } - - String str = (String) value; - - boolean isNumber = true; - try - { - // Double numb = new Double(str); - } - catch(NumberFormatException e) - { - isNumber = false; - } - - - if (!isNumber) - { - - if (resources.getMessage("error.customer.id.numberformat."+key) == null) - return "error.customer.id.numberformat"; - else - return "error.customer.id.numberformat."+key; - } - else - - if (str.length()!=13) - { - - if (resources.getMessage("error.customer.id.length."+key) == null) - return "error.customer.id.length"; - else - return "error.customer.id.length."+key; - } - else - return null; - - } - - - private String validateRange(String key, Object value) - { - - Map rules = (Map) validationMap.get(key); - - if(rules == null) - return null; - - Range range = (Range) rules.get(RANGE); - - if (range == null) - { - return null; - } - - if(!range.isInRange((Comparable) value)) - { - if (resources.getMessage("error.range."+key) == null) - return "error.range"; - else - return "error.range."+key; - } - else - return null; - } - - private String validateEmail(String key, Object value) - { - Map rules = (Map) validationMap.get(key); - - if(rules == null) - return null; - - Boolean email_valid = (Boolean) rules.get(EMAIL_VALID); - - if (email_valid == null) - return null; - - String email = (String) value; - if(!EmailValidator.isValidEmail(email)) - return "error.email"; - else - return null; - - } - - private String validateImageFileExtension(String key, Object value) - { - Map rules = (Map) validationMap.get(key); - - if (rules == null) - return null; - - Boolean imageFile_valid = (Boolean) rules.get(IMAGE_FILE_EXT_VALID); - - if (imageFile_valid == null) - return null; - - //String imageFile = (String) value; - - /* if(!FileExtensionChecker.isValidFileExtention(imageFile)) - return "error.fileNotSupportedException"; - else*/ - return null; - - } - - private String validateMatchFields(String key, Object value, Object vo, Map valueMap) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException - { - Map rules = (Map) validationMap.get(key); - - if((rules == null)) - return null; - - if (!rules.containsKey(MATCH_FIELDS)) - return null; - - String otherField = (String) rules.get(MATCH_FIELDS); - - Class typeOfOtherField = PropertyUtils.getPropertyType(vo, otherField); - String currOtherFieldValue = (String) valueMap.get(otherField); - - if (otherField == null) - { - return null; - } - else - { - Object obj = convert(typeOfOtherField, otherField, currOtherFieldValue, TO_OBJECT); - if(!value.equals(obj)) - { - if (resources.getMessage("error.match."+key) == null) - return "error.match"; - else - return "error.match."+key; - } - else - return null; - - } - } - - private String validateLength(String key, Object value) - { - Map rules = (Map) validationMap.get(key); - - if(rules == null) - return null; - - Range range = (Range) rules.get(MIN_LENGTH_VALID); - - if (range == null) - return null; - - String str = (String) value; - Integer len = Integer.valueOf(str.length()); - - if(!range.isInRange(len)) - { - if (resources.getMessage("error.minlength."+key) == null) - return "error.minlength"; - else - return "error.minlength."+key; - } - else - return null; - - } - -// private String validateYear(String key, Object obj) -// { -// Map rules = (Map) validationMap.get(key); -// -// if (rules == null) -// return null; -// -// Boolean year_valid = (Boolean) rules.get(YEAR_VALID); -// -// String year = (String) obj; -// -// if (year.length()!= 4) -// return "error.year.length.invalid"; -// -// return null; -// -// -// } - - private String validateRequired(String key, Object obj) - { - // This was added because of the String[] - if (obj!=null && !String.class.isAssignableFrom(obj.getClass())) - { - return null; - } - - String value = (String) obj; - Map rules = (Map) validationMap.get(key); - - if(rules == null) - return null; - - Boolean required = (Boolean) rules.get(REQUIRED); - - if (required == null) - return null; - - boolean isRequired = required.booleanValue(); - boolean isBlank =(value == null || value.trim().equals("")); - - if(isRequired && isBlank) - { - if (resources.getMessage("error.required."+key) == null) - return "error.required"; - else - return "error.required."+key; - } - - else - return null; - } - - private String validateCreditCardField(String key, Object value, Object vo, Map valueMap) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException - { - Map rules = (Map) validationMap.get(key); - - if (rules == null) - return null; - - if (!rules.containsKey(CREDITCARD_VALID)) - return null; - - if (value == null) - return null; - - if (value.equals(MPayment.TENDERTYPE_CreditCard)) - { - String creditCardNumber = (String) valueMap.get("creditCardNumber"); - - if (creditCardNumber == null || creditCardNumber.equals("")) - return "error.required.creditCardNumber"; - - } - - return null; - - } - - private String validateCVVField(String key, Object value, Object vo, Map valueMap) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException - { - Map rules = (Map) validationMap.get(key); - - if (rules == null) - return null; - - if (!rules.containsKey(CVV_VALID)) - return null; - - if (value == null) - return null; - - if (value.equals(MPayment.TENDERTYPE_CreditCard)) - { - String cvv = (String) valueMap.get("cvv"); - - if (cvv == null || cvv.equals("")) - return "error.required.cvv"; - - } - - return null; - - } - - private String validateDateFields(String key, Object value, Object vo, Map valueMap) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException - { - Map rules = (Map) validationMap.get(key); - - if (rules == null) - return null; - - if (!rules.containsKey(DATE_FIELDS_VALID)) - return null; - - String otherKey = (String) rules.get(DATE_FIELDS_VALID); - - String otherValue = (String) valueMap.get(otherKey); - - if (value == null && otherValue == null) - return null; - - if (value == null) - return "error.date.prior.today"; - - if (otherValue == null) - return "error.date.prior.today"; - - Class otherType = PropertyUtils.getPropertyType(vo, otherKey); - - - JulianDate toDate = (JulianDate) convert(otherType, otherKey, otherValue, TO_OBJECT); - - JulianDate fromDate = (JulianDate) value; - - Range range = new Range(JulianDate.getToday(), toDate); - - if (!range.isInRange(fromDate)) - return "error.date.prior.today"; - else - return null; - - } - - - protected Formatter getFormatter(String key, Class type) - { - Formatter formatType = (Formatter) formatMap.get(key); - - if (formatType == null) - { - return Formatter.getFormatter(type); - } - - return formatType; - } - - public void setDefaultString(String key, String value) - { - defaultStringMap.put(key,value); - } - /* - * This is where you can override the way things are formatted. - */ - public void setFormatterType(String key, Class type) - { - if(!Formatter.class.isAssignableFrom(type)) - throw new FormattingException(type + "must be a Formatter"); - - formatMap.put(key,type); - } - - protected Map mapRepresentation(Object bean) - { - String errorMsg = "Unable to format values from bean: " + bean; - Map valueMap = null; - - try - { - valueMap = PropertyUtils.describe(bean); - } - catch(IllegalAccessException iae) - { - throw new FormattingException(errorMsg,iae); - } - catch(InvocationTargetException ite) - { - throw new FormattingException(errorMsg,ite); - } - catch(NoSuchMethodException nsme) - { - throw new FormattingException(errorMsg,nsme); - } - - Iterator keyIter = keysToSkip().iterator(); - - while(keyIter.hasNext()) - { - String key = (String) keyIter.next(); - valueMap.remove(key); - } - return valueMap; - } - - protected ArrayList keysToSkip() - { - ArrayList keysToSkip = new ArrayList(); - - // Don't popluate "class" field inherited from Object - - keysToSkip.add("class"); - keysToSkip.add("servletWrapper"); - keysToSkip.add("multipartRequestHandler"); - keysToSkip.add("bean"); - keysToSkip.add("properties"); - keysToSkip.add("checkBoxLists"); -// keysToSkip.add("file"); - keysToSkip.add("minValue"); - keysToSkip.add("maxValue"); - - - return keysToSkip; - } - - - // - protected String action; - protected String input; - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getInput() { - return input; - } - - public void setInput(String input) { - this.input = input; - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/core/DefaultForm.java b/posterita/posterita/src/main/org/posterita/struts/core/DefaultForm.java deleted file mode 100644 index 8cac908d84..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/core/DefaultForm.java +++ /dev/null @@ -1,5793 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.struts.core; - -import java.util.ArrayList; -import java.util.Calendar; - -import org.apache.struts.upload.FormFile; -import org.compiere.model.MInOut; -import org.posterita.beans.AttributeValuesPair; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.PaymentBean; -import org.posterita.beans.PriceListBean; -import org.posterita.beans.ProductBean; -import org.posterita.beans.ProductImageBean; -import org.posterita.beans.RoleBean; -import org.posterita.beans.StockMovementBean; -import org.posterita.beans.UDIBean; - - -public class DefaultForm extends BaseForm -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - protected String aaCardnumber; - protected String blackListedId; - protected String blackListedBankName; - protected String blackListedChequeNo; - - protected String forward; - protected String accountNo; - protected String accountType; - protected String accountName; - protected String address1; - protected String address2; - protected String agreement; - protected String aisle; - protected String allocationId; - protected String allocationStatus; - protected String attribute; - protected String attributeId; - protected String attributeSetId; - protected String attributeSetInstanceId; - protected Integer [] sernoAttributeSetInstanceIds; - protected String attributeValue; - protected String attributeValueId; - protected String bankId; - protected String bankName; - protected String basePriceListId; - protected String bin; - protected String bpartnerId; - - protected String customSize; - protected String discountedLinePrice; - protected String documentId; - protected String documentNo; - protected String documentType; - protected String email; - protected String endDay = "" + Calendar.getInstance().get(Calendar.DATE); - protected String endHour; - protected String endMinute; - protected String endMonth = "" + (Calendar.getInstance().get(Calendar.MONTH) + 1); - protected String endYear="" + Calendar.getInstance().get(Calendar.YEAR); - protected String engineNo; - protected String engineNumber; - protected String fax; - protected String grossProfit; - protected String grossProfitPercentage; - protected FormFile file; - protected FormFile image; - protected String day; - protected String fromDate; - protected String fromOrderLineId; - protected String grandTotal; - protected String id; - protected String inclPrice; - protected String index; - protected String invoiceId; - protected String isAccessAllOrgs= "false"; - protected String isActive="false"; - protected String isApproved; - protected String isAvailableForBackOrder="true"; - protected String isAutomobile; - protected String isCreatePriceList = "false"; - protected String isCustomer="true"; - protected String isDefault = "false"; - protected String isDeleteOldRecords="false"; - protected String isDelivered; - protected String isEmployee="true"; - protected String isInvoiced; - protected String isMandatory; - protected String isMotorcycle; - protected String isNatisReleased; - protected String isOverridePinOk; - - protected String isPresentForProduct; - protected String isPublic="false"; - protected String isQtyReserved; - protected String isTaxIncluded = "false"; - - protected Integer [] checkBox; - protected String checkNo; - protected String city; - protected String colour; - protected String compiereDocStatus; - protected String confirmEmail; - protected String confirmPassword; - protected String counterOrderStatusInfo; - protected String counterOrgID; - protected String counterOrgName; - protected String currentBalance; - protected String custIdNumber; - protected String dateCreated; - protected String dateOrdered; - protected String datePromised; - protected String dateTrx; - protected String description; - protected String isDiscountOnInclUnitPrice = "false"; - protected String discountedInclUnitPrice; - protected String docStatus; - protected String docStatusCode; - - protected String isDiscountAllowed; - protected String isAllowedOverridePriceLimit; - protected String isReceipt; - protected String isRetailer ="true"; - protected String isSalesRep="false"; - protected String isSoTrx; - protected String isVendor="true"; - protected String isVisible; - protected String isWholesaler="true"; - protected String level; - protected String limitPrice; - protected String listPriceIncl; - protected String stdPriceIncl; - protected String limitPriceIncl; - protected String lineNo; - protected ArrayList list; - protected String listPrice; - protected String locationId; - protected String locatorId; - protected FormFile logo; - protected String logoName; - protected String lockingTime; - protected String maintenanceContractNumber; - protected String make; - protected String makeAttributeValueId; - protected String menuId; - protected String menuItemName; - protected String menuLink; - protected String message; - protected String messageID; - protected String mobile; - protected String model; - protected String modelGroup; - protected String month; - protected String moveConfirmId; - protected String movementDate; - protected String movementDescription; - protected String movementId; - protected String movementLineId; - protected String name; - protected String natisApplicationDate; - protected String natisControlNumber; - protected String natisReleaseId; - protected String newEmail; - protected String newPassword; - protected String oldPassword; - - protected PaymentBean paymentBeanIndex; - protected String orderId; - protected String orderLineId; - protected ArrayList orderLineBean; - protected OrderLineBean orderLineIndexed; - protected ArrayList orderLineList = new ArrayList(); - protected String orderStatusInfo; - protected String orderType; - protected String orgId; - protected String allocatedAmount; - protected String OrgID; - protected String orgFromId; - protected String orgFromName; - protected String orgToId; - protected String orgToName; - protected String orgName; - protected String orgType; - protected String orgUser; - protected String parentMenuId; - protected String partnerId; - protected String partnerName=""; - protected String password; - protected String payAmt; - protected String paymentId; - protected String phone; - protected String phone2; - protected String poReference; - protected String POReference; - protected String postalAddress; - protected String postalAddress1; - protected String postalCity; - protected String postalCode; - protected String postalPostalCode; - protected String prefOrderLineId; - protected String price; - protected String priceEntered; - protected String priceList; - protected PriceListBean priceListBean; - protected ArrayList priceListBeanList = new ArrayList(); - protected String priceListName; - protected String salesPriceListId; - protected String purchasePriceListId; - protected String priceListId; - protected String priceListVersionId; - - protected AttributeValuesPair productAttributes; - protected String productAttributeSetInstanceId; - protected String productCategoryId; - protected String productId; - protected ProductBean productBean; - protected ArrayList productBeanList = new ArrayList(); - protected String productName; - protected String qty; - protected String qtyOnHand; - protected String qtyToMove; - protected String qtyReserved; - protected String [] qtyTargeted; - protected String quantity; - protected String read; - protected String refNo; - protected String reference; - protected Integer refToQuote; - protected String region; - protected String regionId; - protected String registerNumber; - protected String reserveStatus; - protected String roleId; - protected String roleName; - protected String routingNumber; - protected String sernoAttributeSetInstance; - protected String sotrxFlag; - protected String startDay = "" + Calendar.getInstance().get(Calendar.DATE); - protected String startHour; - protected String startMinute; - protected String startMonth= "" + (Calendar.getInstance().get(Calendar.MONTH) + 1); - protected String startYear="" + Calendar.getInstance().get(Calendar.YEAR); - protected String stdPrice; - protected String stdPurchasePrice; - protected String stdSalesPrice; - protected String subject; - protected String submit; - protected String subTotal; - protected String surname; - protected Integer[] targetId; - protected String termsAgreement; - protected String toDate; - protected String toOrderLineId; - protected String totalLines; - protected String transmission; - protected String transmissionAttributeValueId; - protected String userId; - protected String username; - protected String value; - protected String vinNumber; - protected String warehouseId; - protected String warehouseName; - protected String warehouseType; - protected String year; - protected String yearAttributeValueId; - protected String first; - protected String licensingDistrictId; - protected String licensingDistrict; - protected String tradeInOrderlineId; - protected String passportNo; - protected String companyRegNo; - protected ArrayList showroomTrafficBean; - - protected String sales; - protected String traffic; - protected String prospects; - - protected String modelId; - protected String trxId; - protected String trx; - protected String modelCode; - protected String modelCodeId; - protected String dealerCode; - protected String dealerCodeId; - protected String name2; - protected String isAllocationWarehouse="false"; - protected String canAlterOrder; - protected String canCreateOrder; - protected String canViewOrder; - protected String salesRepId; - - protected String imagePath; - protected String imageTitle; - protected String altText; - protected String dateFrom; - protected String dateTo; - - protected String weekNo; - protected String startDate; - protected String endDate; - protected String financeOption; - protected String status; - - protected String newVinNumber; - protected String countryOfImpCode; - protected String enginePower; - protected String mainColourCode; - protected String natisModelNo; - protected String noOfWheels; - protected String tare; - protected String unitNumber; - protected Integer unitsPerPack; - protected String isTradeIn = "true"; - - protected String attributesetinstanceIdFrom; - protected String attributesetinstanceIdTo; - protected String releasedBy; - protected Integer productIds[]; - protected String ETA; - protected String ETAFilter; - - protected String engineCapacity; - protected String colourCodeHES; - protected String colourName; - protected String natisModelDescription; - protected Integer orderIds[]; - - protected String colourCodeMatchId; - protected String modelMatchID; - protected String natisModelDesc; - protected String modelDesc; - protected String trans; - protected String showActiveOnly = "true"; - protected String updateAttrValueId; - protected String active; - protected String visible; - protected String beginingBalance; - protected String statementDifference; - protected String endingBalance; - protected String amount; - protected String trxType; - protected String amountGiven; - protected String amountRefunded; - protected String cashBookId; - protected String cashId; - protected String cashLineId; - protected String cashBookName; - protected String chequeNo; - protected String creditCardType; - protected String creditCardNumber; - protected String creditCardNumberEncrypted; - protected String creditCardExpMonth; - protected String creditCardExpMonthName; - protected String creditCardExpYear; - protected Integer orderLineIds[]; - protected Integer [] posOrderLineIds; - protected Integer [] bpartnerIds; - protected Integer [] invoiceIds; - - private String qtySmall; - private String qtyMedium; - private String qtyLarge; - private String qtyXLarge; - private String clientName; - protected String transferAmount; - protected String cashBookIds; - protected String designAttributeValueId; - protected String modelAttributeValueId; - protected String sizeAttributeValueId; - protected String colourAttributeValueId; - protected String shoppingCartItemId; - protected String keyword; - protected String searchText; - protected String backOrder; - - protected String fieldName; - protected String applicationName; - protected String storeId; - protected String isWebstoreFeatured="false"; - protected String isNotWebstoreFeatured; - protected String imageName; - - protected String posId; - protected String purchasePriceList; - protected String purchasePriceLimit; - protected String purchasePriceStandard; - protected String salesPriceList; - protected String salesPriceLimit; - protected String salesPriceStandard; - protected String barCode; - protected String trackingNo; - protected String reportType; - protected String noOfProductsRequired; - protected String qtyAndItem; - protected String [] discountPercent; - protected String [] actualPrice; - protected String userSurname; - protected String countryId; - protected String countryName; - - protected String newName; - protected ArrayList productsList = new ArrayList(); - protected ProductImageBean productsIndexed; - protected String paymentByCash; - protected String paymentByCard; - protected String paymentByChq; - protected String isSales; - protected String isSOPriceList; - protected String ifAdd="true"; - - protected String brandName; - protected String modelName; - protected String designName; - protected String sizeName; - protected String productCategory; - protected String productClassification; - protected String [] sizes; - protected String revenueRecognition; - protected String cvv; - protected String creditCardPayment; - protected String shipmentMethod = MInOut.DELIVERYVIARULE_Pickup; - protected String shipTo; - protected String billTo; - protected String shipperId; - protected String paymentMethod; - - protected String revenueRecoId; - protected String isTextileProduct; - protected String qtyFilter; - protected ArrayList attributeValueList; - protected String [] attributeValueIds; - protected String attributeSetName; - protected String attributeName; - - - protected String requestId; - protected String fromAddress; - protected String toAddresses; - protected String ccAddresses; - protected String bccAddresses; - protected String textMessage; - protected String toUserId; - protected String priority; - protected String title; - protected String chargeId; - protected String statusId; - protected String totalActualPrice; - protected String productType="I"; - protected String qtyNumberFilter; - protected String taxCategoryId; - protected String taxCategoryName; - protected String endingBalanceAsString; - protected String beginingBalanceAsString; - protected String vendorName; - protected String timePeriod; - protected String chartType; - protected String salesGroup; - protected String taxRate; - protected String state; - protected String accountId; - protected String dateRange; - protected String reportName; - protected String orderGrandTotal; - protected String transferAllAmount; - protected String adjustmentAmount; - - protected String differenceAmt; - protected String tillGrandTotal; - protected String cashTotal; - protected String cardTotal; - protected String chequeTotal; - protected String creatingFromOrder; - protected String transferType; - protected String priceQtyFilter; - protected String deliveryViaRule; - protected String userPIN; - protected String paymentRule; - protected String cardDifference; - protected String chequeDifference; - - - protected String isSelfService; - protected String documentNote; - protected String currencySymbole; - protected String userDiscount; - - - - - protected String invoiceDate; - protected String netDays; - protected String daysDue; - protected String dueDate; - protected String discountDate; - protected String discountAmt; - protected String invoiceGrandTotal; - protected String paidAmt; - protected String openAmt; - protected String currencyId; - protected String paymentTermId; - protected String invoiceScheduleId; - - protected String invoicedAmt; - protected String pastDue91_plus; - protected String pastDue61_90; - protected String pastDue31_60; - protected String pastDue1_30; - protected String pastDue8_30; - protected String pastDue1_7; - protected String pastDueAmt; - protected String dueAmt; - protected String due0; - protected String due1_7; - protected String due8_30; - protected String due0_30; - protected String due31_60; - protected String due61_90; - protected String due91_PLUS; - - - protected String paymentAmt; - protected String overUnderPayment; - protected String writeOffAmt; - - protected String invoiceNo; - protected String paymentTermName; - - protected String dunningLevelId; - protected String dunningLevelName; - protected String dunningPrintText; - protected String dunningPrintNote; - protected String BP_Group_ID ; - protected String dunningId; - protected String dunningName; - protected String creditLimit; - protected String creditStatus; - protected String creditUsed; - public String docBasisType; - protected String amtMultiplier; - protected String frequencyType; - protected String commissionAmtId; - protected String subtractAmt; - - protected String taxName; - protected String taxId; - protected String isTaxExempted; - - protected Integer [] paymentIds; - - - protected String inventoryLineId; - protected String inventoryId; - protected String qtyBook; - protected String qtyCount; - protected String qtyCsv; - - protected String afterDelivery; - protected String fixedDueDate; - protected String nextBusinessday; - protected String fixedMonthDay; - protected String fixedMonthOffset; - protected String fiedMonthCutoff; - protected String toBeShipped; - protected String discountDay1; - protected String discountDay2; - protected String discountAmt1; - protected String discountAmt2; - protected String [] allocateAmount; - protected String group1; - protected String group2; - protected Integer [] inventoryIds; - - - protected String isFullAccess; - - protected String historyType; - - protected String birthdate; - protected String openDrawer="true"; - protected String uomId; - protected String uom; - protected String isOverwritePriceLimit; - protected String isDiscountUptoLimitPrice; - protected String isDiscountAllowedOnTotal; - protected String isChecked; - protected String fullDetails; - protected String unitPrice; - protected String unitPurchasePrice; - protected String totalGrossProfit; - protected String totalGrossProfitPercentage; - - protected StockMovementBean stock; - protected ArrayList stockList = new ArrayList(); - protected String stockValue; - private String noOfPack; - - // Additional fields required for user registration - protected String company = ""; - protected String industry = ""; - protected String comments = ""; - - protected String roundOffFactor; - protected String stdPrecision; - protected String isoCode; - protected String curSymbol; - - protected String terminalId; - protected String cashbookTransferType; - protected String checkTransferType; - protected String cardTransferType; - protected String cardBankAccountId; - protected String checkBankAccountId; - protected String templateBPartnerId; - protected String cashbookTransferCashbookId; - protected String cashbookTransferBankAccountId; - protected String checkTransferCashbookId; - protected String checkTransferBankAccountId; - protected String cardTransferCashbookId; - protected String cardTransferBankAccountId; - protected String autoLock; - protected String locked; - protected String isDiscountOnPercentage = "false"; - protected String isDiscountOnTotal = "false"; - protected String isAllowToView; - protected String isAllowToEdit; - protected String isAllowToCreate; - protected String isAllowToDelete; - protected String webMenuId; - protected String isSalesReport; - protected String receiptFooterMsg; - protected String branch; - protected String saleRepName; - - protected String readOnly = "false"; - - public String getIsoCode() { - return isoCode; - } - - public void setIsoCode(String isoCode) { - this.isoCode = isoCode; - } - - public String getCurSymbol() { - return curSymbol; - } - - public void setCurSymbol(String curSymbol) { - this.curSymbol = curSymbol; - } - - public String getStdPrecision() { - return stdPrecision; - } - - public void setStdPrecision(String stdPrecision) { - this.stdPrecision = stdPrecision; - } - - public String getHistoryType() - { - return historyType; - } - - public void setHistoryType(String historyType) - { - this.historyType = historyType; - } - - public Integer[] getPaymentIds() - { - return paymentIds; - } - - public void setPaymentIds(Integer[] paymentIds) - { - this.paymentIds = paymentIds; - } - - public DefaultForm() - { - setBean(new UDIBean()); - } - - public String getOrderGrandTotal() - { - return orderGrandTotal; - } - - public void setOrderGrandTotal(String orderGrandTotal) - { - this.orderGrandTotal = orderGrandTotal; - } - - public String getSalesGroup() - { - return salesGroup; - } - - public void setSalesGroup(String salesGroup) - { - this.salesGroup = salesGroup; - } - - public String getBeginingBalanceAsString() - { - return beginingBalanceAsString; - } - - public void setBeginingBalanceAsString(String beginingBalanceAsString) - { - this.beginingBalanceAsString = beginingBalanceAsString; - } - - public String getEndingBalanceAsString() - { - return endingBalanceAsString; - } - - public void setEndingBalanceAsString(String endingBalanceAsString) - { - this.endingBalanceAsString = endingBalanceAsString; - } - - public String getAttributeName() - { - return attributeName; - } - - public void setAttributeName(String attributeName) - { - this.attributeName = attributeName; - } - - public String getAttributeSetName() - { - return attributeSetName; - } - - public void setAttributeSetName(String attributeSetName) - { - this.attributeSetName = attributeSetName; - } - - public String getBillTo() - { - return billTo; - } - - public void setBillTo(String billTo) - { - this.billTo = billTo; - } - - public String getShipmentMethod() - { - return shipmentMethod; - } - - public void setShipmentMethod(String shipmentMethod) - { - this.shipmentMethod = shipmentMethod; - } - - public String getShipTo() - { - return shipTo; - } - - public void setShipTo(String shipTo) - { - this.shipTo = shipTo; - } - public String[] getActualPrice() - { - return actualPrice; - } - - public void setActualPrice(String[] actualPrice) - { - this.actualPrice = actualPrice; - } - - public String[] getDiscountPercent() - { - return discountPercent; - } - - public void setDiscountPercent(String[] discountPercent) - { - this.discountPercent = discountPercent; - } - - public String getQtyAndItem() - { - return qtyAndItem; - } - - public void setQtyAndItem(String qtyAndItem) - { - this.qtyAndItem = qtyAndItem; - } - - public String getIsTradeIn() - { - return isTradeIn; - } - - public void setIsTradeIn(String isTradeIn) - { - this.isTradeIn = isTradeIn; - } - - public String getLicensingDistrictId() { - return licensingDistrictId; - } - public void setLicensingDistrictId(String licensingDistrictId) { - this.licensingDistrictId = licensingDistrictId; - } - public String getIsAvailableForBackOrder() { - return isAvailableForBackOrder; - } - public void setIsAvailableForBackOrder(String isAvailableForBackOrder) { - this.isAvailableForBackOrder = isAvailableForBackOrder; - } - public String getAaCardnumber() { - return aaCardnumber; - } - public String getAccountNo() { - return accountNo; - } - public String getAccountType() { - return accountType; - } - public String getAddress1() { - return address1; - } - public String getAddress2() { - return address2; - } - - public String getAgreement() - { - return agreement; - } - public String getAisle() { - return aisle; - } - - - public String getAllocationId() - { - return allocationId; - } - - - - public String getAllocationStatus() - { - return allocationStatus; - } - public String getAttribute() { - return attribute; - } - public String getAttributeId() { - return attributeId; - } - public String getAttributeSetId() { - return attributeSetId; - } - public String getAttributeSetInstanceId() - { - return attributeSetInstanceId; - } - public String getAttributeValue() { - return attributeValue; - } - public String getBankId() { - return bankId; - } - public String getBankName() { - return bankName; - } - public String getBin() { - return bin; - } - public String getBpartnerId() { - return bpartnerId; - } - - public Integer[] getCheckBox() - { - return checkBox; - } - - public String getCheckNo() { - return checkNo; - } - public String getCity() { - return city; - } - public String getColour() { - return colour; - } - public String getColourAttributeValueId() { - return colourAttributeValueId; - } - - public String getCompiereDocStatus() - { - return compiereDocStatus; - } - - public String getConfirmEmail() { - return confirmEmail; - } - public String getConfirmPassword() { - return confirmPassword; - } - public String getCounterOrderStatusInfo() { - return counterOrderStatusInfo; - } - public String getCounterOrgID() { - return counterOrgID; - } - public String getCounterOrgName() { - return counterOrgName; - } - public String getCurrentBalance() { - return currentBalance; - } - public String getCustIdNumber() { - return custIdNumber; - } - public String getDateCreated() { - return dateCreated; - } - public String getDateOrdered() { - return dateOrdered; - } - public String getDatePromised() { - return datePromised; - } - public String getDateTrx() { - return dateTrx; - } - - public String getDescription() { - return description; - } - - public String getDocStatus() { - return docStatus; - } - public String getDocStatusCode() { - return docStatusCode; - } - public String getDocumentId() { - return documentId; - } - public String getDocumentNo() { - return documentNo; - } - public String getDocumentType() { - return documentType; - } - public String getEmail() { - return email; - } - - public String getEndDay() { - return endDay; - } - public String getEndHour() { - return endHour; - } - public String getEndMinute() { - return endMinute; - } - public String getEndMonth() { - return endMonth; - } - public String getEndYear() { - return endYear; - } - - - public String getEngineNo() { - return engineNo; - } - - - public String getEngineNumber() - { - return engineNumber; - } - public FormFile getFile() - { - return file; - } - - public String getFromDate() { - return fromDate; - } - - public String getFromOrderLineId() - { - return fromOrderLineId; - } - - public String getGrandTotal() { - return grandTotal; - } - public String getId() { - return id; - } - - public String getInvoiceId() { - return invoiceId; - } - public String getIsAccessAllOrgs() { - return isAccessAllOrgs; - } - public String getIsActive() { - return isActive; - } - public String getIsApproved() { - return isApproved; - } - public String getIsAutomobile() { - return isAutomobile; - } - public String getIsCustomer() { - return isCustomer; - } - public String getIsDefault() { - return isDefault; - } - public String getIsDelivered() { - return isDelivered; - } - public String getIsEmployee() { - return isEmployee; - } - public String getIsInvoiced() { - return isInvoiced; - } - public String getIsMotorcycle() { - return isMotorcycle; - } - public String getIsNatisReleased() { - return isNatisReleased; - } - public String getIsPublic() { - return isPublic; - } - - - public String getIsQtyReserved() { - return isQtyReserved; - } - - public String getIsReceipt() { - return isReceipt; - } - public String getIsRetailer() { - return isRetailer; - } - public String getIsSalesRep() { - return isSalesRep; - } - public String getIsSoTrx() { - return isSoTrx; - } - public String getIsVendor() { - return isVendor; - } - public String getIsWholesaler() { - return isWholesaler; - } - public String getLevel() { - return level; - } - public ArrayList getList() - { - return list; - } - - public String getLocationId() { - return locationId; - } - - - public String getLocatorId() - { - return locatorId; - } - - public FormFile getLogo() - { - return logo; - } - public String getLogoName() - { - return logoName; - } - public String getMaintenanceContractNumber() { - return maintenanceContractNumber; - } - - public String getMake() - { - return make; - } - - public String getMakeAttributeValueId() - { - return makeAttributeValueId; - } - - public String getMenuId() { - return menuId; - } - public String getMenuItemName() { - return menuItemName; - } - public String getMenuLink() { - return menuLink; - } - public String getMessage() { - return message; - } - public String getMessageID() { - return messageID; - } - public String getMobile() { - return mobile; - } - public String getModel() { - return model; - } - public String getModelAttributeValueId() { - return modelAttributeValueId; - } - - public String getModelGroup() { - return modelGroup; - } - public String getMonth() { - return month; - } - - public String getMovementDate() - { - return movementDate; - } - - public String getMovementDescription() - { - return movementDescription; - } - public String getName() { - return name; - } - public String getNatisApplicationDate() - { - return natisApplicationDate; - } - public String getNatisControlNumber() - { - return natisControlNumber; - } - public String getNatisReleaseId() - { - return natisReleaseId; - } - public String getNewEmail() { - return newEmail; - } - public String getNewPassword() { - return newPassword; - } - public String getOldPassword() { - return oldPassword; - } - public String getOrderId() { - return orderId; - } - public ArrayList getOrderLineBean() - { - return orderLineBean; - } - - public String getOrderLineId() - { - return orderLineId; - } - - - public String getOrderStatusInfo() { - return orderStatusInfo; - } - - - public String getOrderType() - { - return orderType; - } - public String getOrgId() - { - return orgId; - } - public String getOrgID() { - return OrgID; - } - public String getOrgName() { - return orgName; - } - public String getOrgType() { - return orgType; - } - public String getOrgUser() { - return orgUser; - } - public String getParentMenuId() { - return parentMenuId; - } - public String getPartnerId() { - return partnerId; - } - public String getPartnerName() { - return partnerName; - } - public String getPassword() { - return password; - } - public String getPayAmt() { - return payAmt; - } - public String getPaymentId() { - return paymentId; - } - - public String getPhone1() { - return phone; - } - public String getPhoneNo() { - return phone2; - } - public String getPoReference() { - return poReference; - } - public String getPOReference() - { - return POReference; - } - - public String getPostalAddress() { - return postalAddress; - } - public String getPostalAddress1() { - return postalAddress1; - } - public String getPostalCity() { - return postalCity; - } - public String getPostalCode() { - return postalCode; - } - public String getPostalPostalCode() { - return postalPostalCode; - } - public String getPrefOrderLineId() - { - return prefOrderLineId; - } - - public String getPriceEntered() - { - return priceEntered; - } - - public String getPriceListVersionId() { - return priceListVersionId; - } - public AttributeValuesPair getProductAttributes() - { - return productAttributes; - } - - public String getProductAttributeSetInstanceId() - { - return productAttributeSetInstanceId; - } - - public String getProductCategoryId() - { - return productCategoryId; - } - - public String getProductId() - { - return productId; - } - - public String getProductName() - { - return productName; - } - - public String getQty() { - return qty; - } - public String getQtyReserved() - { - return qtyReserved; - } - - public String[] getQtyTargeted() { - return qtyTargeted; - } - - public String getQuantity() - { - return quantity; - } - - public String getRead() { - return read; - } - - - public Integer getRefToQuote() - { - return refToQuote; - } - public String getRegion() { - return region; - } - - public String getRegionId() { - return regionId; - } - public String getRegisterNumber() - { - return registerNumber; - } - - public String getReserveStatus() - { - return reserveStatus; - } - public String getRoleId() { - return roleId; - } - public String getRoleName() { - return roleName; - } - public String getRoutingNumber() { - return routingNumber; - } - - public String getSernoAttributeSetInstance() - { - return sernoAttributeSetInstance; - } - - public String getSotrxFlag() - { - return sotrxFlag; - } - public String getStartDay() { - return startDay; - } - public String getStartHour() { - return startHour; - } - public String getStartMinute() { - return startMinute; - } - public String getStartMonth() { - return startMonth; - } - public String getStartYear() { - return startYear; - } - public String getStdPurchasePrice() { - return stdPurchasePrice; - } - public String getStdSalesPrice() { - return stdSalesPrice; - } - public String getSubject() { - return subject; - } - - public String getSubmit() - { - return submit; - } - public String getSurname() { - return surname; - } - - public Integer[] getTargetId() { - return targetId; - } - public String getTermsAgreement() - { - return termsAgreement; - } - - public String getToDate() { - return toDate; - } - - public String getToOrderLineId() - { - return toOrderLineId; - } - - public String getTotalLines() - { - return totalLines; - } - - public String getTransmission() { - return transmission; - } - public String getTransmissionAttributeValueId() { - return transmissionAttributeValueId; - } - public String getUserId() { - return userId; - } - - public String getUsername() { - return username; - } - public String getValue() { - return value; - } - - public String getVinNumber() - { - return vinNumber; - } - public String getWarehouseId() { - return warehouseId; - } - public String getWarehouseName() { - return warehouseName; - } - - public String getWarehouseType() - { - return warehouseType; - } - public String getYear() { - return year; - } - - public void setAisle(String aisle) { - this.aisle = aisle; - } - - - public void setAllocationId(String allocationId) - { - this.allocationId = allocationId; - } - - public void setAllocationStatus(String allocationStatus) - { - this.allocationStatus = allocationStatus; - } - public void setAttribute(String attribute) { - this.attribute = attribute; - } - public void setAttributeId(String attributeId) { - this.attributeId = attributeId; - } - public void setAttributeSetId(String attributeSetId) { - this.attributeSetId = attributeSetId; - } - public void setAttributeSetInstanceId(String attributeSetInstanceId) - { - this.attributeSetInstanceId = attributeSetInstanceId; - } - public void setAttributeValue(String attributeValue) { - this.attributeValue = attributeValue; - } - public void setBankId(String bankId) { - this.bankId = bankId; - } - public void setBankName(String bankName) { - this.bankName = bankName; - } - public void setBin(String bin) { - this.bin = bin; - } - public void setBpartnerId(String partnerId) { - bpartnerId = partnerId; - } - public void setCheckBox(Integer[] checkBox) - { - this.checkBox = checkBox; - } - - public String getYearAttributeValueId() { - return yearAttributeValueId; - } - public void setAaCardnumber(String aaCardnumber) { - this.aaCardnumber = aaCardnumber; - } - public void setAccountNo(String accountNo) { - this.accountNo = accountNo; - } - public void setAccountType(String accountType) { - this.accountType = accountType; - } - public void setAddress1(String address1) { - this.address1 = address1; - } - public void setAddress2(String address2) { - this.address2 = address2; - } - - public void setAgreement(String agreement) - { - this.agreement = agreement; - } - - public void setCheckNo(String checkNo) { - this.checkNo = checkNo; - } - public void setCity(String city) { - this.city = city; - } - public void setColour(String colour) { - this.colour = colour; - } - public void setColourAttributeValueId(String colourAttributeValueId) { - this.colourAttributeValueId = colourAttributeValueId; - } - - public void setCompiereDocStatus(String compiereDocStatus) - { - this.compiereDocStatus = compiereDocStatus; - } - public void setConfirmEmail(String confirmEmail) { - this.confirmEmail = confirmEmail; - } - public void setConfirmPassword(String confirmPassword) { - this.confirmPassword = confirmPassword; - } - public void setCounterOrderStatusInfo(String counterOrderStatusInfo) { - this.counterOrderStatusInfo = counterOrderStatusInfo; - } - public void setCounterOrgID(String counterOrgID) { - this.counterOrgID = counterOrgID; - } - public void setCounterOrgName(String counterOrgName) { - this.counterOrgName = counterOrgName; - } - public void setCurrentBalance(String currentBalance) { - this.currentBalance = currentBalance; - } - public void setCustIdNumber(String custIdNumber) { - this.custIdNumber = custIdNumber; - } - public void setDateCreated(String dateCreated) { - this.dateCreated = dateCreated; - } - public void setDateOrdered(String dateOrdered) { - this.dateOrdered = dateOrdered; - } - public void setDatePromised(String datePromised) { - this.datePromised = datePromised; - } - public void setDateTrx(String dateTrx) { - this.dateTrx = dateTrx; - } - public void setDescription(String description) { - this.description = description; - } - public void setDocStatus(String docStatus) { - this.docStatus = docStatus; - } - public void setDocStatusCode(String docStatusCode) { - this.docStatusCode = docStatusCode; - } - public void setDocumentId(String documentId) { - this.documentId = documentId; - } - public void setDocumentNo(String documentNo) { - this.documentNo = documentNo; - } - public void setDocumentType(String documentType) { - this.documentType = documentType; - } - public void setEmail(String email) { - this.email = email; - } - public void setEndDay(String endDay) { - this.endDay = endDay; - } - public void setEndHour(String endHour) { - this.endHour = endHour; - } - public void setEndMinute(String endMinute) { - this.endMinute = endMinute; - } - public void setEndMonth(String endMonth) { - this.endMonth = endMonth; - } - public void setEndYear(String endYear) { - this.endYear = endYear; - } - public void setEngineNo(String engineNo) { - this.engineNo = engineNo; - } - public void setEngineNumber(String engineNumber) - { - this.engineNumber = engineNumber; - } - - public void setFile(FormFile file) - { - this.file = file; - } - - public void setFromDate(String fromDate) { - this.fromDate = fromDate; - } - - public void setFromOrderLineId(String fromOrderLineId) - { - this.fromOrderLineId = fromOrderLineId; - } - - public void setGrandTotal(String grandTotal) { - this.grandTotal = grandTotal; - } - public void setId(String id) { - this.id = id; - } - public void setInvoiceId(String invoiceId) { - this.invoiceId = invoiceId; - } - public void setIsAccessAllOrgs(String isAccessAllOrgs) { - this.isAccessAllOrgs = isAccessAllOrgs; - } - - public void setIsActive(String isActive) { - this.isActive = isActive; - } - public void setIsApproved(String isApproved) { - this.isApproved = isApproved; - } - public void setIsAutomobile(String isAutomobile) { - this.isAutomobile = isAutomobile; - } - public void setIsCustomer(String isCustomer) { - this.isCustomer = isCustomer; - } - public void setIsDefault(String isDefault) { - this.isDefault = isDefault; - } - public void setIsDelivered(String isDelivered) { - this.isDelivered = isDelivered; - } - public void setIsEmployee(String isEmployee) { - this.isEmployee = isEmployee; - } - public void setIsInvoiced(String isInvoiced) { - this.isInvoiced = isInvoiced; - } - public void setIsMotorcycle(String isMotorcycle) { - this.isMotorcycle = isMotorcycle; - } - public void setIsNatisReleased(String isNatisReleased) { - this.isNatisReleased = isNatisReleased; - } - public void setIsPublic(String isPublic) { - this.isPublic = isPublic; - } - public void setIsQtyReserved(String isQtyReserved) { - this.isQtyReserved = isQtyReserved; - } - - public void setIsReceipt(String isReceipt) { - this.isReceipt = isReceipt; - } - public void setIsRetailer(String isRetailer) { - this.isRetailer = isRetailer; - } - public void setIsSalesRep(String isSalesRep) { - this.isSalesRep = isSalesRep; - } - public void setIsSoTrx(String isSoTrx) { - this.isSoTrx = isSoTrx; - } - public void setIsVendor(String isVendor) { - this.isVendor = isVendor; - } - public void setIsWholesaler(String isWholesaler) { - this.isWholesaler = isWholesaler; - } - public void setLevel(String level) { - this.level = level; - } - public void setList(ArrayList list) - { - this.list = list; - } - - public void setLocationId(String locationId) { - this.locationId = locationId; - } - - public void setLocatorId(String locatorId) - { - this.locatorId = locatorId; - } - - public void setLogo(FormFile logo) - { - this.logo = logo; - } - public void setLogoName(String logoName) - { - this.logoName = logoName; - } - public void setMaintenanceContractNumber(String maintenanceContractNumber) { - this.maintenanceContractNumber = maintenanceContractNumber; - } - - public void setMake(String make) - { - this.make = make; - } - - public void setMakeAttributeValueId(String makeAttributeValueId) - { - this.makeAttributeValueId = makeAttributeValueId; - } - - public void setMenuId(String menuId) { - this.menuId = menuId; - } - public void setMenuItemName(String menuItemName) { - this.menuItemName = menuItemName; - } - public void setMenuLink(String menuLink) { - this.menuLink = menuLink; - } - public void setMessage(String message) { - this.message = message; - } - public void setMessageID(String messageID) { - this.messageID = messageID; - } - public void setMobile(String mobile) { - this.mobile = mobile; - } - public void setModel(String model) { - this.model = model; - } - public void setModelAttributeValueId(String modelAttributeValueId) { - this.modelAttributeValueId = modelAttributeValueId; - } - public void setModelGroup(String modelGroup) { - this.modelGroup = modelGroup; - } - public void setMonth(String month) { - this.month = month; - } - - public void setMovementDate(String movementDate) - { - this.movementDate = movementDate; - } - - public void setMovementDescription(String movementDescription) - { - this.movementDescription = movementDescription; - } - public void setName(String name) { - this.name = name; - } - public void setNatisApplicationDate(String natisApplicationDate) - { - this.natisApplicationDate = natisApplicationDate; - } - public void setNatisControlNumber(String natisControlNumber) - { - this.natisControlNumber = natisControlNumber; - } - public void setNatisReleaseId(String natisReleaseId) - { - this.natisReleaseId = natisReleaseId; - } - public void setNewEmail(String newEmail) { - this.newEmail = newEmail; - } - public void setNewPassword(String newPassword) { - this.newPassword = newPassword; - } - public void setOldPassword(String oldPassword) { - this.oldPassword = oldPassword; - } - public void setOrderId(String orderId) { - this.orderId = orderId; - } - public void setOrderLineBean(ArrayList orderLineBean) - { - this.orderLineBean = orderLineBean; - } - - public void setOrderLineId(String orderLineId) - { - this.orderLineId = orderLineId; - } - - - - public void setOrderStatusInfo(String orderStatusInfo) { - this.orderStatusInfo = orderStatusInfo; - } - - public void setOrderType(String orderType) - { - this.orderType = orderType; - } - public void setOrgId(String orgId) - { - this.orgId = orgId; - } - public void setOrgID(String orgID) { - OrgID = orgID; - } - public void setOrgName(String orgName) { - this.orgName = orgName; - } - public void setOrgType(String orgType) { - this.orgType = orgType; - } - public void setOrgUser(String orgUser) { - this.orgUser = orgUser; - } - public void setParentMenuId(String parentMenuId) { - this.parentMenuId = parentMenuId; - } - public void setPartnerId(String partnerId) { - this.partnerId = partnerId; - } - public void setPartnerName(String partnerName) { - this.partnerName = partnerName; - } - public void setPassword(String password) { - this.password = password; - } - public void setPayAmt(String payAmt) { - this.payAmt = payAmt; - } - public void setPaymentId(String paymentId) { - this.paymentId = paymentId; - } - public void setPhone1(String phone1) { - this.phone = phone1; - } - public void setPhoneNo(String phoneNo) { - this.phone2 = phoneNo; - } - public void setPoReference(String poReference) { - this.poReference = poReference; - } - public void setPOReference(String reference) - { - POReference = reference; - } - - public void setPostalAddress(String postalAddress) { - this.postalAddress = postalAddress; - } - public void setPostalAddress1(String postalAddress1) { - this.postalAddress1 = postalAddress1; - } - public void setPostalCity(String postalCity) { - this.postalCity = postalCity; - } - public void setPostalCode(String postalCode) { - this.postalCode = postalCode; - } - public void setPostalPostalCode(String postalPostalCode) { - this.postalPostalCode = postalPostalCode; - } - - public void setPrefOrderLineId(String prefOrderLineId) - { - this.prefOrderLineId = prefOrderLineId; - } - - public void setPriceEntered(String priceEntered) - { - this.priceEntered = priceEntered; - } - - public void setPriceListVersionId(String priceListVersionId) { - this.priceListVersionId = priceListVersionId; - } - public void setProductAttributes(AttributeValuesPair productAttributes) - { - this.productAttributes = productAttributes; - } - - public void setProductAttributeSetInstanceId(String productAttributeSetInstanceId) - { - this.productAttributeSetInstanceId = productAttributeSetInstanceId; - } - - public void setProductCategoryId(String productCategoryId) - { - this.productCategoryId = productCategoryId; - } - - public void setProductId(String productId) - { - this.productId = productId; - } - - public void setProductName(String productName) - { - this.productName = productName; - } - public void setQty(String qty) { - this.qty = qty; - } - public void setQtyReserved(String qtyReserved) - { - this.qtyReserved = qtyReserved; - } - public void setQtyTargeted(String[] qtyTargeted) { - this.qtyTargeted = qtyTargeted; - } - - - public void setQuantity(String quantity) - { - this.quantity = quantity; - } - - public void setRead(String read) { - this.read = read; - } - public void setRefToQuote(Integer refToQuote) - { - this.refToQuote = refToQuote; - } - public void setRegion(String region) { - this.region = region; - } - - - public void setRegionId(String regionId) { - this.regionId = regionId; - } - public void setRegisterNumber(String registerNumber) - { - this.registerNumber = registerNumber; - } - - public void setReserveStatus(String reserveStatus) - { - this.reserveStatus = reserveStatus; - } - public void setRoleId(String roleId) { - this.roleId = roleId; - } - public void setRoleName(String roleName) { - this.roleName = roleName; - } - public String getPrice() { - return price; - } - public void setPrice(String price) { - this.price = price; - } - public String getPriceList() { - return priceList; - } - public void setPriceList(String priceList) { - this.priceList = priceList; - } - - public void setRoutingNumber(String routingNumber) { - this.routingNumber = routingNumber; - } - - public void setSernoAttributeSetInstance(String sernoAttributeSetInstance) - { - this.sernoAttributeSetInstance = sernoAttributeSetInstance; - } - - public void setSotrxFlag(String sotrxFlag) - { - this.sotrxFlag = sotrxFlag; - } - public void setStartDay(String startDay) { - this.startDay = startDay; - } - public void setStartHour(String startHour) { - this.startHour = startHour; - } - public void setStartMinute(String startMinute) { - this.startMinute = startMinute; - } - public void setStartMonth(String startMonth) { - this.startMonth = startMonth; - } - public void setStartYear(String startYear) { - this.startYear = startYear; - } - public void setStdPurchasePrice(String stdPurchasePrice) { - this.stdPurchasePrice = stdPurchasePrice; - } - public void setStdSalesPrice(String stdSalesPrice) { - this.stdSalesPrice = stdSalesPrice; - } - public void setSubject(String subject) { - this.subject = subject; - } - - public void setSubmit(String submit) - { - this.submit = submit; - } - public void setSurname(String surname) { - this.surname = surname; - } - public void setTargetId(Integer[] targetId) { - this.targetId = targetId; - } - public void setTermsAgreement(String termsAgreement) - { - this.termsAgreement = termsAgreement; - } - public void setToDate(String toDate) { - this.toDate = toDate; - } - - public void setToOrderLineId(String toOrderLineId) - { - this.toOrderLineId = toOrderLineId; - } - - public void setTotalLines(String totalLines) - { - this.totalLines = totalLines; - } - public void setTransmission(String transmission) { - this.transmission = transmission; - } - public void setTransmissionAttributeValueId( - String transmissionAttributeValueId) { - this.transmissionAttributeValueId = transmissionAttributeValueId; - } - public void setUserId(String userId) { - this.userId = userId; - } - - public void setUsername(String username) { - this.username = username; - } - public void setValue(String value) { - this.value = value; - } - public void setVinNumber(String vinNumber) - { - this.vinNumber = vinNumber; - } - public void setWarehouseId(String warehouseId) { - this.warehouseId = warehouseId; - } - public void setWarehouseName(String warehouseName) { - this.warehouseName = warehouseName; - } - - public void setWarehouseType(String warehouseType) - { - this.warehouseType = warehouseType; - } - - public void setYear(String year) { - this.year = year; - } - public void setYearAttributeValueId(String yearAttributeValueId) { - this.yearAttributeValueId = yearAttributeValueId; - } - - public String getFirst() - { - return first; - } - - public void setFirst(String first) - { - this.first = first; - } - - public String getLicensingDistrict() - { - return licensingDistrict; - } - - public void setLicensingDistrict(String licensingDistrict) - { - this.licensingDistrict = licensingDistrict; - } - - public String getCompanyRegNo() - { - return companyRegNo; - } - - public void setCompanyRegNo(String companyRegNo) - { - this.companyRegNo = companyRegNo; - } - - public String getPassportNo() - { - return passportNo; - } - - public void setPassportNo(String passportNo) - { - this.passportNo = passportNo; - } - - public String getTradeInOrderlineId() - { - return tradeInOrderlineId; - } - - public void setTradeInOrderlineId(String tradeInOrderlineId) - { - this.tradeInOrderlineId = tradeInOrderlineId; - } - - public String getProspects() - { - return prospects; - } - - public void setProspects(String prospects) - { - this.prospects = prospects; - } - - public String getSales() - { - return sales; - } - - public void setSales(String sales) - { - this.sales = sales; - } - - public ArrayList getShowroomTrafficBean() - { - return showroomTrafficBean; - } - - public void setShowroomTrafficBean(ArrayList showroomTrafficBean) - { - this.showroomTrafficBean = showroomTrafficBean; - } - - - - public String getTraffic() - { - return traffic; - } - - public void setTraffic(String traffic) - { - this.traffic = traffic; - } - - - - public String getModelCode() { - return modelCode; - } - public void setModelCode(String modelCode) { - this.modelCode = modelCode; - } - public String getModelCodeId() { - return modelCodeId; - } - public void setModelCodeId(String modelCodeId) { - this.modelCodeId = modelCodeId; - } - public String getModelId() { - return modelId; - } - public void setModelId(String modelId) { - this.modelId = modelId; - } - public String getTrx() { - return trx; - } - public void setTrx(String trx) { - this.trx = trx; - } - public String getTrxId() { - return trxId; - } - public void setTrxId(String trxId) { - this.trxId = trxId; - } - public String getDealerCode() { - return dealerCode; - } - public void setDealerCode(String dealerCode) { - this.dealerCode = dealerCode; - } - public String getDealerCodeId() { - return dealerCodeId; - } - public void setDealerCodeId(String dealerCodeId) { - this.dealerCodeId = dealerCodeId; - } - public String getName2() - { - return name2; - } - public void setName2(String name2) - { - this.name2 = name2; - } - public String getIsAllocationWarehouse() { - return isAllocationWarehouse; - } - public void setIsAllocationWarehouse(String isAllocationWarehouse) { - this.isAllocationWarehouse = isAllocationWarehouse; - } - - - public String getCanAlterOrder() { - return canAlterOrder; - } - public void setCanAlterOrder(String canAlterOrder) { - this.canAlterOrder = canAlterOrder; - } - public String getCanCreateOrder() { - return canCreateOrder; - } - public void setCanCreateOrder(String canCreateOrder) { - this.canCreateOrder = canCreateOrder; - } - public String getCanViewOrder() { - return canViewOrder; - } - public void setCanViewOrder(String canViewOrder) { - this.canViewOrder = canViewOrder; - } - public String getSalesRepId() { - return salesRepId; - } - public void setSalesRepId(String salesRepId) { - this.salesRepId = salesRepId; - } - public String getAltText() { - return altText; - } - public void setAltText(String altText) { - this.altText = altText; - } - public String getDateFrom() { - return dateFrom; - } - public void setDateFrom(String dateFrom) { - this.dateFrom = dateFrom; - } - public String getDateTo() { - return dateTo; - } - public void setDateTo(String dateTo) { - this.dateTo = dateTo; - } - public String getImagePath() { - return imagePath; - } - public void setImagePath(String imagePath) { - this.imagePath = imagePath; - } - public String getImageTitle() { - return imageTitle; - } - public void setImageTitle(String imageTitle) { - this.imageTitle = imageTitle; - } - - public String getEndDate() - { - return endDate; - } - public void setEndDate(String endDate) - { - this.endDate = endDate; - } - public String getStartDate() - { - return startDate; - } - public void setStartDate(String startDate) - { - this.startDate = startDate; - } - public String getWeekNo() - { - return weekNo; - } - public void setWeekNo(String weekNo) - { - this.weekNo = weekNo; - } - public String getFax() - { - return fax; - } - public void setFax(String fax) - { - this.fax = fax; - } - - public String getFinanceOption() - { - return financeOption; - } - public void setFinanceOption(String financeOption) - { - this.financeOption = financeOption; - } - public String getStatus() - { - return status; - } - public void setStatus(String status) - { - this.status = status; - } - - - - public String getCountryOfImpCode() - { - return countryOfImpCode; - } - - - - public void setCountryOfImpCode(String countryOfImpCode) - { - this.countryOfImpCode = countryOfImpCode; - } - - - - public String getEnginePower() - { - return enginePower; - } - - - - public void setEnginePower(String enginePower) - { - this.enginePower = enginePower; - } - - - - public String getMainColourCode() - { - return mainColourCode; - } - - - - public void setMainColourCode(String mainColourCode) - { - this.mainColourCode = mainColourCode; - } - - - - public String getNatisModelNo() - { - return natisModelNo; - } - - - - public void setNatisModelNo(String natisModelNo) - { - this.natisModelNo = natisModelNo; - } - - - - public String getNewVinNumber() - { - return newVinNumber; - } - - - - public void setNewVinNumber(String newVinNumber) - { - this.newVinNumber = newVinNumber; - } - - - - public String getNoOfWheels() - { - return noOfWheels; - } - - - - public void setNoOfWheels(String noOfWheels) - { - this.noOfWheels = noOfWheels; - } - - - - public String getTare() - { - return tare; - } - - - - public void setTare(String tare) - { - this.tare = tare; - } - - - - public String getUnitNumber() - { - return unitNumber; - } - - - - public void setUnitNumber(String unitNumber) - { - this.unitNumber = unitNumber; - } - - public String getAttributesetinstanceIdFrom() { - return attributesetinstanceIdFrom; - } - public void setAttributesetinstanceIdFrom(String attributesetinstanceIdFrom) { - this.attributesetinstanceIdFrom = attributesetinstanceIdFrom; - } - public String getAttributesetinstanceIdTo() { - return attributesetinstanceIdTo; - } - public void setAttributesetinstanceIdTo(String attributesetinstanceIdTo) { - this.attributesetinstanceIdTo = attributesetinstanceIdTo; - } - - public String getReleasedBy() { - return releasedBy; - } - public void setReleasedBy(String releasedBy) { - this.releasedBy = releasedBy; - } - - public Integer[] getProductIds() { - return productIds; - } - public void setProductIds(Integer[] productIds) { - this.productIds = productIds; - } - public String getColourCodeHES() - { - return colourCodeHES; - } - - - - public void setColourCodeHES(String colourCodeHES) - { - this.colourCodeHES = colourCodeHES; - } - public String getNatisModelDescription() - { - return natisModelDescription; - } - - - - public void setNatisModelDescription(String natisModelDescription) - { - this.natisModelDescription = natisModelDescription; - } - - public String getETA() - { - return ETA; - } - public void setETA(String eta) - { - ETA = eta; - } - - public String getETAFilter() - { - return ETAFilter; - } - public void setETAFilter(String filter) - { - ETAFilter = filter; - } - - - public String getEngineCapacity() - { - return engineCapacity; - } - - public void setEngineCapacity(String engineCapacity) - { - this.engineCapacity = engineCapacity; - } - - public Integer[] getOrderIds() - { - return orderIds; - } - public void setOrderIds(Integer[] orderIds) { - this.orderIds = orderIds; - } - - public Integer[] getSernoAttributeSetInstanceIds() - { - return sernoAttributeSetInstanceIds; - } - public void setSernoAttributeSetInstanceIds( - Integer[] sernoAttributeSetInstanceIds) - { - this.sernoAttributeSetInstanceIds = sernoAttributeSetInstanceIds; - } - - - public String getModelDesc() - { - return modelDesc; - } - - public void setModelDesc(String modelDesc) - { - this.modelDesc = modelDesc; - } - - public String getModelMatchID() - { - return modelMatchID; - } - - public void setModelMatchID(String modelMatchID) - { - this.modelMatchID = modelMatchID; - } - - public String getNatisModelDesc() - { - return natisModelDesc; - } - - public void setNatisModelDesc(String natisModelDesc) - { - this.natisModelDesc = natisModelDesc; - } - - public String getTrans() - { - return trans; - } - - public void setTrans(String trans) - { - this.trans = trans; - } - public String getAttributeValueId() { - return attributeValueId; - } - public void setAttributeValueId(String attributeValueId) { - this.attributeValueId = attributeValueId; - } - public String getShowActiveOnly() { - return showActiveOnly; - } - public void setShowActiveOnly(String showActiveOnly) { - this.showActiveOnly = showActiveOnly; - } - public String getUpdateAttrValueId() { - return updateAttrValueId; - } - public void setUpdateAttrValueId(String updateAttrValueId) { - this.updateAttrValueId = updateAttrValueId; - } - - public String getIsVisible() - { - return isVisible; - } - - public void setIsVisible(String isVisible) - { - this.isVisible = isVisible; - } - - public String getActive() - { - return active; - } - - public void setActive(String active) - { - this.active = active; - } - - public String getVisible() - { - return visible; - } - - public void setVisible(String visible) - { - this.visible = visible; - } - - public String getColourName() - { - return colourName; - } - - public void setColourName(String colourName) - { - this.colourName = colourName; - } - - public String getColourCodeMatchId() - { - return colourCodeMatchId; - } - - public void setColourCodeMatchId(String colourCodeMatchId) - { - this.colourCodeMatchId = colourCodeMatchId; - } - - - - public String getBeginingBalance() - { - return beginingBalance; - } - - public void setBeginingBalance(String beginingBalance) - { - this.beginingBalance = beginingBalance; - } - - public String getEndingBalance() - { - return endingBalance; - } - - public void setEndingBalance(String endingBalance) - { - this.endingBalance = endingBalance; - } - - public String getStatementDifference() - { - return statementDifference; - } - - public void setStatementDifference(String statementDifference) - { - this.statementDifference = statementDifference; - } - - public String getAmount() - { - return amount; - } - - - public void setAmount(String amount) - { - this.amount = amount; - } - - - public String getTrxType() - { - return trxType; - } - - - public void setTrxType(String trxType) - { - this.trxType = trxType; - } - - - - public String getAmountGiven() { - return amountGiven; - } - - public void setAmountGiven(String amountGiven) { - this.amountGiven = amountGiven; - } - - public String getAmountRefunded() - { - return amountRefunded; - } - - public void setAmountRefunded(String amountRefunded) - { - this.amountRefunded = amountRefunded; - } - - - - public String getCashBookId() - { - return cashBookId; - } - - public void setCashBookId(String cashBookId) - { - this.cashBookId = cashBookId; - } - - public String getCashBookName() - { - return cashBookName; - } - - - public void setCashBookName(String cashBookName) - { - this.cashBookName = cashBookName; - } - - - - public String getChequeNo() - { - return chequeNo; - } - - public void setChequeNo(String chequeNo) - { - this.chequeNo = chequeNo; - } - - public String getCreditCardExpMonth() - { - return creditCardExpMonth; - } - - public void setCreditCardExpMonth(String creditCardExpMonth) - { - this.creditCardExpMonth = creditCardExpMonth; - } - - public String getCreditCardExpYear() - { - return creditCardExpYear; - } - - public void setCreditCardExpYear(String creditCardExpYear) - { - this.creditCardExpYear = creditCardExpYear; - } - - public String getCreditCardNumber() - { - return creditCardNumber; - } - - public void setCreditCardNumber(String creditCardNumber) - { - this.creditCardNumber = creditCardNumber; - } - - public String getCreditCardType() - { - return creditCardType; - } - - public void setCreditCardType(String creditCardType) - { - this.creditCardType = creditCardType; - } - - - - public Integer[] getOrderLineIds() - { - return orderLineIds; - } - - public void setOrderLineIds(Integer[] orderLineIds) - { - this.orderLineIds = orderLineIds; - } - - - public Integer[] getPosOrderLineIds() - { - return posOrderLineIds; - } - - public void setPosOrderLineIds(Integer[] posOrderLineIds) - { - this.posOrderLineIds = posOrderLineIds; - } - public String getQtyLarge() - { - return qtyLarge; - } - - public void setQtyLarge(String qtyLarge) - { - this.qtyLarge = qtyLarge; - } - - public String getQtyMedium() - { - return qtyMedium; - } - - public void setQtyMedium(String qtyMedium) - { - this.qtyMedium = qtyMedium; - } - - public String getQtySmall() - { - return qtySmall; - } - - public void setQtySmall(String qtySmall) - { - this.qtySmall = qtySmall; - } - - public String getQtyXLarge() - { - return qtyXLarge; - } - - public void setQtyXLarge(String qtyXLarge) - { - this.qtyXLarge = qtyXLarge; - } - - public String getClientName() - { - return clientName; - } - - public void setClientName(String clientName) - { - this.clientName = clientName; - } - - - - public String getCashBookIds() { - return cashBookIds; - } - public void setCashBookIds(String cashBookIds) { - this.cashBookIds = cashBookIds; - } - public String getTransferAmount() { - return transferAmount; - } - public void setTransferAmount(String transferAmount) { - this.transferAmount = transferAmount; - } - public String getApplicationName() { - return applicationName; - } - public void setApplicationName(String applicationName) { - this.applicationName = applicationName; - } - - - public String getPosId() { - return this.posId; - } - - public String getBackOrder() - { - return backOrder; - } - - public void setBackOrder(String backOrder) - { - this.backOrder = backOrder; - } - - public String getDesignAttributeValueId() - { - return designAttributeValueId; - } - - public void setDesignAttributeValueId(String designAttributeValueId) - { - this.designAttributeValueId = designAttributeValueId; - } - - public String getFieldName() - { - return fieldName; - } - - public void setFieldName(String fieldName) - { - this.fieldName = fieldName; - } - - public String getKeyword() - { - return keyword; - } - - public void setKeyword(String keyword) - { - this.keyword = keyword; - } - - public String getSearchText() - { - return searchText; - } - - public void setSearchText(String searchText) - { - this.searchText = searchText; - } - - public String getShoppingCartItemId() - { - return shoppingCartItemId; - } - - public void setShoppingCartItemId(String shoppingCartItemId) - { - this.shoppingCartItemId = shoppingCartItemId; - } - - public String getSizeAttributeValueId() - { - return sizeAttributeValueId; - } - - public void setSizeAttributeValueId(String sizeAttributeValueId) - { - this.sizeAttributeValueId = sizeAttributeValueId; - } - - public String getIsNotWebstoreFeatured() - { - return isNotWebstoreFeatured; - } - - public void setIsNotWebstoreFeatured(String isNotWebstoreFeatured) - { - this.isNotWebstoreFeatured = isNotWebstoreFeatured; - } - - public String getIsWebstoreFeatured() - { - return isWebstoreFeatured; - } - - public void setIsWebstoreFeatured(String isWebstoreFeatured) - { - this.isWebstoreFeatured = isWebstoreFeatured; - } - - public String getImageName() - { - return imageName; - } - - public void setImageName(String imageName) - { - this.imageName = imageName; - } - - public ProductImageBean getProductsIndexed() - { - return productsIndexed; - } - - public ProductImageBean getProductsIndexed(int index) - { - while (index >= productsList.size()) - productsList.add(new ProductImageBean()); - return (ProductImageBean) productsList.get(index); - } - - public void setProductsIndexed(ProductImageBean productsIndexed) - { - this.productsIndexed = productsIndexed; - } - - public void setProductsIndexed(int index, ProductImageBean value) - { - productsList.add(index, value); - } - public void setPosId(String posId) { - this.posId = posId; - } - - public String getBarCode() { - return barCode; - } - public void setBarCode(String barCode) { - this.barCode = barCode; - } - public String getPurchasePriceStandard() { - return purchasePriceStandard; - } - public void setPurchasePriceStandard(String purchasePriceStandard) { - this.purchasePriceStandard = purchasePriceStandard; - } - - - public String getPurchasePriceLimit() { - return purchasePriceLimit; - } - public void setPurchasePriceLimit(String purchasePriceLimit) { - this.purchasePriceLimit = purchasePriceLimit; - } - public String getPurchasePriceList() { - return purchasePriceList; - } - public void setPurchasePriceList(String purchasePriceList) { - this.purchasePriceList = purchasePriceList; - } - public String getSalesPriceLimit() { - return salesPriceLimit; - } - public void setSalesPriceLimit(String salesPriceLimit) { - this.salesPriceLimit = salesPriceLimit; - } - public String getSalesPriceList() { - return salesPriceList; - } - public void setSalesPriceList(String salesPriceList) { - this.salesPriceList = salesPriceList; - } - public String getSalesPriceStandard() { - return salesPriceStandard; - } - public void setSalesPriceStandard(String salesPriceStandard) { - this.salesPriceStandard = salesPriceStandard; - } - public String getNoOfProductsRequired() { - return noOfProductsRequired; - } - public void setNoOfProductsRequired(String noOfProductsRequired) { - this.noOfProductsRequired = noOfProductsRequired; - } - public String getReportType() { - return reportType; - } - public void setReportType(String reportType) { - this.reportType = reportType; - } - - public String getUserSurname() { - return userSurname; - } - public void setUserSurname(String userSurname) { - this.userSurname = userSurname; - } - public String getCountryId() { - return countryId; - } - public void setCountryId(String countryId) { - this.countryId = countryId; - } - public String getCountryName() { - return countryName; - } - public void setCountryName(String countryName) { - this.countryName = countryName; - } - - public ArrayList getProductsList() - { - return productsList; - } - - public void setProductsList(ArrayList productsList) - { - this.productsList = productsList; - } - - public String getNewName() - { - return newName; - } - - public void setNewName(String newName) - { - this.newName = newName; - } - public String getPaymentByCard() { - return paymentByCard; - } - public void setPaymentByCard(String paymentByCard) { - this.paymentByCard = paymentByCard; - } - public String getPaymentByCash() { - return paymentByCash; - } - public void setPaymentByCash(String paymentByCash) { - this.paymentByCash = paymentByCash; - } - public String getPaymentByChq() { - return paymentByChq; - } - public void setPaymentByChq(String paymentByChq) { - this.paymentByChq = paymentByChq; - } - public String getIsSales() { - return isSales; - } - public void setIsSales(String isSales) { - this.isSales = isSales; - } - public String getProductClassification() { - return productClassification; - } - - public void setProductClassification(String productClassification) { - this.productClassification = productClassification; - } - - - public String getTrackingNo() { - return trackingNo; - } - - - public void setTrackingNo(String trackingNo) { - this.trackingNo = trackingNo; - } - - public String[] getSizes() - { - return sizes; - } - public void setSizes(String[] sizes) - { - this.sizes = sizes; - } - - public String getRevenueRecognition() - { - return revenueRecognition; - } - public void setRevenueRecognition(String revenueRecognition) - { - this.revenueRecognition = revenueRecognition; - } - public String getBrandName() - { - return brandName; - } - - public void setBrandName(String brandName) - { - this.brandName = brandName; - } - public String getDesignName() - { - return designName; - } - - public void setDesignName(String designName) { - this.designName = designName; - } - - public String getModelName() { - return modelName; - } - - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getProductCategory() { - return productCategory; - } - - public void setProductCategory(String productCategory) - { - this.productCategory = productCategory; - } - - public String getSizeName() - { - return sizeName; - } - - public String getRevenueRecoId() - { - return revenueRecoId; - } - - - public void setRevenueRecoId(String revenueRecoId) - { - this.revenueRecoId = revenueRecoId; - } - - - public void setSizeName(String sizeName) - { - this.sizeName = sizeName; - } - - - - public String getIsTextileProduct() - { - return isTextileProduct; - } - - - public void setIsTextileProduct(String isTextileProduct) - { - this.isTextileProduct = isTextileProduct; - } - - - public String getQtyFilter() - { - return qtyFilter; - } - - - public void setQtyFilter(String qtyFilter) - { - this.qtyFilter = qtyFilter; - } - public ArrayList getAttributeValueList() { - return attributeValueList; - } - public void setAttributeValueList(ArrayList attributeValueList) { - this.attributeValueList = attributeValueList; - } - public String[] getAttributeValueIds() { - return attributeValueIds; - } - public void setAttributeValueIds(String[] attributeValueIds) { - this.attributeValueIds = attributeValueIds; - } - - - - public String getCvv() - { - return cvv; - } - - public void setCvv(String cvv) - { - this.cvv = cvv; - } - - - - - public String getCreditCardPayment() - { - return creditCardPayment; - } - - - - - public void setCreditCardPayment(String creditCardPayment) - { - this.creditCardPayment = creditCardPayment; - } - - - - - - - - - public String getRequestId() - { - return requestId; - } - - public void setRequestId(String requestId) - { - this.requestId = requestId; - } - - - - - public String getBccAddresses() - { - return bccAddresses; - } - - - - - public void setBccAddresses(String bccAddresses) - { - this.bccAddresses = bccAddresses; - } - - - - - public String getCcAddresses() - { - return ccAddresses; - } - - - - - public void setCcAddresses(String ccAddresses) - { - this.ccAddresses = ccAddresses; - } - - - - - public String getFromAddress() - { - return fromAddress; - } - - - - - public void setFromAddress(String fromAddress) - { - this.fromAddress = fromAddress; - } - - - - - public String getTextMessage() - { - return textMessage; - } - - - - - public void setTextMessage(String textMessage) - { - this.textMessage = textMessage; - } - - - - - public String getToAddresses() - { - return toAddresses; - } - - - - - public void setToAddresses(String toAddresses) - { - this.toAddresses = toAddresses; - } - - - - - public String getShipperId() - { - return shipperId; - } - - - - - public void setShipperId(String shipperId) - { - this.shipperId = shipperId; - } - - - - - public String getAccountName() - { - return accountName; - } - - - - - public void setAccountName(String accountName) - { - this.accountName = accountName; - } - - - - - public String getCreditCardExpMonthName() - { - return creditCardExpMonthName; - } - - - - - public void setCreditCardExpMonthName(String creditCardExpMonthName) - { - this.creditCardExpMonthName = creditCardExpMonthName; - } - - - - - public String getCreditCardNumberEncrypted() - { - return creditCardNumberEncrypted; - } - - - - - public void setCreditCardNumberEncrypted(String creditCardNumberEncrypted) - { - this.creditCardNumberEncrypted = creditCardNumberEncrypted; - } - - - - - public String getPaymentMethod() - { - return paymentMethod; - } - - - - - public void setPaymentMethod(String paymentMethod) - { - this.paymentMethod = paymentMethod; - } - - - public String getToUserId() - { - return toUserId; - } - - - - - public void setToUserId(String toUserId) - { - this.toUserId = toUserId; - } - - - - - public String getPriority() - { - return priority; - } - - public void setPriority(String priority) - { - this.priority = priority; - } - public String getTitle() - { - return title; - } - public void setTitle(String title) - { - this.title = title; - } - public String getChargeId() - { - return chargeId; - } - public void setChargeId(String chargeId) - { - this.chargeId = chargeId; - } - public String getStatusId() - { - return statusId; - } - public void setStatusId(String statusId) - { - this.statusId = statusId; - } - public String getProductType() - { - return productType; - } - public void setProductType(String productType) - { - this.productType = productType; - } - public String getQtyNumberFilter() - { - return qtyNumberFilter; - } - public void setQtyNumberFilter(String qtyNumberFilter) - { - this.qtyNumberFilter = qtyNumberFilter; - } - public String getTaxCategoryId() - { - return taxCategoryId; - } - public void setTaxCategoryId(String taxCategoryId) - { - this.taxCategoryId = taxCategoryId; - } - public String getTaxCategoryName() - { - return taxCategoryName; - } - public void setTaxCategoryName(String taxCategoryName) - { - this.taxCategoryName = taxCategoryName; - } - public String getTotalActualPrice() - { - return totalActualPrice; - } - public void setTotalActualPrice(String totalActualPrice) - { - this.totalActualPrice = totalActualPrice; - } - public String getIfAdd() { - return ifAdd; - } - public void setIfAdd(String ifAdd) { - this.ifAdd = ifAdd; - } - public String getVendorName() { - return vendorName; - } - public void setVendorName(String vendorName) { - this.vendorName = vendorName; - } - public String getTimePeriod() { - return timePeriod; - } - public void setTimePeriod(String timePeriod) { - this.timePeriod = timePeriod; - } - - public String getChartType() { - return chartType; - } - public void setChartType(String chartType) { - this.chartType = chartType; - } - - public String getTaxRate() { - return taxRate; - } - - - public void setTaxRate(String taxRate) { - this.taxRate = taxRate; - } - - - public String getState() - { - return state; - } - public void setState(String state) - { - this.state = state; - } - - public String getAccountId() { - return accountId; - } - public void setAccountId(String accountId) { - this.accountId = accountId; - } - public String getDateRange() { - return dateRange; - } - public void setDateRange(String dateRange) { - this.dateRange = dateRange; - } - public String getReportName() { - return reportName; - } - public void setReportName(String reportName) { - this.reportName = reportName; - } - - - public String getTransferAllAmount() { - return transferAllAmount; - } - - - public void setTransferAllAmount(String transferAllAmount) { - this.transferAllAmount = transferAllAmount; - } - - - public String getAdjustmentAmount() { - return adjustmentAmount; - } - - - public void setAdjustmentAmount(String adjustmentAmount) { - this.adjustmentAmount = adjustmentAmount; - } - - - public String getDifferenceAmt() { - return differenceAmt; - } - - - public void setDifferenceAmt(String differenceAmt) { - this.differenceAmt = differenceAmt; - } - - - public String getCardTotal() { - return cardTotal; - } - - - public void setCardTotal(String cardTotal) { - this.cardTotal = cardTotal; - } - - - public String getCashTotal() { - return cashTotal; - } - - - public void setCashTotal(String cashTotal) { - this.cashTotal = cashTotal; - } - - - public String getChequeTotal() { - return chequeTotal; - } - - - public void setChequeTotal(String chequeTotal) { - this.chequeTotal = chequeTotal; - } - - - public String getTillGrandTotal() { - return tillGrandTotal; - } - - - public void setTillGrandTotal(String tillGrandTotal) { - this.tillGrandTotal = tillGrandTotal; - } - - - public String getCreatingFromOrder() { - return creatingFromOrder; - } - - - public void setCreatingFromOrder(String creatingFromOrder) { - this.creatingFromOrder = creatingFromOrder; - } - - - public String getTransferType() { - return transferType; - } - - - public void setTransferType(String transferType) { - this.transferType = transferType; - } -public String getCustomSize() { - return customSize; - } - - - public void setCustomSize(String customSize) { - this.customSize = customSize; - } - - - public String getPriceQtyFilter() { - return priceQtyFilter; - } - - public String getDeliveryViaRule() - { - return deliveryViaRule; - } - - - public void setPriceQtyFilter(String priceQtyFilter) { - this.priceQtyFilter = priceQtyFilter; - } - - public void setDeliveryViaRule(String deliveryViaRule) - { - this.deliveryViaRule = deliveryViaRule; - } - - - public String getCashId() - { - return cashId; - } - - - public void setCashId(String cashId) - { - this.cashId = cashId; - } - - - public String getCashLineId() - { - return cashLineId; - } - - - public void setCashLineId(String cashLineId) - { - this.cashLineId = cashLineId; - } - public String getUserPIN() { - return userPIN; - } - - - public void setUserPIN(String userPIN) { - this.userPIN = userPIN; - } - - public String getPaymentRule() { - return paymentRule; - } - - - public void setPaymentRule(String paymentRule) { - this.paymentRule = paymentRule; - } - - public String getIsSelfService() - { - return isSelfService; - } - - - public void setIsSelfService(String isSelfService) - { - this.isSelfService = isSelfService; - } - - - public String getCardDifference() { - return cardDifference; - } - - - public void setCardDifference(String cardDifference) { - this.cardDifference = cardDifference; - } - - - public String getChequeDifference() { - return chequeDifference; - } - - - public void setChequeDifference(String chequeDifference) { - this.chequeDifference = chequeDifference; - } - - - - public String getDocumentNote() - { - return documentNote; - } - - - public void setDocumentNote(String documentNote) - { - this.documentNote = documentNote; - } - - - public String getCurrencySymbole() { - return currencySymbole; - } - - - public void setCurrencySymbole(String currencySymbole) { - this.currencySymbole = currencySymbole; - } - -public String getUserDiscount() { - return userDiscount; - } - - - public void setUserDiscount(String userDiscount) { - this.userDiscount = userDiscount; - } - - - public String getOpenAmt() { - return openAmt; - } - - - public void setOpenAmt(String openAmt) { - this.openAmt = openAmt; - } - - - public String getOverUnderPayment() { - return overUnderPayment; - } - - - public void setOverUnderPayment(String overUnderPayment) { - this.overUnderPayment = overUnderPayment; - } - - - public String getPaidAmt() { - return paidAmt; - } - - - public void setPaidAmt(String paidAmt) { - this.paidAmt = paidAmt; - } - - - public String getPaymentAmt() { - return paymentAmt; - } - - - public void setPaymentAmt(String paymentAmt) { - this.paymentAmt = paymentAmt; - } - - - public String getWriteOffAmt() { - return writeOffAmt; - } - - - public void setWriteOffAmt(String writeOffAmt) { - this.writeOffAmt = writeOffAmt; - } - - - - public String getCurrencyId() { - return currencyId; - } - - - public void setCurrencyId(String currencyId) { - this.currencyId = currencyId; - } - - - public String getDaysDue() { - return daysDue; - } - - - public void setDaysDue(String daysDue) { - this.daysDue = daysDue; - } - - - public String getDiscountAmt() { - return discountAmt; - } - - - public void setDiscountAmt(String discountAmt) { - this.discountAmt = discountAmt; - } - - - public String getDiscountDate() { - return discountDate; - } - - - public void setDiscountDate(String discountDate) { - this.discountDate = discountDate; - } - - - public String getDue0() { - return due0; - } - - - public void setDue0(String due0) { - this.due0 = due0; - } - - - public String getDue0_30() { - return due0_30; - } - - - public void setDue0_30(String due0_30) { - this.due0_30 = due0_30; - } - - - public String getDue1_7() { - return due1_7; - } - - - public void setDue1_7(String due1_7) { - this.due1_7 = due1_7; - } - - - public String getDue31_60() { - return due31_60; - } - - - public void setDue31_60(String due31_60) { - this.due31_60 = due31_60; - } - - - public String getDue61_90() { - return due61_90; - } - - - public void setDue61_90(String due61_90) { - this.due61_90 = due61_90; - } - - - public String getDue8_30() { - return due8_30; - } - - - public void setDue8_30(String due8_30) { - this.due8_30 = due8_30; - } - - - public String getDue91_PLUS() { - return due91_PLUS; - } - - - public void setDue91_PLUS(String due91_PLUS) { - this.due91_PLUS = due91_PLUS; - } - - - public String getDueAmt() { - return dueAmt; - } - - - public void setDueAmt(String dueAmt) { - this.dueAmt = dueAmt; - } - - - public String getDueDate() { - return dueDate; - } - - - public void setDueDate(String dueDate) { - this.dueDate = dueDate; - } - - - public String getInvoicedAmt() { - return invoicedAmt; - } - - - public void setInvoicedAmt(String invoicedAmt) { - this.invoicedAmt = invoicedAmt; - } - - - public String getInvoiceDate() { - return invoiceDate; - } - - - public void setInvoiceDate(String invoiceDate) { - this.invoiceDate = invoiceDate; - } - - - public String getInvoiceGrandTotal() { - return invoiceGrandTotal; - } - - - public void setInvoiceGrandTotal(String invoiceGrandTotal) { - this.invoiceGrandTotal = invoiceGrandTotal; - } - - - public String getInvoiceScheduleId() { - return invoiceScheduleId; - } - - - public void setInvoiceScheduleId(String invoiceScheduleId) { - this.invoiceScheduleId = invoiceScheduleId; - } - - - public String getNetDays() { - return netDays; - } - - - public void setNetDays(String netDays) { - this.netDays = netDays; - } - - - public String getPastDue1_30() { - return pastDue1_30; - } - - - public void setPastDue1_30(String pastDue1_30) { - this.pastDue1_30 = pastDue1_30; - } - - - public String getPastDue1_7() { - return pastDue1_7; - } - - - public void setPastDue1_7(String pastDue1_7) { - this.pastDue1_7 = pastDue1_7; - } - - - public String getPastDue31_60() { - return pastDue31_60; - } - - - public void setPastDue31_60(String pastDue31_60) { - this.pastDue31_60 = pastDue31_60; - } - - - public String getPastDue61_90() { - return pastDue61_90; - } - - - public void setPastDue61_90(String pastDue61_90) { - this.pastDue61_90 = pastDue61_90; - } - - - public String getPastDue8_30() { - return pastDue8_30; - } - - - public void setPastDue8_30(String pastDue8_30) { - this.pastDue8_30 = pastDue8_30; - } - - - public String getPastDue91_plus() { - return pastDue91_plus; - } - - - public void setPastDue91_plus(String pastDue91_plus) { - this.pastDue91_plus = pastDue91_plus; - } - - - public String getPastDueAmt() { - return pastDueAmt; - } - - - public void setPastDueAmt(String pastDueAmt) { - this.pastDueAmt = pastDueAmt; - } - - - public String getPaymentTermId() { - return paymentTermId; - } - - - public void setPaymentTermId(String paymentTermId) { - this.paymentTermId = paymentTermId; - } - - - public FormFile getImage() - { - return image; - } - - - public void setImage(FormFile image) - { - this.image = image; - } - - - public String getBlackListedId() - { - return blackListedId; - } - - - public void setBlackListedId(String blackListedId) - { - this.blackListedId = blackListedId; - } - - - public String getBlackListedBankName() - { - return blackListedBankName; - } - - - public void setBlackListedBankName(String blackListedBankName) - { - this.blackListedBankName = blackListedBankName; - } - - - public String getBlackListedChequeNo() - { - return blackListedChequeNo; - } - - - public void setBlackListedChequeNo(String blackListedChequeNo) - { - this.blackListedChequeNo = blackListedChequeNo; - } - - public String getInvoiceNo() - { - - return invoiceNo; - } - public void setInvoiceNo(String invoiceNo) - { - this.invoiceNo = invoiceNo; - } - - - - - - - public Integer[] getBpartnerIds() { - return bpartnerIds; - } - - - public void setBpartnerIds(Integer[] bpartnerIds) { - this.bpartnerIds = bpartnerIds; - } - - - public String getPaymentTermName() { - return paymentTermName; - } - - - public void setPaymentTermName(String paymentTermName) { - this.paymentTermName = paymentTermName; - } - - - public String getBP_Group_ID() { - return BP_Group_ID; - } - - - public void setBP_Group_ID(String group_ID) { - BP_Group_ID = group_ID; - } - - - public String getDunningLevelId() { - return dunningLevelId; - } - - - public void setDunningLevelId(String dunningLevelId) { - this.dunningLevelId = dunningLevelId; - } - - - public String getDunningLevelName() { - return dunningLevelName; - } - - - public void setDunningLevelName(String dunningLevelName) { - this.dunningLevelName = dunningLevelName; - } - - - public String getDunningPrintNote() { - return dunningPrintNote; - } - - - public void setDunningPrintNote(String dunningPrintNote) { - this.dunningPrintNote = dunningPrintNote; - } - - - public String getDunningPrintText() { - return dunningPrintText; - } - - - public void setDunningPrintText(String dunningPrintText) { - this.dunningPrintText = dunningPrintText; - } - - - - - public String getDunningId() { - return dunningId; - } - - - public void setDunningId(String dunningId) { - this.dunningId = dunningId; - } - - - public String getDunningName() { - return dunningName; - } - - - public void setDunningName(String dunningName) { - this.dunningName = dunningName; - } - - - public String getCreditLimit() { - return creditLimit; - } - - - public void setCreditLimit(String creditLimit) { - this.creditLimit = creditLimit; - } - - - public String getCreditStatus() { - return creditStatus; - } - - - public void setCreditStatus(String creditStatus) { - this.creditStatus = creditStatus; - } - - - public String getCreditUsed() { - return creditUsed; - } - - - public void setCreditUsed(String creditUsed) { - this.creditUsed = creditUsed; - } - - - public String getDocBasisType() { - return docBasisType; - } - - - public void setDocBasisType(String docBasisType) { - this.docBasisType = docBasisType; - } - - - public String getAmtMultiplier() { - return amtMultiplier; - } - - - public void setAmtMultiplier(String amtMultiplier) { - this.amtMultiplier = amtMultiplier; - } - - - public String getFrequencyType() { - return frequencyType; - } - - - public void setFrequencyType(String frequencyType) { - this.frequencyType = frequencyType; - } - - - public String getCommissionAmtId() { - return commissionAmtId; - } - - - public void setCommissionAmtId(String commissionAmtId) { - this.commissionAmtId = commissionAmtId; - } - - - public String getSubtractAmt() { - return subtractAmt; - } - - - public void setSubtractAmt(String subtractAmt) { - this.subtractAmt = subtractAmt; - } - - - public String getForward() { - return forward; - } - - - public void setForward(String forward) { - this.forward = forward; - } - - - public String getIsTaxExempted() { - return isTaxExempted; - } - - - public void setIsTaxExempted(String isTaxExempted) { - this.isTaxExempted = isTaxExempted; - } - - - public String getTaxId() { - return taxId; - } - - - public void setTaxId(String taxId) { - this.taxId = taxId; - } - - - public String getTaxName() { - return taxName; - } - - - public void setTaxName(String taxName) { - this.taxName = taxName; - } - - - public Integer[] getInvoiceIds() { - return invoiceIds; - } - - - public void setInvoiceIds(Integer[] invoiceIds) { - this.invoiceIds = invoiceIds; - } - - - public String getInventoryId() { - return inventoryId; - } - - - public void setInventoryId(String inventoryId) { - this.inventoryId = inventoryId; - } - - - public String getInventoryLineId() { - return inventoryLineId; - } - - - public void setInventoryLineId(String inventoryLineId) { - this.inventoryLineId = inventoryLineId; - } - - - public String getQtyBook() { - return qtyBook; - } - - - public void setQtyBook(String qtyBook) { - this.qtyBook = qtyBook; - } - - - public String getQtyCount() { - return qtyCount; - } - - - public void setQtyCount(String qtyCount) { - this.qtyCount = qtyCount; - } - - - public String getAfterDelivery() { - return afterDelivery; - } - - - public void setAfterDelivery(String afterDelivery) { - this.afterDelivery = afterDelivery; - } - - - public String getFiedMonthCutoff() { - return fiedMonthCutoff; - } - - - public void setFiedMonthCutoff(String fiedMonthCutoff) { - this.fiedMonthCutoff = fiedMonthCutoff; - } - - - public String getFixedDueDate() { - return fixedDueDate; - } - - - public void setFixedDueDate(String fixedDueDate) { - this.fixedDueDate = fixedDueDate; - } - - - public String getFixedMonthDay() { - return fixedMonthDay; - } - - - public void setFixedMonthDay(String fixedMonthDay) { - this.fixedMonthDay = fixedMonthDay; - } - - - public String getFixedMonthOffset() { - return fixedMonthOffset; - } - - - public void setFixedMonthOffset(String fixedMonthOffset) { - this.fixedMonthOffset = fixedMonthOffset; - } - - - public String getNextBusinessday() { - return nextBusinessday; - } - - - public void setNextBusinessday(String nextBusinessday) { - this.nextBusinessday = nextBusinessday; - } - - - public String getPhone() { - return phone; - } - - - public void setPhone(String phone) { - this.phone = phone; - } - - - public String getPhone2() { - return phone2; - } - - - public void setPhone2(String phone2) { - this.phone2 = phone2; - } - - public String getToBeShipped() { - return toBeShipped; - } - - - public void setToBeShipped(String toBeShipped) { - this.toBeShipped = toBeShipped; - } - - - public String getDiscountAmt1() { - return discountAmt1; - } - - - public void setDiscountAmt1(String discountAmt1) { - this.discountAmt1 = discountAmt1; - } - - - public String getDiscountAmt2() { - return discountAmt2; - } - - - public void setDiscountAmt2(String discountAmt2) { - this.discountAmt2 = discountAmt2; - } - - - public String getDiscountDay1() { - return discountDay1; - } - - - public void setDiscountDay1(String discountDay1) { - this.discountDay1 = discountDay1; - } - - - public String getDiscountDay2() { - return discountDay2; - } - - - public void setDiscountDay2(String discountDay2) { - this.discountDay2 = discountDay2; - } - - - - - - - - public PaymentBean getPaymentBeanIndex() { - return paymentBeanIndex; - } - - - public void setPaymentBeanIndex(PaymentBean paymentBeanIndex) { - this.paymentBeanIndex = paymentBeanIndex; - } - - - public String getAllocatedAmount() { - return allocatedAmount; - } - - - public void setAllocatedAmount(String allocatedAmount) { - this.allocatedAmount = allocatedAmount; - } - - - public String getGroup1() { - return group1; - } - - - public void setGroup1(String group1) { - this.group1 = group1; - } - - - public String getGroup2() { - return group2; - } - - - public void setGroup2(String group2) { - this.group2 = group2; - } - - - - public String getIsFullAccess() { - return isFullAccess; - } - - - public void setIsFullAccess(String isFullAccess) { - this.isFullAccess = isFullAccess; - } - - - public Integer[] getInventoryIds() - { - return inventoryIds; - } - - - public void setInventoryIds(Integer[] inventoryIds) - { - this.inventoryIds = inventoryIds; - } - - - public String[] getAllocateAmount() { - return allocateAmount; - } - - - public void setAllocateAmount(String[] allocateAmount) { - this.allocateAmount = allocateAmount; - } - - - public String getBirthdate() { - return birthdate; - } - - - public void setBirthdate(String birthdate) { - this.birthdate = birthdate; - } - - - public String getDay() { - return day; - } - - - public void setDay(String day) { - this.day = day; - } - - - public String getOpenDrawer() { - return openDrawer; - } - - - public void setOpenDrawer(String openDrawer) { - this.openDrawer = openDrawer; - } - - - public String getStoreId() { - return storeId; - } - - - public void setStoreId(String storeId) { - this.storeId = storeId; - } - - - public String getUomId() { - return uomId; - } - - - public void setUomId(String uomId) { - this.uomId = uomId; - } - - - public String getIsOverwritePriceLimit() { - return isOverwritePriceLimit; - } - - - public void setIsOverwritePriceLimit(String isOverwritePriceLimit) { - this.isOverwritePriceLimit = isOverwritePriceLimit; - } - - - public String getIsChecked() { - return isChecked; - } - - - public void setIsChecked(String isChecked) { - this.isChecked = isChecked; - } - - //============================================================= - - - public void setOrderLineIndexed(int index, OrderLineBean value) - { - orderLineList.add(index, value); - } - - public void setOrderLineIndexed(OrderLineBean orderLineIndexed) - { - this.orderLineIndexed = orderLineIndexed; - } - - public void setOrderLineList(ArrayList orderLineList) - { - this.orderLineList = orderLineList; - } - - public OrderLineBean getOrderLineIndexed() - { - return orderLineIndexed; - } - - public OrderLineBean getOrderLineIndexed(int index) - { - while (index >= orderLineList.size()) - orderLineList.add(new OrderLineBean()); - return (OrderLineBean) orderLineList.get(index); - } - - public ArrayList getOrderLineList() - { - return orderLineList; - } - - //============================================================= - - protected RoleBean roleOrgAccessIndexed; - protected ArrayList roleOrgAccessList = new ArrayList(); - - - - - - public RoleBean getRoleOrgAccessIndexed() - { - return roleOrgAccessIndexed; - } - - public void setRoleOrgAccessIndexed(int index, RoleBean roleOrgAccessIndexed) - { - this.roleOrgAccessList.add(index, roleOrgAccessIndexed); - } - - public void setRoleOrgAccessIndexed(RoleBean roleOrgAccessIndexed) - { - this.roleOrgAccessIndexed = roleOrgAccessIndexed; - } - - - public ArrayList getRoleOrgAccessList() - { - return roleOrgAccessList; - } - - - public void setRoleOrgAccessList(ArrayList roleOrgAccessList) - { - this.roleOrgAccessList = roleOrgAccessList; - } - - public RoleBean getRoleOrgAccessIndexed(int index) - { - while (index >= roleOrgAccessList.size()) - roleOrgAccessList.add(new RoleBean()); - return (RoleBean) roleOrgAccessList.get(index); - } - - public String getFullDetails() - { - return fullDetails; - } - - public void setFullDetails(String fullDetails) - { - this.fullDetails = fullDetails; - } - - public String getOrgFromId() - { - return orgFromId; - } - - public void setOrgFromId(String orgFromId) - { - this.orgFromId = orgFromId; - } - - public String getOrgToId() - { - return orgToId; - } - - public void setOrgToId(String orgToId) - { - this.orgToId = orgToId; - } - - public String getQtyOnHand() - { - return qtyOnHand; - } - - public void setQtyOnHand(String qtyOnHand) - { - this.qtyOnHand = qtyOnHand; - } - - public String getQtyToMove() - { - return qtyToMove; - } - - public void setQtyToMove(String qtyToMove) - { - this.qtyToMove = qtyToMove; - } - - public String getUom() - { - return uom; - } - - public void setUom(String uom) - { - this.uom = uom; - } - - - public String getUnitPrice() - { - return unitPrice; - } - - - public void setUnitPrice(String unitPrice) - { - this.unitPrice = unitPrice; - } - - - public StockMovementBean getStock() - { - return stock; - } - - public void setStock(StockMovementBean stockBean) - { - this.stock = stockBean; - } - - public void setStock(int index,StockMovementBean stockBean) - { - this.stockList.add(index, stockBean); - } - - public StockMovementBean getStock(int index) - { - while (index >= stockList.size()) - { - stockList.add(new StockMovementBean()); - } - return (StockMovementBean) stockList.get(index); - } - - public ArrayList getStockList() - { - return stockList; - } - - public void setStockList(ArrayList stockList) - { - this.stockList = stockList; - } - - public String getGrossProfit() - { - return grossProfit; - } - - public void setGrossProfit(String grossProfit) - { - this.grossProfit = grossProfit; - } - - public String getRefNo() - { - return refNo; - } - - public void setRefNo(String refNo) - { - this.refNo = refNo; - } - - public String getMovementId() - { - return movementId; - } - - public void setMovementId(String movementId) - { - this.movementId = movementId; - } - - - public String getIndex() - { - return index; - } - - - public void setIndex(String index) - { - this.index = index; - } - - - public String getOrgFromName() - { - return orgFromName; - } - - - public void setOrgFromName(String orgFromName) - { - this.orgFromName = orgFromName; - } - - - public String getOrgToName() - { - return orgToName; - } - - - public void setOrgToName(String orgToName) - { - this.orgToName = orgToName; - } - - public String getMoveConfirmId() - { - return moveConfirmId; - } - - public void setMoveConfirmId(String moveConfirmId) - { - this.moveConfirmId = moveConfirmId; - } - - public String getLineNo() - { - return lineNo; - } - - public void setLineNo(String lineNo) - { - this.lineNo = lineNo; - } - - public String getMovementLineId() { - return movementLineId; - } - - public void setMovementLineId(String movementLineId) { - this.movementLineId = movementLineId; - } - - - public String getCompany() { - return company; - } - - public void setCompany(String company) { - this.company = company; - } - - public String getIndustry() { - return industry; - } - - public void setIndustry(String industry) { - this.industry = industry; - } - - public String getComments() { - return comments; - } - - public void setComments(String comments) { - this.comments = comments; - } - - - public String getIsSOPriceList() { - return isSOPriceList; - } - - public void setIsSOPriceList(String isSOPriceList) { - this.isSOPriceList = isSOPriceList; - } - - public String getIsMandatory() { - return isMandatory; - } - - public void setIsMandatory(String isMandatory) { - this.isMandatory = isMandatory; - } - - public String getIsPresentForProduct() { - return isPresentForProduct; - } - - public void setIsPresentForProduct(String isPresentForProduct) { - this.isPresentForProduct = isPresentForProduct; - } - - public String getPriceListId() { - return priceListId; - } - - public void setPriceListId(String priceListId) { - this.priceListId = priceListId; - } - - public String getLimitPrice() { - return limitPrice; - } - - public void setLimitPrice(String limitPrice) { - this.limitPrice = limitPrice; - } - - public String getStdPrice() { - return stdPrice; - } - - public void setStdPrice(String stdPrice) { - this.stdPrice = stdPrice; - } - - public String getListPrice() { - return listPrice; - } - - public void setListPrice(String listPrice) { - this.listPrice = listPrice; - } - - public PriceListBean getPriceListBean() { - return priceListBean; - } - - public void setPriceListBean(PriceListBean priceListBean) { - this.priceListBean = priceListBean; - } - - public ArrayList getPriceListBeanList() { - return priceListBeanList; - } - - public void setPriceListBeanList(ArrayList priceListBeanList) { - this.priceListBeanList = priceListBeanList; - } - - public void setPriceListBean(int index, PriceListBean bean) - { - this.priceListBeanList.add(index, bean); - } - - public PriceListBean getPriceListBean(int index) - { - while (index >= priceListBeanList.size()) - { - priceListBeanList.add(new PriceListBean()); - } - return (PriceListBean) priceListBeanList.get(index); - - } - - public ProductBean getProductBean() { - return productBean; - } - - public void setProductBean(ProductBean productBean) { - this.productBean = productBean; - } - - public ArrayList getProductBeanList() { - return productBeanList; - } - - public void setProductBeanList(ArrayList productBeanList) { - this.productBeanList = productBeanList; - } - public void setProductBean(int index, ProductBean bean) - { - this.productBeanList.add(index, bean); - } - - public ProductBean getProductBean(int index) - { - while (index >= productBeanList.size()) - { - productBeanList.add(new ProductBean()); - } - return (ProductBean) productBeanList.get(index); - - } - - public String getListPriceIncl() { - return listPriceIncl; - } - - public void setListPriceIncl(String listPriceIncl) { - this.listPriceIncl = listPriceIncl; - } - - public String getStdPriceIncl() { - return stdPriceIncl; - } - - public void setStdPriceIncl(String stdPriceIncl) { - this.stdPriceIncl = stdPriceIncl; - } - - public String getLimitPriceIncl() { - return limitPriceIncl; - } - - public void setLimitPriceIncl(String limitPriceIncl) { - this.limitPriceIncl = limitPriceIncl; - - } - - public String getSalesPriceListId() { - return salesPriceListId; - } - - public void setSalesPriceListId(String salesPriceListId) { - this.salesPriceListId = salesPriceListId; - } - - public String getPurchasePriceListId() { - return purchasePriceListId; - } - - public void setPurchasePriceListId(String purchasePriceListId) { - this.purchasePriceListId = purchasePriceListId; - } - - public void setRoundOffFactor(String roundOffFactor) { - this.roundOffFactor = roundOffFactor; - } - - public String getRoundOffFactor() { - return roundOffFactor; - } - - public String getBasePriceListId() { - return basePriceListId; - } - - public void setBasePriceListId(String basePriceListId) { - this.basePriceListId = basePriceListId; - } - - public String getIsDeleteOldRecords() { - return isDeleteOldRecords; - } - - public void setIsDeleteOldRecords(String isDeleteOldRecords) { - this.isDeleteOldRecords = isDeleteOldRecords; - } - - public String getSubTotal() { - return subTotal; - } - - public void setSubTotal(String subTotal) { - this.subTotal = subTotal; - } - - public String getIsDiscountAllowed() { - return isDiscountAllowed; - } - - public void setIsDiscountAllowed(String isDiscountAllowed) { - this.isDiscountAllowed = isDiscountAllowed; - } - - public String getIsAllowedOverridePriceLimit() { - return isAllowedOverridePriceLimit; - } - - public void setIsAllowedOverridePriceLimit(String isAllowedOverridePriceLimit) { - this.isAllowedOverridePriceLimit = isAllowedOverridePriceLimit; - } - - public String getPriceListName() { - return priceListName; - } - - public void setPriceListName(String priceListName) { - this.priceListName = priceListName; - } - - public String getIsCreatePriceList() { - return isCreatePriceList; - } - - public void setIsCreatePriceList(String isCreatePriceList) { - this.isCreatePriceList = isCreatePriceList; - } - - public String getInclPrice() { - return inclPrice; - } - - public void setInclPrice(String inclPrice) { - this.inclPrice = inclPrice; - } - - public String getQtyCsv() - { - return qtyCsv; - } - - public void setQtyCsv(String qtyCsv) - { - this.qtyCsv = qtyCsv; - } - - public String getReadOnly() - { - return readOnly; - } - - public void setReadOnly(String readOnly) - { - this.readOnly = readOnly; - } - - public void setReadOnly(boolean readOnly) - { - this.readOnly = Boolean.toString(readOnly); - } - - public String getTerminalId() - { - return terminalId; - } - - public void setTerminalId(String terminalId) - { - this.terminalId = terminalId; - } - - public String getCashbookTransferType() - { - return cashbookTransferType; - } - - public void setCashbookTransferType(String cashbookTransferType) - { - this.cashbookTransferType = cashbookTransferType; - } - - public String getCheckTransferType() - { - return checkTransferType; - } - - public void setCheckTransferType(String checkTransferType) - { - this.checkTransferType = checkTransferType; - } - - public String getCardTransferType() - { - return cardTransferType; - } - - public void setCardTransferType(String cardTransferType) - { - this.cardTransferType = cardTransferType; - } - - public String getCardBankAccountId() - { - return cardBankAccountId; - } - - public void setCardBankAccountId(String cardBankAccountId) - { - this.cardBankAccountId = cardBankAccountId; - } - - public String getCheckBankAccountId() - { - return checkBankAccountId; - } - - public void setCheckBankAccountId(String checkBankAccountId) - { - this.checkBankAccountId = checkBankAccountId; - } - - public String getTemplateBPartnerId() - { - return templateBPartnerId; - } - - public void setTemplateBPartnerId(String templateBPartnerId) - { - this.templateBPartnerId = templateBPartnerId; - } - - public String getCashbookTransferCashbookId() - { - return cashbookTransferCashbookId; - } - - public void setCashbookTransferCashbookId(String cashTransferCashbookId) - { - this.cashbookTransferCashbookId = cashTransferCashbookId; - } - - public String getCashbookTransferBankAccountId() - { - return cashbookTransferBankAccountId; - } - - public void setCashbookTransferBankAccountId(String cashTransferBankAccountId) - { - this.cashbookTransferBankAccountId = cashTransferBankAccountId; - } - - public String getCheckTransferCashbookId() - { - return checkTransferCashbookId; - } - - public void setCheckTransferCashbookId(String checkTransferCashbookId) - { - this.checkTransferCashbookId = checkTransferCashbookId; - } - - public String getCheckTransferBankAccountId() - { - return checkTransferBankAccountId; - } - - public void setCheckTransferBankAccountId(String checkTransferBankAccountId) - { - this.checkTransferBankAccountId = checkTransferBankAccountId; - } - - public String getCardTransferCashbookId() - { - return cardTransferCashbookId; - } - - public void setCardTransferCashbookId(String cardTransferCashbookId) - { - this.cardTransferCashbookId = cardTransferCashbookId; - } - - public String getCardTransferBankAccountId() - { - return cardTransferBankAccountId; - } - - public void setCardTransferBankAccountId(String cardTransferBankAccountId) - { - this.cardTransferBankAccountId = cardTransferBankAccountId; - } - - public String getAutoLock() - { - return autoLock; - } - - public void setAutoLock(String autoLock) - { - this.autoLock = autoLock; - } - - public String getLocked() - { - return locked; - } - - public void setLocked(String locked) - { - this.locked = locked; - } - - public static long getSerialVersionUID() - { - return serialVersionUID; - } - - /** - * @return the lockingTime - */ - public String getLockingTime() - { - return lockingTime; - } - - /** - * @param lockingTime the lockingTime to set - */ - public void setLockingTime(String lockingTime) - { - this.lockingTime = lockingTime; - } - - public String getIsDiscountOnPercentage() - { - return isDiscountOnPercentage; - } - - public void setIsDiscountOnPercentage(String isDiscountOnPercentage) - { - this.isDiscountOnPercentage = isDiscountOnPercentage; - } - - public String getIsDiscountOnTotal() - { - return isDiscountOnTotal; - } - - public void setIsDiscountOnTotal(String isDiscountOnTotal) - { - this.isDiscountOnTotal = isDiscountOnTotal; - } - - public String getDiscountedLinePrice() { - return discountedLinePrice; - } - - public void setDiscountedLinePrice(String discountedLinePrice) { - this.discountedLinePrice = discountedLinePrice; - } - - public String getIsOverridePinOk() { - return isOverridePinOk; - } - - public void setIsOverridePinOk(String isOverridePinOk) { - this.isOverridePinOk = isOverridePinOk; - } - - public String getIsTaxIncluded() { - return isTaxIncluded; - } - - public void setIsTaxIncluded(String isTaxIncluded) { - this.isTaxIncluded = isTaxIncluded; - } - - public String getIsDiscountOnInclUnitPrice() { - return isDiscountOnInclUnitPrice; - } - - public void setIsDiscountOnInclUnitPrice(String isDiscountOnInclUnitPrice) { - this.isDiscountOnInclUnitPrice = isDiscountOnInclUnitPrice; - } - - public String getDiscountedInclUnitPrice() { - return discountedInclUnitPrice; - } - - public void setDiscountedInclUnitPrice(String discountedInclUnitPrice) { - this.discountedInclUnitPrice = discountedInclUnitPrice; - } - - public String getUnitPurchasePrice() - { - return unitPurchasePrice; - } - - public void setUnitPurchasePrice(String unitPurchasePrice) - { - this.unitPurchasePrice = unitPurchasePrice; - } - - public String getTotalGrossProfit() - { - return totalGrossProfit; - } - - public void setTotalGrossProfit(String totalGrossProfit) - { - this.totalGrossProfit = totalGrossProfit; - } - - public String getGrossProfitPercentage() - { - return grossProfitPercentage; - } - - public void setGrossProfitPercentage(String grossProfitPercentage) - { - this.grossProfitPercentage = grossProfitPercentage; - } - - public String getTotalGrossProfitPercentage() - { - return totalGrossProfitPercentage; - } - - public void setTotalGrossProfitPercentage(String totalGrossProfitPercentage) - { - this.totalGrossProfitPercentage = totalGrossProfitPercentage; - } - - public String getIsAllowToView() - { - return isAllowToView; - } - - public void setIsAllowToView(String isAllowToView) - { - this.isAllowToView = isAllowToView; - } - - public String getIsAllowToEdit() - { - return isAllowToEdit; - } - - public void setIsAllowToEdit(String isAllowToEdit) - { - this.isAllowToEdit = isAllowToEdit; - } - - public String getIsAllowToCreate() - { - return isAllowToCreate; - } - - public void setIsAllowToCreate(String isAllowToCreate) - { - this.isAllowToCreate = isAllowToCreate; - } - - public String getIsAllowToDelete() - { - return isAllowToDelete; - } - - public void setIsAllowToDelete(String isAllowToDelete) - { - this.isAllowToDelete = isAllowToDelete; - } - - public String getWebMenuId() - { - return webMenuId; - } - - public void setWebMenuId(String webMenuId) - { - this.webMenuId = webMenuId; - } - - public String getIsSalesReport() - { - return isSalesReport; - } - - public void setIsSalesReport(String isSalesReport) - { - this.isSalesReport = isSalesReport; - } - - public String getIsDiscountUptoLimitPrice() - { - return isDiscountUptoLimitPrice; - } - - public void setIsDiscountUptoLimitPrice(String isDiscountUptoLimitPrice) - { - this.isDiscountUptoLimitPrice = isDiscountUptoLimitPrice; - } - - public String getIsDiscountAllowedOnTotal() - { - return isDiscountAllowedOnTotal; - } - - public void setIsDiscountAllowedOnTotal(String isDiscountAllowedOnTotal) - { - this.isDiscountAllowedOnTotal = isDiscountAllowedOnTotal; - } - - public String getReceiptFooterMsg() - { - return receiptFooterMsg; - } - - public void setReceiptFooterMsg(String receiptFooterMsg) - { - this.receiptFooterMsg = receiptFooterMsg; - } - public String getStockValue() - { - return stockValue; - } - - public void setStockValue(String stockValue) - { - this.stockValue = stockValue; - } - - public String getBranch() - { - return branch; - } - - public void setBranch(String branch) - { - this.branch = branch; - } - - public String getSalesRepName() - { - return saleRepName; - } - - public void setSalesRepName(String salesRepName) - { - this.saleRepName = salesRepName; - } - - public String getNoOfPack() - { - return noOfPack; - } - - public void setNoOfPack(String noOfPack) - { - this.noOfPack = noOfPack; - } - - public String getReference() - { - return reference; - } - - public void setReference(String reference) - { - this.reference = reference; - } - - public Integer getUnitsPerPack() - { - return unitsPerPack; - } - - public void setUnitsPerPack(Integer unitsPerPack) - { - this.unitsPerPack = unitsPerPack; - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/customer/CustomerAction.java b/posterita/posterita/src/main/org/posterita/struts/customer/CustomerAction.java deleted file mode 100644 index 044e7f1ed3..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/customer/CustomerAction.java +++ /dev/null @@ -1,816 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 02-Sep-2005 - */ - - -package org.posterita.struts.customer; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MBPartner; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.CustomerBean; -import org.posterita.beans.PriceListBean; -import org.posterita.businesslogic.CustomerCart; -import org.posterita.businesslogic.PaymentTermManager; -import org.posterita.businesslogic.administration.BarcodeManager; -import org.posterita.businesslogic.administration.CustomerManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.EmailValidator; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.BPartnerNotFoundException; -import org.posterita.exceptions.NoAccessToEditObjectException; -import org.posterita.exceptions.NoCustomerFoundException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.SurnameNotPresentException; -import org.posterita.exceptions.SystemException; -import org.posterita.form.CustomerForm; -import org.posterita.form.InitCustomerForm; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - - -public class CustomerAction extends BaseDispatchAction -{ - public static final String CREATE_CUSTOMER = "createCustomer"; - public static final String RETURN_TO_ORDER = "returnToOrder"; - - public ActionForward createCustomer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - CustomerBean bean = (CustomerBean)request.getSession().getAttribute(Constants.CUSTOMER_DETAILS); - - String email = bean.getEmail(); - - if( email != null ) - { - boolean isValid = EmailValidator.isValidEmail(email); - if( !isValid ) - { - postGlobalError("errors.invalid","email", request); - return mapping.getInputForward(); - } - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - trx.start(); - try - { - MBPartner partner = CustomerManager.saveCustomer(ctx,bean.getBpartnerId() ,bean, trx.getTrxName()); - Integer customerId = Integer.valueOf(partner.get_ID()); - request.getSession().setAttribute(Constants.CUSTOMER_ID, customerId); - trx.commit(); - } - catch (SurnameNotPresentException e) - { - trx.rollback(); - postGlobalError("error.required.Surname", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - if(bean.getCreatingFromOrder()) - return new ActionForward("RETURN_TO_ORDER"); - else - return mapping.findForward(CREATE_CUSTOMER); - } - - public static final String CREATE_POS_ORDER = "createPOSOrder"; - public static final String CREATE_CREDIT_ORDER = "initCreateCreditOrder"; - public static final String CREATE_POS_ORDER2 = "createPOSOrder2"; - public static final String CREATE_POS_ORDER3 = "createPOSOrder3"; - public static final String CREATE_POS_ORDER_WA = "createPOSOrderWA"; - public static final String SAVE_POS_CUSTOMER = "savePOSCustomer"; - public static final String CREATE_PAYMENT = "createPayment"; - public ActionForward savePOSCustomer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm)form; - String creatingForOrder=(String)request.getSession().getAttribute(Constants.CREATING_FROM_ORDER); - CustomerBean bean = (CustomerBean)df.getBean(); - bean.setRegionId(Integer.valueOf(1000001));//FIXME why do we need regionId? Is it compulsory? - - String email = bean.getEmail(); - - if( email != null ) - { - boolean isValid = EmailValidator.isValidEmail(email); - if( !isValid ) - { - postGlobalError("errors.invalid","email", request); - return mapping.getInputForward(); - } - } - if(bean.getBpartnerId()==null) - { - bean.setBpartnerId(0); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - trx.start(); - try - { - MBPartner partner = CustomerManager.saveCustomer(ctx, bean.getBpartnerId(), bean, trx.getTrxName()); - - request.getSession().setAttribute(Constants.CUSTOMER_ID, partner.get_ID()); - trx.commit(); - } - catch (SurnameNotPresentException e) - { - trx.rollback(); - postGlobalError("error.required.Surname", request); - return mapping.getInputForward(); - } - catch (NoAccessToEditObjectException e) - { - trx.rollback(); - postGlobalError("error.no.edit.access", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - if (creatingForOrder == null) - return mapping.findForward(SAVE_POS_CUSTOMER); - - if (creatingForOrder.equals(Constants.POS_ORDER)) - return mapping.findForward(CREATE_POS_ORDER); - else - if (creatingForOrder.equals(Constants.CREDIT_ORDER)) - return mapping.findForward(CREATE_CREDIT_ORDER); - else - if (creatingForOrder.equals(Constants.CREATE_PAYMENT)) - return mapping.findForward(CREATE_PAYMENT); - else - if (creatingForOrder.equals(Constants.POS_ORDER_CUSTOMER_COMPULSORY)) - return mapping.findForward(CREATE_POS_ORDER2); - else - if (creatingForOrder.equals(Constants.QUICK_POS_ORDER)) - return mapping.findForward(CREATE_POS_ORDER3); - else - if (creatingForOrder.equals(Constants.POS_ORDER_WITHOUT_ADVANCED)) - return mapping.findForward(CREATE_POS_ORDER_WA); - - return mapping.findForward(SAVE_POS_CUSTOMER); - } - - public static final String GET_EXISTING_CUSTOMERS = "getExistingCustomers"; - public ActionForward getExistingCustomers(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SQLException - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList customers = CustomerManager.getAllCustomers(ctx,false); - - request.getSession().setAttribute(Constants.ALL_CUSTOMERS, customers); - - return mapping.findForward(GET_EXISTING_CUSTOMERS); - } - - - public static final String GET_EXISTING_POS_CUSTOMERS = "getExistingPOSCustomers"; - public ActionForward getExistingPOSCustomers(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SQLException - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - - Properties ctx=TmkJSPEnv.getCtx(request); - - ArrayList customers = CustomerManager.getAllCustomers(ctx,true); - - request.getSession().setAttribute(Constants.ALL_CUSTOMERS, customers); - - return mapping.findForward(GET_EXISTING_POS_CUSTOMERS); - } - - - public static final String GET_CUSTOMER_DETAILS = "getCustomerDetails"; - public ActionForward getCustomerDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - Integer partnerId = Integer.valueOf(df.getBpartnerId()); - - CustomerBean customerBean = CustomerManager.getCustomerDetails(ctx, partnerId.intValue()); - - request.getSession().setAttribute(Constants.CUSTOMER_DETAILS, customerBean); - - return mapping.findForward(GET_CUSTOMER_DETAILS); - } - - - public static final String INIT_CREATE_POS_CUSTOMER_ACTION = "initCreatePOSCustomer"; - public ActionForward initCreatePOSCustomer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SystemException - { - ActionForward fwd = init(mapping,form,request,response); - - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - InitCustomerForm cf = (InitCustomerForm) form; - - CustomerBean bean = (CustomerBean) cf.getBean(); - bean.setBpartnerId(0); - String creatingFromOrder= cf.getCreatingFromOrder(); - cf.populate(bean); - - - ArrayList list = PaymentTermManager.getAllActivePaymentTerm(ctx); - request.getSession().setAttribute (Constants.PAYMENT_TERM,list); - - request.getSession().setAttribute(Constants.CREATING_FROM_ORDER, creatingFromOrder); - - return mapping.findForward(INIT_CREATE_POS_CUSTOMER_ACTION); - } - - public static final String GET_ALL_CUSTOMER = "getAllPOSCustomer"; - public ActionForward getAllPOSCustomer(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList customerList = CustomerManager.searchPOSCustomer(ctx, "", "", "","", ""); - - //ArrayList customerList = CustomerManager.getAllPosCustomer(ctx); - - request.getSession().setAttribute(Constants.ALL_CUSTOMERS,customerList); - - return mapping.findForward(GET_ALL_CUSTOMER); - } - - - public static final String INIT_EDIT_POS_CUSTOMER = "initEditPOSCustomer"; - public ActionForward initEditPOSCustomer(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - - CustomerForm f = (CustomerForm) form; - f.validate(mapping,request); - - CustomerBean bean = (CustomerBean) f.getBean(); - Integer bpartnerId = bean.getBpartnerId(); - if(bpartnerId==null) - { - throw new OperationException("Cannot edit customer. Cause customer id cannot be null!"); - } - - - bean = CustomerManager.getCustomerDetails(ctx,bpartnerId); - f.populate(bean); - ArrayList list = PaymentTermManager.getAllActivePaymentTerm(ctx); - ArrayList activePriceLists = PriceListManager.getPriceLists(ctx,0,"",true,null,null,true,null); - ArrayList priceListsKNP = PriceListManager.getKeyNamePair(ctx, activePriceLists); - - request.getSession().setAttribute(Constants.USER_PRICE_LISTS, priceListsKNP); - request.getSession().setAttribute (Constants.PAYMENT_TERM,list); - - return mapping.findForward(INIT_EDIT_POS_CUSTOMER); - } - - - public static final String VIEW_POS_CUSTOMER = "viewPOSCustomer"; - public ActionForward viewPOSCustomer(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException,Exception - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - CustomerForm f = (CustomerForm) form; - f.validate(mapping,request); - - CustomerBean bean = (CustomerBean) f.getBean(); - Integer bpartnerId = bean.getBpartnerId(); - if(bpartnerId==null) - { - throw new OperationException("Cannot load customer details. Cause customer id cannot be null!"); - } - - bean = CustomerManager.getCustomerDetails(ctx,bpartnerId); - request.getSession().setAttribute(Constants.CUSTOMER_DETAILS,bean); - - return mapping.findForward(VIEW_POS_CUSTOMER); - } - - public static final String ACTIVATE_POS_CUSTOMER = "activatePOSCustomer"; - @SuppressWarnings("unchecked") - public ActionForward activatePOSCustomer(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - CustomerForm f = (CustomerForm) form; - f.validate(mapping,request); - - CustomerBean bean = (CustomerBean) f.getBean(); - Integer bpartnerId = bean.getBpartnerId(); - if(bpartnerId==null) - { - throw new OperationException("Cannot activate customer. Cause customer id cannot be null!"); - } - - //since customer is a business partner we call the BPartnerManager's activate method - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - - try - { - trx.start(); - CustomerManager.activateCustomer(ctx,bpartnerId.intValue(), trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.activate.customer", request); - mapping.getInputForward(); - } - finally - { - trx.rollback(); - } - - ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.ALL_CUSTOMERS); - //ArrayList customerBeanList = list; - - ArrayList newList = CustomerManager.updateCustomerListStatus(list, bpartnerId, true); - - request.getSession().setAttribute(Constants.ALL_CUSTOMERS, newList); - - - return mapping.findForward(ACTIVATE_POS_CUSTOMER); - } - - public static final String DEACTIVATE_POS_CUSTOMER = "deactivatePOSCustomer"; - @SuppressWarnings("unchecked") - public ActionForward deactivatePOSCustomer(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - CustomerForm f = (CustomerForm) form; - f.validate(mapping,request); - - CustomerBean bean = (CustomerBean) f.getBean(); - Integer bpartnerId = bean.getBpartnerId(); - if(bpartnerId==null) - { - throw new OperationException("Cannot deactivate customer. Cause customer id cannot be null!"); - } - - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - //since customer is a business partner we call the BPartnerManager's deactivate method - try - { - trx.start(); - CustomerManager.deactivateCustomer(ctx,bpartnerId.intValue(), trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.deactivate.customer", request); - mapping.getInputForward(); - } - finally - { - trx.close(); - } - - ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.ALL_CUSTOMERS); - //ArrayList customerBeanList = list; - - ArrayList newList = CustomerManager.updateCustomerListStatus(list, bpartnerId, false); - - request.getSession().setAttribute(Constants.ALL_CUSTOMERS, newList); - - return mapping.findForward(DEACTIVATE_POS_CUSTOMER); - } - - public static final String GENERATE_CARD ="generateFidelityCard"; - public ActionForward generateFidelityCard(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException, Exception - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList customerList =null; - CustomerCart cart = (CustomerCart) request.getSession().getAttribute(Constants.CUSTOMER_CART); - - if(cart != null) - { - customerList = cart.getCustomers(); - - } - else - { - customerList = new ArrayList(); - } - - String reportName = null; - try - { - reportName = CustomerManager.fidelityCard(ctx,customerList); - } - catch (NoCustomerFoundException e) - { - postGlobalError("error.print.fidelity.card",request); - return new ActionForward("/ViewAllCartCustomers.do"); - } - - String uri = ReportManager.getReportURI(reportName,request); - - response.sendRedirect(uri); - //ReportManager.writeReport(reportName, response); - - - return null; - } - - public static final String INIT_SEARCH_POS_CUSTOMER = "initSearchPOSCustomer"; - public ActionForward initSearchPOSCustomer(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - - return mapping.findForward(INIT_SEARCH_POS_CUSTOMER); - } - - - public static final String SEARCH_POS_CUSTOMER = "searchPOSCustomer"; - public ActionForward searchPOSCustomer(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm)form; - - String customerName = df.getPartnerName(); - - ArrayList customerList = CustomerManager.searchPOSCustomer(ctx, customerName, df.getDay(), df.getMonth(),df.getYear(), df.getIsActive()); - - request.getSession().setAttribute(Constants.ALL_CUSTOMERS,customerList); - - return mapping.findForward(SEARCH_POS_CUSTOMER); - } - - public static final String ADD_ALL_CUSTOMERS = "addAllCustomers"; - public ActionForward addAllCustomers(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - CustomerCart cart = (CustomerCart)request.getSession().getAttribute(Constants.CUSTOMER_CART); - - ArrayList customerList = (ArrayList) request.getSession().getAttribute(Constants.ALL_CUSTOMERS); - - if(customerList==null) - { - return mapping.findForward(SEARCH_POS_CUSTOMER); - } - - if(cart == null) - { - cart = new CustomerCart(ctx); - } - - for(CustomerBean bean : customerList) - { - Integer customerId = bean.getBpartnerId(); - if(customerId == null) continue; - - if(! cart.hasCustomer(customerId.intValue())) - { - cart.addCustomer(customerId.intValue()); - } - - } - - request.getSession().setAttribute(Constants.CUSTOMER_CART, cart); - return mapping.findForward(SEARCH_POS_CUSTOMER); - } - -// used for create pos order to get customer name from id - public ActionForward getNameByID(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, Exception - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - CustomerForm f = (CustomerForm) form; - - String errormsg = ""; - String bpartner = f.getBpartnerId(); - - - - if(bpartner == null||bpartner.length()==0) - { - errormsg = "alert('Invalid Customer ID. ID cannot be empty');"; - return sendData(errormsg,response); - } - - Integer bpartnerId = null; - try - { - bpartnerId = Integer.valueOf(bpartner); - } - catch (NumberFormatException e2) - { - errormsg = "alert('Please enter numeric value for Customer ID!');defaultCustomer();"; - return sendData(errormsg,response); - } - - String customerName = ""; - - try - { - CustomerBean bean = CustomerManager.getCustomerDetails(ctx,bpartnerId); - - String firstname = (bean.getPartnerName() == null) ? "" : bean.getPartnerName(); - String lastname = (bean.getSurname() == null) ? "" : bean.getSurname(); - - customerName = firstname + " " + lastname; - customerName = customerName.trim(); - - String data = "setCustomerName('"+ customerName +"');"; - - return sendData(data,response); - } - catch (BPartnerNotFoundException e1) - { - errormsg = "alert('Could not find customer! Please try again with proper Customer ID');defaultCustomer();"; - return sendData(errormsg,response); - } - - } - - private ActionForward sendData(String data,HttpServletResponse response) throws OperationException - { - try - { - response.setContentType("text/plain"); - PrintWriter out = response.getWriter(); - out.print(data); - - out.flush(); - out.close(); - } - catch (IOException e) - { - throw new OperationException(e); - } - return null; - } - - public static final String ADD_TO_CART = "addToCart"; - public ActionForward addToCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - //CustomerBean bean = (CustomerBean) df.getBean(); - - int customerId = Integer.parseInt(df.getBpartnerId()); - - CustomerCart cart = (CustomerCart) request.getSession().getAttribute(Constants.CUSTOMER_CART); - - if( cart == null ) - { - cart = new CustomerCart( ctx ); - } - - if ( ! cart.hasCustomer (customerId ) ) - { - cart.addCustomer( customerId ); - } - - request.getSession().setAttribute(Constants.CUSTOMER_CART, cart); - - String script = "setCartCounter("+ cart.getNoOfCustomers() +");customerAdded("+ customerId +")"; - - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - - public ActionForward clearCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - HttpSession session = request.getSession(); - session.removeAttribute(Constants.CUSTOMER_CART); - - request.getSession().getAttribute(Constants.CUSTOMER_CART); - - String script = "clearAll();"; - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - - public static final String VIEW_CART = "viewCart"; - public ActionForward viewCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, Exception - { - HttpSession session = request.getSession(); - CustomerCart cart = (CustomerCart) session.getAttribute(Constants.CUSTOMER_CART); - - ArrayList customerList =null; - - if(cart != null) - { - customerList = cart.getCustomers(); - - } - else - { - customerList = new ArrayList(); - } - - session.setAttribute(Constants.ALL_CART_CUSTOMERS, customerList); - - return mapping.findForward(VIEW_CART); - } - - public static final String REMOVE = "remove"; - public ActionForward remove(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, Exception - { - DefaultForm df = (DefaultForm) form; - - int customerId = Integer.parseInt(df.getBpartnerId()); - CustomerCart cart = (CustomerCart) request.getSession().getAttribute(Constants.CUSTOMER_CART); - - if( cart != null ) - { - cart.removeCustomer(customerId); - ArrayList customerList = cart.getCustomers(); - request.getSession().setAttribute(Constants.CUSTOMER_CART, cart); - request.getSession().setAttribute(Constants.ALL_CART_CUSTOMERS, customerList); - } - - return mapping.findForward(VIEW_CART); - } - - public static final String REMOVE_FROM_CART = "removeFromCart"; - public ActionForward removeFromCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - //CustomerBean bean = (CustomerBean) df.getBean(); - - int customerId = Integer.parseInt(df.getBpartnerId()); - - CustomerCart cart = (CustomerCart) request.getSession().getAttribute(Constants.CUSTOMER_CART); - - if( cart == null ) - { - cart = new CustomerCart( ctx ); - } - - if ( cart.hasCustomer (customerId ) ) - { - cart.removeCustomer( customerId ); - } - - request.getSession().setAttribute(Constants.CUSTOMER_CART, cart); - - String script = "setCartCounter("+ cart.getNoOfCustomers() +");customerRemoved("+ customerId +")"; - - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - - public static final String GENERATE_CUSTOMER_BARCODE ="generateCustomerBarcode"; - public ActionForward generateCustomerBarcode(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException, Exception - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList customerList =null; - CustomerCart cart = (CustomerCart) request.getSession().getAttribute(Constants.CUSTOMER_CART); - - if(cart != null) - { - customerList = cart.getCustomers(); - - } - else - { - customerList = new ArrayList(); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - byte printData[] = null; - - String barcodeData = BarcodeManager.printCustomerBarcode(ctx, cart, trx.getTrxName()); - - response.setContentType("application/octet-stream"); - printData = barcodeData.getBytes(); - - OutputStream os = response.getOutputStream(); - os.write(printData); - os.flush(); - os.close(); - - return mapping.findForward("/POSCustomerAction.do?action=viewCart"); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/customer/SalesAction.java b/posterita/posterita/src/main/org/posterita/struts/customer/SalesAction.java deleted file mode 100644 index c942249930..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/customer/SalesAction.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 16, 2005 by praveen - * - */ -package org.posterita.struts.customer; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.core.TmkJSPEnv; - -import org.posterita.Constants; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.SystemException; -import org.posterita.keyname.SalesRepKeyNamePair; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - -public class SalesAction extends BaseDispatchAction -{ - public static final String INIT_SALES = "initSales"; - public ActionForward initSales(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SystemException - { - ActionForward fwd = init(mapping,form,request,response); - - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - //CustomerBean bean = new CustomerBean(); - //get sales reps - ArrayList salesRep = SalesRepKeyNamePair.getKeyNamePairs(ctx); - request.getSession().setAttribute(Constants.SALES_REP,salesRep); - - return mapping.findForward(INIT_SALES); - } - - public static String INIT_SALES_FOR_EXISTING_CUSTOMER = "initSalesForExistingCustomer"; - public ActionForward initSalesForExistingCustomer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SystemException - { - ActionForward fwd = init(mapping,form,request,response); - - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - Integer customerId = Integer.valueOf(df.getBpartnerId()); - - request.getSession().setAttribute(Constants.CUSTOMER_ID, customerId); - - ArrayList salesRep = SalesRepKeyNamePair.getKeyNamePairs(ctx); - - Boolean canTradeIn = Boolean.valueOf(true); - request.getSession().setAttribute(Constants.SALES_REP,salesRep); - request.getSession().setAttribute(Constants.CAN_TRADE_IN, canTradeIn); - - return mapping.findForward(INIT_SALES); - } - - public static final String CREATE_TRADE_IN_ORDER = "createTradeInOrder"; - public static final String CREATE_NATIS_ORDER = "createNatisOrder"; - - - public static final String PURCHASE_TRADE_IN_VEHICLE_AND_CREATE_CUSTOMER_ORDER = "purchaseTradeInVehicleAndCreateCustomerOrder"; - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/inOut/ViewMinOutAction.java b/posterita/posterita/src/main/org/posterita/struts/inOut/ViewMinOutAction.java deleted file mode 100644 index de64bc0fea..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/inOut/ViewMinOutAction.java +++ /dev/null @@ -1,107 +0,0 @@ -/* -* -* Copyright (c) 2005 UDI Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* UDI Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with UDI. -* -* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -*/ -package org.posterita.struts.inOut; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.Globals; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.config.ActionConfig; -import org.apache.struts.config.ForwardConfig; -import org.apache.struts.util.MessageResources; -import org.compiere.model.MInOut; -import org.posterita.core.TmkJSPEnv; - -import org.posterita.Constants; -import org.posterita.beans.DocumentBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.businesslogic.MinOutManager; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.BaseAction; -import org.posterita.struts.core.DefaultForm; - - -public class ViewMinOutAction extends BaseAction -{ - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - - MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); - - String operationException = resources.getMessage("error.operationException"); - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - DocumentBean bean = (DocumentBean) df.getBean(); - Integer minoutId = bean.getDocumentId(); - - // retrieve from cache - WebDocumentBean webBean = null; - - MInOut inout = null; - if (minoutId!= null) - { - inout = new MInOut(ctx, minoutId.intValue(), null); - webBean = MinOutManager.getWebMinOutBean(ctx, inout); - request.getSession().setAttribute(Constants.WEB_MINOUT_BEAN, webBean); - - } - - //int orgID = Env.getAD_Org_ID(ctx); - - if (webBean == null) - webBean = (WebDocumentBean) request.getSession().getAttribute(Constants.WEB_MINOUT_BEAN); - - if (webBean == null) - throw new OperationException(operationException); - - request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); - request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); - request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); - request.getSession().setAttribute(Constants.ME, webBean.getMe()); - request.getSession().setAttribute(Constants.YOU,webBean.getYou()); - request.getSession().setAttribute(Constants.MINOUT_LINES_COLLECTION, webBean.getLines()); - request.getSession().setAttribute(Constants.MINOUT, webBean.getMinOut()); - request.getSession().setAttribute(Constants.MINVOICE, webBean.getInvoice()); - request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); - request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); - request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); - - ForwardConfig forwardConfig = getForward(ctx,webBean,mapping,form); - - ActionForward forward = new ActionForward(forwardConfig.getPath()); - - return forward; - } - - private ForwardConfig getForward(Properties ctx, WebDocumentBean webBean, ActionMapping mapping, ActionForm form) - { - - ActionConfig config = mapping.getModuleConfig().findActionConfig("/ViewMinOutAction"); - - return config.findForwardConfig(Constants.VIEW_MINOUT); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/invoice/ViewInvoiceAction.java b/posterita/posterita/src/main/org/posterita/struts/invoice/ViewInvoiceAction.java deleted file mode 100644 index de257d269e..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/invoice/ViewInvoiceAction.java +++ /dev/null @@ -1,190 +0,0 @@ -/* -* -* Copyright (c) 2007 - 2008 Posterita Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* UDI Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with UDI. -* -* UDI MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UDI SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -*/ -package org.posterita.struts.invoice; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.Globals; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.config.ActionConfig; -import org.apache.struts.config.ForwardConfig; -import org.apache.struts.util.MessageResources; -import org.compiere.model.MDocType; -import org.compiere.model.MInvoice; -import org.compiere.model.MOrder; -import org.compiere.process.DocumentEngine; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.DocumentBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.businesslogic.InvoiceManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.order.UDIOrderTypes; -import org.posterita.struts.core.BaseAction; -import org.posterita.struts.core.DefaultForm; - - -public class ViewInvoiceAction extends BaseAction -{ - - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - - MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); - - //String securityException = resources.getMessage("error.securityException"); - String operationException = resources.getMessage("error.operationException"); - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - DocumentBean bean = (DocumentBean) df.getBean(); - Integer invoiceId = bean.getDocumentId(); - - // retrieve from cache - WebDocumentBean webBean = null; - - MInvoice invoice = null; - if (invoiceId!= null && (invoiceId.intValue()!=0)) - { - invoice = new MInvoice(ctx, invoiceId.intValue(), null); - webBean = InvoiceManager.getWebInvoiceBean(invoice); - request.getSession().setAttribute(Constants.WEB_INVOICE_BEAN, webBean); - } - - //int orgID = Env.getAD_Org_ID(ctx); - - if (webBean == null) - webBean = (WebDocumentBean) request.getSession().getAttribute(Constants.WEB_INVOICE_BEAN); - - if (webBean == null) - throw new OperationException(operationException); - - request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); - request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); - request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); - request.getSession().setAttribute(Constants.ME, webBean.getMe()); - request.getSession().setAttribute(Constants.YOU,webBean.getYou()); - request.getSession().setAttribute(Constants.MINVOICE, webBean.getInvoice()); - request.getSession().setAttribute(Constants.MORDER, webBean.getOrder()); - request.getSession().setAttribute(Constants.MINVOICE_LINES_COLLECTION,webBean.getLines()); - request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); - request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); - request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); - request.getSession().setAttribute(Constants.INVOICE_TAX,webBean.getTotalTax()); - request.getSession().setAttribute(Constants.TOTAL_LINES,webBean.getTotalLines()); - request.getSession().setAttribute(Constants.GRAND_TOTAL,webBean.getGrandTotal()); - request.setAttribute(Constants.CURRENCY_SYMBOLE,webBean.getCurrencySymbole()); - - - ForwardConfig forwardConfig = getForward(ctx,webBean,mapping,form); - - ActionForward forward = new ActionForward(forwardConfig.getPath()); - - return forward; - } - - private ForwardConfig getForward(Properties ctx, WebDocumentBean webBean, ActionMapping mapping, ActionForm form) throws OperationException - { - ActionConfig config = mapping.getModuleConfig().findActionConfig("/ViewInvoiceAction"); - - MInvoice invoice = webBean.getInvoice(); - - //vendor invoice -- isSoTrx is false - //customer invoice -- isSoTrx true - - if (webBean.getOrder().getOrderType().equals(UDIOrderTypes.WEBSTORE_ORDER.getOrderType())) - { - //Webstore CI--customer invoice - if (invoice.isSOTrx()) - return getWebstoreCI_Forward(webBean,config); - } - else - { - //VI--vendor invoice - if (!invoice.isSOTrx()) - return getVI_Forward(webBean,config); - - //CI--customer invoice - if (invoice.isSOTrx()) - return getCI_Forward(webBean,config); - } - - // DEFAULT - return config.findForwardConfig(Constants.FINISHED_DO); - - } - - public ForwardConfig getVI_Forward(WebDocumentBean invoiceBean, ActionConfig config) throws OperationException - { - return config.findForwardConfig(Constants.WEBSTORE_INVOICE); - } - - public ForwardConfig getWebstoreCI_Forward(WebDocumentBean invoiceBean, ActionConfig config) throws OperationException - { - MInvoice invoice = invoiceBean.getInvoice(); - - String status = invoice.getDocStatus(); - - if(status.equals(DocumentEngine.STATUS_Completed)) - { - return config.findForwardConfig(Constants.WEBSTORE_INVOICE); - } - - return config.findForwardConfig(Constants.WEBSTORE_INVOICE); - } - - public ForwardConfig getCI_Forward(WebDocumentBean invoiceBean, ActionConfig config) throws OperationException - { - MInvoice invoice = invoiceBean.getInvoice(); - - MOrder order = new MOrder(invoice.getCtx(), invoice.getC_Order_ID(), null); - - - int[] docTypes = MDocType.getAllIDs(MDocType.Table_Name, " ad_client_id="+ Env.getAD_Client_ID(invoice.getCtx()) + " and DOCSUBTYPESO='" + MDocType.DOCSUBTYPESO_POSOrder+ "'", null ); - - - //POS order - if (order.getC_DocType_ID() == docTypes[0]) - return config.findForwardConfig(Constants.PAID_INVOICE); - - String status = invoice.getDocStatus(); - - if (!invoice.isActive()) - return config.findForwardConfig(Constants.CANCEL_INVOICE); - - if(status.equals(DocumentEngine.STATUS_Completed)) - { - return config.findForwardConfig(Constants.WEBSTORE_INVOICE); - } - return config.findForwardConfig(Constants.UNPAID_INVOICE); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/login/ChangePasswordAction.java b/posterita/posterita/src/main/org/posterita/struts/login/ChangePasswordAction.java deleted file mode 100644 index 6f2f5bb636..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/login/ChangePasswordAction.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 29, 2005 by din - */ - -package org.posterita.struts.login; - - - -import java.util.Properties; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.core.TmkJSPEnv; - -import org.posterita.Constants; -import org.posterita.beans.ChangePasswordBean; -import org.posterita.businesslogic.LoginManager; -import org.posterita.exceptions.WrongPasswordException; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; -import org.posterita.user.WebUserInfo; - - - - public class ChangePasswordAction extends BaseDispatchAction - { - - public ActionForward change(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - DefaultForm df = (DefaultForm) form; - ChangePasswordBean bean = (ChangePasswordBean) df.getBean(); - Properties ctx = TmkJSPEnv.getCtx(request); - - WebUserInfo userInfo = (WebUserInfo) request.getSession().getAttribute(WebUserInfo.NAME); - - try - { - LoginManager.changePassword(ctx, bean, userInfo); - } - - catch(WrongPasswordException e) - { - postGlobalError("admin.wrongPasswordError",request); - return (new ActionForward(mapping.getInput())); - - } - - - return mapping.findForward(Constants.CHANGE); - - } - - } - - diff --git a/posterita/posterita/src/main/org/posterita/struts/login/GoToHomePageAction.java b/posterita/posterita/src/main/org/posterita/struts/login/GoToHomePageAction.java deleted file mode 100644 index cfd3097ab0..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/login/GoToHomePageAction.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 26, 2005 by praveen - * - */ -package org.posterita.struts.login; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MStore; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.ApplicationParametersBean; -import org.posterita.businesslogic.StoreManager; -import org.posterita.businesslogic.core.ApplicationManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.lib.UdiConstants; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - -public class GoToHomePageAction extends BaseDispatchAction -{ - public static String GO_TO_HOMEPAGE = "goToHomePage"; - public ActionForward goToHomePage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - try - { - Properties ctx = Env.getCtx(); - MStore store = StoreManager.getDefaultStore(ctx); - ApplicationManager.setApplicationParametersInContext(ctx, store.get_ID()); - request.getSession().setAttribute(Constants.APP_NAME, store.getName()); - ctx = TmkJSPEnv.getCtx(request); - String forward = Env.getContext(ctx, UdiConstants.DEFAULT_FORWARD); - - return mapping.findForward(forward); - } - catch(Exception ex) - { - postGlobalError("error.store.default", ex.getMessage(), request); - return mapping.findForward(CHOOSE_APPLICATION); - } - } - - public static final String CHOOSE_APPLICATION = "chooseApplication"; - public ActionForward setApplicationParameters(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - DefaultForm df = (DefaultForm) form; - ApplicationParametersBean bean = (ApplicationParametersBean) df.getBean(); - - Integer storeId = bean.getStoreId(); - - // Store not defined, should go to default store or choose from different stores - if (storeId == null) - { - return goToHomePage(mapping, form, request, response); - } - - Properties ctx = TmkJSPEnv.getCtx(request); // Get default context from system - - MStore store = new MStore(ctx, storeId, null); - - if (store.get_ID() == 0) - { - //TODO: Add error message showing no store error to user - mapping.findForward(CHOOSE_APPLICATION); - } - - request.getSession().setAttribute(Constants.APP_NAME, store.getName()); - ApplicationManager.setApplicationParametersInContext(ctx, storeId); - - ctx = TmkJSPEnv.getCtx(request); - - return mapping.findForward(UdiConstants.DEFAULT_FORWARD); - } - - public static final String INIT_CHOOSE_APPLICATION = "initChooseApplication"; - public ActionForward initChooseApplication(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ArrayList appList = ApplicationManager.getAvailableApplications(); - servlet.getServletContext().setAttribute(Constants.WEB_APPLICATIONS, appList); - - return mapping.findForward(INIT_CHOOSE_APPLICATION); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/login/LoginAction.java b/posterita/posterita/src/main/org/posterita/struts/login/LoginAction.java deleted file mode 100644 index 21dd666c00..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/login/LoginAction.java +++ /dev/null @@ -1,471 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ -package org.posterita.struts.login; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.struts.Globals; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.util.MessageResources; -import org.compiere.model.MSession; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.WebUser; -import org.posterita.Constants; -import org.posterita.beans.ChangePasswordBean; -import org.posterita.beans.LoginBean; -import org.posterita.beans.TerminalBean; -import org.posterita.beans.UserBean; -import org.posterita.businesslogic.LoginManager; -import org.posterita.businesslogic.MenuManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.administration.RoleManager; -import org.posterita.businesslogic.core.ApplicationManager; -import org.posterita.core.Configuration; -import org.posterita.core.MenuItem; -import org.posterita.core.SessionStorage; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.EmailNotFoundException; -import org.posterita.exceptions.InvalidPasswordLengthException; -import org.posterita.exceptions.InvalidRoleException; -import org.posterita.exceptions.NotLoggedInException; -import org.posterita.exceptions.UserInactiveException; -import org.posterita.exceptions.UserNotFoundException; -import org.posterita.exceptions.WrongPasswordException; -import org.posterita.lib.UdiConstants; -import org.compiere.model.MWebMenu; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; -import org.posterita.user.WebUserInfo; - -public class LoginAction extends BaseDispatchAction -{ - - LoginManager bd = new LoginManager(); - Properties ctx = null; - - public static final String LOGIN_USER = "loginUser"; - public ActionForward loginUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd !=null) - return fwd; - - DefaultForm df = (DefaultForm) form; - LoginBean bean = (LoginBean) df.getBean(); - ctx = TmkJSPEnv.getCtx(request); - - WebUserInfo wuInfo = null; - MenuItem menus = null; - ArrayList topMenusList; - ArrayList leftMenusList; - - try - { - //Checking username and password - - //TODO - wuInfo = bd.loginUser(ctx, bean); - - Configuration config = Configuration.getConfiguration(request); - - ArrayList menuList = MenuManager.getMenus(ctx, request); - - //filter menulist based on configuration - for(MWebMenu menu : menuList) - { - String name = menu.getName(); - - if("smenu.credit.sales".equalsIgnoreCase(name) && !config.isAllowCreditSales()) - { - menuList.remove(menu); - continue; - } - - if("smenu.customer.returned.order".equalsIgnoreCase(name) && !config.isAllowCustomerReturnOrder()) - { - menuList.remove(menu); - continue; - } - } - - - menus = MenuManager.buildMenuTree(ctx, menuList); - topMenusList = menus.getTopMenus(); - leftMenusList = menus.getLeftMenus(); - - //Adding the switch user menu - Object userId = request.getSession().getAttribute(Constants.ADMIN_USER_ID); - - if(userId != null) - { - MWebMenu menu = new MWebMenu(ctx,0,null); - menu.setName("Switch User"); - menu.setMenuLink("LoginUserAction.do?action=loginUser&userId=" + userId); - - //MenuItem menuItem = new MenuItem(menu); - leftMenusList.add(new MenuItem(menu)); - } - - - } - catch(UserNotFoundException unfe) - { - postGlobalError("login.passwordError",request); - return (mapping.getInputForward()); - } - catch(NotLoggedInException e) - { - postGlobalError("login.passwordError",request); - return (mapping.getInputForward()); - } - catch(InvalidRoleException ire) - { - postGlobalError("error.role.invalid", request); - return (mapping.getInputForward()); - } - catch(UserInactiveException unae) - { - postGlobalError("login.userInactive",request); - return (mapping.getInputForward()); - } - - HttpSession session = request.getSession(); - MSession cSession = MSession.get (ctx, request.getRemoteAddr(), request.getRemoteHost(), session.getId()); - - if (cSession != null) - cSession.setWebStoreSession(true); - - //Set breadcrumb to empty - - request.getSession().setAttribute(Constants.BREADCRUMB, null); - - request.getSession().setAttribute(WebUserInfo.NAME, wuInfo); - request.getSession().setAttribute(Constants.MENUS, menus); - request.getSession().setAttribute(Constants.TOP_MENUS, topMenusList); - request.getSession().setAttribute(Constants.LEFT_MENUS, leftMenusList); - SessionStorage.putOrg(ctx, request); - - - return mapping.findForward(LOGIN_USER); - - } - - public static final String LOGOUT = "logout"; - public ActionForward logout(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - HttpSession session = request.getSession(); - Properties ctx = TmkJSPEnv.getCtx(request); - - WebUserInfo wuInfo = (WebUserInfo)session.getAttribute(WebUserInfo.NAME); - - int storeId = Env.getContextAsInt(ctx, UdiConstants.WSTORE_CTX_PARAM); - - if (wuInfo != null) - { - WebUser wu = wuInfo.getUser(); - if (wu != null) - wu.logout(); - - session.removeAttribute(WebUserInfo.NAME); - session.setMaxInactiveInterval(0); - } - - try - { - ApplicationManager.setApplicationParametersInContext(ctx, storeId); - return mapping.findForward(UdiConstants.DEFAULT_FORWARD); - } - catch(Exception ex) - { - postGlobalError("error.store.default", ex.getMessage(), request); - return mapping.findForward(CHOOSE_APPLICATION); - } - } - - public static final String SUCCESS = "success"; - public static final String CHOOSEPOS = "choosePOS"; - public static final String CREATEPOSORDER = "createPOSOrder"; - public ActionForward success(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - DefaultForm df = (DefaultForm) form; - LoginBean bean = (LoginBean) df.getBean(); - - Properties ctx = TmkJSPEnv.getCtx(request); - - HttpSession session = request.getSession(); - WebUserInfo info = null; - WebUser wu; - - try - { - wu = bd.checkLoginPassword(ctx, bean); - - info = bd.login(ctx, wu); - - - - MSession cSession = MSession.get (ctx, request.getRemoteAddr(), request.getRemoteHost(), session.getId()); - - if (cSession != null) - cSession.setWebStoreSession(true); - - session.setAttribute (WebUserInfo.NAME, info); - - SessionStorage.putMenus(ctx, request); - - - } - catch(UserNotFoundException unfe) - { - postGlobalError("login.passwordError",request); - return (mapping.getInputForward()); - } - catch(NotLoggedInException e) - { - postGlobalError("login.passwordError",request); - return (mapping.getInputForward()); - } - catch(InvalidRoleException ire) - { - postGlobalError("error.role.invalid", request); - return (mapping.getInputForward()); - } - catch(UserInactiveException unae) - { - postGlobalError("login.userInactive",request); - return (mapping.getInputForward()); - } - - // Should be removed after backward compatibility achieved - POSTerminalManager.migrateOldPOSTerminal(ctx); - - String strPosId = POSTerminalManager.getTerminalFromCookie(request); - int posId = 0; - boolean isValidPOSId = false; - - if(strPosId != null) - { - try - { - posId = Integer.parseInt(strPosId); - isValidPOSId = POSTerminalManager.isPOSTerminalAccessible(ctx, posId); - } - catch(Exception ex) - {} - } - - if(!isValidPOSId) - { - int adOrgId = Env.getAD_Org_ID(ctx); - ArrayList list = POSTerminalManager.getAllActiveTerminals(ctx, adOrgId, null); - request.getSession().setAttribute(Constants.POSTERMINALS,list); - return mapping.findForward(CHOOSEPOS); - } - else - { - SessionStorage.setPOSTerminal(ctx, posId, request); - String currSymboleSales = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); - String currSymbolePurchase=POSTerminalManager.getDefaultPurchaseCurrency(ctx).getCurSymbol(); - request.getSession().setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); - request.getSession().setAttribute(Constants.CURRENCY_SYMBOLE_PURCHASE,currSymbolePurchase); - return mapping.findForward(CREATEPOSORDER); - } - } - - public ActionForward password(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - DefaultForm df = (DefaultForm) form; - UserBean bean = (UserBean) df.getBean(); - Properties ctx = TmkJSPEnv.getCtx(request); - boolean ok = false; - - MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); - - String subject = resources.getMessage("login.password.emailTitle"); - String content = resources.getMessage("login.password.emailSubject"); - - try - { - ok = bd.sendPassword(ctx, bean, subject, content); - } - catch(EmailNotFoundException e) - { - postGlobalError("login.emailNotFound",request); - return (new ActionForward(mapping.getInput())); - } - catch(UserNotFoundException une) - { - postGlobalError("login.userNotFound",request); - return (new ActionForward(mapping.getInput())); - - } - - if(ok == false) - { - postGlobalError("email.send.error",request); - return mapping.getInputForward(); - } - else - { - return mapping.findForward(Constants.PASSWORD); - } - } - - public static final String CHANGE_USER_PASSWORD="changeUserPassword"; - public ActionForward changeUserPassword(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd !=null) - return fwd; - - DefaultForm df = (DefaultForm) form; - ChangePasswordBean bean = (ChangePasswordBean) df.getBean(); - Properties ctx = TmkJSPEnv.getCtx(request); - - WebUserInfo userInfo = (WebUserInfo) request.getSession().getAttribute(WebUserInfo.NAME); - - try - { - LoginManager.changePassword(ctx,bean,userInfo); - } - catch(InvalidPasswordLengthException e2) - { - postGlobalError("error.wrong.password.length", request); - return mapping.getInputForward(); - } - catch(WrongPasswordException e) - { - postGlobalError("admin.wrongPasswordError",request); - return (new ActionForward(mapping.getInput())); - } - - return mapping.findForward(CHANGE_USER_PASSWORD); - } - - - - //----------------------------------Refactoring LoginAction----------------------------------- - - public static final String VALIDATE_USER = "validateUser"; - /** - * We check whether the name & password supplied is valid - * Result: - * If valid we forward to choose role - * else we forward to login page witn appropriate login error - */ - public ActionForward validateUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - LoginBean bean = (LoginBean) df.getBean(); - - HttpSession session = request.getSession(); - WebUserInfo info = null; - WebUser wu = null; - - // validate user - try - { - wu = bd.checkLoginPassword(ctx, bean); - - info = bd.login(ctx, wu); - - MSession cSession = MSession.get (ctx, request.getRemoteAddr(), request.getRemoteHost(), session.getId()); - - if (cSession != null) - cSession.setWebStoreSession(true); - - session.setAttribute (WebUserInfo.NAME, info); - - ArrayList myRoles = RoleManager.getMyRoles(ctx); - - if(myRoles.size() == 1) - { - KeyNamePair pair = (KeyNamePair) myRoles.get(0); - - Env.setContext(ctx,"#AD_Role_ID", pair.getKey()); - - SessionStorage.putMenus(ctx,request); - SessionStorage.putOrg(ctx, request); - - return mapping.findForward(LOGIN_SUCCESS); - } - - - } - catch(UserNotFoundException unfe) - { - postGlobalError("login.passwordError",request); - return (mapping.getInputForward()); - } - catch(NotLoggedInException e) - { - postGlobalError("login.passwordError",request); - return (mapping.getInputForward()); - } - catch(InvalidRoleException ire) - { - postGlobalError("error.role.invalid", request); - return (mapping.getInputForward()); - } - catch(UserInactiveException unae) - { - postGlobalError("login.userInactive",request); - return (mapping.getInputForward()); - } - - return mapping.findForward(INIT_CHOOSE_ROLE); - } - - - public static final String INIT_CHOOSE_ROLE = "initChooseRole"; - /** - * We get all the roles assign to the user and all orgs - * accessible by the user - */ - - - - - public static final String LOGIN_SUCCESS = "loginSuccess"; - /** - * We load all the menus - */ - public ActionForward loginSuccess(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd !=null) - return fwd; - - return mapping.findForward(LOGIN_SUCCESS); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/login/POSLoginAction.java b/posterita/posterita/src/main/org/posterita/struts/login/POSLoginAction.java deleted file mode 100644 index 121fb7b7eb..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/login/POSLoginAction.java +++ /dev/null @@ -1,207 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Sep 25, 2006 - */ - - -package org.posterita.struts.login; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MSession; -import org.compiere.util.Env; -import org.compiere.util.WebUser; -import org.posterita.Constants; -import org.posterita.beans.LoginBean; -import org.posterita.beans.TerminalBean; -import org.posterita.businesslogic.LoginManager; -import org.posterita.businesslogic.MenuManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.core.Configuration; -import org.posterita.core.SessionStorage; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.DuplicatePINException; -import org.posterita.exceptions.InvalidPINException; -import org.posterita.exceptions.InvalidRoleException; -import org.posterita.exceptions.NotLoggedInException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.UserInactiveException; -import org.posterita.exceptions.UserNotFoundException; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; -import org.posterita.user.WebUserInfo; - - -public class POSLoginAction extends BaseDispatchAction -{ - LoginManager bd = new LoginManager(); - public static final String SUCCESS = "success"; - public static final String CHOOSEPOS = "choosePOS"; - public static final String CREATEPOSORDER = "createPOSOrder"; - public static final String CREATEPOSORDERSCREEN = "createPOSOrderScreen"; - // public static final String SUCCESS_WSTORE_USER = "successWStoreUser"; - public ActionForward success(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df = (DefaultForm) form; - LoginBean bean = (LoginBean) df.getBean(); - - Properties ctx = TmkJSPEnv.getCtx(request); - - HttpSession session = request.getSession(); - WebUserInfo info = null; - WebUser wu; - - try - { - if(bean.getUserPIN()!=null) - { - bean=bd.getUserNameFromPIN(ctx,bean.getUserPIN()); - } - - wu = bd.checkLoginPassword(ctx, bean);/////////////// - - info = bd.login(ctx, wu); - - MSession cSession = MSession.get (ctx, request.getRemoteAddr(), request.getRemoteHost(), session.getId()); - - if (cSession != null) - cSession.setWebStoreSession(false); - - session.setAttribute (WebUserInfo.NAME, info); - - Configuration config = Configuration.getConfiguration(request); - config.save(response); - - SessionStorage.putMenus(ctx, request); - } - catch(InvalidPINException e) - { - postGlobalError("error.invalid.pin",request); - return (mapping.getInputForward()); - } - catch(DuplicatePINException e) - { - postGlobalError("error.duplicate.pin",request); - return (mapping.getInputForward()); - } - catch(UserNotFoundException unfe) - { - postGlobalError("login.passwordError",request); - return (mapping.getInputForward()); - } - catch(NotLoggedInException e) - { - postGlobalError("login.passwordError",request); - return (mapping.getInputForward()); - } - catch(InvalidRoleException ire) - { - postGlobalError("error.role.invalid", request); - return (mapping.getInputForward()); - } - catch(UserInactiveException unae) - { - postGlobalError("login.userInactive",request); - return (mapping.getInputForward()); - } - - // Should be removed after backward compatibility achieved - POSTerminalManager.migrateOldPOSTerminal(ctx); - - - String strTerminalId = POSTerminalManager.getTerminalFromCookie(request); - boolean isValidPOSId = false; - int terminalId = 0; - - if(strTerminalId != null) - { - try - { - terminalId= Integer.parseInt(strTerminalId); - isValidPOSId = POSTerminalManager.isPOSTerminalAccessible(ctx, terminalId); - } - catch(Exception ex) - {} - } - - if(!isValidPOSId) - { - int adOrgId = Env.getAD_Org_ID(ctx); - ArrayList list = POSTerminalManager.getAllActiveTerminals(ctx, adOrgId, null); - request.getSession().setAttribute(Constants.POSTERMINALS, list); - return mapping.findForward(CHOOSEPOS); - } - else - { - SessionStorage.putLoginSession(ctx, request, response, terminalId); - boolean isCashSalesAllowed = MenuManager.isCashSalesAllowed(ctx, Env.getAD_Role_ID(ctx)); - - if(isCashSalesAllowed) - { - return mapping.findForward(CREATEPOSORDERSCREEN); - } - else - { - return mapping.findForward(CREATEPOSORDER); - } - } - } - - public ActionForward choosePOS(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - - String strTerminalId = df.getPosId(); - - int terminalId = 0; - - try - { - terminalId = Integer.parseInt(strTerminalId); - } - catch (Exception ex) - { - throw new OperationException("Invalid terminal"); - } - - SessionStorage.putLoginSession(ctx, request, response, terminalId); - - return mapping.findForward(CHOOSEPOS); - } - -} - diff --git a/posterita/posterita/src/main/org/posterita/struts/menu/CloseMenuAction.java b/posterita/posterita/src/main/org/posterita/struts/menu/CloseMenuAction.java deleted file mode 100644 index b571a5092f..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/menu/CloseMenuAction.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 28, 2005 by din - */ - -package org.posterita.struts.menu; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.Constants; -import org.posterita.beans.MenuItemBean; -import org.posterita.businesslogic.MenuManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.SystemException; -import org.posterita.keyname.MenuKeyNamePair; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - -public class CloseMenuAction extends BaseDispatchAction -{ - - public static final String CLOSE_MENU= "closeMenuItems"; - public ActionForward closeMenuItems(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - MenuItemBean bean = (MenuItemBean) df.getBean(); - - MenuManager.saveMenu(ctx,bean); - - request.getSession().setAttribute(Constants.MENUS,bean); - - return mapping.findForward(CLOSE_MENU); - } - - public static final String INIT_MENU= "initMenuItems"; - public ActionForward initMenuItems(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList menus = MenuKeyNamePair.getKeyNamePairs(ctx); - - - - request.getSession().setAttribute(Constants.MENUS, menus); - - return mapping.findForward(INIT_MENU); - } - } - - diff --git a/posterita/posterita/src/main/org/posterita/struts/menu/MenuAction.java b/posterita/posterita/src/main/org/posterita/struts/menu/MenuAction.java deleted file mode 100644 index 7280fba206..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/menu/MenuAction.java +++ /dev/null @@ -1,274 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.struts.menu; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.PO; -import org.posterita.Constants; -import org.posterita.beans.MenuItemBean; -import org.posterita.businesslogic.MenuManager; -import org.posterita.core.MenuItem; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.bean.ElementBean; -import org.posterita.core.businesslogic.ElementManager; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.factory.POSMenuFactory; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - - - -public class MenuAction extends BaseDispatchAction -{ - public static final String GET_MENU_ITEMS = "getMenuItems"; - public static final String GET_POS_MENU_ITEMS = "getPOSMenuItems"; - - public ActionForward getMenuItems(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - MenuItemBean bean = (MenuItemBean) df.getBean(); - - MenuItem rootMenuItem = (MenuItem)request.getSession().getAttribute(Constants.MENUS); - - if(rootMenuItem == null) - { - //TODO: Display error message or should kick to right store - return mapping.findForward(CHOOSE_APPLICATION); - } - - ArrayList subMenus = new ArrayList(); - if(bean.getMenuId()==null) - { - PO po = POSMenuFactory.getFactoryInstance(ctx).get(ctx, POSMenuFactory.PMENU_SALES_ID); - bean.setMenuId(po.get_ID()); - } - - if(bean.getMenuId()!= null) - { - subMenus = rootMenuItem.getSubMenus(bean.getMenuId().intValue()); - } - - //subgrouping menus - ArrayList menuItems = subMenus; - HashMap> categoryMap = new HashMap>(); - - StringWriter sw = new StringWriter(); - PrintWriter out = new PrintWriter(sw); - ElementBean elementBean = null; - - String category = ""; - String imgSrc = "images/newUI/"; - ArrayList list = null; - ArrayList categories = new ArrayList(); - - //group menus - for(MenuItem menuItem : menuItems) - { - category = menuItem.getCategory(); - category = (category==null)? "" : category; - - if(!categories.contains(category)) - { - categories.add(category); - } - - list = categoryMap.get(category); - - if(list==null) - { - list = new ArrayList(); - } - - list.add(menuItem); - categoryMap.put(category,list); - - } - - //display groups - - Iterator iter = categories.iterator(); - - - while(iter.hasNext()) - { - //---------------------------------------------------------------------------------------------------------------------- - imgSrc = "images/newUI/"; - out.print("

    "); - out.print("
    "); - out.print(""); - out.print(""); - out.print("
    "); //top - out.print("
    "); - out.print("
    "); - out.print("
    "); - out.print("

    "); - - category = iter.next(); - list = categoryMap.get(category); - - if((category != null)&&(category.length() != 0)) - { - if(category.contains("order")) - { - imgSrc = imgSrc + "hicon-salesorder.gif"; - } - else if(category.contains("cash")) - { - imgSrc = imgSrc + "hicon-cashbook.gif"; - } - else if(category.contains("till")) - { - imgSrc = imgSrc + "hicon-tillmgt.gif"; - } - else - { - imgSrc = imgSrc + "spacer.gif"; - } - out.print(""); - - elementBean = ElementManager.getMsg(ctx,category); - out.print(elementBean.getName()); - }//if - else - { - out.print(""); - } - - out.print("

    "); - out.print("
    "); //salesOrder - - out.print(""); - out.print("
    "); //posSubNavContainer - out.print("
    "); //center-content - out.print("
    "); - out.print(""); - out.print(""); - out.print("
    "); - - if((category != null)&&(category.length() != 0)) - { - out.print("
    "); //liquid-round - }//if - - } - - out.flush(); - - String menu = sw.toString(); - - request.getSession().setAttribute(Constants.MENU_ITEMS, menu); - return mapping.findForward(GET_POS_MENU_ITEMS); - } - - public static final String INIT_EDIT_LINKSTATUS = "initEditLinkStatus"; - public ActionForward initEditLinkStatus(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList menuKeyNamePairs = MenuManager.getClosableMenus(ctx); - - request.getSession().setAttribute(Constants.MENU_LIST, menuKeyNamePairs); - - return mapping.findForward(INIT_EDIT_LINKSTATUS); - } - - public static final String SELECT_LINK_TO_EDIT = "selectLinkToEdit"; - public ActionForward selectLinkToEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - MenuItemBean bean = (MenuItemBean) df.getBean(); - - MenuItemBean bean2 = MenuManager.getMenu(ctx, bean.getMenuId().intValue()); - - df.populate(bean2); - - return mapping.findForward(SELECT_LINK_TO_EDIT); - } - - public static final String EDIT_MENU = "editMenu"; - public ActionForward editMenu(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - MenuItemBean bean = (MenuItemBean) df.getBean(); - - MenuItemBean editedMenu = MenuManager.editMenu(ctx, bean); - - request.getSession().setAttribute(Constants.MENU, editedMenu); - - return mapping.findForward(EDIT_MENU); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/order/CompletePOSOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/order/CompletePOSOrderAction.java deleted file mode 100644 index 53195712f4..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/order/CompletePOSOrderAction.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 27-Mar-2006 - */ - - -package org.posterita.struts.order; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MOrder; - -import org.posterita.Constants; -import org.posterita.beans.WebDocumentBean; -import org.posterita.businesslogic.OrderReferenceManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; - - -public class CompletePOSOrderAction extends ViewOrderAction -{ - - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - - WebDocumentBean webBean = null; - - Integer posOrderId=(Integer) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); - - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,posOrderId); - - MOrder completedPOSOrder=POSManager.completePOSOrder(ctx,posOrderId, null); - webBean = OrderReferenceManager.getWebOrderBean(ctx,completedPOSOrder); - - - request.getSession().setAttribute(Constants.WEB_ORDER_BEAN, webBean); - - return super.execute(mapping,form,request,response); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/order/ViewOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/order/ViewOrderAction.java deleted file mode 100644 index 0b31d0e623..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/order/ViewOrderAction.java +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Created on Mar 4, 2005 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ -package org.posterita.struts.order; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.Globals; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.config.ActionConfig; -import org.apache.struts.config.ForwardConfig; -import org.apache.struts.util.MessageResources; -import org.compiere.model.MOrder; -import org.compiere.model.MUser; -import org.compiere.process.DocumentEngine; -import org.compiere.util.Env; - -import org.posterita.Constants; -import org.posterita.beans.DocumentBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.businesslogic.OrderReferenceManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.order.UDIOrderTypes; -import org.posterita.struts.core.BaseAction; -import org.posterita.struts.core.DefaultForm; - - -public class ViewOrderAction extends BaseAction -{ - - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - - MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); - - //String securityException = resources.getMessage("error.securityException"); - String operationException = resources.getMessage("error.operationException"); - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - DocumentBean bean = (DocumentBean) df.getBean(); - Integer orderID = bean.getDocumentId(); - - // retrieve from cache - WebDocumentBean webBean = null; - - MOrder order = null; - if (orderID!= null) - { - order = new MOrder(ctx, orderID.intValue(), null); - webBean = OrderReferenceManager.getWebOrderBean(ctx,order); - request.getSession().setAttribute(Constants.WEB_ORDER_BEAN, webBean); - } - - - if (webBean == null) - webBean = (WebDocumentBean) request.getSession().getAttribute(Constants.WEB_ORDER_BEAN); - - if (webBean == null) - throw new OperationException(operationException); - - request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); - request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); - request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); - request.getSession().setAttribute(Constants.ME, webBean.getMe()); - request.getSession().setAttribute(Constants.YOU,webBean.getYou()); - request.getSession().setAttribute(Constants.MORDER, webBean.getOrder()); - request.getSession().setAttribute(Constants.MORDER_LINES_COLLECTION,webBean.getLines()); - request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); - request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); - request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); - request.getSession().setAttribute(Constants.ORDER_TAX,webBean.getTotalTax()); - request.getSession().setAttribute(Constants.TOTAL_LINES,webBean.getTotalLines()); - request.getSession().setAttribute(Constants.GRAND_TOTAL,webBean.getGrandTotal()); - request.getSession().setAttribute(Constants.ALLOCATION,webBean.getAllocations()); - request.getSession().setAttribute(Constants.SALES_REP, webBean.getSalesRep()); - request.getSession().setAttribute(Constants.IS_PAID, webBean.getIsPaid()); - - ForwardConfig forwardConfig = getForward(ctx,webBean,mapping,form); - - ActionForward forward = new ActionForward(forwardConfig.getPath()); - - return forward; - } - - - private ForwardConfig getForward(Properties ctx, WebDocumentBean webBean, ActionMapping mapping, ActionForm form) throws OperationException - { - ActionConfig config = mapping.getModuleConfig().findActionConfig("/ViewOrderAction"); - - MOrder order = webBean.getOrder(); - - String orderType = order.getOrderType(); - - webBean.setCtx(ctx); - - if (orderType == null) - throw new OperationException("Cannot determine type of order. Type is null"); - - - //Tamak POS Order - if(orderType.equals(UDIOrderTypes.POS_ORDER.getOrderType())) - return getCustomerOrderForward(webBean,config); - - - - //Material Return Order - if(orderType.equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) - return getMROForward(webBean, config); - - // WEBSTORE ORDER - if (orderType.equals(UDIOrderTypes.WEBSTORE_ORDER.getOrderType())) - return getWebstoreOrderForward(ctx, webBean,config); - - // DEFAULT - return config.findForwardConfig(Constants.FINISHED_DO); - } - - - - - - - public ForwardConfig getAllocationOrderForward(WebDocumentBean bean, ActionConfig config) - { - MOrder order = bean.getOrder(); - - String docStatus = order.getDocStatus(); - - if (!order.isActive()) - return config.findForwardConfig(Constants.CANCEL_DO); - - if (docStatus.equals(DocumentEngine.STATUS_Drafted)) - return config.findForwardConfig(Constants.UNFINISHED_AL); - - if (docStatus.equals(DocumentEngine.STATUS_InProgress)) - return config.findForwardConfig(Constants.SWAP_VIN); - - if (docStatus.equals(DocumentEngine.STATUS_Voided)) - return config.findForwardConfig(Constants.UNFINISHED_AL); - - return config.findForwardConfig(Constants.GENERATE_INVOICE); - } - - // same as for customer order - private ForwardConfig getUsedCarPurchaseOrderForward(WebDocumentBean webBean, ActionConfig config) throws OperationException - { - MOrder order = webBean.getOrder(); - - String status = order.getDocStatus(); - - if (status.equals(DocumentEngine.STATUS_Completed)) - return config.findForwardConfig(Constants.PROGRESS_TI); - - if (!order.isActive()) - return config.findForwardConfig(Constants.CANCEL_DO); - - - return config.findForwardConfig(Constants.PROGRESS_TI); - } - - - private ForwardConfig getCustomerOrderForward(WebDocumentBean webBean, ActionConfig config) throws OperationException - { - MOrder order = webBean.getOrder(); - - String status = order.getDocStatus(); - - - if (status.equals(DocumentEngine.STATUS_Drafted)) - { - return config.findForwardConfig(Constants.UNFINISHED_NR); - } - - if(status.equals(DocumentEngine.STATUS_InProgress)) - return config.findForwardConfig(Constants.PROGRESS_NR); - - if (status.equals(DocumentEngine.STATUS_Completed)) - return config.findForwardConfig(Constants.FINISHED_NR); - - - if (!order.isActive()) - return config.findForwardConfig(Constants.CANCEL_DO); - - return config.findForwardConfig(Constants.UNFINISHED_NR); - } - - private ForwardConfig getMROForward(WebDocumentBean webBean, ActionConfig config) - { - MOrder order = webBean.getOrder(); - - if (order.isSOTrx()) - return getSO_MROForward(webBean, config); - - return getPO_MROForward(webBean, config); - } - - - - - private ForwardConfig getSO_MROForward(WebDocumentBean webBean, ActionConfig config) - { - MOrder order = webBean.getOrder(); - - if (!order.isActive()) - { - return config.findForwardConfig(Constants.CANCEL_DO); - } - - return config.findForwardConfig(Constants.PROGRESS_DT); - } - - private ForwardConfig getPO_MROForward(WebDocumentBean orderBean, ActionConfig config) - { - MOrder order = orderBean.getOrder(); - - - if (order == null) - { - - return config.findForwardConfig(Constants.CANCEL_DO); - } - - String status = order.getDocStatus(); - - if (status.equals(DocumentEngine.STATUS_Drafted)) - { - //orderStatusMessage = "status drafted"; - } - - if (!order.isActive()) - return config.findForwardConfig(Constants.CANCEL_DO); - - - return config.findForwardConfig(Constants.PROGRESS_DT); - - } - - private ForwardConfig getWebstoreOrderForward(Properties ctx, WebDocumentBean webBean, ActionConfig config) throws OperationException - { - - int userId = Env.getAD_User_ID(ctx); - new MUser(ctx, userId, null); - - - return getWebstoreSOForward(webBean, config); - } - - public ForwardConfig getWebstoreSOForward(WebDocumentBean orderBean, ActionConfig config) throws OperationException - { - - MOrder order = orderBean.getOrder(); - - - if (order == null) - throw new OperationException("Order cannot be NULL!"); - - - return config.findForwardConfig(Constants.WEBSTORE_PROGRESS_DO); - } - - - public ForwardConfig getPO_SCO_Forward(WebDocumentBean webBean, ActionConfig config) - { - MOrder order = webBean.getOrder(); - - if (order == null) - { - return config.findForwardConfig(Constants.CANCEL_SCO); - } - - if (!order.isActive()) - { - return config.findForwardConfig(Constants.CANCEL_SCO); - } - - - String status = order.getDocStatus(); - - if (status.equals(DocumentEngine.STATUS_Drafted)) - { - return config.findForwardConfig(Constants.UNFINISHED_SCO); - } - - - if (status.equals(DocumentEngine.STATUS_Voided)) - { - return config.findForwardConfig(Constants.PROGRESS_SCO); - } - - - return config.findForwardConfig(Constants.PROGRESS_SCO); - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/BarcodeAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/BarcodeAction.java deleted file mode 100644 index ed129cba4a..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/BarcodeAction.java +++ /dev/null @@ -1,363 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 17-Aug-2006 13:49:29 by praveen - * - */ - -package org.posterita.struts.pos; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.math.BigDecimal; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; -import org.apache.struts.util.MessageResources; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.ItemBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.ShoppingCartBean; -import org.posterita.businesslogic.ProductCart; -import org.posterita.businesslogic.ShoppingcartManager; -import org.posterita.businesslogic.administration.BarcodeManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.stock.StockManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.InputQuantityLessThanZeroException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.exceptions.ProductNotOnPriceListException; -import org.posterita.exceptions.QuantityNotAvailableException; -import org.posterita.exceptions.UOMValuePrecisionNotValidException; -import org.posterita.form.OrderLineForm; -import org.posterita.lib.UdiConstants; -import org.posterita.struts.core.DefaultForm; - -import com.lowagie.text.DocumentException; - -public class BarcodeAction extends POSDispatchAction -{ - public ActionForward getBarcodeImage(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - if (fwd !=null) - return fwd; - - DefaultForm df = (DefaultForm) form; - String barcode = df.getBarCode(); - - if(barcode!=null) - { - //send image - BarcodeManager.writeBarcode(barcode,response); - } - - return null; - - } - - //------------------------------------------------------------------------------------------// - /** - * BARCODE IMPLEMENTATION - */ - - public static final String INCREMENT_QTY = "incrementQty"; - public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - // Bug fix for null pointer - OrderLineForm of = (OrderLineForm) form; - if(of.getQuantity() == null) - { - of.setQuantity("1"); - } - - addToBarcodeCart(mapping,form,request,response); - return getBarcodeCart(mapping,form,request,response); - } - - public static final String DECREMENT_QTY = "decrementQty"; - public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - // Bug fix for null pointer - OrderLineForm of = (OrderLineForm) form; - if(of.getQuantity() == null) - { - of.setQuantity("1"); - } - - addToBarcodeCart(mapping,form,request,response); - return getBarcodeCart(mapping,form,request,response); - } - - public ActionForward addProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, ParseException - { - // Bug fix for null pointer - OrderLineForm of = (OrderLineForm) form; - if(of.getQuantity() == null) - { - of.setQuantity("1"); - } - - addToBarcodeCart(mapping,form,request,response); - - return getBarcodeCart(mapping,form,request,response); - } - - public static final String UPDATE_QTY = "updateQty"; - public ActionForward updateQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx=TmkJSPEnv.getCtx(request); - - // Bug fix for null pointer - OrderLineForm of = (OrderLineForm) form; - if(of.getQuantity() == null) - { - of.setQuantity("1"); - } - - OrderLineBean bean = (OrderLineBean) of.getBean(); - Integer product_id = bean.getProductId(); - BigDecimal quantity = bean.getQuantity(); - Integer priceListId = bean.getPriceListId(); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.BARCODE_CART_ITEMS); - StockManager.updateItemFromPOSList(ctx, priceListId, items, product_id, quantity); - - return getBarcodeCart(mapping,form,request,response); - } - - public static final String ADD_TO_BARCODE_CART = "addToBarcodeCart"; - public ActionForward addToBarcodeCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - OrderLineBean bean = (OrderLineBean) df.getBean(); - - - String barcodeCart = Constants.BARCODE_CART; - String barcodeCartItems = Constants.BARCODE_CART_ITEMS; - - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(barcodeCart); - - try - { - if(bean.getProductId()==null && bean.getBarCode()==null) - { - postGlobalError("error.barcode.required", request); - return mapping.getInputForward(); - } - - BigDecimal qty = bean.getQuantity(); - if(qty != null && qty.doubleValue() < 0.0) - { - throw new InputQuantityLessThanZeroException(""); - } - - cartBean = StockManager.addToPOSCart(ctx, bean, cartBean, false,Boolean.parseBoolean(bean.getIfAdd())); - } - catch (InputQuantityLessThanZeroException e) - { - postGlobalError("error.invalid.inputQty", request); - return mapping.getInputForward(); - } - catch (ProductNotFoundException e) - { - postGlobalError("error.product.not.found", e.getMessage(), request); - return mapping.getInputForward(); - } - catch(QuantityNotAvailableException e) - { - postGlobalError("error.quantity.notAvailable", e.getMessage(), request); - return mapping.getInputForward(); - } - - catch(ProductNotOnPriceListException e) - { - postGlobalError("error.product.price.not.found", e.getMessage(), request); - return mapping.getInputForward(); - } - - catch (UOMValuePrecisionNotValidException e) - { - postGlobalError("error.precision", e.getMessage(), request); - return mapping.getInputForward(); - } - - - - int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - String currSymboleSales = PriceListManager.getCurrency(ctx, priceListId); - request.setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); - - request.getSession().setAttribute(barcodeCart, cartBean); - request.getSession().setAttribute(barcodeCartItems, cartBean.getItems()); - - df.setQtyAndItem(""); - - return mapping.findForward(ADD_TO_BARCODE_CART); - } - - public ActionForward getBarcodeCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException - { - DefaultForm df = (DefaultForm) form; - String orderType = df.getOrderType(); - - String shoppingcartHTML = ShoppingcartManager.getBarcodecartAsHTML(request); - - PrintWriter writer = response.getWriter(); - writer.write(shoppingcartHTML); - - - ActionMessages errors = (ActionMessages) request.getAttribute("org.apache.struts.action.ERROR"); - if(errors != null && !errors.isEmpty()) - { - MessageResources messageResources = getResources(request); - - Iterator iter = errors.get(); - while(iter.hasNext()) - { - ActionMessage message = iter.next(); - String key = message.getKey(); - Object[] values = message.getValues(); - - String errMsg = messageResources.getMessage(key, values); - writer.write(""); - } - - } - - writer.close(); - - return null; - } - - - public static final String COPY_PRODUCT_TO_SHOPPING_CART = "copyProductToShoppingCart"; - public ActionForward copyProductToShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException, ParseException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - HttpSession session = request.getSession(); - ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); - String shoppingcartHTML = ShoppingcartManager.copyShoppingCartAsHTML(ctx, cart); - - request.getSession().setAttribute(Constants.BARCODE_CART, cart); - request.getSession().setAttribute(Constants.BARCODE_CART_ITEMS, cart.getProducts()); - - return new ActionForward("/initProductBarcodeCart.do"); - } - - public static final String RELOAD_BARCODE_CART = "reloadBarcodeCart"; - public ActionForward reloadBarcodeCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException, ApplicationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - OrderLineBean bean = (OrderLineBean) df.getBean(); - - String barcodeCart = Constants.BARCODE_CART; - String barcodeCartItems = Constants.BARCODE_CART_ITEMS; - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(barcodeCart); - ArrayList itemBeans= cartBean.getItems(); - - String priceListIdAsStr = request.getParameter("priceListId"); - String productIdAsStr = request.getParameter("productId"); - int productId = Integer.parseInt(productIdAsStr); - int priceListId = Integer.parseInt(priceListIdAsStr); - - BigDecimal qty = BigDecimal.ZERO; - - for(int i=0; iblackListedList = BlackListedManager.getAllBlackListed(ctx); - request.getSession().setAttribute(Constants.BLACKLISTED_LISTS , blackListedList); - return mapping.findForward(GET_ALL_BLACKLISTED); - } - - public static final String INIT_SEARCH_CHEQUE="initSearchCheque"; - public ActionForward initSearchCheque(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ArrayList Blacklist = new ArrayList(); - request.getSession().setAttribute(Constants.BLACKLISTED_LISTS, Blacklist); - - return mapping.findForward(INIT_SEARCH_CHEQUE); - } - - public static final String SEARCH_CHEQUE="searchCheque"; - public ActionForward searchCheque(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm)form; - - //BlackListedBean bean = (BlackListedBean)df.getBean(); - - ArrayList Blacklist = BlackListedManager.searchChequeNo(ctx, df.getChequeNo()); - - request.getSession().setAttribute(Constants.BLACKLISTED_LISTS, Blacklist); - - return mapping.findForward(SEARCH_CHEQUE); - - } - - public static final String INIT_EDIT_CHEQUE="initEditCheque"; - public ActionForward initEditCheque(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - - BlackListForm f = (BlackListForm) form; - f.validate(mapping,request); - - BlackListedBean bean = (BlackListedBean) f.getBean(); - Integer blacklistedID = bean.getBlackListedId(); - - if(blacklistedID==null) - { - throw new OperationException("Cannot edit Cheques. Cause BlacklistedID id cannot be null!"); - } - - bean= BlackListedManager.getBlackListedDetails(ctx, blacklistedID); - f.populate(bean); - - return mapping.findForward(INIT_EDIT_CHEQUE); - } - - - public static final String EDIT_CHEQUE = "editCheque"; - public ActionForward editCheque(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - BlackListForm f = (BlackListForm) form; - BlackListedBean bean=(BlackListedBean)f.getBean(); - - Integer blacklistedID = bean.getBlackListedId(); - if(blacklistedID==null) - { - throw new OperationException("Cannot load Cheque details. Cause BlacklistedId cannot be null!"); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - trx.start(); - - try - { - BlackListedManager.editBlackListed(ctx, bean, trx.getTrxName()); - trx.commit(); - } - catch(OperationException ex) - { - trx.rollback(); - throw ex; - } - finally - { - trx.close(); - } - request.getSession().setAttribute(Constants.BLACKLISTED_DETAILS,bean); - return mapping.findForward(EDIT_CHEQUE); - } - - - public static final String DEACTIVATE_CHEQUE = "deactivateCheque"; - public ActionForward deactivateCheque(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - BlackListForm f=(BlackListForm)form; - f.validate(mapping,request); - - BlackListedBean bean=(BlackListedBean)f.getBean(); - Integer blackListedId = bean.getBlackListedId(); - - if(blackListedId==null) - { - throw new OperationException("Cannot deactivate Blacklisted Cheques. Cause BlackListed id cannot be null!"); - } - - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - try - { - trx.start(); - BlackListedManager.deactivateBListedCheque(ctx, blackListedId.intValue(), trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.deactivate.customer", request); - mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return mapping.findForward(DEACTIVATE_CHEQUE); - } - - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/BpartnerInfoAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/BpartnerInfoAction.java deleted file mode 100644 index 753a9ea75a..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/BpartnerInfoAction.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Jul 26, 2006 - */ - - -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.Constants; -import org.posterita.beans.BPartnerInfoBean; -import org.posterita.businesslogic.MenuManager; -import org.posterita.businesslogic.POSBpartnerInfoManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.factory.POSMenuFactory; -import org.posterita.struts.core.DefaultForm; - - -public class BpartnerInfoAction extends POSDispatchAction -{ - public static final String GET_BPARTNER_INFO = "getBpartnerInfo"; - public ActionForward getBpartnerInfo(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - BPartnerInfoBean bean=(BPartnerInfoBean) df.getBean(); - - ArrayList list = POSBpartnerInfoManager.getPartnerInfo(ctx,bean.getPartnerName(),bean.getIsCustomer()); - - request.getSession().setAttribute(Constants.BUSINESSPARTNER,list); - request.getSession().removeAttribute(Constants.DEBTORS); - - return mapping.findForward(GET_BPARTNER_INFO); - } - - - public static final String GET_BPARTNER_TRX_DETAILS = "getBpartnerTrxDetails"; - public ActionForward getBpartnerTrxDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - BPartnerInfoBean bean=(BPartnerInfoBean) df.getBean(); - - boolean access=MenuManager.getRoleMenuAccess(ctx,POSMenuFactory.SMENU_VIEW_BPINFO); - if(access==false) - { - postGlobalError("error.access.not.allowed",request); - return new ActionForward(bean.getForward()); - } - - ArrayList list = POSBpartnerInfoManager.getbPartnerTrxDetails(ctx,bean.getBpartnerId(),bean.getIsCustomer()); - ArrayList orderList=POSBpartnerInfoManager.getBpartnerOrderHistory(ctx,bean.getBpartnerId()); - ArrayList infoList = POSBpartnerInfoManager.getPartnerInfo(ctx,bean.getBpartnerId(),bean.getIsCustomer()); - - request.getSession().setAttribute(Constants.BUSINESSPARTNERINFO,infoList); - request.getSession().setAttribute(Constants.BUSINESSPARTNER_TRX_DETAILS,list); - request.getSession().setAttribute(Constants.BUSINESSPARTNER_ORDER_DETAILS,orderList); - - return mapping.findForward(GET_BPARTNER_TRX_DETAILS); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CashAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CashAction.java deleted file mode 100644 index 92c61fa298..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/CashAction.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Sep 11, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.struts.pos; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MAttachment; -import org.compiere.model.MCash; -import org.posterita.Constants; -import org.posterita.beans.CashBean; -import org.posterita.beans.CashBookBean; -import org.posterita.beans.CashLineBean; -import org.posterita.beans.CashSummaryBean; -import org.posterita.beans.CloseTillBean; -import org.posterita.beans.DateFilterBean; -import org.posterita.beans.POSHistoryBean; -import org.posterita.businesslogic.CashManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.performanceanalysis.POSReportManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.form.POSHistoryForm; -import org.posterita.struts.core.DefaultForm; - -public class CashAction extends POSDispatchAction -{ - - public static final String INIT_GET_CASH_DETAILS_HISTORY = "initGetCashDetailsHistory"; - public ActionForward initGetCashDetailsHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - POSHistoryForm historyForm = new POSHistoryForm(); - POSHistoryBean bean = (POSHistoryBean)historyForm.getBean(); - - int cashBookId = POSTerminalManager.getCashBookId(ctx); - bean.setCashBookId(cashBookId); - - getCashDetailsHistory(mapping, historyForm, request, response); - ArrayList cashBooks = CashManager.getCashBooks(ctx, null); - - request.getSession().setAttribute(Constants.ACCESSIBLE_CASHBOOKS, cashBooks); - - return mapping.findForward(INIT_GET_CASH_DETAILS_HISTORY); - } - - public static final String GET_CASH_DETAILS_HISTORY = "getCashDetailsHistory"; - public ActionForward getCashDetailsHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df = (DefaultForm)form; - - Properties ctx = TmkJSPEnv.getCtx(request); - - POSHistoryBean historyBean = (POSHistoryBean)df.getBean(); - - ArrayList cashList = CashManager.getCashDetails(ctx, historyBean.getCashBookId(), historyBean.getMonth(), historyBean.getYear(), null); - - request.getSession().setAttribute(Constants.CASH_DETAILS, cashList); - - return mapping.findForward(GET_CASH_DETAILS_HISTORY); - } - - public static final String GET_CASHLINE_DETAILS = "getCashLineDetails"; - public ActionForward getCashLineDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df = (DefaultForm)form; - - Properties ctx = TmkJSPEnv.getCtx(request); - - CashBean cashBean = (CashBean)df.getBean(); - - CashSummaryBean cashSummaryBean = CashManager.getCashSummary(ctx, cashBean.getCashId(), null); - ArrayList cashLineList = CashManager.getCashLineHistory(ctx, cashBean.getCashId(), null); - - int cash_id = cashBean.getCashId(); - MAttachment attachment = MAttachment.get(ctx, MCash.Table_ID, cash_id); - CloseTillBean closeTillBean = null; - if(attachment != null) - { - try - { - byte[] data = attachment.getEntryData(0); - if(data != null) - { - ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data)); - Object obj = ois.readObject(); - closeTillBean = (CloseTillBean) obj; - } - } - catch (IOException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (ClassNotFoundException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - if(closeTillBean != null) - { - String printData = POSReportManager.endOfTheDayHTMLReport(ctx, closeTillBean); - request.setAttribute(Constants.CLOSE_TILL_PRINT_DATA, printData); - } - - request.setAttribute(Constants.CASH_LINE_DETAILS, cashLineList); - request.setAttribute(Constants.CASH_SUMMARY, cashSummaryBean); - - return mapping.findForward(GET_CASHLINE_DETAILS); - } - - public static final String GET_CASH_SUMMARY_BY_DATE = "getCashSummaryByDate"; - public ActionForward getCashSummaryByDate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df = (DefaultForm)form; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DateFilterBean dateBean = (DateFilterBean)df.getBean(); - - CashSummaryBean cashSummaryBean = CashManager.getCashSummary(ctx, dateBean.getFromDate(), dateBean.getToDate(), null); - - ArrayList cashLineList = CashManager.getCashLineHistory(ctx, dateBean.getFromDate(), dateBean.getToDate(), null); - - request.setAttribute(Constants.CASH_LINE_DETAILS, cashLineList); - request.setAttribute(Constants.CASH_SUMMARY, cashSummaryBean); - - return mapping.findForward(GET_CASH_SUMMARY_BY_DATE); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CashBookAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CashBookAction.java deleted file mode 100644 index 8f3c8eeb30..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/CashBookAction.java +++ /dev/null @@ -1,648 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 22-Mar-2006 - */ - - -package org.posterita.struts.pos; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.io.OutputStream; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; -import java.util.logging.Level; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MAttachment; -import org.compiere.model.MCash; -import org.compiere.model.MCashBook; -import org.compiere.model.MCashLine; -import org.compiere.model.MCurrency; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.CashBookBean; -import org.posterita.beans.CashBookDetailBean; -import org.posterita.beans.CloseTillBean; -import org.posterita.beans.CurrentTillAmountBean; -import org.posterita.beans.UDIBean; -import org.posterita.businesslogic.CashManager; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.PrintManager; -import org.posterita.businesslogic.core.AccountingManager; -import org.posterita.businesslogic.performanceanalysis.POSReportManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.CanNotAjdustTillException; -import org.posterita.exceptions.CanNotCloseTillException; -import org.posterita.exceptions.CashBookAlreadyAssignedException; -import org.posterita.exceptions.NoCashJournalPresentException; -import org.posterita.exceptions.NullTransferAmountException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.TerminalLockedException; -import org.posterita.exceptions.TransferAmountExceedsTotalAmountException; -import org.posterita.form.CashBookForm; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; -import org.posterita.util.PoManager; -import org.posterita.util.TmkPrinterConstants; - - -public class CashBookAction extends BaseDispatchAction -{ - /** Logger */ - private static final CLogger logger = CLogger.getCLogger(CashBookAction.class); - - public static final String GET_CASH_BOOK_DETAILS="getCashBookDetails"; - public ActionForward getCashBookDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - CashBookDetailBean bean = CashManager.getCashBookDetails(ctx, null); - - // Keeping compatibility with view - ArrayList list = new ArrayList(); - list.add(bean); - - request.getSession().setAttribute(Constants.CASH_BOOK, list); - - return mapping.findForward(GET_CASH_BOOK_DETAILS); - } - - - - public static final String ADJUST_CASH_BOOK_ACTION="adjustCashBookAction"; - public ActionForward adjustCashBookAction(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df = (DefaultForm)form; - CashBookDetailBean bean = (CashBookDetailBean)df.getBean(); - Properties ctx = TmkJSPEnv.getCtx(request); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - MCashLine cashLine = null; - - try - { - trx.start(); - cashLine = CashManager.adjustCashBook(ctx, bean, trx.getTrxName()); - trx.commit(); - } - catch(NullTransferAmountException e) - { - postGlobalError("error.no.transfer.amount",request); - return mapping.getInputForward(); - } - - catch(TransferAmountExceedsTotalAmountException e) - { - postGlobalError("error.transferAmt.exceeds.endingBalance",request); - return mapping.getInputForward(); - } - catch(CanNotAjdustTillException e) - { - postGlobalError("error.cannot.adjust.till",request); - return mapping.getInputForward(); - } - catch(NumberFormatException e) - { - postGlobalError("error.invalid.number",request); - return mapping.getInputForward(); - } - finally - { - trx.rollback(); - trx.close(); - } - - // Keeping compatibility with view - ArrayList list = new ArrayList(); - list.add(bean); - - // Printing - if (cashLine != null) - { - PrintManager.printAdjustCashbookReport(ctx, cashLine); - } - - request.getSession().setAttribute(Constants.CASH_BOOK,list); - - return mapping.findForward(ADJUST_CASH_BOOK_ACTION); - } - - public static final String INIT_CLOSE_TILL="initCloseTill"; - public ActionForward initCloseTill(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - - CurrentTillAmountBean tillBean = POSManager.getCurrentTillAmount(ctx); - request.setAttribute(Constants.CURRENT_TILL_AMOUNT_POS,tillBean); - MCurrency currency = POSTerminalManager.getCurrencyOfTerminalCashBook(ctx); - request.setAttribute(Constants.CURRENCY_SYMBOLE,currency.getCurSymbol()); - return mapping.findForward(INIT_CLOSE_TILL); - - } - - public static final String CLOSE_TILL="closeTill"; - public ActionForward closeTill(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, SQLException, IOException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df = (DefaultForm)form; - CashBookDetailBean bean =(CashBookDetailBean)df.getBean(); - - Properties ctx = TmkJSPEnv.getCtx(request); - CurrentTillAmountBean tillBean=null; - - tillBean = POSManager.getCurrentTillAmount(ctx); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - bean = CashManager.CloseTill(ctx, bean, trx.getTrxName()); - trx.commit(); - } - catch (NoCashJournalPresentException exception) - { - trx.rollback(); - postGlobalError("error.no.cashjournal.present",request); - return mapping.getInputForward(); - } - catch(NullTransferAmountException e) - { - trx.rollback(); - postGlobalError("error.no.transfer.amount",request); - return mapping.getInputForward(); - } - catch(CanNotCloseTillException e) - { - trx.rollback(); - postGlobalError("error.till.already.close",request); - return mapping.getInputForward(); - } - catch (TerminalLockedException exception) - { - trx.rollback(); - postGlobalError("error.terminal.locked", request); - } - catch(NumberFormatException e) - { - trx.rollback(); - postGlobalError("error.invalid.number",request); - return mapping.getInputForward(); - } - catch(OperationException e) - { - trx.rollback(); - throw e; - } - finally - { - trx.close(); - } - - String currency = POSTerminalManager.getDefaultSalesCurrency(ctx) - .getCurSymbol(); - - CloseTillBean closeTillBean = new CloseTillBean(); - closeTillBean.setTillName(tillBean.getPosName()); - closeTillBean.setCurrency(currency); - closeTillBean.setBeginningBalance(bean.getBeginingBalance()); - closeTillBean.setNetCashTrx(bean.getStatementDifference()); - closeTillBean.setBalanceEntered(bean.getTransferAmount()); - closeTillBean.setDifference(bean.getDifferenceAmt()); - closeTillBean.setEndingBalance(bean.getEndingBalance()); - closeTillBean.setCashTotal(tillBean.getCashTotal()); - closeTillBean.setCardTotal(tillBean.getCardTotal()); - closeTillBean.setChequeTotal(tillBean.getChequeTotal()); - closeTillBean.setGrandTotal(tillBean.getTillGrandTotal()); - closeTillBean.setCardAmtEntered(bean.getCardTotal()); - closeTillBean.setCardDifference(bean.getCardDifference()); - closeTillBean.setChequeAmtEntered(bean.getChequeTotal()); - closeTillBean.setChequeDifference(bean.getChequeDifference()); - - //save the CloseTillBean as attachment - int cash_id = bean.getCash_id(); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(bos); - oos.writeObject(closeTillBean); - byte[] attachmentData = bos.toByteArray(); - MAttachment attachment = new MAttachment(ctx,MCash.Table_ID,cash_id,null); - attachment.addEntry("Close Till Data", attachmentData); - PoManager.save(attachment); - - String reportName = POSReportManager.endOfTheDayPDF(ctx,closeTillBean); //generates report - String reportURI = ReportManager.getReportURI(reportName,request); //resolves report path - - request.getSession().setAttribute(Constants.END_OF_THE_DAY_DETAILS,closeTillBean); //session as being used for printing - request.setAttribute(Constants.REPORT_URL,reportURI); - - return mapping.findForward(CLOSE_TILL); - } - - public static final String OPEN_CASH_DRAWER="openCashDrawer"; - - public ActionForward openCashDrawer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - PrintManager.openCashDrawer(ctx); - - return null; - - } - - //--------------------------------------------------------------- - public ActionForward getClosedTillData(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - CloseTillBean bean = (CloseTillBean)request.getSession().getAttribute(Constants.END_OF_THE_DAY_DETAILS); - - if (bean == null) - { - throw new OperationException("Till amount details not available"); - } - - request.getSession().setAttribute(Constants.END_OF_THE_DAY_DETAILS, null); // remove end of day details - - String printingType = POSManager.getPrintingTypeFromCookie(request); - - if (printingType == null) - { - printingType = TmkPrinterConstants.SLIP_PRINTER_9PIN; - } - - if (TmkPrinterConstants.NORMAL_PRINTER.equalsIgnoreCase(printingType)) - { - String reportName = POSReportManager.endOfTheDayPDF(ctx,bean); //generates report - response.setContentType("application/pdf"); - ReportManager.writeReport(reportName, response); - return null; - } - else if (TmkPrinterConstants.SLIP_PRINTER_THERMAL.equals(printingType) - || TmkPrinterConstants.SLIP_PRINTER_9PIN.equals(printingType)) - { - int length = TmkPrinterConstants.PRINTER_9PIN_WIDTH; - if (TmkPrinterConstants.SLIP_PRINTER_THERMAL.equals(printingType)) - { - length = TmkPrinterConstants.PRINTER_SLIP_WIDTH; - } - - String printData = ""; - try - { - //Timestamp ts = new Timestamp(System.currentTimeMillis()); - String data = POSReportManager.endOfTheDayReport(ctx,bean); - // int terminalId = POSTerminalManager.getTerminalId(ctx); - // String salesData = POSReportManager.getDailySalesReport(ctx, ts, terminalId, length, null); - // printData = data + salesData; - printData = data; - } - catch (Exception ex) - { - printData = "Could not get data for the report"; - } - - try - { - response.setContentType("application/octet-stream"); - OutputStream os = response.getOutputStream(); - os.write(printData.getBytes()); - os.flush(); - os.close(); - } - catch (Exception ex) - { - logger.log(Level.SEVERE, "Failed to write to response", ex); - throw new OperationException(ex); - } - } - else - { - logger.log(Level.SEVERE, "Printing Type not defined, PrintingType: " + printingType); - return null; - } - return null; - } - - - //----------------- - - private void populateData(HttpServletRequest request, String trxName) - { - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList accessibleOrgs = OrganisationManager.getUserOrgPairs(ctx, false); - request.getSession().setAttribute(Constants.ACCESSIBLE_ORGS, accessibleOrgs); - } - - public static final String INIT_SEARCH_CASHBOOK = "initSearchCashBook"; - public ActionForward initSearchCashBook(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - request.getSession().setAttribute(Constants.CASHBOOKS, null); - - return mapping.findForward(INIT_SEARCH_CASHBOOK); - } - - - public static final String SEARCH_CASHBOOK = "searchCashBook"; - public ActionForward searchCashBook(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - UDIBean bean = (UDIBean)df.getBean(); - - String searchText = bean.getSearchText(); - - ArrayList cashbookList = CashManager.getCashBooks(ctx, searchText, null); - - request.getSession().setAttribute(Constants.CASHBOOKS, cashbookList); - - return mapping.findForward(SEARCH_CASHBOOK); - } - - public static final String VIEW_CASHBOOK = "viewCashBook"; - public ActionForward viewCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - CashBookForm cashBookForm = (CashBookForm)form; - CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); - - populateData(request, null); - - cashBookBean = CashManager.getCashBook(ctx, cashBookBean.getCashBookId(), null); - - cashBookForm.populate(cashBookBean); - cashBookForm.setAction(VIEW_CASHBOOK); - cashBookForm.setReadOnly(true); - - return mapping.findForward(VIEW_CASHBOOK); - } - - public static final String INIT_CREATE_CASHBOOK = "initCreateCashBook"; - public ActionForward initCreateCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - - int defaultCurrencyId = AccountingManager.getCurrencyId(ctx, Env.getAD_Client_ID(ctx), null); - - CashBookBean cashBookBean = new CashBookBean(); - cashBookBean.setCurrencyId(defaultCurrencyId); - cashBookBean.setIsDefault(false); - cashBookBean.setIsActive(true); - - int orgId = Env.getAD_Org_ID(ctx); - - populateData(request, null); - cashBookBean.setOrgId(orgId); - df.populate(cashBookBean); - df.setAction(CREATE_CASHBOOK); - df.setReadOnly(false); - - return mapping.findForward(INIT_CREATE_CASHBOOK); - } - - public static final String CREATE_CASHBOOK = "createCashBook"; - public ActionForward createCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - CashBookForm cashBookForm = (CashBookForm)form; - CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); - - Trx trx = Trx.get(Trx.createTrxName(), true); - trx.start(); - - try - { - if (cashBookBean.getCurrencyId() == null || cashBookBean.getCurrencyId() == 0) - { - // Needed till the ability to chose currency when creating a cash book is not enabled. - // This is the case for the moment since there is no way to define conversion rates - int defaultCurrencyId = AccountingManager.getCurrencyId(ctx, Env.getAD_Client_ID(ctx), null); - cashBookBean.setCurrencyId(defaultCurrencyId); - } - - MCashBook cashBook = CashManager.createUpdateCashBook(ctx, cashBookBean, trx.getTrxName()); - cashBookBean.setCashBookId(cashBook.get_ID()); - trx.commit(); - } - catch (CashBookAlreadyAssignedException cashBookAlreadyAssignedException) - { - postGlobalError("error.deactivate.cashbook", request); - return mapping.getInputForward(); - } - catch (Exception ex) - { - postGlobalError("error.operation", request); - return mapping.getInputForward(); - } - finally - { - trx.rollback(); - trx.close(); - } - - cashBookForm.populate(cashBookBean); - viewCashBook(mapping, form, request, response); - - return mapping.findForward(CREATE_CASHBOOK); - } - - public static final String EDIT_CASHBOOK = "editCashBook"; - public ActionForward editCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - CashBookForm cashBookForm = (CashBookForm)form; - CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); - - populateData(request, null); - cashBookBean = CashManager.getCashBook(ctx, cashBookBean.getCashBookId(), null); - cashBookForm.populate(cashBookBean); - cashBookForm.setAction(SAVE_CASHBOOK); - cashBookForm.setReadOnly(false); - return mapping.findForward(EDIT_CASHBOOK); - } - - public static final String SAVE_CASHBOOK = "saveCashBook"; - public ActionForward saveCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - return createCashBook(mapping, form, request, response); - } - - public static final String COPY_CASHBOOK = "copyCashBook"; - public ActionForward copyCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - CashBookForm cashBookForm = (CashBookForm)form; - CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); - - populateData(request, null); - - cashBookBean = CashManager.getCashBook(ctx, cashBookBean.getCashBookId(), null); - cashBookBean.setCashBookId(0); - - cashBookForm.populate(cashBookBean); - cashBookForm.setAction(SAVE_CASHBOOK); - cashBookForm.setReadOnly(false); - - return mapping.findForward(COPY_CASHBOOK); - } - - - public static final String ACTIVATE_CASHBOOK = "activateCashBook"; - public ActionForward activateCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - CashBookForm cashBookForm = (CashBookForm)form; - CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); - - Trx trx = Trx.get(Trx.createTrxName(), true); - trx.start(); - - try - { - CashManager.updateCashBookStatus(ctx, cashBookBean.getCashBookId(), true, trx.getTrxName()); - trx.commit(); - } - catch (Exception ex) - { - postGlobalError("error.operation", request); - } - finally - { - trx.rollback(); - trx.close(); - } - - searchCashBook(mapping, form, request, response); - - return mapping.findForward(SEARCH_CASHBOOK); - } - - - public static final String DEACTIVATE_CASHBOOK = "deactivateCashBook"; - public ActionForward deactivateCashBook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - CashBookForm cashBookForm = (CashBookForm)form; - CashBookBean cashBookBean = (CashBookBean)cashBookForm.getBean(); - - Trx trx = Trx.get(Trx.createTrxName(), true); - trx.start(); - - try - { - CashManager.updateCashBookStatus(ctx, cashBookBean.getCashBookId(), false, trx.getTrxName()); - trx.commit(); - } - catch (CashBookAlreadyAssignedException cashBookAlreadyAssignedException) - { - postGlobalError("error.deactivate.cashbook", request); - } - catch (Exception ex) - { - postGlobalError("error.operation", request); - } - finally - { - trx.rollback(); - trx.close(); - } - - searchCashBook(mapping, form, request, response); - - return mapping.findForward(SEARCH_CASHBOOK); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CommissionAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CommissionAction.java deleted file mode 100644 index 80b0f8d5de..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/CommissionAction.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 7, 2006 - */ - - -package org.posterita.struts.pos; - -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MCurrency; -import org.posterita.Constants; -import org.posterita.beans.CommissionBean; -import org.posterita.beans.ReportBean; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.administration.CommissionManager; -import org.posterita.businesslogic.performanceanalysis.ReportDateManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.DefaultForm; - - -public class CommissionAction extends POSDispatchAction -{ - - public static final String GENERATE_COMMISSION="generateCommission"; - public ActionForward generateCommission(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - ReportBean bean = (ReportBean) df.getBean(); - MCurrency currency = POSTerminalManager.getCurrencyOfTerminalCashBook(ctx); - request.setAttribute(Constants.CURRENCY_SYMBOLE,currency.getCurSymbol()); - - Timestamp fromdate = ReportDateManager.getFromDate(bean); - CommissionManager.generateCommission(ctx,fromdate); - ArrayList list=CommissionManager.getCommissionAmt(ctx); - String reportName = CommissionManager.getCommissionAmtAsCSV(ctx, list); - String reportURI = ReportManager.getReportURI(reportName, request); - - request.getSession().setAttribute(Constants.COMMISSION_AMT,list); - request.getSession().setAttribute(Constants.REPORT_URL, reportURI); - - return mapping.findForward(GENERATE_COMMISSION); - } - - public static final String VIEW_COMMISSION="viewCommission"; - public ActionForward viewCommission(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - ArrayList list=CommissionManager.getCommissionAmt(ctx); - String reportName = CommissionManager.getCommissionAmtAsCSV(ctx, list); - String reportURI = ReportManager.getReportURI(reportName, request); - - request.getSession().setAttribute(Constants.COMMISSION_AMT,list); - request.getSession().setAttribute(Constants.REPORT_URL, reportURI); - - return mapping.findForward(VIEW_COMMISSION); - } - - - public static final String VIEW_COMMISSION_DETAILS="viewCommissionDetails"; - public ActionForward viewCommissionDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - CommissionBean bean = (CommissionBean) df.getBean(); - - ArrayList list=CommissionManager.getCommissionDetails(ctx,bean.getCommissionAmtId()); - request.getSession().setAttribute(Constants.COMMISSION_AMT_DETAILS,list); - - return mapping.findForward(VIEW_COMMISSION_DETAILS); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CreditOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CreditOrderAction.java deleted file mode 100644 index f10d7857e2..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/CreditOrderAction.java +++ /dev/null @@ -1,791 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 13, 2006 - */ - - -package org.posterita.struts.pos; - -import java.io.IOException; -import java.io.PrintWriter; -import java.math.BigDecimal; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MCurrency; -import org.compiere.model.MInOut; -import org.compiere.model.MOrder; -import org.compiere.model.MPayment; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.compiere.util.WebUser; -import org.posterita.Constants; -import org.posterita.beans.AgingBean; -import org.posterita.beans.BPartnerInfoBean; -import org.posterita.beans.DocumentHistoryBean; -import org.posterita.beans.LoginBean; -import org.posterita.beans.OpenItemBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.PaymentAllocationBean; -import org.posterita.beans.PaymentTypeBean; -import org.posterita.beans.ShoppingCartBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.businesslogic.LoginManager; -import org.posterita.businesslogic.MenuManager; -import org.posterita.businesslogic.OrderManager; -import org.posterita.businesslogic.OrderReferenceManager; -import org.posterita.businesslogic.POSBpartnerInfoManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.PaymentAllocationManager; -import org.posterita.businesslogic.PaymentManager; -import org.posterita.businesslogic.PaymentTermManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.businesslogic.administration.RoleManager; -import org.posterita.businesslogic.creditsales.CreditOrderManager; -import org.posterita.core.SessionStorage; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.BPartnerNotFoundException; -import org.posterita.exceptions.BPartnerOverCreditLimitException; -import org.posterita.exceptions.CanNotCreatePaymentAllocationException; -import org.posterita.exceptions.DiscountLimitException; -import org.posterita.exceptions.DuplicatePINException; -import org.posterita.exceptions.InsufficientQtyException; -import org.posterita.exceptions.InvalidAddressException; -import org.posterita.exceptions.InvalidPINException; -import org.posterita.exceptions.LimitPriceViolatedException; -import org.posterita.exceptions.MandatoryException; -import org.posterita.exceptions.NoAllocateeInvoiceException; -import org.posterita.exceptions.NoPaymentAmountException; -import org.posterita.exceptions.NotLoggedInException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.TooManyAllocateInvoiceException; -import org.posterita.exceptions.UserInactiveException; -import org.posterita.exceptions.UserNotFoundException; -import org.posterita.factory.POSMenuFactory; -import org.posterita.form.DocumentHistoryForm; -import org.posterita.form.OpenItemForm; -import org.posterita.struts.core.DefaultForm; - - -public class CreditOrderAction extends POSDispatchAction -{ - - - public static final String GET_BPARTNER_PAYMENT_STATUS="getBpartnerPaymentStatus"; - public ActionForward getBpartnerPaymentStatus(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OpenItemBean bean=(OpenItemBean) df.getBean(); - boolean access=MenuManager.getRoleMenuAccess(ctx,POSMenuFactory.SMENU_SETTLE_PAYMENT_ID); - if(access==false) - { - postGlobalError("error.access.not.allowed",request); - return new ActionForward(bean.getForward()); - } - - ArrayList openItemList = null; - ArrayList agingList = null; - ArrayList paymentList = null; - try - { - openItemList=CreditOrderManager.getOpenItems(ctx,bean.getBpartnerId()); - agingList = CreditOrderManager.getAging(ctx,bean.getBpartnerId()); - paymentList = CreditOrderManager.getUnallocatedPayments(ctx,bean.getBpartnerId()); - - } - catch(BPartnerNotFoundException e) - { - postGlobalError("error.customer.not.exists",request); - return mapping.getInputForward(); - } - - - request.getSession().setAttribute(Constants.OPEN_ITEMS,openItemList); - request.getSession().setAttribute(Constants.AGING_ITEMS,agingList); - request.getSession().setAttribute(Constants.UNALLOCATED_PAYMENTS,paymentList); - return mapping.findForward(GET_BPARTNER_PAYMENT_STATUS); - } - - - public static final String MATCH_INVOICE = "matchInvoice"; - public ActionForward matchInvoice(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OpenItemBean bean=(OpenItemBean) df.getBean(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - try - { - trx.start(); - PaymentAllocationManager.allocate(ctx,bean.getInvoiceIds(),bean.getPaymentIds(),trx.getTrxName()); - trx.commit(); - } - - catch(TooManyAllocateInvoiceException e) - { - trx.rollback(); - postGlobalError("error.too.many.invoice",request); - return mapping.getInputForward(); - } - catch(CanNotCreatePaymentAllocationException e1) - { - trx.rollback(); - postGlobalError("error.allocation.amt.exceeds.openamt",request); - return mapping.getInputForward(); - } - catch(NoAllocateeInvoiceException e2) - { - trx.rollback(); - postGlobalError("error.no.invoice.to.allocate",request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - ArrayList openItemList=CreditOrderManager.getOpenItems(ctx,bean.getBpartnerId()); - ArrayList agingList = CreditOrderManager.getAging(ctx,bean.getBpartnerId()); - ArrayList paymentList = CreditOrderManager.getUnallocatedPayments(ctx,bean.getBpartnerId()); - - request.getSession().setAttribute(Constants.UNALLOCATED_PAYMENTS,paymentList); - request.getSession().setAttribute(Constants.OPEN_ITEMS,openItemList); - request.getSession().setAttribute(Constants.AGING_ITEMS,agingList); - - df.setInvoiceIds(null); - df.setPaymentIds(null); - - return mapping.findForward(MATCH_INVOICE); - } - - - public static final String INIT_GET_BPARTNER_PAYMENT_STATUS = "initGetBpartnerPaymentStatus"; - public ActionForward initGetBpartnerPaymentStatus(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - //DefaultForm df= (DefaultForm) form; - ArrayList list = POSBpartnerInfoManager.getPartnerInfo(ctx,true); - request.getSession().removeAttribute(Constants.UNALLOCATED_PAYMENTS); - request.getSession().removeAttribute(Constants.OPEN_ITEMS); - request.getSession().removeAttribute(Constants.AGING_ITEMS); - request.getSession().setAttribute(Constants.BUSINESSPARTNER,list); - return mapping.findForward(INIT_GET_BPARTNER_PAYMENT_STATUS); - } - - - public static final String INIT_CREATE_PAYMENT = "initCreatePayment"; - public ActionForward initCreatePayment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - // Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OpenItemBean bean=(OpenItemBean) df.getBean(); - request.getSession().setAttribute(Constants.CREDIT_INVOICE_INFO,bean); - return mapping.findForward(INIT_CREATE_PAYMENT); - } - - public static final String CREATE_PAYMENT = "createPayment"; - public ActionForward createPayment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OpenItemBean bean=(OpenItemBean) df.getBean(); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - PaymentTypeBean pBean =null; - - HashMap map = new HashMap(); - map.put("Cash",MPayment.TENDERTYPE_Cash); - map.put("Card",MPayment.TENDERTYPE_CreditCard); - map.put("Cheque",MPayment.TENDERTYPE_Check); - - bean.setTenderType(map.get(bean.getTrxType())); - - try - { - trx.start(); - - pBean = CreditOrderManager.createPayment(ctx,bean,trx.getTrxName()); - - MCurrency currency = POSTerminalManager.getCurrencyOfTerminalCashBook(ctx); - request.setAttribute(Constants.CURRENCY_SYMBOLE,currency.getCurSymbol()); - - trx.commit(); - if(!pBean.getPaymentType().equalsIgnoreCase("cash")) - { - MPayment payment = new MPayment(ctx,pBean.getId(),null); - PaymentManager.completePayment(ctx,payment); - request.getSession().removeAttribute(Constants.OPEN_ITEMS); - request.getSession().removeAttribute(Constants.AGING_ITEMS); - trx.close(); - return new ActionForward("/ViewWebstorePaymentAction.do?action=viewOrder&documentId="+payment.get_ID()); - } - } - catch(NoPaymentAmountException ex) - { - trx.rollback(); - postGlobalError("error.paymentamount.mandatory",request); - return mapping.getInputForward(); - } - catch(OperationException e) - { - trx.rollback(); - } - finally - { - trx.close(); - } - - request.getSession().removeAttribute(Constants.OPEN_ITEMS); - request.getSession().removeAttribute(Constants.AGING_ITEMS); - - - return new ActionForward("/ViewWebstoreCashPaymentAction.do?action=viewOrder&documentId="+pBean.getId()); - //return mapping.findForward(CREATE_PAYMENT); - } - - - public static final String GET_PAYMENT_DETAILS_FOR_INVOICE = "getPaymentDetailsForInvoice"; - public ActionForward getPaymentDetailsForInvoice(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OpenItemBean bean=(OpenItemBean) df.getBean(); - ArrayList cashPaymentList = CreditOrderManager.getAllCashPaymentForInvoice(ctx,bean.getInvoiceId()); - ArrayList cardChqPaymentList=CreditOrderManager.getAllPaymentForInvoice(ctx,bean.getInvoiceId()); - request.getSession().setAttribute(Constants.CASH_PAYMENT_LIST,cashPaymentList); - request.getSession().setAttribute(Constants.CARD_CHQ_PAYMENT_LIST,cardChqPaymentList); - request.getSession().setAttribute(Constants.INVOICE_GRAND_TOTAL,bean.getPaidAmt()); - return mapping.findForward(GET_PAYMENT_DETAILS_FOR_INVOICE); - } - - - - - public static final String GET_CRDITORDER_DISC_DETAILS="getCreditOrderDiscDetails"; - public ActionForward getCreditOrderDiscDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - Properties ctx=TmkJSPEnv.getCtx(request); - Integer bPartnerId = bean.getBpartnerId(); - MOrder order=null; - String toBeShipped=bean.getToBeShipped(); - if(toBeShipped==null) - { - toBeShipped=(String)request.getSession().getAttribute(Constants.TO_BE_SHIPPED); - bean.setToBeShipped(toBeShipped); - } - if(toBeShipped==null) - { - toBeShipped="true"; - } - - if(bPartnerId==null) - { - postGlobalError("error.required.bpartnerId",request); - return mapping.getInputForward(); - } - if(BPartnerManager.isBPartnerPresent(ctx,bPartnerId,null) == false) - { - postGlobalError("error.customer.not.exists",request); - return mapping.getInputForward(); - } - - if(bean.getOrderId()!=null) - { - order = new MOrder(ctx, bean.getOrderId(), null); - } - - df.populate(new OrderLineBean()); - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.CREDIT_ORDER_SHOPPING_CART); - if(cartBean==null) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - request.getSession().setAttribute(Constants.CREDIT_ORDER_SHOPPING_CART, cartBean); - request.getSession().setAttribute(Constants.PRESENT_CREDIT_ORDER,order); - request.getSession().setAttribute(Constants.CREDITORDER_BPARTNER,bPartnerId); - request.getSession().setAttribute(Constants.TO_BE_SHIPPED,bean.getToBeShipped()); - request.getSession().setAttribute(Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS, cartBean.getItems()); - return mapping.findForward(GET_CRDITORDER_DISC_DETAILS); - } - - public static final String CREATE_CREDIT_ORDER="createCreditOrder"; - public ActionForward createCreditOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); - - if(cartBean==null ||cartBean.getItems() == null||cartBean.getItems().size()==0) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - - String toBeShipped=bean.getToBeShipped(); - if(toBeShipped==null) - { - toBeShipped=(String)request.getSession().getAttribute(Constants.TO_BE_SHIPPED); - bean.setToBeShipped(toBeShipped); - } - if(toBeShipped==null) - { - toBeShipped="true"; - } - - Integer bPartnerId = bean.getBpartnerId(); - if(bPartnerId==null) - { - bPartnerId = (Integer) request.getSession().getAttribute(Constants.CREDITORDER_BPARTNER); - bean.setBpartnerId(bPartnerId); - } - - if(bPartnerId==null) - { - postGlobalError("error.required.bpartnerId",request); - return mapping.getInputForward(); - } - - if(BPartnerManager.isBPartnerPresent(ctx,bean.getBpartnerId(),null) == false) - { - postGlobalError("error.customer.not.exists",request); - return mapping.getInputForward(); - } - - BigDecimal discountAllowed = (BigDecimal) request.getSession().getAttribute( Constants.DISCOUNT_ALLOWED ); - bean.setUserDiscount( discountAllowed ); - MOrder previousOrder= null; - previousOrder=(MOrder)request.getSession().getAttribute(Constants.PRESENT_CREDIT_ORDER); - - if(previousOrder!=null) - { - bean.setOrderId(Integer.valueOf(previousOrder.get_ID())); - } - else - { - bean.setOrderId(null); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - MOrder creditOrder=null; - try - { - trx.start(); - creditOrder= CreditOrderManager.createCreditOrder(ctx,bean,cartBean.getItems(),trx.getTrxName()); - trx.commit(); - } - catch (DiscountLimitException e) - { - trx.rollback(); - postGlobalError("error.discountLimit.exceeded",request); - return mapping.getInputForward(); - } - catch(BPartnerOverCreditLimitException e1) - { - trx.rollback(); - postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); - return mapping.getInputForward(); - } - - catch(MandatoryException e2) - { - trx.rollback(); - postGlobalError("error.bpartner.no.payment.term",request); - return mapping.getInputForward(); - } - catch(InsufficientQtyException e3) - { - trx.rollback(); - postGlobalError("error.insufficient.qty",e3.getMessage(),request); - return mapping.getInputForward(); - } - catch(LimitPriceViolatedException e3) - { - trx.rollback(); - postGlobalError("error.limit.price.violated",e3.getMessage(),request); - return mapping.getInputForward(); - } - - catch(OperationException e) - { - trx.rollback(); - throw e; - } - finally - { - trx.close(); - request.getSession().removeAttribute( Constants.DISCOUNT_ALLOWED ); - } - bean.setOrderId(Integer.valueOf(creditOrder.get_ID())); - df.populate(new OrderLineBean()); - WebDocumentBean webBean =null; - try - { - webBean = OrderReferenceManager.getWebOrderBean(ctx, creditOrder); - } - catch(InvalidAddressException e) - { - postGlobalError("error.invalid.address",request); - return mapping.getInputForward(); - } - - ArrayList list = POSManager.populateOrderLines(ctx,creditOrder); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,Integer.valueOf(creditOrder.get_ID())); - request.getSession().setAttribute(Constants.PRESENT_CREDIT_ORDER,creditOrder); - request.getSession().setAttribute(Constants.ORDER_LINE_BEAN,bean); - request.getSession().setAttribute(Constants.CREDITORDER_BPARTNER,bPartnerId); - request.setAttribute(Constants.POS_ORDER_LINES,list); - request.getSession().removeAttribute(Constants.PRESENT_CREDIT_ORDER); - request.getSession().removeAttribute(Constants.PRESENT_CREDIT_ORDER_ID); - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - return mapping.findForward(CREATE_CREDIT_ORDER); - } - - - public static final String COMPLETE_CREDIT_ORDER="completeCreditOrder"; - public ActionForward completeCreditOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean b = (OrderLineBean) df.getBean(); - - OrderLineBean bean=(OrderLineBean) request.getSession().getAttribute(Constants.ORDER_LINE_BEAN); - bean.setAmountGiven(b.getAmountGiven()); - bean.setAmountRefunded(b.getAmountRefunded()); - - Integer orderId = (Integer) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); - - if (orderId == null) - { - return mapping.getInputForward(); - } - MOrder completedCreditOrder=null; - - if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) - { - postGlobalError("error.pos.no.orderline",request); - request.getSession().removeAttribute(Constants.SHOPPING_CART); - request.getSession().removeAttribute(Constants.SHOPPING_CART_ITEMS); - - return mapping.getInputForward(); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - try - { - trx.start(); - completedCreditOrder=CreditOrderManager.completeCreditOrder(ctx,orderId.intValue(), trx.getTrxName()); - trx.commit(); - } - catch(BPartnerOverCreditLimitException e1) - { - trx.rollback(); - postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); - return mapping.getInputForward(); - } - catch(OperationException e2) - { - trx.rollback(); - throw e2; - } - finally - { - trx.close(); - } - - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedCreditOrder); - ArrayList list = POSManager.populateOrderLines(ctx,completedCreditOrder); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,completedCreditOrder.get_ID()); - request.setAttribute(Constants.POS_ORDER_LINES,list); - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.SHOPPING_CART); - request.getSession().removeAttribute(Constants.SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); - request.getSession().removeAttribute(Constants.CREDITORDER_BPARTNER); - request.getSession().removeAttribute(Constants.SHIPMENT_REQUIRED); - request.getSession().removeAttribute(Constants.TO_BE_SHIPPED); - // String reportName = POSReportManager.getInvoicePDFReport(ctx,completedCreditOrder.getC_Invoice_ID(),null); - // String reportURI = ReportManager.getReportURI(reportName,request); - //request.getSession().setAttribute(Constants.REPORT_URL,reportURI); - return mapping.findForward(COMPLETE_CREDIT_ORDER); - } - - public ActionForward validateAdvanceOrderPIN(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException - { - Properties ctx=TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - String userPIN = df.getUserPIN(); - - LoginBean bean = null; - LoginManager loginManager = new LoginManager(); - String script = null; - - try - { - bean = loginManager.getUserNameFromPIN(ctx, userPIN); - WebUser wu = loginManager.checkLoginPassword(ctx, bean); - - int roleId = Env.getAD_Role_ID(ctx); - - BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null); - - if(discountAllowed != Env.ZERO) - { - script = "setAction(document.forms[0],'GetCreditOrderDiscDetailsAction.do','getCreditOrderDiscDetails');" + - "disableButtons();"; - - request.getSession().setAttribute(Constants.DISCOUNT_ALLOWED, discountAllowed); - } - else - { - script = "PINError('It seems that you are not authorised to give discounts.');"; - } - } - catch (DuplicatePINException e) - { - script = "PINError('It seems that you are not authorised to give discounts.');"; - } - catch (InvalidPINException e) - { - script = "PINError('It seems that you are not authorised to give discounts.');"; - } - catch (UserNotFoundException e) - { - - } - catch (UserInactiveException e) - { - - } - catch (NotLoggedInException e) - { - - } - catch (SQLException e) - { - throw new OperationException(e); - } - catch (OperationException e) - { - throw new OperationException(e); - } - - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - - - public static final String GET_ALLOCATION_DETAILS_FOR_PARTNER = "getAllocationDetailsForPartner"; - public ActionForward getAllocationDetailsForPartner(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - PaymentAllocationBean bean=(PaymentAllocationBean) df.getBean(); - ArrayList allocationList = CreditOrderManager.viewAllocation(ctx,bean.getPartnerName(),bean.getInvoiceNo(),bean.getIsCustomer(),bean.getIsVendor()); - request.getSession().setAttribute(Constants.PAYMENT_ALLOCATIONS,allocationList); - return mapping.findForward(GET_ALLOCATION_DETAILS_FOR_PARTNER); - } - - public static final String INIT_CREATE_CREDIT_ORDER = "initCreateCreditOrder"; - public ActionForward initCreateCreditOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - ArrayList list = PaymentTermManager.getAllActivePaymentTerm(ctx); - request.getSession().setAttribute (Constants.PAYMENT_TERM,list); - return mapping.findForward(INIT_CREATE_CREDIT_ORDER); - } - - - public static final String CREATE_SHIPMENT_CREDIT_ORDER = "createShipmentForCreditOrder"; - public ActionForward createShipmentForCreditOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DocumentHistoryForm dhf = (DocumentHistoryForm) form; - DocumentHistoryBean bean = (DocumentHistoryBean) dhf.getBean(); - MInOut shipment=CreditOrderManager.createAndCompleteShipment(ctx,bean.getInvoiceId()); - return new ActionForward("/ViewMinOutAction.do?action=viewOrder&documentId="+shipment.get_ID()); - } - - - - public static final String GET_MULTIPLE_INVOICE_FOR_PAYMENT = "getMultipleInvoicesForPayment"; - public ActionForward getMultipleInvoicesForPayment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - OpenItemForm oif= (OpenItemForm) form; - OpenItemBean bean=(OpenItemBean) oif.getBean(); - ArrayList list=null; - try - { - list= PaymentAllocationManager.getInvoiceToAllocate(ctx,bean.getInvoiceIds(),null); - } - catch(NoAllocateeInvoiceException e2) - { - postGlobalError("error.no.invoice.to.allocate",request); - return mapping.getInputForward(); - } - request.getSession().setAttribute (Constants.INVOICE_FOR_ALLOCATION,list); - return mapping.findForward(GET_MULTIPLE_INVOICE_FOR_PAYMENT); - } - - //---------------------------------------------------------------------------------------------- - // Methods related to purchasing - public static final String INIT_GET_CREDITOR_PAYMENT_STATUS = "initGetCreditorPaymentStatus"; - public ActionForward initGetCreditorPaymentStatus(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - //DefaultForm df= (DefaultForm) form; - ArrayList list = POSBpartnerInfoManager.getPartnerInfo(ctx,true); - request.getSession().removeAttribute(Constants.UNALLOCATED_PAYMENTS); - request.getSession().removeAttribute(Constants.OPEN_ITEMS); - request.getSession().removeAttribute(Constants.AGING_ITEMS); - request.getSession().setAttribute(Constants.BUSINESSPARTNER,list); - return mapping.findForward(INIT_GET_CREDITOR_PAYMENT_STATUS); - } - - public static final String GET_CREDITOR_PAYMENT_STATUS = "getCreditorPaymentStatus"; - public ActionForward getCreditorPaymentStatus(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OpenItemBean bean=(OpenItemBean) df.getBean(); - boolean access=MenuManager.getRoleMenuAccess(ctx,POSMenuFactory.SMENU_SETTLE_GRN_PAYMENT_ID); - if(access==false) - { - postGlobalError("error.access.not.allowed",request); - return new ActionForward(bean.getForward()); - } - - ArrayList openItemList = null; - ArrayList agingList = null; - ArrayList paymentList = null; - - try - { - openItemList = CreditOrderManager.getOpenItems(ctx,bean.getBpartnerId()); - agingList = CreditOrderManager.getAging(ctx,bean.getBpartnerId()); - paymentList = CreditOrderManager.getUnallocatedPayments(ctx,bean.getBpartnerId()); - - } - catch(BPartnerNotFoundException e) - { - postGlobalError("error.vendor.not.exists",request); - mapping.findForward(GET_CREDITOR_PAYMENT_STATUS); - } - - - request.getSession().setAttribute(Constants.OPEN_ITEMS,openItemList); - request.getSession().setAttribute(Constants.AGING_ITEMS,agingList); - request.getSession().setAttribute(Constants.UNALLOCATED_PAYMENTS,paymentList); - - return mapping.findForward(GET_CREDITOR_PAYMENT_STATUS); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CurrencyAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CurrencyAction.java deleted file mode 100644 index d49d18fae5..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/CurrencyAction.java +++ /dev/null @@ -1,268 +0,0 @@ -package org.posterita.struts.pos; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; -import java.util.logging.Level; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MCurrency; -import org.compiere.util.CLogger; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.CurrencyBean; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.form.CurrencyForm; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.util.PoManager; - -public class CurrencyAction extends BaseDispatchAction -{ - private static CLogger logger = CLogger.getCLogger(CurrencyAction.class); - - public static final String VIEW_CURRENCY = "viewCurrency"; - public ActionForward updateCurrency(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - CurrencyForm currencyForm = (CurrencyForm) form; - CurrencyBean currencyBean = (CurrencyBean) currencyForm.getBean(); - - Properties ctx = TmkJSPEnv.getCtx(request); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - if((currencyBean.getCurrencyId() != 0) && (currencyBean.getCurrencyId() != null)) - { - MCurrency currency = MCurrency.get(ctx, currencyBean.getCurrencyId()); - - if(currencyBean.getRoundOffFactor().doubleValue() < 0) - { - postGlobalError("error.round.off.cannot.be.negative", request); - return mapping.getInputForward(); - } - - currency.setRoundOffFactor(currencyBean.getRoundOffFactor()); - currency.setStdPrecision(currencyBean.getStdPrecision()); - currency.setIsActive(currencyBean.getIsActive()); - PoManager.save(currency); - } - trx.commit(); - //postGlobalMessage("success.currency.updated.successfully", request); - } - - catch(OperationException e) - { - trx.rollback(); - logger.log(Level.SEVERE, e.getMessage()); - postGlobalError("error.process", e.getMessage(), request); - } - - finally - { - trx.close(); - } - - request.getSession().removeAttribute(Constants.CURRENCY_LIST); - request.getSession().setAttribute(Constants.CURRENCY, currencyBean); - return mapping.getInputForward(); - } - - - public static final String LIST_CURRENCIES = "listCurrencies"; - public ActionForward listCurrencies(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - CurrencyForm currencyForm = (CurrencyForm) form; - CurrencyBean currencyBean = (CurrencyBean) currencyForm.getBean(); - - Properties ctx = TmkJSPEnv.getCtx(request); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - ArrayList list = new ArrayList(); - list = getAllCurrencies(ctx, currencyBean.getIsoCode(), trx.getTrxName()); - - request.getSession().setAttribute(Constants.CURRENCY_LIST, list); - return mapping.findForward(LIST_CURRENCIES); - - } - - public static final String UPDATE_CURRENCY = "updateCurrency"; - public ActionForward viewCurrency(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - Integer currencyId = Integer.valueOf(request.getParameter("currencyId")); - String next =request.getParameter("isNext"); - Boolean isNext= null; - if ("true".equals(next)) - { - isNext = true; - } - else if ("false".equals(next)) - { - isNext = false; - } - - CurrencyForm currencyForm = (CurrencyForm)form; - - ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.CURRENCY_LIST); - - CurrencyBean currencyBean = new CurrencyBean(); - currencyBean = getCurrencyBean(ctx, list, currencyId, isNext, trx.getTrxName()); - currencyForm.populate(currencyBean); - - request.getSession().setAttribute(Constants.CURRENCY, currencyBean); - - return mapping.findForward(UPDATE_CURRENCY); - } - - /** - * Retrieves all currencies or search for currency by ISO_Code - * @param ctx Context - * @param isoCode Currency ISO Code. Search for currency by ISO Code - * @param trxName Transaction Name - * @return ArrayList of type CurrencyBean - */ - public ArrayList getAllCurrencies(Properties ctx, String isoCode, String trxName) - { - String whereClause = "C_Currency_Id IS NOT NULL ORDER BY ISO_CODE"; - - if(isoCode != null) - { - whereClause = "ISO_CODE = '" + isoCode.toUpperCase() + "'"; - } - - int[] currencyIds = MCurrency.getAllIDs(MCurrency.Table_Name, whereClause, null); - - ArrayList list = new ArrayList(); - - if((currencyIds == null) || (currencyIds.length == 0)) - { - return list; - } - - for(int id : currencyIds) - { - CurrencyBean currencyBean = new CurrencyBean(); - MCurrency currency = new MCurrency(ctx, id, trxName ); - currencyBean.setCurrencyId(currency.getC_Currency_ID()); - currencyBean.setIsActive(currency.isActive()); - currencyBean.setIsoCode(currency.getISO_Code()); - currencyBean.setCurSymbol(currency.getCurSymbol()); - currencyBean.setRoundOffFactor(currency.getRoundOffFactor()); - currencyBean.setStdPrecision(currency.getStdPrecision()); - currencyBean.setDescription(currency.getDescription()); - - list.add(currencyBean); - } - - return list; - } - - /** - * Get a specific currencyBean from an ArrayList of CurrencyBean - * @param ctx Context - * @param list Arraylist of type CurrencyBean - * @param currencyId - * @param isNext used to keep track of next CurrencyBean relative to bean having currencyId - * @return CurrencyBean - * @throws OperationException - */ - public static CurrencyBean getCurrencyBean(Properties ctx, - ArrayList list, Integer currencyId, Boolean isNext, String trxName) throws OperationException - { - int index = -1; - - if (currencyId == null || currencyId == 0) - { - return new CurrencyBean(); - } - else - { - if (list != null) - { - Iterator iter = list.iterator(); - - while (iter.hasNext()) - { - CurrencyBean currBean = iter.next(); - if (currBean.getCurrencyId().equals(currencyId)) - { - index = list.indexOf(currBean); - } - } - if (index != -1) - { - if (isNext!=null) - { - if (isNext) - { - int nextIndex = (index + 1)%list.size(); - index = nextIndex; - } - else - { - int previousIndex = (index-1)%list.size(); - if (previousIndex < 0) - { - previousIndex += list.size(); - } - index = previousIndex; - } - } - return list.get(index); - } - else - { - throw new OperationException("no currency not found in search list"); - } - } - else - { - return getCurrencyBean(ctx, currencyId, trxName); - } - } - } - - - public static CurrencyBean getCurrencyBean(Properties ctx, Integer currencyId, String trxName) - { - CurrencyBean currencyBean = new CurrencyBean(); - MCurrency currency = MCurrency.get(ctx, currencyId); - currencyBean.setCurrencyId(currency.getC_Currency_ID()); - currencyBean.setIsActive(currency.isActive()); - currencyBean.setCurSymbol(currency.getCurSymbol()); - currencyBean.setIsoCode(currency.getISO_Code()); - currencyBean.setStdPrecision(currency.getStdPrecision()); - currencyBean.setRoundOffFactor(currency.getRoundOffFactor()); - - return currencyBean; - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CustomPOSReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CustomPOSReportAction.java deleted file mode 100644 index 724730a2d0..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/CustomPOSReportAction.java +++ /dev/null @@ -1,357 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 24-Jul-2006 15:53:04 by praveen - * - */ - -package org.posterita.struts.pos; - -import java.sql.Timestamp; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; -import org.compiere.model.MAttribute; -import org.compiere.model.MAttributeSet; -import org.compiere.model.MElementValue; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.ReportBean; -import org.posterita.businesslogic.performanceanalysis.CSVReportManager; -import org.posterita.businesslogic.performanceanalysis.CustomPOSReportManager; -import org.posterita.businesslogic.performanceanalysis.ReportDateManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.BarChart; -import org.posterita.core.PieChart; -import org.posterita.core.RandomStringGenerator; -import org.posterita.core.SessionStorage; -import org.posterita.core.TabularReport; -import org.posterita.core.TimeSeriesChart; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.form.SalesReportForm; - -public class CustomPOSReportAction extends POSDispatchAction -{ - public static final String INIT_CUSTOM_REPORT = "initCustomReport"; - public ActionForward initCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - SalesReportForm reportForm = (SalesReportForm) form; - - //setting defaults - String chartType = PieChart.CHART_TYPE; - String accountId = "41000"; - String timePeriod = ReportDateManager.TODAY; - String salesGroup = Constants.REVENUE_RECOGNITION; - String dateRange = Constants.FIXED_DATE_RANGE; - - reportForm.setChartType(chartType); - reportForm.setAccountId(accountId); - reportForm.setTimePeriod(timePeriod); - reportForm.setSalesGroup(salesGroup); - reportForm.setDateRange(dateRange); - reportForm.setFromDate(""); - reportForm.setToDate(""); - - reportForm.validate(mapping,request); - - ReportBean reportBean = (ReportBean) reportForm.getBean(); - - SessionStorage.putSalesGroupFilter(ctx,request,reportBean); - - return mapping.findForward(INIT_CUSTOM_REPORT); - } - - - public static final String GET_CUSTOM_REPORT = "getCustomReport"; - public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - SalesReportForm reportForm = (SalesReportForm) form; - ReportBean bean = (ReportBean) reportForm.getBean(); - - //validate form - ActionMessages messages = validate(form); - if(!messages.isEmpty()) - { - saveErrors(request, messages); - return mapping.getInputForward(); - } - - final Integer TAX_DUE = Constants.TAX_DUE; - final Integer TAX_CREDIT = Constants.TAX_CREDIT; - final Integer PROFIT_MARGIN = Constants.PROFIT_MARGIN; - - Timestamp fromDate = null; - Timestamp toDate = null; - String dateRange = bean.getDateRange(); - String timePeriod = bean.getTimePeriod(); - String chartType = bean.getChartType(); - String salesGroup = bean.getSalesGroup(); - String priceQtyFilter = bean.getPriceQtyFilter(); - Integer account_id = bean.getAccountId(); - - String filename = RandomStringGenerator.randomstring(); - String reportPath = ReportManager.getReportPath(filename); - - String title = ""; - String subtitle = ""; - int height = 600; - int width = 700; - - //setting from and to dates - if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) - { - if(timePeriod == null) - { - throw new OperationException("Invalid Parameter for timePeriod. TimePeriod is null"); - } - - fromDate = ReportDateManager.getStartDateForPeriod(timePeriod); - toDate = ReportDateManager.getEndDateForPeriod(timePeriod); - - subtitle = "For " + timePeriod; - } - else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) - { - fromDate = ReportDateManager.getFromDate(bean); - toDate = ReportDateManager.getToDate(bean); - - subtitle = "For period:"+fromDate+" to "+toDate; - } - else - { - throw new OperationException("Invalid Parameter for dateRange :" + dateRange); - } - - //setting title - String str = null; - boolean isProfitMargin = (account_id.equals( PROFIT_MARGIN )); - - if(isProfitMargin) - { - str = "Profit Margin"; - } - else - { - int[] ids = MElementValue.getAllIDs(MElementValue.Table_Name,"AD_CLIENT_ID ="+ Env.getAD_Client_ID(ctx) + " AND VALUE ='"+ account_id + "'",null); - - if(ids==null || ids.length==0) - { - throw new OperationException("Unable to resolve account type!"); - } - else - { - MElementValue elementValue = new MElementValue(ctx,ids[0],null); - str = elementValue.getName(); - }//else - }//else - - - - boolean isTaxDue = (account_id.equals( TAX_DUE )); - boolean isTaxCredit = (account_id.equals( TAX_CREDIT )); - - if(isTaxCredit || isTaxDue) - { - title = str; - } - else - { - title = str + " by "; - - if( - salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)|| - salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET) || - salesGroup.equalsIgnoreCase(Constants.PRODUCT) || - salesGroup.equalsIgnoreCase(Constants.GROUP1) || - salesGroup.equalsIgnoreCase(Constants.GROUP2) || - salesGroup.equalsIgnoreCase(Constants.CUSTOMER) - ) - { - title = title + salesGroup; - } - else - { - String[] s = salesGroup.split("_"); - - if(s.length!=2) - { - throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); - } - - int attributeSetId = Integer.parseInt(s[0]); - int attributeId = Integer.parseInt(s[1]); - - String attributeSetName = null; - String attributeName = null; - - attributeSetName = MAttributeSet.get(ctx,attributeSetId).getName(); - attributeName = new MAttribute(ctx,attributeId,null).getName(); - - title = title + attributeName + " For " + attributeSetName; - - }//else - - }//else - - - //drawing chart - if(chartType.equals(PieChart.CHART_TYPE)) - { - PieChart pieChart = CustomPOSReportManager.generatePieChart(ctx,title,subtitle,account_id.intValue(), fromDate, toDate, salesGroup,priceQtyFilter); - pieChart.saveChartAsJPEG(reportPath+".jpg",width,height); - } - else if(chartType.equals(BarChart.CHART_TYPE)) - { - BarChart barChart = CustomPOSReportManager.generateBarChart(ctx,title,subtitle,account_id.intValue(), fromDate, toDate,salesGroup,priceQtyFilter); - barChart.saveChartAsJPEG(reportPath+".jpg",width,height); - } - else if(chartType.equals(TimeSeriesChart.CHART_TYPE)) - { - //draw timeseries - TimeSeriesChart timeSeriesChart = CustomPOSReportManager.generateTimeSeriesChart(ctx,title,subtitle,account_id.intValue(), fromDate, toDate,salesGroup,priceQtyFilter); - timeSeriesChart.saveChartAsJPEG(reportPath+".jpg",width,height); - } - else if(chartType.equals("Tabular")) - { - //constructing the table - TabularReport tReport = CustomPOSReportManager.generateTabularReport( ctx, title, subtitle, account_id.intValue(), fromDate, toDate, salesGroup, priceQtyFilter ); - - String csvReport = CSVReportManager.generateCSVReport(ctx,tReport.getReportData()); - String csvURI = ReportManager.getReportURI(csvReport,request); - - request.getSession().removeAttribute(Constants.REPORT_URL); - request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA,tReport.toString()); - request.getSession().setAttribute(Constants.CSV_FILE,csvURI); - request.getSession().setAttribute(Constants.DISPLAY_REPORT,""); - - //------------------------------------------------------------------------------------------------------------------- - tReport = CustomPOSReportManager.generateTabularReportGroupByDate(ctx,title,subtitle,account_id.intValue(), fromDate, toDate,salesGroup,priceQtyFilter); - csvReport = CSVReportManager.generateCSVReport(ctx,tReport.getReportData()); - csvURI = ReportManager.getReportURI(csvReport,request); - - request.getSession().removeAttribute(Constants.REPORT_URL); - request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA2,tReport.toString()); - request.getSession().setAttribute(Constants.CSV_FILE2,csvURI); - request.getSession().setAttribute(Constants.DISPLAY_REPORT,""); - - return mapping.findForward(GET_CUSTOM_REPORT); - - - } - else - { - throw new OperationException("Invalid Chart type:" + chartType); - } - - String imgURL = ReportManager.getReportURI(filename+".jpg",request); - - request.getSession().setAttribute(Constants.REPORT_URL,imgURL); - request.getSession().removeAttribute(Constants.TABULAR_REPORT_DATA); - request.getSession().setAttribute(Constants.DISPLAY_REPORT,""); - - - - return mapping.findForward(GET_CUSTOM_REPORT); - } - - - //---------------------------------------------------------------------------------------------------- - public static ActionMessages validate(ActionForm form) throws OperationException, ApplicationException - { - ActionMessages messages = new ActionMessages(); - ActionMessage message = null; - boolean error = false; - - SalesReportForm reportForm = (SalesReportForm) form; - ReportBean bean = (ReportBean) reportForm.getBean(); - - String fromDate = bean.getFromDate(); - String toDate = bean.getToDate(); - String dateRange = bean.getDateRange(); - String timePeriod = bean.getTimePeriod(); - - - if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) - { - if(timePeriod == null) - { - throw new OperationException("Invalid Parameter for timePeriod. Time Period is null."); - } - } - else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) - { - - if((fromDate == null)||(fromDate == "")) - { - message = new ActionMessage("error.required.fromDate"); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - error = true; - } - - if((toDate == null)||(toDate == "")) - { - message = new ActionMessage("error.required.toDate"); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - error = true; - } - - if(!error) - { - - - Timestamp date1 = ReportDateManager.getFromDate(bean); - Timestamp date2 = ReportDateManager.getToDate(bean); - - if(date2.getTime()<= date1.getTime()) - { - message = new ActionMessage("error.invalid.period"); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - error = true; - } - } - } - else - { - throw new OperationException("Invalid Parameter for dateRange :" + dateRange); - } - - return messages; - - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/CustomerReturnOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/CustomerReturnOrderAction.java deleted file mode 100644 index 518e4480cf..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/CustomerReturnOrderAction.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 22-Sep-2006 11:43:05 by praveen - * - */ - -package org.posterita.struts.pos; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.exceptions.ApplicationException; - -public class CustomerReturnOrderAction extends POSDispatchAction -{ - public static final String CREATE_CUSTOMER_RETURN_ORDER = "createCustomerReturnOrder"; - public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; - public static final String INCREMENT_QTY = "incrementQty"; - public static final String DECREMENT_QTY = "decrementQty"; - public static final String DELETE_ORDERLINE = "deleteOrderline"; - - public ActionForward addToShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(ADD_TO_SHOPPING_CART); - } - - public ActionForward incrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(INCREMENT_QTY); - } - - public ActionForward decrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(DECREMENT_QTY); - } - - public ActionForward deleteOrderline(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(DELETE_ORDERLINE); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/DocumentAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/DocumentAction.java deleted file mode 100644 index 1fd4383c3d..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/DocumentAction.java +++ /dev/null @@ -1,291 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Oct 17, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.struts.pos; - -import java.io.File; -import java.io.IOException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MInventory; -import org.compiere.print.ReportEngine; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.DocumentBean; -import org.posterita.beans.InventoryBean; -import org.posterita.businesslogic.stock.InventoryManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.RandomStringGenerator; -import org.posterita.core.TabularReport; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.form.InventoryForm; -import org.posterita.struts.core.DefaultForm; - -import com.lowagie.text.DocumentException; - -public class DocumentAction extends POSDispatchAction -{ - public static final String VIEW_ORDER_DOCUMENT_PDF = "viewOrderDocumentPDF"; - public ActionForward viewOrderDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - DocumentBean bean = (DocumentBean) df.getBean(); - String reportName = RandomStringGenerator.randomstring() + ".pdf"; - String reportPath = ReportManager.getReportPath(reportName); - - ReportEngine reportEngine = ReportEngine.get(ctx, ReportEngine.ORDER, bean.getDocumentId().intValue()); - reportEngine.createPDF(new File(reportPath)); - - String reportURI = ReportManager.getReportURI(reportPath,request); - request.setAttribute(Constants.DOCUMENT_PDF, reportURI); - - return mapping.findForward(VIEW_ORDER_DOCUMENT_PDF); - } - - public static final String VIEW_INVOICE_DOCUMENT_PDF = "viewInvoiceDocumentPDF"; - public ActionForward viewInvoiceDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - DocumentBean bean = (DocumentBean) df.getBean(); - String reportName = RandomStringGenerator.randomstring() + ".pdf"; - String reportPath = ReportManager.getReportPath(reportName); - - ReportEngine reportEngine = ReportEngine.get(ctx, ReportEngine.INVOICE, bean.getDocumentId().intValue()); - reportEngine.createPDF(new File(reportPath)); - - String reportURI = ReportManager.getReportURI(reportPath,request); - request.setAttribute(Constants.DOCUMENT_PDF, reportURI); - - return mapping.findForward(VIEW_INVOICE_DOCUMENT_PDF); - } - - public static final String VIEW_SHIPMENT_DOCUMENT_PDF = "viewShipmentDocumentPDF"; - public ActionForward viewShipmentDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - DocumentBean bean = (DocumentBean) df.getBean(); - String reportName = RandomStringGenerator.randomstring() + ".pdf"; - String reportPath = ReportManager.getReportPath(reportName); - - ReportEngine reportEngine = ReportEngine.get(ctx, ReportEngine.SHIPMENT, bean.getDocumentId().intValue()); - reportEngine.createPDF(new File(reportPath)); - - String reportURI = ReportManager.getReportURI(reportPath,request); - request.setAttribute(Constants.DOCUMENT_PDF, reportURI); - - return mapping.findForward(VIEW_SHIPMENT_DOCUMENT_PDF); - } - - public static String VIEW_PAYMENT_DOCUMENT_PDF = "viewPaymentDocumentPDF"; - public ActionForward viewPaymentDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - DocumentBean bean = (DocumentBean) df.getBean(); - String reportName = RandomStringGenerator.randomstring() + ".pdf"; - String reportPath = ReportManager.getReportPath(reportName); - - ReportEngine reportEngine = ReportEngine.get(ctx, ReportEngine.REMITTANCE, bean.getDocumentId().intValue()); - reportEngine.createPDF(new File(reportPath)); - - String reportURI = ReportManager.getReportURI(reportPath,request); - request.setAttribute(Constants.DOCUMENT_PDF, reportURI); - - return mapping.findForward(VIEW_SHIPMENT_DOCUMENT_PDF); - } - - - - -/* public static String VIEW_PAYMENT_DOCUMENT_PDF = "viewPaymentDocumentPDF"; - public ActionForward viewPaymentDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - DocumentBean bean = (DocumentBean) df.getBean(); - - String pdfPath = POSReportManager.getPaymentPDFReport(ctx, bean.getDocumentId(), null); - pdfPath = ReportManager.getReportURI(pdfPath,request); - - request.setAttribute(Constants.DOCUMENT_PDF, pdfPath); - - return mapping.findForward(VIEW_PAYMENT_DOCUMENT_PDF); - } -*/ - - /*public static String VIEW_INVOICEFROMORDER_DOCUMENT_PDF = "viewInvoiceFromOrderDocumentPDF"; - public ActionForward viewInvoiceFromOrderDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - DocumentBean bean = (DocumentBean) df.getBean(); - - String pdfPath = POSReportManager.getInvoiceFromOrderPDFReport(ctx, bean.getDocumentId(), null); - pdfPath = ReportManager.getReportURI(pdfPath,request); - - request.setAttribute(Constants.DOCUMENT_PDF, pdfPath); - - return mapping.findForward(VIEW_INVOICEFROMORDER_DOCUMENT_PDF); - }*/ - - /*========================================================================*/ - - public static final String VIEW_INVENTORY_DOCUMENT_PDF = "viewInventoryDocumentPDF"; - - /** - * Generate Inventory Document after Inventory count - * @param mapping - * @param form - * @param request - * @param response - * @throws ApplicationException - * @throws OperationException - * @throws DocumentException - * @throws IOException - * @return - * @throws SQLException - * @throws ParseException - */ - - public ActionForward viewInventoryDocumentPDF(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, DocumentException, IOException, SQLException, ParseException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - InventoryForm If = (InventoryForm)form; - InventoryBean bean = (InventoryBean) If.getBean(); - - ArrayList reportData = InventoryManager.getInventoryReportData(ctx, bean.getInventoryId(), null); - - String title = ""; - - MInventory inv = MInventory.get(ctx, bean.getInventoryId()); - - if(inv.getDescription() == null) - { - title = "Inventory Adjustment Report"; - } - else - { - title = inv.getDescription(); - } - - String subtitle = null; - - String sql = "Select Name from AD_Org where AD_org_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - - pstmt = DB.prepareStatement(sql.toString(), null); - pstmt.setInt(1, Env.getAD_Org_ID(ctx)); - - try - { - rs = pstmt.executeQuery(); - - if (rs.next()) - { - subtitle = rs.getString(1); - } - - } - catch(SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs); - DB.close(pstmt); - } - - //constructing the table - TabularReport tReport = new TabularReport(reportData); - tReport.setSortable(false); - tReport.setStyle("display"); - tReport.setTitle(title); - tReport.setSubtitle(subtitle); - tReport.createReport(); - - response.setContentType("x-application/pdf"); - response.setHeader("Content-Disposition","inline;filename=Inventory"+System.currentTimeMillis()+".pdf"); - response.getOutputStream().write(tReport.getPDFData()); - - return null; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/DunningAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/DunningAction.java deleted file mode 100644 index d88ca91438..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/DunningAction.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 27, 2006 - */ - - -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.Constants; -import org.posterita.beans.DunningBean; -import org.posterita.businesslogic.POSBpartnerInfoManager; -import org.posterita.businesslogic.administration.DunningManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.DefaultForm; - - -public class DunningAction extends POSDispatchAction -{ - - public static final String INIT_PRINT_DUNNING = "initPrintDunning"; - public ActionForward initPrintDunning(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DunningManager.associateAllBpartnerWithDunning(ctx); - ArrayList list = POSBpartnerInfoManager.getPartnerInfo(ctx,true); - - request.getSession().setAttribute(Constants.DEBTORS,list); - request.getSession().removeAttribute(Constants.BUSINESSPARTNER); - - return mapping.findForward(INIT_PRINT_DUNNING); - } - - public static final String PRINT_DUNNING_LETTERS="printDunningLetters"; - public ActionForward printDunningLetters(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - DunningBean bean=(DunningBean) df.getBean(); - - DunningManager.printDunningLetters(ctx,bean); - return mapping.findForward(PRINT_DUNNING_LETTERS); - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/EditBulkProductFromFileAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/EditBulkProductFromFileAction.java deleted file mode 100644 index 258521634f..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/EditBulkProductFromFileAction.java +++ /dev/null @@ -1,265 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Sep 28, 2006 - */ - - -package org.posterita.struts.pos; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.util.Trx; - -import org.posterita.Constants; -import org.posterita.beans.ProductBean; -import org.posterita.businesslogic.EditBulkProductFromFileManager; -import org.posterita.businesslogic.POSProductManager; -import org.posterita.businesslogic.ProductCart; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.BarcodeAlreadyExistsException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductAlreadyExistException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.exceptions.TaxRateNotDefineException; -import org.posterita.struts.core.DefaultForm; - - -public class EditBulkProductFromFileAction extends POSDispatchAction -{ - - /*public static final String VIEW_ALL_POS_PRODUCTS_FOR_UPDATE="viewAllPOSProductsForUpdate"; - public ActionForward viewAllPOSProductsForUpdate(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - ProductBean bean = (ProductBean) df.getBean(); - ArrayList list=null; - - try - { - list = new ArrayList(); - list = POSProductManager.viewAllProducts(ctx,bean.getProductName(),null); - - } - catch(ProductNotFoundException e1) - { - postGlobalError("error.product.not.defined.client",request); - - } - - request.setAttribute(Constants.POS_PRODUCTS_FOR_UPDATE,list); - return mapping.findForward(VIEW_ALL_POS_PRODUCTS_FOR_UPDATE); - } - - public static final String CREATE_CSV_FILE="createCSVFile"; - public ActionForward createCSVFile(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); - - if(cart==null) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return new ActionForward("/jsp/pos/viewAllPOSProductsForUpdate.jsp"); - } - String fileName= EditBulkProductFromFileManager.createCSVFile(ctx, cart.getProductIDs()); - String fileURI = ReportManager.getReportURI(fileName,request); - - request.getSession().setAttribute(Constants.FILE_FOR_UPDATE,fileURI); - return mapping.findForward(CREATE_CSV_FILE); - } - - public static final String UPDATE_ALL_PRODUCTS="updateAllProducts"; - public ActionForward updateAllProducts(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - request.getSession().removeAttribute(Constants.PRODUCT_CREATED); - DefaultForm df = (DefaultForm) form; - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - EditBulkProductFromFileManager.updateAllProducts(ctx,df.getFile(),trx.getTrxName()); - trx.commit(); - } - catch(ProductAlreadyExistException e) - { - trx.rollback(); - postGlobalError("error.duplicate.product",e.getMessage(),request); - return mapping.getInputForward(); - - } - catch(BarcodeAlreadyExistsException e) - { - trx.rollback(); - postGlobalError("error.duplicate.barcode",e.getMessage(),request); - return mapping.getInputForward(); - } - catch(NumberFormatException e) - { - trx.rollback(); - postGlobalError("error.invalid.number",request); - return mapping.getInputForward(); - } - catch(TaxRateNotDefineException e) - { - trx.rollback(); - postGlobalError("tax.rate.not.defined",e.getMessage(),request); - return mapping.getInputForward(); - } - catch(Exception e) - { - trx.rollback(); - postGlobalError("error.in.file",request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return mapping.findForward(UPDATE_ALL_PRODUCTS); - - } - - public static final String VIEW_CART = "viewCart"; - public ActionForward viewCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); - - if( cart == null ) - { - throw new OperationException( "Cart is empty" ); - } - - ArrayList productList = EditBulkProductFromFileManager.getProductList( ctx, cart.getProductIDs() ); - request.getSession().setAttribute( Constants.PRODUCT_CART_ITEMS, productList ); - - return mapping.findForward(VIEW_CART); - } - - public static final String REMOVE = "remove"; - public ActionForward remove(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - ProductBean bean = (ProductBean) df.getBean(); - - Integer productId = bean.getProductId(); - - ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); - - if( cart == null ) - { - throw new OperationException( "Cart is empty" ); - } - - cart.removeProduct( productId.intValue() ); - - ArrayList productList = EditBulkProductFromFileManager.getProductList( ctx, cart.getProductIDs() ); - request.getSession().setAttribute( Constants.PRODUCT_CART_ITEMS, productList ); - request.getSession().setAttribute( Constants.PRODUCT_CART, cart); - - return mapping.findForward(REMOVE); - } - - - //------------------------------------------------------------------------------------------------------------------------------------------------ - public static final String ADD_TO_CART = "addToCart"; - public ActionForward addToCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - ProductBean bean = (ProductBean) df.getBean(); - - Integer productId = bean.getProductId(); - - ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); - - if( cart == null ) - { - cart = new ProductCart( ctx ); - } - - cart = EditBulkProductFromFileManager.addToCart( ctx, cart, productId.intValue() ); - request.getSession().setAttribute(Constants.PRODUCT_CART, cart); - - String script = "setCartCounter("+ cart.getNoOfProducts() +");productAdded("+ productId +")"; - - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - - public ActionForward clearCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - HttpSession session = request.getSession(); - session.removeAttribute(Constants.PRODUCT_CART); - - String script = "clearAll();"; - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - */ -} - diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/FastMovingItemReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/FastMovingItemReportAction.java deleted file mode 100644 index 2032eb18f8..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/FastMovingItemReportAction.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - -package org.posterita.struts.pos; - -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.Constants; -import org.posterita.beans.ReportBean; -import org.posterita.businesslogic.performanceanalysis.POSReportManager; -import org.posterita.businesslogic.performanceanalysis.ReportDateManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.DefaultForm; - -public class FastMovingItemReportAction extends POSDispatchAction -{ - public static final String GET_CURRENT_DAY_REPORT = "getCurrentDayReport"; - public ActionForward getCurrentDayReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - Calendar cal = Calendar.getInstance(); - - Timestamp toDate = new Timestamp(cal.getTimeInMillis()); - - cal.set(Calendar.HOUR_OF_DAY,0); - cal.set(Calendar.MINUTE,0); - cal.set(Calendar.SECOND,0); - cal.set(Calendar.MILLISECOND,0); - - Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); - - ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"desc",fromDate,toDate); - request.getSession().setAttribute(Constants.MAX_SOLD_ITEMS,list); - - return mapping.findForward(GET_CURRENT_DAY_REPORT); - } - - public static final String GET_CURRENT_MONTH_REPORT = "getCurrentMonthReport"; - public ActionForward getCurrentMonthReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - Calendar cal = Calendar.getInstance(); - - Timestamp toDate = new Timestamp(cal.getTimeInMillis()); - - cal.set(Calendar.DATE,1); - cal.set(Calendar.HOUR_OF_DAY,0); - cal.set(Calendar.MINUTE,0); - cal.set(Calendar.SECOND,0); - cal.set(Calendar.MILLISECOND,0); - - Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); - - ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"desc",fromDate,toDate); - request.getSession().setAttribute(Constants.MAX_SOLD_ITEMS,list); - - return mapping.findForward(GET_CURRENT_MONTH_REPORT); - } - - public static final String GET_CUSTOM_REPORT = "getCustomReport"; - public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - ReportBean bean = (ReportBean) df.getBean(); - Timestamp fromDate = ReportDateManager.getFromDate(bean); - Timestamp toDate = ReportDateManager.getToDate(bean); - - ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"desc",fromDate,toDate); - request.getSession().setAttribute(Constants.MAX_SOLD_ITEMS,list); - - return mapping.findForward(GET_CUSTOM_REPORT); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/GetReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/GetReportAction.java deleted file mode 100644 index 039de6a62f..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/GetReportAction.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 31-Jul-2006 10:08:46 by praveen - * - */ - -package org.posterita.struts.pos; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.util.MimeType; - -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.DefaultForm; - -public class GetReportAction extends POSAction -{ - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException - { - - DefaultForm df = (DefaultForm) form; - String reportName = df.getReportName(); - - if(reportName==null) - { - throw new OperationException("Invalid parameter! ReportName cannot be null."); - } - - String mimeType = null; - - if(reportName.toLowerCase().endsWith(".csv")) - { - mimeType = "text/comma-separated-values"; - } - else - { - mimeType = MimeType.getMimeType(reportName); - } - - String reportPath = ReportManager.getReportPath(reportName); - - File f = new File(reportPath); - - if(!f.exists()) - { - throw new OperationException("Unable to load " + reportName + ". Cause file not found."); - } - - try - { - response.setContentType(mimeType); - - FileInputStream fis = new FileInputStream(f); - BufferedInputStream bis = new BufferedInputStream(fis); - BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); - - //Transfer bytes from bis to bos - byte[] buf = new byte[1024]; - int len; - while ((len = bis.read(buf)) > 0) - { - bos.write(buf, 0, len); - } - bis.close(); - - bos.flush(); - bos.close(); - - } - catch (Exception e) - { - throw new OperationException(e); - } - - return null; - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReceiveNoteAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReceiveNoteAction.java deleted file mode 100644 index f344f0c1fb..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReceiveNoteAction.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 22-Sep-2006 11:41:54 by praveen - * - */ - -package org.posterita.struts.pos; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.exceptions.ApplicationException; - -public class GoodsReceiveNoteAction extends POSDispatchAction -{ - public static final String CREATE_GOODS_RECEIVE_NOTE = "createGoodsReceiveNote"; - public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; - public static final String DELETE_ORDERLINES = "deleteOrderlines"; - - public static final String INCREMENT_QTY = "incrementQty"; - public static final String DECREMENT_QTY = "decrementQty"; - public static final String DELETE_ORDERLINE = "deleteOrderline"; - - public ActionForward addToShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(ADD_TO_SHOPPING_CART); - } - - public ActionForward deleteOrderlines(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(DELETE_ORDERLINES); - } - - //----------------------------------------------------------------------------------------------------------- - - public ActionForward incrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(INCREMENT_QTY); - } - - public ActionForward decrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(DECREMENT_QTY); - } - - public ActionForward deleteOrderline(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(DELETE_ORDERLINE); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReturnNoteAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReturnNoteAction.java deleted file mode 100644 index cbeb8303f8..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/GoodsReturnNoteAction.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 22-Sep-2006 11:42:25 by praveen - * - */ - -package org.posterita.struts.pos; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.exceptions.ApplicationException; - -public class GoodsReturnNoteAction extends POSDispatchAction -{ - public static final String CREATE_GOODS_RETURN_NOTE = "createGoodsReturnNote"; - public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; - public static final String INCREMENT_QTY = "incrementQty"; - public static final String DECREMENT_QTY = "decrementQty"; - public static final String DELETE_ORDERLINE = "deleteOrderline"; - - public ActionForward addToShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(ADD_TO_SHOPPING_CART); - } - - public ActionForward incrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(INCREMENT_QTY); - } - - public ActionForward decrementQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(DECREMENT_QTY); - } - - public ActionForward deleteOrderline(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(DELETE_ORDERLINE); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/ImportCustomerAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/ImportCustomerAction.java deleted file mode 100644 index 8b6579e203..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/ImportCustomerAction.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ - -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.Constants; -import org.posterita.beans.CustomerBean; -import org.posterita.businesslogic.administration.ImportCustomerManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - - -public class ImportCustomerAction extends BaseDispatchAction -{ - public static final String IMPORT_POS_CUSTOMER ="importPOSCustomer"; - public ActionForward importPOSCustomer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - - ArrayList list = new ArrayList(); - - try - { - list=ImportCustomerManager.importCustomer(ctx, df.getFile(), null); - } - - catch(Exception e) - { - String message = e.getMessage(); - int index = message.indexOf("csv"); - String filename = message.substring(0,index+3); - String error = message.substring(index+3); - postGlobalError("error.process", error, request); - String csvURI = ReportManager.getReportURI(filename,request); - request.getSession().setAttribute(Constants.IMPORT_FAIL_CSV_FILE, csvURI); - return mapping.getInputForward(); - } - - request.getSession().setAttribute(Constants.CUSTOMER_CREATED,list); - // return mapping.findForward(IMPORT_POS_CUSTOMER); - return mapping.getInputForward(); - - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/ImportPOSProductAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/ImportPOSProductAction.java deleted file mode 100644 index 17067db777..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/ImportPOSProductAction.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on May 16, 2006 - */ - - -package org.posterita.struts.pos; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.Constants; -import org.posterita.beans.ProductBean; -import org.posterita.businesslogic.ImportPosProductManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.StoreManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - - -public class ImportPOSProductAction extends BaseDispatchAction -{ - public static final String IMPORT_POS_PRODUCT ="importPOSProducts"; - public ActionForward importPOSProducts(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd = init(mapping,form,request,response); - if (fwd!=null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - request.getSession().removeAttribute(Constants.PRODUCT_CREATED); - DefaultForm df = (DefaultForm) form; - ArrayList list=new ArrayList(); - request.getSession().removeAttribute(Constants.IMPORT_FAIL_CSV_FILE); - String salesPListId = df.getSalesPriceListId(); - String purchasePListId = df.getPurchasePriceListId(); - - int purchasePriceListId = StoreManager.getPriceListId(ctx); - int salesPriceListId = POSTerminalManager.getSOPriceListId(ctx); - - if (salesPListId != null) - { - try - { - int soPriceListId = Integer.valueOf(salesPListId); - salesPriceListId = soPriceListId; - } - catch (NumberFormatException e) - { - - } - } - if (purchasePListId != null) - { - try - { - int poPriceListId = Integer.valueOf(purchasePListId); - purchasePriceListId = poPriceListId; - } - catch (NumberFormatException e) - { - } - } - try - { - list=ImportPosProductManager.importSingleProducts(ctx,df.getFile(), salesPriceListId, purchasePriceListId, null); - } - catch(Exception e) - { - - String message = e.getMessage(); - int index = message.indexOf("csv"); - String filename = message.substring(0,index+3); - String error = message.substring(index+3); - postGlobalError("error.process", error, request); - String csvURI = ReportManager.getReportURI(filename,request); - request.getSession().setAttribute(Constants.IMPORT_FAIL_CSV_FILE, csvURI); - return mapping.getInputForward(); - } - finally - { - } - - request.getSession().setAttribute(Constants.PRODUCT_CREATED,list); - return mapping.findForward(IMPORT_POS_PRODUCT); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/InventoryAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/InventoryAction.java deleted file mode 100644 index 9d2d5f77fb..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/InventoryAction.java +++ /dev/null @@ -1,472 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Dec 4, 2006 - */ - - -package org.posterita.struts.pos; - -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MInventory; -import org.compiere.process.DocumentEngine; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.InventoryBean; -import org.posterita.beans.InventoryCartBean; -import org.posterita.beans.InventoryLineBean; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.businesslogic.stock.InventoryCartManager; -import org.posterita.businesslogic.stock.InventoryManager; -import org.posterita.businesslogic.stock.StockManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.CannotCreateInventoryLineException; -import org.posterita.exceptions.NoCheckBoxSelectedException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.form.InventoryForm; -import org.posterita.form.InventoryLineForm; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - - -public class InventoryAction extends BaseDispatchAction -{ - - public static final String CREATE_INVENTORY="createInventory"; - public ActionForward createInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - InventoryForm If = (InventoryForm)form; - InventoryBean bean = (InventoryBean) If.getBean(); - MInventory inventory=null; - - if(bean.getBarCode()!=null && bean.getProductId()==null) - { - int productId=StockManager.getProductIdFromBarCode(ctx,bean.getBarCode()); - bean.setProductId(productId); - } - - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - try - { - if(bean.getInventoryId()==null || bean.getInventoryId()==0) - { - inventory=InventoryManager.createInventory(ctx,bean.getDescription(),null); - bean.setInventoryId(inventory.get_ID()); - } - if(bean.getDescription()!=null) - { - MInventory inventory2=new MInventory(ctx,bean.getInventoryId(),null); - inventory2.setDescription(bean.getDescription()); - inventory2.save(); - } - - - InventoryManager.addInventoryLine(ctx,bean.getInventoryId(),bean.getProductId(), new BigDecimal(0), new BigDecimal(1), true,null); - trx.commit(); - } - catch(CannotCreateInventoryLineException e) - { - trx.rollback(); - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - postGlobalError("error.cannot.create.inventory.line",request); - return mapping.getInputForward(); - } - catch(ProductNotFoundException e) - { - postGlobalError("error.product.name.required",request); - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - return mapping.getInputForward(); - } - - catch(OperationException e) - { - trx.rollback(); - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - throw new OperationException(e); - } - finally - { - trx.close(); - } - - If.populate(bean); - - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - - return mapping.findForward(CREATE_INVENTORY); - } - - public static final String SAVE_COUNT_QTY="saveCountQty"; - public ActionForward saveCountQty(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - InventoryForm If = (InventoryForm)form; - InventoryBean bean = (InventoryBean) If.getBean(); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - try - { - InventoryManager.saveCountQtyInInventoryLine(ctx,bean.getInventoryLineId(), bean.getQtyCsv(), bean.getQtyCount(), trx.getTrxName()); - trx.commit(); - } - catch(OperationException e) - { - trx.rollback(); - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - throw new OperationException(e); - } - finally - { - trx.close(); - } - - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.setAttribute(Constants.WHOLE_INVENTORY_LINE_LIST,list); - return mapping.findForward(SAVE_COUNT_QTY); - } - - - public static final String COMPLETE_INVENTORY="completeInventory"; - public ActionForward completeInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - InventoryForm If = (InventoryForm)form; - InventoryBean bean = (InventoryBean) If.getBean(); - InventoryManager.completeStockAdjustment(ctx,bean.getInventoryId()); - - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.setAttribute(Constants.COMPLETED_INVENTORY_LINE_LIST,list); - request.removeAttribute(Constants.INVENTORY_LINE_LIST); - request.removeAttribute(Constants.WHOLE_INVENTORY_LINE_LIST); - return mapping.findForward(COMPLETE_INVENTORY); - } - - - public static final String VIEW_INVENTORY_HISTORY="viewInventoryHistory"; - public ActionForward viewInventoryHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm If = (DefaultForm)form; - - Properties ctx =TmkJSPEnv.getCtx(request); - ArrayList list = InventoryManager.viewInventoryHistory(ctx); - request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); - return mapping.findForward(VIEW_INVENTORY_HISTORY); - } - - public ActionForward getInventoryHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm If = (DefaultForm)form; - InventoryBean bean = (InventoryBean) If.getBean(); - - Properties ctx =TmkJSPEnv.getCtx(request); - ArrayList list = InventoryManager.viewInventory(ctx, bean.getDocStatus(), bean.getMonth(), bean.getYear()); - request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); - return mapping.findForward(VIEW_INVENTORY_HISTORY); - } - - public ActionForward searchProductInInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm If = (DefaultForm)form; - InventoryBean bean = (InventoryBean) If.getBean(); - ArrayList list = null; - - Properties ctx =TmkJSPEnv.getCtx(request); - try - { - list = InventoryManager.searchProductInInventory(ctx, bean.getProductId(), bean.getBarCode()); - } - catch(Exception e) - { - postComplexGlobalError("error.notfound", new Object[]{e.getMessage()}, request); - } - request.setAttribute(Constants.INVENTORY_HISTORY_LIST, list); - return mapping.findForward(VIEW_INVENTORY_HISTORY); - } - - public static final String DELETE_INVENTORY="deleteInventory"; - public ActionForward deleteInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - InventoryForm If = (InventoryForm)form; - InventoryBean bean = (InventoryBean) If.getBean(); - InventoryManager.deleteInventory(ctx,bean.getInventoryId().intValue()); - InventoryCartManager.clearInventorycart(ctx, request); - ArrayList list = InventoryManager.viewInventoryHistory(ctx); - request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); - return mapping.findForward(DELETE_INVENTORY); - } - - public static final String DELETE_INVENTORY_LINE="deleteInventoryLine"; - public ActionForward deleteInventoryLine(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - InventoryForm If = (InventoryForm)form; - InventoryBean bean = (InventoryBean) If.getBean(); - InventoryManager.deleteInventoryLine(ctx,bean.getInventoryId().intValue(),bean.getInventoryLineId().intValue()); - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - - return mapping.findForward(DELETE_INVENTORY_LINE); - } - - public static final String VIEW_INVENTORY="viewInventory"; - public ActionForward viewInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - InventoryLineForm If = (InventoryLineForm)form; - InventoryLineBean bean = (InventoryLineBean) If.getBean(); - - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - If.populate(bean); - if(InventoryManager.getInventoryDocStatus(ctx,bean.getInventoryId()).equals(DocumentEngine.STATUS_Drafted)) - { - InventoryCartBean cartBean = null; - - for (InventoryLineBean inventoryLineBean : list) - { - cartBean = StockManager.addToInventoryCart(ctx, inventoryLineBean, cartBean, false, true); - bean.setDocStatus(inventoryLineBean.getDocStatus()); - bean.setDocumentNo(inventoryLineBean.getDocumentNo()); - } - - If.populate(bean); - request.getSession().setAttribute(Constants.INVENTORY_CART_ITEMS, cartBean.getItems()); - request.getSession().setAttribute(Constants.INVENTORY_CART, cartBean); - request.getSession().setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - - Env.setContext(ctx, Constants.INVENTORY_ID, bean.getInventoryId()); - Env.setContext(ctx, Constants.DESCRIPTION, bean.getDescription()); - request.getSession().setAttribute(Constants.DOC_NO, bean.getDocumentNo()); - request.getSession().setAttribute(Constants.DOC_STATUS, bean.getDocStatus()); - - return new ActionForward("/initInventoryCart.do"); - } - else - { - request.setAttribute(Constants.COMPLETED_INVENTORY_LINE_LIST,list); - return new ActionForward("/CompletedAdjustmentStock.do"); - } - - } - - public static final String CREATE_WHOLE_INVENTORY="createWholeInventory"; - public ActionForward createWholeInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - InventoryForm If = (InventoryForm)form; - InventoryBean bean = (InventoryBean) If.getBean(); - MInventory inventory=null; - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - try - { trx.start(); - if(bean.getInventoryId()==null || bean.getInventoryId()==0) - { - inventory=InventoryManager.createInventory(ctx,bean.getDescription(),trx.getTrxName()); - bean.setInventoryId(inventory.get_ID()); - } - - InventoryManager.addAllProductsInventoryLine(ctx,bean.getInventoryId(),trx.getTrxName()); - - trx.commit(); - } - catch(OperationException e) - { - trx.rollback(); - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - throw new OperationException(e); - } - finally - { - trx.close(); - } - - ArrayList list = InventoryManager.getInventoryLines(ctx, inventory.getM_Inventory_ID()); - InventoryCartBean cartBean = null; - - for (InventoryLineBean inventoryLineBean : list) - { - cartBean = StockManager.addToInventoryCart(ctx, inventoryLineBean, cartBean, false, true); - } - - request.getSession().setAttribute(Constants.INVENTORY_CART_ITEMS, cartBean.getItems()); - request.getSession().setAttribute(Constants.INVENTORY_CART, cartBean); - request.getSession().setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - - Env.setContext(ctx, Constants.INVENTORY_ID, inventory.getM_Inventory_ID()); - Env.setContext(ctx, Constants.DESCRIPTION, inventory.getDescription()); - request.getSession().setAttribute(Constants.DOC_NO, inventory.getDocumentNo()); - request.getSession().setAttribute(Constants.DOC_STATUS, inventory.getDocStatus()); - - return new ActionForward("/initInventoryCart.do"); - } - - public static final String CREATE_CSV_FILE_FOR_INVENTORY="createCSVFileForInventory"; - public ActionForward createCSVFileForInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - InventoryForm If = (InventoryForm)form; - InventoryBean bean = (InventoryBean) If.getBean(); - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - String reportName = InventoryManager.createCSVForInventory(ctx,list); - String reportURI=ReportManager.getReportURI(reportName,request); - response.sendRedirect(reportURI); - return null; - - } - - - public static final String MERGE_INVENTORY_TO_CREATE_ONE="mergeInventoryToCreateOne"; - public ActionForward mergeInventoryToCreateOne(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - InventoryForm If = (InventoryForm)form; - InventoryBean bean = (InventoryBean) If.getBean(); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - MInventory inventory =null; - try - { - inventory = InventoryManager.mergeInventory(ctx,bean,null); - trx.commit(); - } - catch(NoCheckBoxSelectedException e) - { - trx.rollback(); - ArrayList list = InventoryManager.viewInventoryHistory(ctx); - request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); - postGlobalError("error.no.checkbox.selected",request); - return mapping.getInputForward(); - } - catch(CannotCreateInventoryLineException e1) - { - trx.rollback(); - ArrayList list = InventoryManager.viewInventoryHistory(ctx); - request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); - postGlobalError("error.cannot.create.inventory.line",request); - return mapping.getInputForward(); - } - - catch(OperationException e2) - { - trx.rollback(); - throw new OperationException(e2); - } - finally - { - trx.close(); - } - - ArrayList list = InventoryManager.getInventoryLines(ctx, inventory.getM_Inventory_ID()); - InventoryCartBean cartBean = null; - - for (InventoryLineBean inventoryLineBean : list) - { - cartBean = StockManager.addToInventoryCart(ctx, inventoryLineBean, cartBean, false, true); - } - - request.getSession().setAttribute(Constants.INVENTORY_CART_ITEMS, cartBean.getItems()); - request.getSession().setAttribute(Constants.INVENTORY_CART, cartBean); - request.getSession().setAttribute(Constants.INVENTORY_ID, inventory.getM_Inventory_ID()); - - Env.setContext(ctx, Constants.INVENTORY_ID, inventory.getM_Inventory_ID()); - Env.setContext(ctx, Constants.DESCRIPTION, inventory.getDescription()); - request.getSession().setAttribute(Constants.DOC_NO, inventory.getDocumentNo()); - request.getSession().setAttribute(Constants.DOC_STATUS, inventory.getDocStatus()); - - return new ActionForward("/initInventoryCart.do"); - - } -} - \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/InventoryCartAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/InventoryCartAction.java deleted file mode 100644 index ada076b58d..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/InventoryCartAction.java +++ /dev/null @@ -1,672 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * - * @author shameem - */ - -package org.posterita.struts.pos; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; -import org.apache.struts.upload.FormFile; -import org.apache.struts.util.MessageResources; -import org.compiere.model.MInventory; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.InventoryCartBean; -import org.posterita.beans.InventoryLineBean; -import org.posterita.beans.ItemBean; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.businesslogic.stock.InventoryCartManager; -import org.posterita.businesslogic.stock.InventoryManager; -import org.posterita.businesslogic.stock.StockManager; -import org.posterita.core.TabularReport; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.CannotCreateInventoryLineException; -import org.posterita.exceptions.InputQuantityLessThanZeroException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.exceptions.ProductNotOnPriceListException; -import org.posterita.exceptions.QuantityNotAvailableException; -import org.posterita.exceptions.UOMValuePrecisionNotValidException; -import org.posterita.form.InventoryLineForm; -import org.posterita.struts.core.DefaultForm; - -import com.lowagie.text.DocumentException; - -public class InventoryCartAction extends POSDispatchAction -{ - private static final CLogger logger = CLogger.getCLogger(InventoryCartAction.class); - - public static final String INCREMENT_QTY = "incrementQty"; - public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - // Bug fix for null pointer - InventoryLineForm of = (InventoryLineForm) form; - if(of.getQuantity() == null) - { - of.setQuantity("1"); - } - - addToInventoryCart(mapping,form,request,response); - return getInventoryCart(mapping,form,request,response); - } - - public static final String DECREMENT_QTY = "decrementQty"; - public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - // Bug fix for null pointer - InventoryLineForm of = (InventoryLineForm) form; - if(of.getQuantity() == null) - { - of.setQuantity("1"); - } - - addToInventoryCart(mapping,form,request,response); - return getInventoryCart(mapping,form,request,response); - } - - public ActionForward addProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, ParseException - { - // Bug fix for null pointer - InventoryLineForm of = (InventoryLineForm) form; - if(of.getQtyCount() == null) - { - of.setQtyCount("1"); - } - - addToInventoryCart(mapping,form,request,response); - - return getInventoryCart(mapping,form,request,response); - } - - public static final String UPDATE_QTY = "updateQty"; - public ActionForward updateQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx=TmkJSPEnv.getCtx(request); - - // Bug fix for null pointer - InventoryLineForm of = (InventoryLineForm) form; - if(of.getQtyCount() == null) - { - of.setQtyCount("1"); - } - - InventoryLineBean bean = (InventoryLineBean) of.getBean(); - Integer product_id = bean.getProductId(); - bean.setQtyCount(new BigDecimal(of.getQtyCount())); - Integer priceListId = bean.getPriceListId(); - of.populate(bean); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); - StockManager.updateItemFromInventoryList(ctx, priceListId, items, product_id, bean.getQtyCount().intValue()); - request.getSession().setAttribute(Constants.INVENTORY_CART_ITEMS, items); - - return getInventoryCart(mapping, form, request, response); - } - - - public static final String ADD_TO_INVENTORY_CART = "addToInventoryCart"; - public ActionForward addToInventoryCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - Properties ctx = TmkJSPEnv.getCtx(request); - InventoryLineForm df = (InventoryLineForm) form; - InventoryLineBean bean = (InventoryLineBean) df.getBean(); - - String inventoryCart = Constants.INVENTORY_CART; - String inventoryCartItems = Constants.INVENTORY_CART_ITEMS; - - InventoryCartBean cartBean = (InventoryCartBean) request.getSession().getAttribute(inventoryCart); - - try - { - if(bean.getProductId()==null && bean.getBarCode()==null) - { - postGlobalError("error.barcode.required", request); - return mapping.getInputForward(); - } - - BigDecimal qty = bean.getQtyCount(); - if(qty != null && qty.doubleValue() < 0.0) - { - throw new InputQuantityLessThanZeroException(""); - } - - cartBean = StockManager.addToInventoryCart(ctx, bean, cartBean,true,Boolean.parseBoolean(bean.getIfAdd())); - } - catch (InputQuantityLessThanZeroException e) - { - postGlobalError("error.invalid.inputQty", request); - return mapping.getInputForward(); - } - catch (ProductNotFoundException e) - { - postGlobalError("error.product.not.found", e.getMessage(), request); - return mapping.getInputForward(); - } - catch(QuantityNotAvailableException e) - { - postGlobalError("error.quantity.notAvailable", e.getMessage(), request); - return mapping.getInputForward(); - } - - catch(ProductNotOnPriceListException e) - { - postGlobalError("error.product.price.not.found", e.getMessage(), request); - return mapping.getInputForward(); - } - - catch (UOMValuePrecisionNotValidException e) - { - postGlobalError("error.precision", e.getMessage(), request); - return mapping.getInputForward(); - } - - String currSymboleSales = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); - request.setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); - - - request.getSession().setAttribute(inventoryCart, cartBean); - request.getSession().setAttribute(inventoryCartItems, cartBean.getItems()); - - df.setQtyAndItem(""); - - return mapping.findForward(ADD_TO_INVENTORY_CART); - } - - public ActionForward getInventoryCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException - { - DefaultForm df = (DefaultForm) form; - - String shoppingcartHTML = InventoryCartManager.getInventoryCartAsHTML(request); - - PrintWriter writer = response.getWriter(); - writer.write(shoppingcartHTML); - - - ActionMessages errors = (ActionMessages) request.getAttribute("org.apache.struts.action.ERROR"); - if(errors != null && !errors.isEmpty()) - { - MessageResources messageResources = getResources(request); - - Iterator iter = errors.get(); - while(iter.hasNext()) - { - ActionMessage message = iter.next(); - String key = message.getKey(); - Object[] values = message.getValues(); - - String errMsg = messageResources.getMessage(key, values); - writer.write(""); - } - - } - - writer.close(); - - return null; - } - - public static final String RELOAD_CART = "reloadCart"; - public ActionForward reloadCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - return getInventoryCart(mapping,form,request,response); - } - - public ActionForward clearCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - - Properties ctx = TmkJSPEnv.getCtx(request); - Object inventoryIdAsStr = request.getSession().getAttribute(Constants.INVENTORY_ID); - Integer inventoryId = 0; - - if(inventoryIdAsStr != null) - { - inventoryId = Integer.parseInt(inventoryIdAsStr.toString()); - } - - - if(inventoryId != 0) - { - MInventory inventory = new MInventory(ctx, inventoryId,null); - inventory.delete(true); - } - - InventoryCartManager.clearInventorycart(ctx, request); - - return getInventoryCart(mapping, form, request, response); - } - - public static final String AUTO_SAVE_INVENTORY_LINES = "autoSaveInventoryLines"; - public ActionForward autoSaveInventoryLines(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd=init(mapping,form,request,response); - - if(fwd!=null) - { - return fwd; - } - - String inventoryCart = Constants.INVENTORY_CART; - String inventoryCartItems = Constants.INVENTORY_CART_ITEMS; - - InventoryCartBean cartBean = (InventoryCartBean) request.getSession().getAttribute(inventoryCart); - - Properties ctx=TmkJSPEnv.getCtx(request); - - String description = request.getParameter("description"); - String priceListIdAsStr = request.getParameter("priceListId"); - String inventoryIdAsStr = request.getParameter("inventoryId"); - int priceListId = Integer.parseInt(priceListIdAsStr); - int inventoryId = Integer.parseInt(inventoryIdAsStr); - - DefaultForm df = (DefaultForm)form; - InventoryLineBean bean = (InventoryLineBean) df.getBean(); - bean.setPriceListId(priceListId); - bean.setDescription(description); - bean.setInventoryId(inventoryId); - df.populate(bean); - - String docNo = null; - String docStatus = null; - String docInfo = null; - - MInventory inventory=null; - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); - - if(bean.getInventoryId() == null || bean.getInventoryId() == 0) - { - inventory= InventoryCartManager.createInventory(ctx,bean.getDescription(),null); - docNo = inventory.getDocumentNo(); - docStatus = inventory.getDocStatus(); - docInfo = inventory.getDocumentInfo(); - bean.setDocumentNo(docNo); - bean.setInventoryId(inventory.get_ID()); - } - else - { - MInventory inventory2 = new MInventory(ctx, bean.getInventoryId(),null); - inventory2.setDescription(description); - docNo = inventory2.getDocumentNo(); - docStatus = inventory2.getDocStatus(); - docInfo = inventory2.getDocumentInfo(); - inventory2.save(); - - InventoryCartManager.deleteInventoryLines(ctx, inventory2.getM_Inventory_ID()); - } - - - try - { - trx.start(); - - for (ItemBean itemBean : items) - { - InventoryCartManager.addInventoryLine(ctx, bean.getInventoryId(), itemBean.getProductId() , itemBean.getQtyBook(), itemBean.getQtyCount(), itemBean.getQtyCsv(), true, trx.getTrxName()); - } - - trx.commit(); - } - catch(CannotCreateInventoryLineException e) - { - trx.rollback(); - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.getSession().setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.getSession().setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - postGlobalError("error.cannot.create.inventory.line",request); - return mapping.getInputForward(); - } - catch(ProductNotFoundException e) - { - postGlobalError("error.product.name.required",request); - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.getSession().setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.getSession().setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - return mapping.getInputForward(); - } - - catch(OperationException e) - { - trx.rollback(); - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.setAttribute(Constants.INVENTORY_ID,bean.getInventoryId()); - throw new OperationException(e); - } - finally - { - trx.close(); - } - - df.populate(bean); - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.getSession().setAttribute(Constants.DOC_NO, docNo); - request.getSession().setAttribute(Constants.DOC_STATUS, docStatus); - request.getSession().setAttribute(Constants.INVENTORY_LINE_LIST,list); - request.getSession().setAttribute(Constants.INVENTORY_ID, bean.getInventoryId()); - request.getSession().setAttribute(Constants.DESCRIPTION, description); - - Env.setContext(ctx, Constants.INVENTORY_ID, bean.getInventoryId()); - Env.setContext(ctx, Constants.DESCRIPTION, description); - - request.getSession().setAttribute(Constants.INVENTORY_ID, bean.getInventoryId()); - - if((MInventory.DOCSTATUS_Drafted).equals(docStatus)) - { - docStatus = "DRAFTED"; - } - - if((MInventory.DOCSTATUS_Completed).equals(docStatus)) - { - docStatus = "COMPLETED"; - } - - if((MInventory.DOCSTATUS_Closed).equals(docStatus)) - { - docStatus = "CLOSED"; - } - - StringBuffer sb = new StringBuffer(); - sb.append("{"); - sb.append("inventoryID: \"" + bean.getInventoryId() + "\""); - sb.append(", docNo: \"" + docNo + "\""); - sb.append(", docStatus: \"" + docStatus + "\""); - sb.append(", docInfo: \"" + docInfo + "\""); - sb.append(", description: \"" + bean.getDescription() + "\""); - sb.append("}"); - - PrintWriter writer = response.getWriter(); - writer.print( sb.toString() ); - writer.flush(); - writer.close(); - - return null; - } - - public static final String GENERATE_INVENTORY_CSV = "generateInventoryCSV"; - public ActionForward generateInventoryCSV(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - InventoryLineForm If = (InventoryLineForm)form; - InventoryLineBean bean = (InventoryLineBean) If.getBean(); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); - String reportName = InventoryCartManager.createCSVForInventory(ctx,items); - String reportURI = ReportManager.getReportURI(reportName,request); - response.sendRedirect(reportURI); - - return null; - - } - - public ActionForward printInventory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException, SQLException, DocumentException, ParseException - { - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - InventoryLineBean bean = (InventoryLineBean) df.getBean(); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - String description = Env.getContext(ctx, Constants.DESCRIPTION); - - String inventoryCart = Constants.INVENTORY_CART; - String inventoryCartItems = Constants.INVENTORY_CART_ITEMS; - - InventoryCartBean cartBean = (InventoryCartBean) request.getSession().getAttribute(inventoryCart); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); - ArrayList reportData = InventoryCartManager.getInventoryData(ctx, items, trx.getTrxName()); - - String title = description; - String subtitle = null; - byte printData[] = null; - - String sql = "Select Name from AD_Org where AD_org_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, Env.getAD_Org_ID(ctx)); - - try - { - rs = pstmt.executeQuery(); - - if (rs.next()) - { - subtitle = rs.getString(1); - } - - } - catch(SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs); - DB.close(pstmt); - } - - //constructing the table - TabularReport tReport = new TabularReport(reportData); - tReport.setSortable(false); - tReport.setStyle("display"); - tReport.setTitle(title); - tReport.setSubtitle(subtitle); - tReport.createReport(); - - printData = tReport.getInventoryData(); - response.setContentType("application/pdf"); - - OutputStream os = response.getOutputStream(); - os.write(printData); - os.flush(); - os.close(); - - return null; - - } - - public static final String COMPLETE_INVENTORY_ADJUSTMENT="completeInventoryAdjustment"; - public ActionForward completeInventoryAdjustment(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - InventoryLineForm If = (InventoryLineForm)form; - InventoryLineBean bean = (InventoryLineBean) If.getBean(); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.INVENTORY_CART_ITEMS); - - try - { - - if(bean.getInventoryId() == null || bean.getInventoryId()==0) - { - MInventory inventory= InventoryCartManager.createInventory(ctx,bean.getDescription(),null); - bean.setInventoryId(inventory.get_ID()); - bean.setDocumentNo(inventory.getDocumentNo()); - bean.setDocStatus(inventory.getDocStatus()); - inventory.save(); - - trx.start(); - - for (ItemBean itemBean : items) - { - InventoryCartManager.addInventoryLine(ctx, bean.getInventoryId(), itemBean.getProductId() , itemBean.getQtyBook(), itemBean.getQtyCount(), itemBean.getQtyCsv(), true, trx.getTrxName()); - } - - trx.commit(); - - InventoryManager.completeStockAdjustment(ctx,bean.getInventoryId()); - } - else - { - InventoryCartManager.deleteInventoryLines(ctx, bean.getInventoryId()); - - trx.start(); - - for (ItemBean itemBean : items) - { - InventoryCartManager.addInventoryLine(ctx, bean.getInventoryId(), itemBean.getProductId() , itemBean.getQtyBook(), itemBean.getQtyCount(), itemBean.getQtyCsv(), true, trx.getTrxName()); - } - - trx.commit(); - - - - InventoryManager.completeStockAdjustment(ctx,bean.getInventoryId()); - } - - } - catch (OperationException e) - { - trx.rollback(); - trx.close(); - } - - request.setAttribute(Constants.DOC_NO, null); - request.setAttribute(Constants.DOC_STATUS, null); - - request.setAttribute("cartTotalCsv", null); - request.setAttribute("cartTotalBook", null); - request.setAttribute("cartTotalCount", null); - - ArrayList list = InventoryManager.getInventoryLines(ctx,bean.getInventoryId()); - request.setAttribute(Constants.COMPLETED_INVENTORY_LINE_LIST, list); - - request.setAttribute(Constants.INVENTORY_LINE_LIST, null); - request.setAttribute(Constants.INVENTORY_ID, null); - - InventoryCartManager.clearInventorycart(ctx, request); - - return mapping.findForward(COMPLETE_INVENTORY_ADJUSTMENT); - } - - public static final String ADD_STOCK_SHEETS = "addStockSheets"; - public ActionForward addStockSheets(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df = (DefaultForm) form; - FormFile file = df.getFile(); - - if(file.getFileName().trim().equals("")) - { - postGlobalError("error.file.not.found", request); - return mapping.getInputForward(); - } - - Properties ctx =TmkJSPEnv.getCtx(request); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - InventoryLineForm If = (InventoryLineForm)form; - InventoryLineBean bean = (InventoryLineBean) If.getBean(); - request.getSession().removeAttribute(Constants.IMPORT_FAIL_CSV_FILE); - - String inventoryCart = Constants.INVENTORY_CART; - String inventoryCartItems = Constants.INVENTORY_CART_ITEMS; - - ArrayList items = (ArrayList) request.getSession().getAttribute(inventoryCartItems); - - InventoryCartBean cartBean = (InventoryCartBean) request.getSession().getAttribute(inventoryCart); - - try - { - cartBean = InventoryCartManager.addItemsFromCsv(ctx, file, bean, cartBean, trx.getTrxName()); - } - catch(Exception e) - { - - String message = e.getMessage(); - - - if(message != null) - { - int index = message.indexOf("csv"); - String filename = message.substring(0,index+3); - String error = message.substring(index+3); - postGlobalError("error.process", error, request); - String csvURI = ReportManager.getReportURI(filename,request); - request.getSession().setAttribute(Constants.IMPORT_FAIL_CSV_FILE, csvURI); - } - else - { - postGlobalError("error.process", e.toString() , request); - } - - return new ActionForward("/jsp/pos/inventoryImportErrors.jsp"); - } - finally - { - - } - - request.getSession().setAttribute(inventoryCart, cartBean); - request.getSession().setAttribute(inventoryCartItems, cartBean.getItems()); - - return new ActionForward("/initInventoryCart.do"); - - } - - public ActionForward newInventoryCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx =TmkJSPEnv.getCtx(request); - InventoryCartManager.clearInventorycart(ctx, request); - return new ActionForward("/initInventoryCart.do"); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSAction.java deleted file mode 100644 index 4e704ac2bb..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSAction.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - -package org.posterita.struts.pos; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.exceptions.ApplicationException; -import org.posterita.struts.core.BaseAction; - -public class POSAction extends BaseAction -{ - public static final String POS_LOGIN = "posLogin"; - - public final ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - ActionForward fwd = super.init(mapping,form,request,response); - - if(fwd!=null) - { - return mapping.findForward(POS_LOGIN); - } - - return fwd; - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSAttributesAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSAttributesAction.java deleted file mode 100644 index 2c4bc7325b..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSAttributesAction.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on May 23, 2006 by ashley -* -*/ - -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.util.KeyNamePair; -import org.posterita.Constants; -import org.posterita.beans.AttributeValueDetailBean; -import org.posterita.businesslogic.AttributeValuesManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.struts.core.DefaultForm; - -public class POSAttributesAction extends POSDispatchAction -{ - public static final String INIT_VIEW_ATTRIBUTEVALUES = "initViewAttributeValues"; - public ActionForward initViewAttributeValues(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList attributeList = AttributeValuesManager.getAttributes(ctx); - - request.getSession().setAttribute(Constants.ATTRIBUTE_LIST, attributeList); - - return mapping.findForward(INIT_VIEW_ATTRIBUTEVALUES); - } - - public static final String LIST_ATTRIBUTEVALUES = "listAttributeValues"; - public ActionForward listAttributeValues(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm)form; - - AttributeValueDetailBean attrValBean = (AttributeValueDetailBean)df.getBean(); - - ArrayList attributeValuesList = AttributeValuesManager.getAttributeValues(ctx, attrValBean.getAttributeId().intValue()); - - request.setAttribute(Constants.ATTRIBUTE_VALUES_LIST, attributeValuesList); - - return mapping.findForward(LIST_ATTRIBUTEVALUES); - } - - public static final String INIT_EDIT_ATTRIBUTEVALUE = "initEditAttributeValue"; - public ActionForward initEditAttributeValue(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - return mapping.findForward(INIT_EDIT_ATTRIBUTEVALUE); - } - - public static final String EDIT_ATTRIBUTEVALUE = "editAttributeValue"; - /*public ActionForward editAttributeValue(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - EditAttributeForm df = (EditAttributeForm)form; - ActionErrors errors = df.validate(mapping,request); - - if(!errors.isEmpty()) - { - postGlobalError("error.required","New Name",request); - return mapping.getInputForward(); - } - - AttributeValueDetailBean attrBean = (AttributeValueDetailBean)df.getBean(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - - try - { - trx.start(); - int newAttrValueId = AttributeValuesManager.changeAttributeValue(ctx, attrBean.getAttributeValueId().intValue(), attrBean.getNewName(), trx.getTrxName()); - ProductManager.updateProductsAttribute(ctx, attrBean.getAttributeValueId().intValue(), newAttrValueId, attrBean.getAttributeId().intValue(), trx.getTrxName()); - trx.commit(); - } - catch(Exception ex) - { - trx.rollback(); - postGlobalError("error.updating.attribute", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - - return mapping.findForward(EDIT_ATTRIBUTEVALUE); - } */ - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSDispatchAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSDispatchAction.java deleted file mode 100644 index 9b740400e7..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSDispatchAction.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - -package org.posterita.struts.pos; - - - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.struts.core.BaseDispatchAction; - -public class POSDispatchAction extends BaseDispatchAction -{ - - public ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - TmkJSPEnv.getCtx(request); - return super.init(mapping, form, request, response); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSGoodsAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSGoodsAction.java deleted file mode 100644 index 3da0d27fd7..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSGoodsAction.java +++ /dev/null @@ -1,1451 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 27-Apr-2006 - */ - - -package org.posterita.struts.pos; - -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MBPartner; -import org.compiere.model.MInOut; -import org.compiere.model.MOrder; -import org.compiere.model.MPayment; -import org.compiere.process.DocAction; -import org.compiere.process.DocumentEngine; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.ItemBean; -import org.posterita.beans.OrderBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.POSSupplierBean; -import org.posterita.beans.ShoppingCartBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.businesslogic.OrderManager; -import org.posterita.businesslogic.OrderReferenceManager; -import org.posterita.businesslogic.POSGoodsManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.businesslogic.stock.StockManager; -import org.posterita.core.SessionStorage; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.core.bean.ElementBean; -import org.posterita.core.businesslogic.ElementManager; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.BPartnerNoLocationException; -import org.posterita.exceptions.BPartnerOverCreditLimitException; -import org.posterita.exceptions.InputQuantityLessThanZeroException; -import org.posterita.exceptions.InvalidOrderIDException; -import org.posterita.exceptions.NoOrderLineFoundException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.exceptions.ProductNotOnPriceListException; -import org.posterita.exceptions.QuantityNotAvailableException; -import org.posterita.exceptions.UOMValuePrecisionNotValidException; -import org.posterita.form.OrderLineForm; -import org.posterita.lib.UdiConstants; -import org.posterita.order.UDIOrderTypes; -import org.posterita.struts.core.DefaultForm; - - -public class POSGoodsAction extends POSDispatchAction -{ - public static final String CREATE_POS_GOODS_RECEIVE_NOTE="createPOSGoodsReceiveNote"; - public ActionForward createPOSGoodsReceiveNote(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd= init(mapping,form,request,response); - - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - Integer bPartnerId = bean.getBpartnerId(); - String supplierRef = bean.getDescription(); - - MOrder previousOrder= null; - previousOrder=(MOrder)request.getSession().getAttribute(Constants.PRESENT_GRN_ORDER); - - if(previousOrder!=null) - { - bean.setOrderId(Integer.valueOf(previousOrder.get_ID())); - } - else - { - bean.setOrderId(null); - } - - if( bPartnerId == null ) - { - //see if we have previously saved bpartnerId - bPartnerId= (Integer) request.getSession().getAttribute(Constants.B_PARTNER_ID); - } - else - { - //set the new bpartnerId in session - request.getSession().setAttribute(Constants.B_PARTNER_ID, bPartnerId); - } - - if( supplierRef == null ) - { - //see if we have previously saved supplierRef - supplierRef=(String) request.getSession().getAttribute(Constants.DESCRIPTION); - } - else - { - //set new supplierRef in session - request.getSession().setAttribute(Constants.DESCRIPTION, supplierRef); - } - - if( bPartnerId == null ) - { - postGlobalError("error.required.supplierName", request); - return mapping.getInputForward(); - } - - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); - - if(cartBean == null||cartBean.getItems() == null||cartBean.getItems().size() == 0) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - - MOrder goodsReceiveNote = null; - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - goodsReceiveNote = POSGoodsManager.createGoodsReceiveNote(ctx,bean,cartBean.getItems(),bPartnerId,supplierRef,trx.getTrxName()); - trx.commit(); - } - catch(BPartnerNoLocationException ex) - { - trx.rollback(); - postGlobalError("error.bpartner.nolocation", request); - return mapping.getInputForward(); - } - catch(OperationException e) - { - trx.rollback(); - throw (e); - } - finally - { - trx.close(); - } - - // Reset transaction as it has already been committed and closed - goodsReceiveNote.set_TrxName(null); - - bean.setOrderId(Integer.valueOf(goodsReceiveNote.get_ID())); - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,goodsReceiveNote); - ArrayList list = POSManager.populateOrderLines(ctx,goodsReceiveNote); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - - request.getSession().setAttribute(Constants.GOODS_RECEIVE_NOTE_ID,goodsReceiveNote.get_ID()); - request.setAttribute(Constants.GOODS_RECEIVE_NOTE_LINES,list); - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); -/* SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean);*/ - request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER); - request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER_ID); - - return mapping.findForward(CREATE_POS_GOODS_RECEIVE_NOTE); - } - - public static final String COMPLETE_GOODS_RECEIVE_NOTE="completeGoodsReceiveNote"; - public ActionForward completeGoodsReceiveNote(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - //OrderLineBean bean=(OrderLineBean) df.getBean(); - Integer goodsReceiveNoteId=(Integer) request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE_ID); - - MOrder completedGRN=null; - - Trx trx =Trx.get(TrxPrefix.getPrefix(),true); - - if(goodsReceiveNoteId==null) - { - postGlobalError("error.no.order.exists",request); - return mapping.getInputForward(); - } - - try - { - trx.start(); - completedGRN=POSGoodsManager.createAndCompletePODocuments(ctx,goodsReceiveNoteId,null); - trx.commit(); - } - catch(NoOrderLineFoundException e) - { - trx.rollback(); - postGlobalError("error.pos.no.orderline",request); - request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); - request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS); - return mapping.getInputForward(); - } - catch(OperationException e) - { - trx.rollback(); - throw new OperationException("Could not complete documents. Reason: " + e); - - } - finally - { - trx.close(); - } - - - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,completedGRN); - ArrayList list = POSManager.populateOrderLines(ctx,completedGRN); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - - //request.getSession().setAttribute(Constants.GOODS_RECEIVE_NOTE_ID,completedGRN.get_ID()); - request.setAttribute(Constants.GOODS_RECEIVE_NOTE_LINES,list); - /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ - - - - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); - request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.DESCRIPTION); - request.getSession().removeAttribute(Constants.B_PARTNER_ID); - request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_ID); - request.getSession().removeAttribute(Constants.DESCRIPTION); - request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER); - request.getSession().removeAttribute(Constants.PRESENT_GRN_ORDER_ID); - - request.removeAttribute(Constants.DESCRIPTION); - - return mapping.findForward(COMPLETE_GOODS_RECEIVE_NOTE); - } - - - public static final String CREATE_POS_GOODS_RETURN_NOTE="createPOSGoodsReturnNote"; - public ActionForward createPOSGoodsReturnNote(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - - Integer bPartnerId = bean.getBpartnerId(); - String supplierRef = bean.getDescription(); - BigDecimal quantity = bean.getQuantity(); - - if( bPartnerId == null ) - { - //see if we have previously saved bpartnerId - bPartnerId= (Integer) request.getSession().getAttribute(Constants.B_PARTNER_ID); - } - else - { - //set the new bpartnerId in session - request.getSession().setAttribute(Constants.B_PARTNER_ID, bPartnerId); - } - - if ( quantity == null) - { - throw new OperationException("Quantity cannot be null"); - } - if( quantity.equals(0) ) - { - throw new OperationException("Quantity cannot be zero"); - } - - if( supplierRef == null ) - { - //see if we have previously saved supplierRef - supplierRef=(String) request.getSession().getAttribute(Constants.DESCRIPTION); - } - else - { - //set new supplierRef in session - request.getSession().setAttribute(Constants.DESCRIPTION, supplierRef); - } - - if( bPartnerId == null ) - { - postGlobalError("error.required.supplierName", request); - return mapping.getInputForward(); - } - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - //ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); - - if(items == null || items.size() == 0) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - - MOrder previousOrder= null; - previousOrder=(MOrder)request.getSession().getAttribute(Constants.PRESENT_GOODS_RET_ORDER); - - if(previousOrder!=null) - { - bean.setOrderId(Integer.valueOf(previousOrder.get_ID())); - } - else - { - bean.setOrderId(null); - } - MOrder goodsReturnNote=null; - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - bean.getDescription(); - try - { - trx.start(); - goodsReturnNote= POSGoodsManager.createGoodsReturnNote(ctx,bean,items,bPartnerId,supplierRef,trx.getTrxName()); - trx.commit(); - - } - catch(BPartnerOverCreditLimitException e1) - { - trx.rollback(); - postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); - return mapping.getInputForward(); - } - - catch(BPartnerNoLocationException ex) - { - trx.rollback(); - postGlobalError("error.bpartner.nolocation", request); - return mapping.getInputForward(); - } - catch (OperationException e) - { - trx.rollback(); - throw new OperationException("Could not create goods return note: Reason :" + e); - } - finally - { - trx.close(); - } - bean.setOrderId(Integer.valueOf(goodsReturnNote.get_ID())); - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,goodsReturnNote); - ArrayList list = POSManager.populateOrderLines(ctx,goodsReturnNote); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - request.setAttribute(Constants.GOODS_RETURN_NOTE_LINES,list); - request.getSession().setAttribute(Constants.GOODS_RETURN_NOTE_ID,goodsReturnNote.get_ID()); - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - - request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER); - request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER_ID); - - return mapping.findForward(CREATE_POS_GOODS_RETURN_NOTE); - } - - - public static final String COMPLETE_GOODS_RETURN_NOTE="completeGoodsReturnNote"; - public ActionForward completeGoodsReturnNote(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - //OrderLineBean bean=(OrderLineBean) df.getBean(); - Integer goodsReturnNoteId=(Integer) request.getSession().getAttribute(Constants.GOODS_RETURN_NOTE_ID); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - MOrder completedGRetN=null; - - - if(goodsReturnNoteId==null) - { - postGlobalError("error.no.order.exists",request); - return mapping.getInputForward(); - } - - try - { - trx.start(); - completedGRetN=POSGoodsManager.createAndCompletePODocuments(ctx,goodsReturnNoteId,null);//same sort of order i.e. sales Order - trx.commit(); - } - catch(BPartnerOverCreditLimitException e1) - { - trx.rollback(); - postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); - return mapping.getInputForward(); - } - catch(NoOrderLineFoundException e) - { - trx.rollback(); - postGlobalError("error.pos.no.orderline",request); - request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART); - request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS); - return mapping.getInputForward(); - } - - catch(OperationException e) - { - trx.rollback(); - throw new OperationException("Could not complete documents. Reason : " + e); - } - finally - { - trx.close(); - } - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,completedGRetN); - ArrayList list = POSManager.populateOrderLines(ctx,completedGRetN); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - request.setAttribute(Constants.GOODS_RETURN_NOTE_LINES,list); - //request.getSession().setAttribute(Constants.GOODS_RETURN_NOTE_ID,completedGRetN.get_ID()); - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART); - request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_ID); - request.getSession().removeAttribute(Constants.B_PARTNER_ID); - request.getSession().removeAttribute(Constants.DESCRIPTION); - request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER); - request.getSession().removeAttribute(Constants.PRESENT_GOODS_RET_ORDER_ID); - - - request.removeAttribute(Constants.DESCRIPTION); - - return mapping.findForward(COMPLETE_GOODS_RETURN_NOTE); - } - - //public static final String GET_ALL_VENDORS="getAllVendors"; - public ActionForward getAllVendors(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - HttpSession session = request.getSession(); - - DefaultForm df = (DefaultForm) form; - OrderLineBean b = (OrderLineBean) df.getBean(); - - OrderLineForm f = (OrderLineForm) form; - OrderLineBean bean = new OrderLineBean(); - - Integer bPartnerId = (Integer) session.getAttribute(Constants.B_PARTNER_ID); - String description = (String) session.getAttribute(Constants.DESCRIPTION); - - bean.setBpartnerId(bPartnerId); - bean.setDescription(description); - - f.populate(bean); - - ArrayList list=POSGoodsManager.getAllSuppliers(ctx); - - session.setAttribute(Constants.BP_LIST,list); - return mapping.findForward(POSGoodsManager.getForward(ctx,b.getIsSales())); - } - - public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; - public ActionForward addToShoppingCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - OrderLineBean bean = (OrderLineBean) df.getBean(); - - String orderType = bean.getOrderType(); - String shoppingCart = null; - String shoppingCartItem = null; - - if(orderType.equals(Constants.GOODS_RECEIVE_NOTE)) - { - shoppingCart = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART; - shoppingCartItem = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS; - - } - else if(orderType.equals(Constants.GOODS_RETURN_NOTE)) - { - shoppingCart = Constants.GOODS_RETURN_NOTE_SHOPPING_CART; - shoppingCartItem = Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS; - - - } - else if(orderType.equals(Constants.CUSTOMER_RETURN_ORDER)) - { - shoppingCart = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART; - shoppingCartItem = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS; - - - } - - String currSymboleSales = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); - request.setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); - - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(shoppingCart); - - try - { - //POSManager.getQtyAndItem(bean); - if(bean.getProductId()==null && bean.getBarCode()==null) - { - postGlobalError("error.barcode.required", request); - return mapping.getInputForward(); - } - - if(bean.getQuantity().doubleValue() <= 0) - { - postGlobalError("error.invalid.inputQty", request); - return mapping.getInputForward(); - } - - cartBean = StockManager.addToPOSCart(ctx, bean, cartBean,Boolean.parseBoolean(bean.getIsSales()),Boolean.parseBoolean(bean.getIfAdd())); - } - catch (InputQuantityLessThanZeroException e1) - { - postGlobalError("error.invalid.inputQty", request); - return mapping.getInputForward(); - } - catch (ProductNotFoundException e2) - { - postGlobalError("error.product.not.found", e2.getMessage(), request); - return mapping.getInputForward(); - } - catch(QuantityNotAvailableException e3) - { - postGlobalError("error.quantity.notAvailable", e3.getMessage(), request); - return mapping.getInputForward(); - } - - catch(ProductNotOnPriceListException e4) - { - postGlobalError("error.product.price.not.found", e4.getMessage(), request); - return mapping.getInputForward(); - } - - catch (UOMValuePrecisionNotValidException e) - { - postGlobalError("error.precision", e.getMessage(), request); - return mapping.getInputForward(); - } - request.getSession().setAttribute(Constants.DESCRIPTION, bean.getDescription()); - bean.setDescription(bean.getDescription()); - request.getSession().setAttribute(shoppingCart, cartBean); - request.getSession().setAttribute(shoppingCartItem, cartBean.getItems()); - request.getSession().setAttribute(Constants.B_PARTNER_ID,bean.getBpartnerId()); - - df.setQtyAndItem(""); - - return mapping.findForward(ADD_TO_SHOPPING_CART); - } - - public static final String SET_SUPPLIER="setSupplier"; - public ActionForward setSupplier(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - //Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - POSSupplierBean bean = (POSSupplierBean)df.getBean(); - request.getSession().setAttribute(Constants.B_PARTNER_ID,bean.getBpartnerId()); - return mapping.findForward(SET_SUPPLIER); - } - - //NOTE:this does not select the actualy product category of compiere,its gets all the revenue recognitions - //revenue reco is used to categorise the proucts - /*public static final String GET_PRODUCT_CATEGORY="getProductCategory"; - public ActionForward getProductCategory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - - //warning if no productid is passed as a parameter the form - // will not return you the bean, it will be null. - - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - POSProductForm pf = (POSProductForm)form; - pf.validate(mapping, request); - - ProductBean bean = (ProductBean) pf.getBean(); - - bean = POSProductManager.viewPOSProduct(ctx,bean.getProductId(), null); - bean.setProductType(MProduct.PRODUCTTYPE_Item); - pf.populate(bean); - - ArrayList list = POSGoodsManager.getAllRevenueRecos(ctx); - ArrayList supList=POSGoodsManager.getAllSuppliers(ctx); - ArrayList taxList=POSGoodsManager.getAllTaxCategory(ctx); - - ArrayList uomList = POSProductManager.getUoms(ctx, null); - - request.getSession().setAttribute(Constants.BP_LIST,supList); - request.getSession().setAttribute(Constants.PRODUCT_CATEGORY_ID,list); - request.getSession().setAttribute(Constants.TAX_CATEGORY_ID,taxList); - request.getSession().setAttribute(Constants.UOM_LIST, uomList); - - return mapping.findForward(GET_PRODUCT_CATEGORY); - }*/ - - - public static final String CREATE_CUSTOMER_RETURN_ORDER="createCustomerReturnOrder"; - public ActionForward createCustomerReturnOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - HttpSession session = request.getSession(); - Integer bPartnerId = bean.getBpartnerId(); - - if( bPartnerId == null) - { - bPartnerId = (Integer) request.getSession().getAttribute(Constants.B_PARTNER_ID); - } - else - { - request.getSession().setAttribute(Constants.B_PARTNER_ID, bPartnerId); - } - - BigDecimal qty = bean.getQuantity(); - - if ( (qty == null) || (qty.doubleValue() <= 0) ) - { - postGlobalError("error.invalid.inputQty", request); - return mapping.getInputForward(); - } - - - String reason = bean.getDescription(); - - if( reason == null ) - { - reason = (String) session.getAttribute(Constants.DESCRIPTION); - - if( reason == null ) - { - postGlobalError("error.reason.required", request); - return mapping.getInputForward(); - } - } - else - { - session.setAttribute(Constants.DESCRIPTION, reason); - } - MOrder previousOrder= null; - previousOrder=(MOrder)request.getSession().getAttribute(Constants.PRESENT_CUSTOMER_RET_ORDER); - - if(previousOrder!=null) - { - bean.setOrderId(Integer.valueOf(previousOrder.get_ID())); - } - else - { - bean.setOrderId(null); - } - - String posOrderDocNumber = (String) request.getSession().getAttribute(Constants.POS_ORDER_DOC_NUMBER); - Integer paymentTermId =(Integer) request.getSession().getAttribute(Constants.CREDIT_PAYMENT_TERM_ID); - String orderType = (String) request.getSession().getAttribute(Constants.ORDER_TYPE); - - if(posOrderDocNumber!=null) - bean.setDocumentNo(posOrderDocNumber); - if(orderType!=null) - bean.setOrderType(orderType); - if(paymentTermId!=null) - bean.setPaymentTermId(paymentTermId); - if(bPartnerId==null) - bPartnerId=Integer.valueOf(POSTerminalManager.getCashBPartner(ctx).get_ID()); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - //ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); - - if(items == null || items.size() == 0) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - - MOrder customerReturnOrder=null; - MInOut materitalReceipt = null; - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - - /* - // Materital Receipt - String Description = "Test Material Receipt"; - int C_DocType_ID = 1000029; - int C_BPartner_ID = 1000000; - int M_Product_ID = 1000002; - BigDecimal Qty = BigDecimal.ONE; - int M_Warehouse_ID = 1000001; - boolean IsSOTrx = false; - String trxName = trx.getTrxName(); - - if(bPartnerId != 0) - { - C_BPartner_ID = bPartnerId; - } - - materitalReceipt = MinOutManager.createMateritalReceipt(ctx, C_DocType_ID, C_BPartner_ID, M_Warehouse_ID, IsSOTrx, trxName); - - ArrayList list = cartBean.getItems(); - - for (ItemBean itemBean : list) - { - MinOutManager.createMaterialReceiptLine(ctx, materitalReceipt.get_ID(), itemBean.getProductId(), new BigDecimal(itemBean.getQty()), trxName); - } - - // End Material Receipt - */ - - customerReturnOrder= POSGoodsManager.createCustomerReturn(ctx,bean,items,bPartnerId,reason,trx.getTrxName()); - trx.commit(); - } - catch(BPartnerNoLocationException ex) - { - trx.rollback(); - postGlobalError("error.bpartner.nolocation", request); - return mapping.getInputForward(); - } - catch(BPartnerOverCreditLimitException e1) - { - trx.rollback(); - postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); - return mapping.getInputForward(); - } - catch(OperationException e) - { - trx.rollback(); - throw new OperationException("Could not create customer return order!! Reason : " + e); - } - finally - { - trx.close(); - } - - bean.setOrderId(Integer.valueOf(customerReturnOrder.get_ID())); - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,customerReturnOrder); - ArrayList list = POSManager.populateOrderLines(ctx,customerReturnOrder); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - - if(customerReturnOrder.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) - { - ElementBean title=ElementManager.getMsg(ctx,"credit.memo"); - request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); - } - - else - { - ElementBean title=ElementManager.getMsg(ctx,"customer.returned.order"); - request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); - } - - - request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_ID,customerReturnOrder.get_ID()); - request.setAttribute(Constants.CUSTOMER_RETURN_ORDER_LINES,list); - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - - return mapping.findForward(CREATE_CUSTOMER_RETURN_ORDER); - } - - public static final String COMPLETE_CUSTOMER_RETURN_ORDER="completeCustomerReturnOrder"; - public ActionForward completeCustomerReturnOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - - Integer customerReturnOrderId=(Integer)request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); - MOrder completedCustomerReturn=null; - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - if(customerReturnOrderId==null) - { - postGlobalError("error.no.order.exists",request); - return mapping.getInputForward(); - } - - try - { - trx.start(); - completedCustomerReturn=POSGoodsManager.completeCustomerReturnOrder(ctx,customerReturnOrderId.intValue(),trx.getTrxName()); - trx.commit(); - } - catch(NoOrderLineFoundException e) - { - trx.rollback(); - postGlobalError("error.pos.no.orderline",request); - request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS); - return mapping.getInputForward(); - } - catch(BPartnerOverCreditLimitException e1) - { - trx.rollback(); - postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); - return mapping.getInputForward(); - } - - catch(OperationException e) - { - trx.rollback(); - throw new OperationException("Could not complete customer return order!! Reason : " + e); - } - finally - { - trx.close(); - } - - - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,completedCustomerReturn); - ArrayList list = POSManager.populateOrderLines(ctx,completedCustomerReturn); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - - //request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_ID,completedCustomerReturn.get_ID()); - request.setAttribute(Constants.CUSTOMER_RETURN_ORDER_LINES,list); - /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ - - - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - - if(completedCustomerReturn.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) - { - ElementBean title=ElementManager.getMsg(ctx,"credit.memo"); - request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); - } - - else - { - ElementBean title=ElementManager.getMsg(ctx,"customer.returned.order"); - request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); - } - - - request.getSession().removeAttribute(Constants.DESCRIPTION); - request.removeAttribute(Constants.DESCRIPTION); - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.DESCRIPTION); - request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); - request.getSession().removeAttribute(Constants.B_PARTNER_ID); - - request.getSession().removeAttribute(Constants.ORDER_TYPE); - request.getSession().removeAttribute(Constants.POS_ORDER_DOC_NUMBER); - request.getSession().removeAttribute(Constants.CREDIT_PAYMENT_TERM_ID); - - return mapping.findForward(COMPLETE_CUSTOMER_RETURN_ORDER); - } - - public static final String COMPLETE_POS_ORDER="completePOSOrder"; - public static final String VIEW_POS_ORDERS="viewPOSOrders"; - public static final String COMPLETED_CREDIT_ORDER="completedCreditOrder"; - - - public ActionForward viewPOSOrders(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - MOrder order= new MOrder(ctx,bean.getOrderId(),null); - String status = order.getDocStatus(); - - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,order); - - ArrayList list = POSManager.populateOrderLines(ctx,order); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - ActionForward forward=null; - - if(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equals(order.getOrderType())) - { - if( status.equals(DocAction.STATUS_Drafted) ) - { - int c_BPartner_Id = order.getC_BPartner_ID(); - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.GOODS_RECEIVE_NOTE_LINES, list ); - request.getSession().setAttribute( Constants.GOODS_RECEIVE_NOTE_ID , Integer.valueOf(order.get_ID()) ); - forward = new ActionForward("/DraftedGoodsReceiveNote.do"); - } - else - { - request.getSession().setAttribute(Constants.GOODS_RECEIVE_NOTE,order); - request.setAttribute(Constants.GOODS_RECEIVE_NOTE_LINES,list); - forward= mapping.findForward(COMPLETE_GOODS_RECEIVE_NOTE); - } - } - else if(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(order.getOrderType())) - { - if( status.equals(DocAction.STATUS_Drafted) ) - { - - int c_BPartner_Id = order.getC_BPartner_ID(); - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.GOODS_RETURN_NOTE_LINES, list ); - request.getSession().setAttribute( Constants.GOODS_RETURN_NOTE_ID, Integer.valueOf(order.get_ID()) ); - - forward = new ActionForward("/DraftedGoodsReturnNote.do"); - } - else - { - request.getSession().setAttribute(Constants.GOODS_RETURN_NOTE,order); - request.setAttribute(Constants.GOODS_RETURN_NOTE_LINES,list); - forward= mapping.findForward(COMPLETE_GOODS_RETURN_NOTE); - } - - } - else if(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equals(order.getOrderType())|| UDIOrderTypes.CREDIT_MEMO.getOrderType().equals(order.getOrderType())) - { - if(order.getPaymentRule().equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) - { - ElementBean title=ElementManager.getMsg(ctx,"credit.memo"); - request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); - } - - else - { - ElementBean title=ElementManager.getMsg(ctx,"customer.returned.order"); - request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); - } - if( status.equals(DocAction.STATUS_Drafted) ) - { - - int c_BPartner_Id = order.getC_BPartner_ID(); - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.CUSTOMER_RETURN_ORDER_LINES, list ); - request.getSession().setAttribute( Constants.CUSTOMER_RETURN_ORDER_ID, Integer.valueOf(order.get_ID()) ); - - - forward = new ActionForward("/DraftedCustomerReturnOrder.do"); - } - else - { - - request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER,order); - request.setAttribute(Constants.CUSTOMER_RETURN_ORDER_LINES,list); - forward= mapping.findForward(COMPLETE_CUSTOMER_RETURN_ORDER); - } - } - else if(UDIOrderTypes.WEBSTORE_ORDER.getOrderType().equals(order.getOrderType())) - { - - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER,order); - request.setAttribute(Constants.POS_ORDER_LINES,list); - request.setAttribute(Constants.ORDER_NAME,"Webstore Order"); - - forward= mapping.findForward(COMPLETE_POS_ORDER); - } - - else if(UDIOrderTypes.POS_ORDER.getOrderType().equals(order.getOrderType())) - { - if( status.equals(DocAction.STATUS_Drafted) ) - { - int c_BPartner_Id = order.getC_BPartner_ID(); - - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.POS_ORDER_LINES, list ); - request.getSession().setAttribute( Constants.CURRENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); - forward = new ActionForward("/DraftedPOSOrder.do"); - } - else if( status.equals(DocAction.STATUS_InProgress) ) - { - int c_BPartner_Id = order.getC_BPartner_ID(); - - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.POS_ORDER_LINES, list ); - request.setAttribute(Constants.ORDER_NAME,"POS Order"); - request.getSession().setAttribute( Constants.CURRENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); - forward= mapping.findForward(COMPLETE_POS_ORDER); - } - else - { - if( status.equals(DocAction.STATUS_Completed) ) - { //setting card & check tendered amount - BigDecimal cardTendered = POSManager.getPayment(ctx,order.get_ID(),MPayment.TENDERTYPE_CreditCard,null); - BigDecimal chequeTendered = POSManager.getPayment(ctx,order.get_ID(),MPayment.TENDERTYPE_Check,null); - - request.setAttribute(Constants.CARD_AMT_TENDERED, cardTendered); - request.setAttribute(Constants.CHEQUE_AMT_TENDERED, chequeTendered); - } - - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER,order); - request.setAttribute(Constants.POS_ORDER_LINES,list); - request.setAttribute(Constants.ORDER_NAME,"POS Order"); - forward= mapping.findForward(COMPLETE_POS_ORDER); - } - } - else if(UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) - { - if( status.equals(DocAction.STATUS_Drafted) ) - { - int c_BPartner_Id = order.getC_BPartner_ID(); - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.POS_ORDER_LINES, list ); - request.getSession().setAttribute( Constants.CURRENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); - - forward = new ActionForward("/DraftedCreditOrder.do"); - } - else - { - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER,order); - request.setAttribute(Constants.POS_ORDER_LINES,list); - forward= mapping.findForward(COMPLETED_CREDIT_ORDER); - } - } - else - { - String msg = "Unknown orderType : " + order.getOrderType(); - throw new OperationException(msg); - } - if(order.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) - { - POSManager.getAmountForMixedPayment(ctx,order,webBean); - } - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - df.populate(new OrderLineBean()); - return forward; - - } - - public static final String VIEW_COMPLETED_POS_ORDER = "viewCompletedPOSOrder"; - public ActionForward viewCompletedPOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - MOrder order= new MOrder(ctx,bean.getOrderId(),null); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx,order); - - - - ArrayList list = POSManager.populateOrderLines(ctx,order); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER,order); - request.setAttribute(Constants.POS_ORDER_LINES,list); - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - - return mapping.findForward(VIEW_COMPLETED_POS_ORDER); - } - - public static final String GET_TAX_CATEGORY="getTaxCategory"; - public ActionForward getTaxCategory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - //DefaultForm df = (DefaultForm)form; - ArrayList taxList=POSGoodsManager.getAllTaxCategory(ctx); - - request.getSession().setAttribute(Constants.TAX_CATEGORY_ID,taxList); - return mapping.findForward(GET_TAX_CATEGORY); - } - - public static final String INCREMENT_QTY = "incrementQty"; - public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - DefaultForm df = (DefaultForm) form; - OrderLineBean bean = (OrderLineBean) df.getBean(); - bean.setQuantity(new BigDecimal(1)); - - addToShoppingCart(mapping,form,request,response); - return getShoppingCart(mapping,form,request,response); - } - - public static final String DECREMENT_QTY = "decrementQty"; - public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - DefaultForm df = (DefaultForm) form; - OrderLineBean bean = (OrderLineBean) df.getBean(); - bean.setQuantity(new BigDecimal(1)); - - addToShoppingCart(mapping,form,request,response); - return getShoppingCart(mapping,form,request,response); - } - - public ActionForward getShoppingCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException - { - DefaultForm df = (DefaultForm) form; - String orderType = df.getOrderType(); - - if(orderType == null) - { - throw new OperationException("Cannot lookup for shopping cart! Cause orderType is null."); - } - - HashMap map = new HashMap(); - - map.put(Constants.GOODS_RECEIVE_NOTE, "/jsp/pos/goodsReceiveShoppingCart.jsp"); - map.put(Constants.GOODS_RETURN_NOTE, "/jsp/pos/goodsReturnShoppingCart.jsp"); - map.put(Constants.CUSTOMER_RETURN_ORDER,"/jsp/pos/customerReturnShoppingCart.jsp"); - - String url = map.get(orderType); - if(url == null) - { - throw new OperationException("Cannot lookup for shopping cart! Cause no shopping cart is define for orderType:" + orderType); - } - - return new ActionForward(url); - } - - - public static final String CREATE_CUSTOMER_RETURN_FROM_POSORDER="createCustomerReturnFromPOSOrder"; - public ActionForward createCustomerReturnFromPOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - ShoppingCartBean cart =null; - OrderBean orderBean; - try - { - orderBean = POSManager.getPOSOrderDetail(ctx,bean.getDocumentNo()); - - if(orderBean==null) - { - postGlobalError("error.orderid.notpresent",request); - return mapping.getInputForward(); - } - - if(!orderBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) - { - postGlobalError("error.only.pos.order.supported",request); - return mapping.getInputForward(); - } - - if(orderBean.getDocStatus().equalsIgnoreCase(DocumentEngine.STATUS_Drafted)) - { - postGlobalError("error.pos.order.not.completed",request); - return mapping.getInputForward(); - } - - cart = POSManager.getShoppingCartForOrder(ctx,orderBean.getOrderId(),null); - } - catch(InvalidOrderIDException e) - { - postGlobalError("error.orderid.notpresent",request); - return mapping.getInputForward(); - } - - if(orderBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) - { - ElementBean title=ElementManager.getMsg(ctx,"credit.memo"); - request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); - } - - else - { - ElementBean title=ElementManager.getMsg(ctx,"customer.returned.order"); - request.getSession().setAttribute(Constants.ORDER_TITLE,title.getName()); - } - - int bpartnerId = orderBean.getBpartnerId().intValue(); - MBPartner partner = BPartnerManager.loadBPartner(ctx, bpartnerId,null); - String partnerName = partner.getName() + " " + partner.getName2(); - partnerName = partnerName.trim(); - - df.setPartnerName(partnerName); - df.setBpartnerId(orderBean.getBpartnerId().toString()); - - request.getSession().setAttribute(Constants.B_PARTNER_ID,orderBean.getBpartnerId()); - request.getSession().setAttribute(Constants.ORDER_TYPE,orderBean.getOrderType()); - request.getSession().setAttribute(Constants.POS_ORDER_DOC_NUMBER,bean.getDocumentNo()); - request.getSession().setAttribute(Constants.CREDIT_PAYMENT_TERM_ID,orderBean.getPaymentTermId()); - request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART,cart); - request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS,cart.getItems()); - return mapping.findForward(CREATE_CUSTOMER_RETURN_FROM_POSORDER); - } - - - //--------------------------------------------------credit order------------------------------------------------------------ - public static final String LOAD_CREDIT_ORDER="loadCreditOrder"; - public ActionForward loadCreditOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - ShoppingCartBean cart =null; - OrderBean orderBean; - - try - { - orderBean = POSManager.getPOSOrderDetail(ctx,bean.getDocumentNo()); - - if(orderBean==null) - { - postGlobalError("error.orderid.notpresent",request); - return mapping.getInputForward(); - } - - if(!orderBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType()) && !orderBean.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) - { - postGlobalError("error.only.credit.order.supported",request); - return mapping.getInputForward(); - } - - if(orderBean.getDocStatus().equalsIgnoreCase(DocumentEngine.STATUS_Drafted)) - { - postGlobalError("error.credit.order.not.completed",request); - return mapping.getInputForward(); - } - - cart = POSManager.getShoppingCartForOrder(ctx,orderBean.getOrderId(),null); - } - catch(InvalidOrderIDException e) - { - postGlobalError("error.orderid.notpresent",request); - return mapping.getInputForward(); - } - - int bpartnerId = orderBean.getBpartnerId().intValue(); - MBPartner partner = BPartnerManager.loadBPartner(ctx, bpartnerId,null); - String partnerName = partner.getName() + " " + partner.getName2(); - partnerName = partnerName.trim(); - - df.setPartnerName(partnerName); - df.setBpartnerId(orderBean.getBpartnerId().toString()); - - request.getSession().setAttribute(Constants.B_PARTNER_ID,orderBean.getBpartnerId()); - request.getSession().setAttribute(Constants.ORDER_TYPE,orderBean.getOrderType()); - request.getSession().setAttribute(Constants.POS_ORDER_DOC_NUMBER,bean.getDocumentNo()); - request.getSession().setAttribute(Constants.CREDIT_PAYMENT_TERM_ID,orderBean.getPaymentTermId()); - request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART,cart); - request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS,cart.getItems()); - return mapping.findForward(LOAD_CREDIT_ORDER); - } - - //####################### Deletion of orders #######################// - //deleteGoodsReturnOrder - //deleteGoodsReceiveOrder - //deleteCustomerReturnOrder - - public static final String DELETE_GOODS_RETURN_ORDER = "deleteGoodsReturnOrder"; - public static final String DELETE_GOODS_RECEIVE_ORDER = "deleteGoodsReceiveOrder"; - public static final String DELETE_CUSTOMER_RETURN_ORDER = "deleteCustomerReturnOrder"; - - public ActionForward deleteGoodsReturnOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - Integer orderId = (Integer) request.getSession().getAttribute( Constants.GOODS_RETURN_NOTE_ID ); - - if( orderId == null ) - { - throw new OperationException("Cannot delete order. Reason: order ID not found!"); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - OrderManager.deleteDraftedOrder(ctx, orderId.intValue(), null); - trx.commit(); - } - catch(OperationException ex) - { - trx.rollback(); - postGlobalError("error.order.delete", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - //remove previously set values - request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART); - request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.GOODS_RETURN_NOTE_ID); - request.getSession().removeAttribute(Constants.B_PARTNER_ID); - request.getSession().removeAttribute(Constants.DESCRIPTION); - - //return mapping.findForward(DELETE_GOODS_RETURN_ORDER); - return new ActionForward( "/GetAllPOSVendor.do?action=getAllVendors&isSales=false" ); - } - - public ActionForward deleteGoodsReceiveOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - Integer orderId = (Integer) request.getSession().getAttribute( Constants.GOODS_RECEIVE_NOTE_ID ); - - if( orderId == null ) - { - throw new OperationException("Cannot delete order. Reason: order ID not found!"); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - OrderManager.deleteDraftedOrder(ctx, orderId.intValue(), null); - trx.commit(); - } - catch(OperationException ex) - { - trx.rollback(); - postGlobalError("error.order.delete", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - //remove previously set values - request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); - request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.GOODS_RECEIVE_NOTE_ID); - request.getSession().removeAttribute(Constants.B_PARTNER_ID); - request.getSession().removeAttribute(Constants.DESCRIPTION); - - //GetAllPOSVendor.do?action=getAllVendors&isSales=false - //return mapping.findForward(DELETE_GOODS_RECEIVE_ORDER); - return new ActionForward( "/GetAllPOSVendor.do?action=getAllVendors&isSales=true" ); - } - - public ActionForward deleteCustomerReturnOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - Integer orderId = (Integer) request.getSession().getAttribute( Constants.CUSTOMER_RETURN_ORDER_ID ); - - if( orderId == null ) - { - throw new OperationException("Cannot delete order. Reason: order ID not found!"); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - OrderManager.deleteDraftedOrder(ctx, orderId.intValue(), null); - trx.commit(); - } - catch(OperationException ex) - { - trx.rollback(); - postGlobalError("error.order.delete", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - //remove previously set values - request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); - request.getSession().removeAttribute(Constants.B_PARTNER_ID); - request.getSession().removeAttribute(Constants.DESCRIPTION); - - request.getSession().removeAttribute(Constants.ORDER_TYPE); - request.getSession().removeAttribute(Constants.POS_ORDER_DOC_NUMBER); - request.getSession().removeAttribute(Constants.CREDIT_PAYMENT_TERM_ID); - - return mapping.findForward(DELETE_CUSTOMER_RETURN_ORDER); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSInfoAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSInfoAction.java deleted file mode 100644 index 5137a8d86e..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSInfoAction.java +++ /dev/null @@ -1,208 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - -package org.posterita.struts.pos; - -import java.io.FileNotFoundException; -import java.sql.Timestamp; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; -import org.posterita.Constants; -import org.posterita.beans.POSInfoBean; -import org.posterita.beans.ReportBean; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.performanceanalysis.CSVReportManager; -import org.posterita.businesslogic.performanceanalysis.ReportDateManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.TabularReport; -import org.posterita.core.TimestampConvertor; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.DefaultForm; - -import com.lowagie.text.DocumentException; - -public class POSInfoAction extends POSDispatchAction -{ - public static final String GET_CURRENT_DAY_REPORT = "getCurrentDayReport"; - public ActionForward getCurrentDayReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - Timestamp fromDate = TimestampConvertor.getCurrentDateTimestamp(); - Timestamp toDate = TimestampConvertor.getCurrentDateTimeTimestamp(); - - ArrayList list = POSManager.getPOSInfo(ctx, fromDate, toDate, null); - request.getSession().setAttribute(Constants.POS_INFO,list); - - return mapping.findForward(GET_CURRENT_DAY_REPORT); - } - - public static final String GET_CURRENT_MONTH_REPORT = "getCurrentMonthReport"; - public ActionForward getCurrentMonthReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - Calendar cal = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - - Timestamp toDate = new Timestamp(cal.getTimeInMillis()); - - cal.set(Calendar.DATE,1); - cal.set(Calendar.HOUR_OF_DAY,0); - cal.set(Calendar.MINUTE,0); - cal.set(Calendar.SECOND,0); - cal.set(Calendar.MILLISECOND,0); - - Timestamp fromDate =new Timestamp(cal.getTimeInMillis()); - - ArrayList list = POSManager.getPOSInfo(ctx, fromDate, toDate, null); - request.getSession().setAttribute(Constants.POS_INFO, list); - - return mapping.findForward(GET_CURRENT_MONTH_REPORT); - } - - public static final String GET_CUSTOM_REPORT = "getCustomReport"; - public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, FileNotFoundException, DocumentException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - ReportBean bean = (ReportBean) df.getBean(); - - String title = "POS Info"; - String subtitle = ""; - - String dateRange = bean.getDateRange(); - String timePeriod = bean.getTimePeriod(); - - Timestamp fromDate = null; - Timestamp toDate = null; - - //setting from and to dates - if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) - { - if(timePeriod==null) - { - throw new OperationException("Invalid Parameter for timePeriod. timePeriod is NULL"); - } - - Date startDate = ReportDateManager.getStartDateForPeriod(timePeriod); - Date endDate = ReportDateManager.getEndDateForPeriod(timePeriod); - - - fromDate = new Timestamp(startDate.getTime()); - toDate = new Timestamp(endDate.getTime()); - - subtitle = "For " + timePeriod; - } - else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) - { - boolean error = false; - ActionMessages messages = new ActionMessages(); - ActionMessage message = null; - - - if((bean.getFromDate()==null)||(bean.getFromDate()=="")) - { - message = new ActionMessage("error.required.fromDate"); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - error = true; - } - - if((bean.getToDate()==null)||(bean.getToDate()=="")) - { - message = new ActionMessage("error.required.toDate"); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - error = true; - } - - if(error) - { - saveErrors(request, messages); - return mapping.getInputForward(); - } - else - { - fromDate = ReportDateManager.getFromDate(bean); - toDate = ReportDateManager.getToDate(bean); - - } - - - subtitle = "For period:"+fromDate+" to "+toDate; - } - else - { - throw new OperationException("Invalid Parameter for dateRange :" + dateRange); - } - - ArrayList reportData = POSManager.getPOSInfoReportData(ctx, fromDate, toDate, null); - - //constructing the table - TabularReport tReport = new TabularReport(reportData); - tReport.setSortable(false); - tReport.setStyle("display"); - tReport.setTitle(title); - tReport.setSubtitle(subtitle); - tReport.createReport(); - - String csvReport = CSVReportManager.generateCSVReport(ctx,reportData); - String csvURI = ReportManager.getReportURI(csvReport,request); - - String pdfReport = tReport.createPDFReport(); - String pdfURI = ReportManager.getReportURI(pdfReport,request); - - request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA,tReport.toString()); - request.getSession().setAttribute(Constants.CSV_FILE,csvURI); - - request.getSession().setAttribute(Constants.PDF_FILE,pdfURI); - - return mapping.findForward(GET_CUSTOM_REPORT); - - - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSOrderAction.java deleted file mode 100644 index 0e96f2d774..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSOrderAction.java +++ /dev/null @@ -1,2210 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on 14-Mar-2006 - */ -package org.posterita.struts.pos; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; -import java.util.logging.Level; - -import javax.management.relation.RoleNotFoundException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; -import org.apache.struts.util.MessageResources; -import org.compiere.model.MBPartner; -import org.compiere.model.MCurrency; -import org.compiere.model.MOrder; -import org.compiere.model.MPayment; -import org.compiere.model.MRole; -import org.compiere.print.ReportEngine; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.compiere.util.WebUser; -import org.posterita.Constants; -import org.posterita.beans.CheckoutBean; -import org.posterita.beans.CurrentTillAmountBean; -import org.posterita.beans.ItemBean; -import org.posterita.beans.LoginBean; -import org.posterita.beans.OrderBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.POSInfoBean; -import org.posterita.beans.RemoveSessionBean; -import org.posterita.beans.ReportBean; -import org.posterita.beans.ShoppingCartBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.businesslogic.LoginManager; -import org.posterita.businesslogic.OrderManager; -import org.posterita.businesslogic.OrderReferenceManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.PrintManager; -import org.posterita.businesslogic.ShoppingcartManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.administration.RoleManager; -import org.posterita.businesslogic.administration.UserManager; -import org.posterita.businesslogic.performanceanalysis.ReportDateManager; -import org.posterita.businesslogic.stock.StockManager; -import org.posterita.core.Configuration; -import org.posterita.core.SessionStorage; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.core.businesslogic.ElementManager; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.BPartnerNoLocationException; -import org.posterita.exceptions.BPartnerOverCreditLimitException; -import org.posterita.exceptions.DiscountLimitException; -import org.posterita.exceptions.DuplicatePINException; -import org.posterita.exceptions.InputQuantityLessThanZeroException; -import org.posterita.exceptions.InsufficientQtyException; -import org.posterita.exceptions.InvalidAddressException; -import org.posterita.exceptions.InvalidPINException; -import org.posterita.exceptions.InvalidTenderedAmountException; -import org.posterita.exceptions.LimitPriceViolatedException; -import org.posterita.exceptions.NoOrderLineSelectedException; -import org.posterita.exceptions.NotLoggedInException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.exceptions.ProductNotOnPriceListException; -import org.posterita.exceptions.QuantityNotAvailableException; -import org.posterita.exceptions.UOMValuePrecisionNotValidException; -import org.posterita.exceptions.UserInactiveException; -import org.posterita.exceptions.UserNotFoundException; -import org.posterita.form.CheckoutForm; -import org.posterita.form.OrderLineForm; -import org.posterita.form.RemoveSessionForm; -import org.posterita.lib.UdiConstants; -import org.posterita.order.UDIOrderTypes; -import org.posterita.struts.core.DefaultForm; -import org.posterita.util.TmkPrinterConstants; - -public class POSOrderAction extends POSDispatchAction -{ - /** Logger */ - private static final CLogger logger = CLogger.getCLogger(POSOrderAction.class); - - public static final String CREATE_POS_ORDER="createPOSOrder"; - public ActionForward createPOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); - - if(cartBean==null ||cartBean.getItems() == null||cartBean.getItems().size()==0) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - - String[] discountPercentage = df.getDiscountPercent(); - String[] actualPrice = df.getActualPrice(); - - double d = 0.0d; - - if(( discountPercentage != null ) && ( discountPercentage.length != 0 )) - { - for(String s : discountPercentage) - { - if(s == null || s == "") - { - continue; - } - - try - { - d = Double.parseDouble(s); - - if(d < 0) - { - postGlobalError("error.discount.nagative",request); - return mapping.getInputForward(); - } - } - catch (NumberFormatException e) - { - postGlobalError("errors.double","Discount(s)",request); - return mapping.getInputForward(); - } - } - - for(String s : actualPrice) - { - if(s == null || s == "") - { - continue; - } - - try - { - Double.parseDouble(s); - } - catch (NumberFormatException e) - { - postGlobalError("errors.double","Price(s)",request); - return mapping.getInputForward(); - } - } - } - - - - Integer bPartnerId = bean.getBpartnerId(); - - if(bPartnerId==null) - bPartnerId = (Integer) request.getSession().getAttribute(Constants.BPARTNER); - - if(bPartnerId==null) - { - String orderType = df.getOrderType(); - if(orderType!=null && orderType.equalsIgnoreCase( Constants.POS_ORDER_CUSTOMER_COMPULSORY )) - { - postGlobalError("error.required" ,"customer" ,request); - return mapping.getInputForward(); - } - - bPartnerId=Integer.valueOf(POSTerminalManager.getCashBPartner(ctx).get_ID()); - } - else - { - boolean isBPartnerPresent = BPartnerManager.isBPartnerPresent(ctx,bPartnerId.intValue(),null); - - if( !isBPartnerPresent ) - { - postGlobalError("error.pos.invalid.customerID",request); - return mapping.getInputForward(); - } - } - - // VALIDATING DISCOUNT AUTHORISATION <========= - BigDecimal discountAllowed = (BigDecimal) request.getSession().getAttribute(Constants.DISCOUNT_ALLOWED); - - - bean.setUserDiscount(discountAllowed); - bean.setBpartnerId(bPartnerId); - - //check if the order is alredy created - MOrder previousOrder= null; - previousOrder=(MOrder)request.getSession().getAttribute(Constants.PRESENT_POS_ORDER); - - if(previousOrder!=null) - { - bean.setOrderId(Integer.valueOf(previousOrder.get_ID())); - } - else - { - bean.setOrderId(null); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - MOrder posOrder=null; - try - { - trx.start(); - posOrder= POSManager.createPOSOrder(ctx,bean,cartBean.getItems(),trx.getTrxName()); - trx.commit(); - } - catch(BPartnerOverCreditLimitException e1) - { - trx.rollback(); - postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); - return mapping.getInputForward(); - } - catch(BPartnerNoLocationException ex) - { - trx.rollback(); - postGlobalError("error.bpartner.nolocation", request); - return mapping.getInputForward(); - } - catch(InvalidTenderedAmountException e) - { - trx.rollback(); - postGlobalError("error.pos.incorrect.tendered.amount",request); - return mapping.getInputForward(); - } - catch (DiscountLimitException e) - { - trx.rollback(); - postGlobalError("error.discountLimit.exceeded",request); - return mapping.getInputForward(); - } - catch(InsufficientQtyException e3) - { - trx.rollback(); - postGlobalError("error.insufficient.qty",e3.getMessage(),request); - return mapping.getInputForward(); - } - catch(LimitPriceViolatedException e3) - { - trx.rollback(); - postGlobalError("error.limit.price.violated",e3.getMessage(),request); - return mapping.getInputForward(); - } - - finally - { - trx.close(); - } - - // Reset transaction as it has already been committed and closed - posOrder.set_TrxName(null); - - bean.setOrderId(Integer.valueOf(posOrder.get_ID())); - - df.populate(new OrderLineBean()); - WebDocumentBean webBean =null; - try - { - webBean = OrderReferenceManager.getWebOrderBean(ctx, posOrder); - } - catch(InvalidAddressException e) - { - postGlobalError("error.invalid.address",request); - return mapping.getInputForward(); - } - - if(posOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) - { - if(bean.getPaymentByCash()!=null) - webBean.setPaymentByCash(bean.getPaymentByCash()); - if(bean.getPaymentByCard()!=null) - webBean.setPaymentByCard(bean.getPaymentByCard()); - if(bean.getPaymentByChq()!=null) - webBean.setPaymentbyCheque(bean.getPaymentByChq()); - } - - - ArrayList list = POSManager.populateOrderLines(ctx,posOrder); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,Integer.valueOf(posOrder.get_ID())); - request.getSession().setAttribute(Constants.PRESENT_POS_ORDER,posOrder); - request.getSession().setAttribute(Constants.ORDER_LINE_BEAN,bean); - request.getSession().setAttribute(Constants.BPARTNER,bPartnerId); - request.setAttribute(Constants.POS_ORDER_LINES,list); - request.getSession().removeAttribute(Constants.PRESENT_POS_ORDER); - request.getSession().removeAttribute(Constants.PRESENT_POS_ORDER_ID); - - - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - - //remove any previously set discount - request.getSession().removeAttribute(Constants.DISCOUNT_ALLOWED); - - return mapping.findForward(CREATE_POS_ORDER); - } - - public static final String COMPLETE_POS_ORDER="completePOSOrder"; - public ActionForward completePOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean b = (OrderLineBean) df.getBean(); - - OrderLineBean bean=(OrderLineBean) request.getSession().getAttribute(Constants.ORDER_LINE_BEAN); - - - if(bean==null) - { - bean = new OrderLineBean(); - } - bean.setAmountGiven(b.getAmountGiven()); - bean.setAmountRefunded(b.getAmountRefunded()); - - Integer orderId = (Integer) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); - MOrder completedPOSOrder=null; - - - if(orderId==null) - { - postGlobalError("error.no.order.exists",request); - return mapping.getInputForward(); - } - - - if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) - { - postGlobalError("error.pos.no.orderline",request); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - - return mapping.getInputForward(); - } - - - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - completedPOSOrder=POSManager.completePOSOrder(ctx,orderId.intValue(),bean,null); - trx.commit(); - } - catch(BPartnerOverCreditLimitException e1) - { - trx.rollback(); - MOrder posOrder = new MOrder(ctx,orderId.intValue(),null); - ArrayList list = POSManager.populateOrderLines(ctx,posOrder); - request.setAttribute(Constants.POS_ORDER_LINES,list); - postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); - return mapping.getInputForward(); - } - catch(InvalidTenderedAmountException e) - { - trx.rollback(); - MOrder posOrder = new MOrder(ctx,orderId.intValue(),null); - ArrayList list = POSManager.populateOrderLines(ctx,posOrder); - request.setAttribute(Constants.POS_ORDER_LINES,list); - postGlobalError("error.required.amount.given",request); - return mapping.getInputForward(); - } - catch(OperationException e) - { - trx.rollback(); - MOrder posOrder = new MOrder(ctx,orderId.intValue(),null); - ArrayList list = POSManager.populateOrderLines(ctx,posOrder); - request.setAttribute(Constants.POS_ORDER_LINES,list); - throw e; - } - finally - { - trx.close(); - } - - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedPOSOrder); - - if(completedPOSOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) - { - POSManager.getAmountForMixedPayment(ctx,completedPOSOrder,webBean); - } - - ArrayList list = POSManager.populateOrderLines(ctx,completedPOSOrder); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,completedPOSOrder.get_ID()); - request.setAttribute(Constants.POS_ORDER_LINES,list); - - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.BPARTNER); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); - - - //fix for invoke partial pos order - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); - request.getSession().removeAttribute(Constants.PRESENT_POS_ORDER); - request.getSession().removeAttribute( Constants.PRESENT_POS_ORDER_ID ); - - //setting card & check tendered amount - BigDecimal cardTendered = POSManager.getPayment(ctx,completedPOSOrder.get_ID(),MPayment.TENDERTYPE_CreditCard,trx.getTrxName()); - BigDecimal chequeTendered = POSManager.getPayment(ctx,completedPOSOrder.get_ID(),MPayment.TENDERTYPE_Check,trx.getTrxName()); - - request.setAttribute(Constants.CARD_AMT_TENDERED, cardTendered); - request.setAttribute(Constants.CHEQUE_AMT_TENDERED, chequeTendered); - - return mapping.findForward(COMPLETE_POS_ORDER); - } - - - public static final String COMPLETE_POS_ORDER_PRINT_INVOICE="completePOSOrderPrintInvoice"; - public ActionForward completePOSOrderPrintInvoice(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean b = (OrderLineBean) df.getBean(); - - OrderLineBean bean=(OrderLineBean) request.getSession().getAttribute(Constants.ORDER_LINE_BEAN); - bean.setAmountGiven(b.getAmountGiven()); - bean.setAmountRefunded(b.getAmountRefunded()); - - Integer orderId = (Integer) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); - MOrder completedPOSOrder=null; - - - if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) - { - postGlobalError("error.pos.no.orderline",request); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - - return mapping.getInputForward(); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - completedPOSOrder = POSManager.completePOSOrder(ctx,orderId.intValue(),bean,null); - trx.commit(); - } - catch(BPartnerOverCreditLimitException e1) - { - trx.rollback(); - postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); - return mapping.getInputForward(); - } - catch(OperationException e) - { - trx.rollback(); - throw e; - } - finally - { - trx.close(); - } - - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedPOSOrder); - - if(completedPOSOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) - { - POSManager.getAmountForMixedPayment(ctx,completedPOSOrder,webBean); - } - - ArrayList list = POSManager.populateOrderLines(ctx,completedPOSOrder); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,completedPOSOrder.get_ID()); - request.setAttribute(Constants.POS_ORDER_LINES,list); - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - - /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); - - return mapping.findForward(COMPLETE_POS_ORDER_PRINT_INVOICE); - } - - - public static final String CREATE_AND_COMPLETE_POS_ORDER="createAndCompletePOSOrder"; - public ActionForward createAndCompletePOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - bean.getPaymentByCash(); - bean.getPaymentByCard(); - bean.getPaymentByChq(); - - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); - - if(cartBean==null ||cartBean.getItems() == null||cartBean.getItems().size()==0) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - - //MOrder posOrder=(MOrder) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER); - - Integer bPartnerId = bean.getBpartnerId(); - - if(bPartnerId==null) - bPartnerId = (Integer) request.getSession().getAttribute(Constants.BPARTNER); - - if(bPartnerId==null) - { - bPartnerId=Integer.valueOf(POSTerminalManager.getCashBPartner(ctx).get_ID()); - } - else - { - boolean isBPartnerPresent = BPartnerManager.isBPartnerPresent(ctx,bPartnerId.intValue(),null); - - if( !isBPartnerPresent ) - { - postGlobalError("error.pos.invalid.customerID",request); - return mapping.getInputForward(); - } - } - - bean.setBpartnerId(bPartnerId); - - MOrder completedPOSOrder = null; - - try - { - completedPOSOrder = POSManager.createAndCompletePOSOrder(ctx,bean,cartBean.getItems()); - } - catch(BPartnerOverCreditLimitException e1) - { - - postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); - return mapping.getInputForward(); - } - catch(BPartnerNoLocationException ex) - { - postGlobalError("error.bpartner.nolocation", request); - return mapping.getInputForward(); - } - catch (DiscountLimitException e) - { - postGlobalError("error.discountLimit.exceeded",request); - return mapping.getInputForward(); - } - - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedPOSOrder); - - ArrayList list = POSManager.populateOrderLines(ctx,completedPOSOrder); - WebDocumentBean documentBean=POSManager.calculateOrderTotals(list); - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,completedPOSOrder.get_ID()); - request.setAttribute(Constants.POS_ORDER_LINES,list); - - /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); - - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - - return mapping.findForward(CREATE_AND_COMPLETE_POS_ORDER); - } - - public static final String GET_POS_PAYMENT_DETAILS="getPOSPaymentDetails"; - public ActionForward getPOSPaymentDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - MOrder order=null; - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - df.populate(new OrderLineBean()); - if(bean.getBpartnerId()!=null) - request.getSession().setAttribute(Constants.BPARTNER, bean.getBpartnerId()); - - else if(bean.getOrderId()!=null) - { - order = new MOrder(ctx, bean.getOrderId(), null); - bean.setBpartnerId(order.getC_BPartner_ID()); - request.getSession().setAttribute(Constants.BPARTNER, bean.getBpartnerId()); - - } - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); - if(cartBean==null) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - request.getSession().setAttribute(Constants.PRESENT_POS_ORDER,order); - request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART, cartBean); - request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, cartBean.getItems()); - return mapping.findForward(GET_POS_PAYMENT_DETAILS); - } - - public static final String GET_POS_CUSTOMERS="getPOSCustomers"; - public ActionForward getPOSCustomers(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - //Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - //OrderLineBean bean=(OrderLineBean) df.getBean(); - df.populate(new OrderLineBean()); - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); - - if(cartBean == null||cartBean.getItems() == null||cartBean.getItems().size() == 0) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART, cartBean); - request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, cartBean.getItems()); - - - return mapping.findForward(GET_POS_CUSTOMERS); - } - - public ActionForward deletePOSOrderLine(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - String forward = null; - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - forward = POSManager.deleteOrderLines(ctx,bean.getPosOrderLineIds(),trx.getTrxName()); - trx.commit(); - } - catch (NoOrderLineSelectedException e) - { - trx.rollback(); - SessionStorage.putPOSOrderInfo(ctx,bean,request,forward); - - postGlobalError("error.order.noOrderline.selected",request); - return mapping.getInputForward(); - } - catch(OperationException ex) - { - trx.rollback(); - throw new OperationException("Could not delete orderline. Reason : " + ex); - } - finally - { - trx.close(); - } - - Integer orderId = getCurrentOrderId(mapping, form, request, response); - //validating order - //if lines == 0 goto createpartialOrder - - //reload shopping cart - ShoppingCartBean cart = POSManager.getShoppingCartForOrder(ctx,orderId.intValue(),null); - String shoppingCart = null; - String shoppingCartItem = null; - String input = null; - - String orderType = bean.getOrderType(); - - if(orderType.equals(Constants.POS_ORDER)) - { - input = "/CreatePOSOrder.do"; - - shoppingCart = Constants.SHOPPING_ORDER_CART; - shoppingCartItem = Constants.SHOPPING_ORDER_CART_ITEMS; - } - else if(orderType.equals(Constants.GOODS_RECEIVE_NOTE)) - { - input = "/GetAllPOSVendor.do?action=getAllVendors&isSales=true"; - - shoppingCart = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART; - shoppingCartItem = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS; - } - else if(orderType.equals(Constants.GOODS_RETURN_NOTE)) - { - input = "/GetAllPOSVendor.do?action=getAllVendors&isSales=false"; - - shoppingCart = Constants.GOODS_RETURN_NOTE_SHOPPING_CART; - shoppingCartItem = Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS; - } - else if(orderType.equals(Constants.CUSTOMER_RETURN_ORDER)) - { - input = "/CustomerReturnOrder.do"; - - shoppingCart = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART; - shoppingCartItem = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS; - } - else - { - - } - - request.getSession().setAttribute(shoppingCart,cart); - request.getSession().setAttribute(shoppingCartItem,cart.getItems()); - - - if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) - { - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(shoppingCart); - request.getSession().removeAttribute(shoppingCartItem); - return new ActionForward(input); - } - - SessionStorage.putPOSOrderInfo(ctx,bean,request,forward); - df.populate(new OrderLineBean()); - return mapping.findForward(forward); - } - - public static final String VIEW_POS_INFO="viewPOSInfo"; - public ActionForward viewPOSInfo(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - ReportBean bean = (ReportBean) df.getBean(); - - Timestamp fromdate = ReportDateManager.getFromDate(bean); - Timestamp todate = ReportDateManager.getToDate(bean); - - ArrayList list = POSManager.getPOSInfo(ctx, fromdate, todate, null); - request.getSession().setAttribute(Constants.POS_INFO,list); - //df.populate(new OrderLineBean()); - - return mapping.findForward(VIEW_POS_INFO); - } - - - - public static final String INCREMENT_QTY = "incrementQty"; - public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - // Bug fix for null pointer - OrderLineForm of = (OrderLineForm) form; - if(of.getQuantity() == null) - { - of.setQuantity("1"); - } - - addToShoppingCart(mapping,form,request,response); - return getShoppingCart(mapping,form,request,response); - } - - public static final String DECREMENT_QTY = "decrementQty"; - public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - // Bug fix for null pointer - OrderLineForm of = (OrderLineForm) form; - if(of.getQuantity() == null) - { - of.setQuantity("1"); - } - - addToShoppingCart(mapping,form,request,response); - return getShoppingCart(mapping,form,request,response); - } - - public ActionForward addProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, ParseException - { - // Bug fix for null pointer - OrderLineForm of = (OrderLineForm) form; - if(of.getQuantity() == null) - { - of.setQuantity("1"); - } - - addToShoppingCart(mapping,form,request,response); - - return getShoppingCart(mapping,form,request,response); - } - - - public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; - public ActionForward addToShoppingCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - OrderLineBean bean = (OrderLineBean) df.getBean(); - // ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); - String orderType = bean.getOrderType(); - - if (orderType==null) - { orderType=(String)request.getSession().getAttribute(Constants.ORDER_TYPE); - bean.setOrderType(orderType); - df.populate(bean); - } - - String shoppingCart = Constants.SHOPPING_ORDER_CART; - String shoppingCartItem = Constants.SHOPPING_ORDER_CART_ITEMS; - String path=null; - - if (orderType.equalsIgnoreCase(Constants.POS_ORDER)) - { - path="/jsp/pos/createPOSOrder.jsp"; - } - if (orderType.equalsIgnoreCase(Constants.POS_ORDER_WITHOUT_ADVANCED)) - { - path="/jsp/pos/createPOSOrderWithoutAdvance.jsp"; - } - if (orderType.equalsIgnoreCase(Constants.QUICK_POS_ORDER)) - { - path="/jsp/pos/createPOSOrder3.jsp"; - } - if (orderType.equalsIgnoreCase(Constants.POS_ORDER_CUSTOMER_COMPULSORY)) - { - path="/jsp/pos/createPOSOrder2.jsp"; - } - else if(orderType.equalsIgnoreCase(Constants.CREDIT_ORDER)) - { - path="/jsp/pos/createCreditOrder.jsp"; - } - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(shoppingCart); - - try - { - // POSManager.getQtyAndItem(bean); - if(bean.getProductId()==null && bean.getBarCode()==null) - { - postGlobalError("error.barcode.required", request); - return new ActionForward(path); - } - - BigDecimal qty = bean.getQuantity(); - if(qty != null && qty.doubleValue() < 0.0) - { - throw new InputQuantityLessThanZeroException(""); - } - - cartBean = StockManager.addToPOSCart(ctx, bean, cartBean,true,Boolean.parseBoolean(bean.getIfAdd())); - - try - { - // cartBean = ComputeTotalLinePriceForDiscount(request, cartBean); - } - catch (Exception e) - { - e.printStackTrace(); - } - - } - catch (InputQuantityLessThanZeroException e) - { - postGlobalError("error.invalid.inputQty", request); - return new ActionForward(path); - } - catch (ProductNotFoundException e) - { - postGlobalError("error.product.not.found", e.getMessage(), request); - return new ActionForward(path); - } - catch(QuantityNotAvailableException e) - { - postGlobalError("error.quantity.notAvailable", e.getMessage(), request); - return new ActionForward(path); - } - - catch(ProductNotOnPriceListException e) - { - postGlobalError("error.product.price.not.found", e.getMessage(), request); - return new ActionForward(path); - } - - catch (UOMValuePrecisionNotValidException e) - { - postGlobalError("error.precision", e.getMessage(), request); - return new ActionForward(path); - } - - BigDecimal cartTotal = StockManager.setGrandTotal(cartBean.getItems()); - - String currSymboleSales = POSTerminalManager.getDefaultSalesCurrency(ctx).getCurSymbol(); - request.setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); - request.getSession().setAttribute(Constants.ORDER_TYPE,orderType); - - - request.getSession().setAttribute(shoppingCart, cartBean); - request.getSession().setAttribute(shoppingCartItem, cartBean.getItems()); - request.getSession().setAttribute(Constants.SHOPPING_CART_TOTAL, cartTotal); - request.getSession().setAttribute(Constants.B_PARTNER_ID,bean.getBpartnerId()); - - df.setQtyAndItem(""); - - return new ActionForward(path); - //return mapping.findForward(ADD_TO_SHOPPING_CART); - } - - public static final String GET_CURRENT_TILL_AMOUNT="getCurrentTillAmount"; - - public ActionForward getCurrentTillAmount(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - //DefaultForm df= (DefaultForm) form; - - CurrentTillAmountBean bean = POSManager.getCurrentTillAmount(ctx); - MCurrency currency = POSTerminalManager.getCurrencyOfTerminalCashBook(ctx); - request.setAttribute(Constants.CURRENCY_SYMBOLE,currency.getCurSymbol()); - request.getSession().setAttribute(Constants.CURRENT_TILL_AMOUNT,bean); - return mapping.findForward(GET_CURRENT_TILL_AMOUNT); - } - - public static final String OPEN_CASH_DRAWER="openCashDrawer"; - - public ActionForward openCashDrawer(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - String cmd = PrintManager.getOpenDrawerCmd(); - - response.setContentType("application/octet-stream"); - OutputStream os = response.getOutputStream(); - os.write(cmd.getBytes()); - os.flush(); - os.close(); - - return null; - //return mapping.findForward(OPEN_CASH_DRAWER); - } - - public static final String REPRINT_ORDER="reprintOrder"; - - public ActionForward reprintOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - DefaultForm df= (DefaultForm) form; - - OrderLineBean bean=(OrderLineBean)df.getBean(); - - OrderManager.rePrintOrder(ctx,bean.getOrderId()); - - return mapping.findForward(REPRINT_ORDER); - } - - public static final String DELETE_ORDER="deleteOrder"; - public ActionForward deleteOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - DefaultForm df= (DefaultForm) form; - - OrderBean orderBean = (OrderBean)df.getBean(); - - try - { - OrderManager.deleteDraftedOrder(ctx, orderBean.getOrderId(), null); - } - catch(OperationException ex) - { - MOrder posOrder = new MOrder(ctx,orderBean.getOrderId(),null); - ArrayList list = POSManager.populateOrderLines(ctx,posOrder); - request.setAttribute(Constants.POS_ORDER_LINES,list); - postGlobalError("error.order.delete", request); - return mapping.getInputForward(); - } - return mapping.findForward(DELETE_ORDER); - } - - public static Integer getCurrentOrderId(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) - { - DefaultForm f = (DefaultForm)form; - - String orderType = f.getOrderType(); - Integer orderId = null; - - if(orderType.equals(Constants.POS_ORDER)) - { - orderId = (Integer) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER_ID); - } - - if(orderType.equals(Constants.GOODS_RECEIVE_NOTE)) - { - orderId = (Integer) request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE_ID); - } - - if(orderType.equals(Constants.GOODS_RETURN_NOTE)) - { - orderId = (Integer) request.getSession().getAttribute(Constants.GOODS_RETURN_NOTE_ID); - } - - if(orderType.equals(Constants.CUSTOMER_RETURN_ORDER)) - { - orderId = (Integer) request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_ID); - } - - return orderId; - } - - public static final String DELETE_POS_ORDER = "deletePOSOrder"; - public ActionForward deletePOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - Integer orderId = (Integer) request.getSession().getAttribute( Constants.CURRENT_POS_ORDER_ID ); - - if( orderId == null ) - { - throw new OperationException("Cannot delete order. Reason: order ID not found!"); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - OrderManager.deleteDraftedOrder(ctx, orderId.intValue(), trx.getTrxName()); - trx.commit(); - } - catch(OperationException ex) - { - trx.rollback(); - MOrder posOrder = new MOrder(ctx,orderId.intValue(),null); - ArrayList list = POSManager.populateOrderLines(ctx,posOrder); - request.setAttribute(Constants.POS_ORDER_LINES,list); - postGlobalError("error.order.delete", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - //remove previously set values - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART); - request.getSession().removeAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - request.getSession().removeAttribute(Constants.CURRENT_POS_ORDER_ID); - request.getSession().removeAttribute(Constants.CREDIT_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.CREDITORDER_BPARTNER); - - return mapping.findForward(DELETE_POS_ORDER); - } - - public ActionForward getShoppingCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException - { - DefaultForm df = (DefaultForm) form; - String orderType = df.getOrderType(); - - String shoppingcartHTML = ShoppingcartManager.getShoppingcartAsHTML(request, orderType); - - PrintWriter writer = response.getWriter(); - writer.write(shoppingcartHTML); - - - ActionMessages errors = (ActionMessages) request.getAttribute("org.apache.struts.action.ERROR"); - if(errors != null && !errors.isEmpty()) - { - MessageResources messageResources = getResources(request); - - Iterator iter = errors.get(); - while(iter.hasNext()) - { - ActionMessage message = iter.next(); - String key = message.getKey(); - Object[] values = message.getValues(); - - String errMsg = messageResources.getMessage(key, values); - writer.write(""); - } - - } - - writer.close(); - - return null; - } - - public ActionForward getBarcodeCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException - { - DefaultForm df = (DefaultForm) form; - String orderType = df.getOrderType(); - - String shoppingcartHTML = ShoppingcartManager.getBarcodecartAsHTML(request); - - PrintWriter writer = response.getWriter(); - writer.write(shoppingcartHTML); - - - ActionMessages errors = (ActionMessages) request.getAttribute("org.apache.struts.action.ERROR"); - if(errors != null && !errors.isEmpty()) - { - MessageResources messageResources = getResources(request); - - Iterator iter = errors.get(); - while(iter.hasNext()) - { - ActionMessage message = iter.next(); - String key = message.getKey(); - Object[] values = message.getValues(); - - String errMsg = messageResources.getMessage(key, values); - writer.write(""); - } - - } - - writer.close(); - - return null; - } - - public ActionForward validateAdvanceOrderPIN(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException - { - Properties ctx=TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - String userPIN = df.getUserPIN(); - - LoginBean bean = null; - LoginManager loginManager = new LoginManager(); - String script = null; - String errorMsg = ElementManager.getMsg(ctx,"not.authorised.to.give.discount").getName(); - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); - - if (cartBean == null || cartBean.getItems().size() == 0) - { - script = "PINError('No items in cart')"; - } - else - { - try - { - bean = loginManager.getUserNameFromPIN(ctx, userPIN); - WebUser wu = loginManager.checkLoginPassword(ctx, bean); - - int roleId = Env.getAD_Role_ID(ctx); - BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null); - - if(discountAllowed != Env.ZERO) - { - script = "setAction(document.forms[0],'GetPOSPaymentDetailsAction.do','getPOSPaymentDetails');" + - "disableButtons();"; - - request.getSession().setAttribute(Constants.DISCOUNT_ALLOWED, discountAllowed); - } - else - { - script = "PINError('" + errorMsg + "');" ; - } - } - catch (DuplicatePINException e) - { - script = "PINError('" + errorMsg + "');" ; - } - catch (InvalidPINException e) - { - script = "PINError('" + errorMsg + "');" ; - } - catch (UserNotFoundException e) - { - script = "PINError('" + errorMsg + "');" ; - } - catch (UserInactiveException e) - { - script = "PINError('" + errorMsg + "');" ; - } - catch (NotLoggedInException e) - { - script = "PINError('" + errorMsg + "');" ; - } - catch (SQLException e) - { - throw new OperationException(e); - } - catch (OperationException e) - { - throw new OperationException(e); - } - } - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - - public ActionForward skipValidation(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException - { - Properties ctx=TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - LoginBean bean = null; - LoginManager loginManager = new LoginManager(); - String script = null; - String errorMsg = ElementManager.getMsg(ctx,"not.authorised.to.give.discount").getName(); - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); - - if (cartBean == null || cartBean.getItems().size() == 0) - { - script = "PINError('No items in cart')"; - } - else - { - try - { - int roleId = Env.getAD_Role_ID(ctx); - - BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null); - - if(discountAllowed != Env.ZERO) - { - script = "setAction(document.forms[0],'GetPOSPaymentDetailsAction.do','getPOSPaymentDetails');" + - "disableButtons();"; - - request.getSession().setAttribute(Constants.DISCOUNT_ALLOWED, discountAllowed); - } - else - { - script = "PINError('" + errorMsg + "');" ; - } - } - catch (OperationException e) - { - throw new OperationException(e); - } - } - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - - public ActionForward validateAdvanceOrderPIN2(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException - { - Properties ctx=TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - String userPIN = df.getUserPIN(); - - LoginBean bean = null; - LoginManager loginManager = new LoginManager(); - String script = null; - - try - { - bean = loginManager.getUserNameFromPIN(ctx, userPIN); - WebUser wu = loginManager.checkLoginPassword(ctx, bean); - - int roleId = Env.getAD_Role_ID(ctx); - - BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null); - - if(discountAllowed != Env.ZERO) - { - script = "setAction(document.forms[0],'GetPOSPaymentDetailsAction2.do','getPOSPaymentDetails');" + - "disableButtons();"; - - request.getSession().setAttribute(Constants.DISCOUNT_ALLOWED, discountAllowed); - } - else - { - script = "PINError('It seems that you are not authorised to give discounts.');" ; - } - } - catch (DuplicatePINException e) - { - script = "PINError('It seems that you are not authorised to give discounts.');" ; - } - catch (InvalidPINException e) - { - script = "PINError('It seems that you are not authorised to give discounts.');" ; - } - catch (UserNotFoundException e) - { - script = "PINError('It seems that you are not authorised to give discounts.');" ; - } - catch (UserInactiveException e) - { - script = "PINError('It seems that you are not authorised to give discounts.');" ; - } - catch (NotLoggedInException e) - { - script = "PINError('It seems that you are not authorised to give discounts.');" ; - } - catch (SQLException e) - { - throw new OperationException(e); - } - catch (OperationException e) - { - throw new OperationException(e); - } - - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - - public ActionForward getPrintOrderData(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException - { - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - OrderLineBean bean = (OrderLineBean) df.getBean(); - - Integer C_Order_ID = bean.getOrderId(); - - if(C_Order_ID == null) - return null; - - String printingType = POSManager.getPrintingTypeFromCookie(request); - boolean cashDrawerPresent = POSManager.getCashDrawerStatusFromCookie(request); - - if (printingType == null) - { - printingType = TmkPrinterConstants.SLIP_PRINTER_9PIN; - } - - byte printData[] = null; - byte [] openCashDrawer = {10,27,112,48,55,1}; - - String args = "showFooter=true;lineLength=40;priceWithVat=true;showDiscount=true;showLogo=false;showBarcode=false;"; - - if (TmkPrinterConstants.SLIP_PRINTER_9PIN.equalsIgnoreCase(printingType)) - { - String data = PrintManager.getPrintData(ctx, C_Order_ID, args, null); - response.setContentType("application/octet-stream"); - printData = data.getBytes(); - } - else if (TmkPrinterConstants.SLIP_PRINTER_THERMAL.equalsIgnoreCase(printingType)) - { - args = "showFooter=true;lineLength=64;priceWithVat=true;showDiscount=true;showLogo=false;showBarcode=false;"; - String data = PrintManager.getPrintData(ctx, C_Order_ID, args, null); - response.setContentType("application/octet-stream"); - printData = data.getBytes(); - } - else if (TmkPrinterConstants.NORMAL_PRINTER.equalsIgnoreCase(printingType)) - { - printData = PrintManager.getPDFData(ctx, ReportEngine.ORDER, C_Order_ID); - response.setContentType("application/pdf"); - } - else - { - logger.log(Level.SEVERE, "Printing Type not defined, PrintingType: " + printingType); - return null; - } - - OutputStream os = response.getOutputStream(); - - if(bean.getOpenDrawer() && cashDrawerPresent) - { - os.write(openCashDrawer); - } - - os.write(printData); - os.flush(); - os.close(); - - - return null; - } - - public static final String GET_ORDER_SHOPPING_CART="getOrderShoppingCart"; - public ActionForward getOrderShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException - { - - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - OrderLineBean bean = (OrderLineBean) df.getBean(); - ActionForward forward=null; - - Integer orderId = bean.getOrderId(); - MOrder order = new MOrder(ctx,orderId,null); - - ShoppingCartBean cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); - if(cart == null) - { - cart = POSManager.getShoppingCartForOrder(ctx, order.get_ID(), null); - } - - - int c_BPartner_Id = order.getC_BPartner_ID(); - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - - if((Constants.POS_ORDER_WITHOUT_ADVANCED).equalsIgnoreCase(df.getOrderType())) - { - cart = POSManager.getShoppingCartForOrder(ctx, order.get_ID(), null); - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART , cart ); - request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART_ITEMS , cart.getItems() ); - request.getSession().setAttribute( Constants.PRESENT_POS_ORDER , order ); - request.getSession().setAttribute( Constants.PRESENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); - - forward = new ActionForward("/CreatePOSOrderWithoutAdvanced.do"); - - df.populate(new OrderLineBean()); - return forward; - } - - if((Constants.POS_ORDER_CUSTOMER_COMPULSORY).equalsIgnoreCase(df.getOrderType())) - { - cart = POSManager.getShoppingCartForOrder(ctx, order.get_ID(), null); - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART , cart ); - request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART_ITEMS , POSManager.getItemBean(cart.getItems()) ); - request.getSession().setAttribute( Constants.PRESENT_POS_ORDER , order ); - request.getSession().setAttribute( Constants.PRESENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); - - forward = new ActionForward("/CreatePOSOrder2.do"); - - df.populate(new OrderLineBean()); - return forward; - } - - if(order.getOrderType().equals(UDIOrderTypes.POS_ORDER.getOrderType())) - { - cart = POSManager.getShoppingCartForOrder(ctx, order.get_ID(), null); - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART , cart ); - request.getSession().setAttribute( Constants.SHOPPING_ORDER_CART_ITEMS , POSManager.getItemBean(cart.getItems())); - request.getSession().setAttribute( Constants.PRESENT_POS_ORDER , order ); - request.getSession().setAttribute( Constants.PRESENT_POS_ORDER_ID , Integer.valueOf(order.get_ID()) ); - df.populate(new OrderLineBean()); - forward = new ActionForward("/CreatePOSOrder.do"); - } - else if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType())) - { - cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART); - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART , cart ); - - if (cart != null) - { - request.getSession().setAttribute( Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS , cart.getItems() ); - request.getSession().setAttribute( Constants.PRESENT_GRN_ORDER , order ); - request.getSession().setAttribute( Constants.PRESENT_GRN_ORDER_ID , Integer.valueOf(order.get_ID()) ); - } - - forward = new ActionForward("/GetAllPOSVendor.do?action=getAllVendors&isSales=true"); - } - else if(order.getOrderType().equals(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType())) - { - cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.GOODS_RETURN_NOTE_SHOPPING_CART); - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.GOODS_RETURN_NOTE_SHOPPING_CART, cart ); - request.getSession().setAttribute( Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS,cart.getItems() ); - request.getSession().setAttribute( Constants.PRESENT_GOODS_RET_ORDER , order ); - request.getSession().setAttribute( Constants.PRESENT_GOODS_RET_ORDER_ID , Integer.valueOf(order.get_ID()) ); - - forward = new ActionForward("/GetAllPOSVendor.do?action=getAllVendors&isSales=false"); - } - else if(order.getOrderType().equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType())) - { - cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART, cart ); - request.getSession().setAttribute( Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS, POSManager.getItemBean(cart.getItems()) ); - request.getSession().setAttribute( Constants.PRESENT_CUSTOMER_RET_ORDER , order ); - request.getSession().setAttribute( Constants.PRESENT_CUSTOMER_RET_ORDER_ID , Integer.valueOf(order.get_ID()) ); - - forward = new ActionForward("/CustomerReturnOrder.do"); - - } - else if(order.getOrderType().equals(UDIOrderTypes.CREDIT_ORDER.getOrderType())) - { - cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.CREDIT_ORDER_SHOPPING_CART); - request.getSession().setAttribute(Constants.CREDITORDER_BPARTNER, Integer.valueOf(c_BPartner_Id)); - request.getSession().setAttribute( Constants.CREDIT_ORDER_SHOPPING_CART , cart ); - request.getSession().setAttribute( Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS , POSManager.getItemBean(cart.getItems()) ); - request.getSession().setAttribute( Constants.PRESENT_CREDIT_ORDER , order ); - request.getSession().setAttribute( Constants.PRESENT_CREDIT_ORDER_ID , Integer.valueOf(order.get_ID()) ); - forward = new ActionForward("/InitCreateCreditOrderAction.do?action=initCreateCreditOrder"); - - } - - else if(order.getOrderType().equals(UDIOrderTypes.CREDIT_MEMO.getOrderType())) - { - cart = (ShoppingCartBean)request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART); - OrderBean orderBean = POSManager.getPOSOrderDetail(ctx,order.getDocumentNo()); - int bpartnerId = orderBean.getBpartnerId().intValue(); - MBPartner partner = BPartnerManager.loadBPartner(ctx, bpartnerId,null); - String partnerName = partner.getName() + " " + partner.getName2(); - partnerName = partnerName.trim(); - - df.setPartnerName(partnerName); - df.setBpartnerId(orderBean.getBpartnerId().toString()); - - request.getSession().setAttribute(Constants.B_PARTNER_ID,orderBean.getBpartnerId()); - request.getSession().setAttribute(Constants.ORDER_TYPE,orderBean.getOrderType()); - request.getSession().setAttribute(Constants.POS_ORDER_DOC_NUMBER,bean.getDocumentNo()); - request.getSession().setAttribute(Constants.CREDIT_PAYMENT_TERM_ID,orderBean.getPaymentTermId()); - if (cart != null) - { - request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART,cart); - request.getSession().setAttribute(Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS,cart.getItems()); - } - forward = new ActionForward("/CreditMemoAction.do"); - - } - else - { - String msg = "Unknown orderType : " + order.getOrderType(); - throw new OperationException(msg); - } - df.populate(new OrderLineBean()); - return forward; - } - - public static final String GET_CUSTOMER_RETURN_ORDER_SHOPPING_CART = "getCustomerReturnOrderShoppingCart"; - public ActionForward getCustomerReturnOrderShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException - { - getOrderShoppingCart(mapping,form,request,response); - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - Integer bpartnerId = (Integer) request.getSession().getAttribute(Constants.B_PARTNER_ID); - - MBPartner partner = BPartnerManager.loadBPartner(ctx, bpartnerId.intValue(),null); - String partnerName = partner.getName() + " " + partner.getName2(); - partnerName = partnerName.trim(); - - df.setPartnerName(partnerName); - df.setBpartnerId(bpartnerId.toString()); - - return mapping.findForward(GET_CUSTOMER_RETURN_ORDER_SHOPPING_CART); - } - - public static final String GET_CUSTOMER_RETURN_ORDER_SHOPPING_CART2 = "getCustomerReturnOrderShoppingCart2"; - public ActionForward getCustomerReturnOrderShoppingCart2(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException - { - getOrderShoppingCart(mapping,form,request,response); - - /* - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - Integer bpartnerId = (Integer) request.getSession().getAttribute(Constants.B_PARTNER_ID); - - MBPartner partner = BPartnerManager.loadBPartner(ctx, bpartnerId.intValue(),null); - String partnerName = partner.getName() + " " + partner.getName2(); - partnerName = partnerName.trim(); - - df.setPartnerName(partnerName); - df.setBpartnerId(bpartnerId.toString()); - */ - - return mapping.findForward(GET_CUSTOMER_RETURN_ORDER_SHOPPING_CART2); - } - - public static final String GET_CREDIT_MEMO_SHOPPING_CART = "getCreditMemoShoppingCart"; - public ActionForward getCreditMemoShoppingCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException - { - getCustomerReturnOrderShoppingCart(mapping,form,request,response); - return mapping.findForward(GET_CREDIT_MEMO_SHOPPING_CART); - } - - public static final String REMOVE_SESSION_FOR_NEW_OREDR="removeSessionForNewOrder"; - public ActionForward removeSessionForNewOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, OperationException, ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - - Properties ctx=TmkJSPEnv.getCtx(request); - RemoveSessionForm df = (RemoveSessionForm) form; - RemoveSessionBean bean = (RemoveSessionBean) df.getBean(); - - SessionStorage.removeSession(ctx,request); - String forwd =POSManager.getForward(ctx,bean.getOrderType()); - - - return new ActionForward(forwd); - } - - //---------------------------------------------------------------------------------------------- - - public static final String UPDATE_QTY = "updateQty"; - public ActionForward updateQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx=TmkJSPEnv.getCtx(request); - - // Bug fix for null pointer - OrderLineForm of = (OrderLineForm) form; - if(of.getQuantity() == null) - { - of.setQuantity("1"); - } - - OrderLineBean bean = (OrderLineBean) of.getBean(); - Integer product_id = bean.getProductId(); - BigDecimal quantity = bean.getQuantity(); - Integer priceListId = bean.getPriceListId(); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - StockManager.updateItemFromPOSList(ctx, priceListId, items, product_id, quantity); - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART); - cartBean.setItems(items); - BigDecimal cartTotal = StockManager.setGrandTotal(items); - request.getSession().setAttribute(Constants.SHOPPING_CART_TOTAL, cartTotal); - request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, items); - - if(quantity.doubleValue() == 0.0d) - { - request.getSession().setAttribute(Constants.SHOPPING_CART_DISCOUNTED_TOTAL, Env.ZERO); - } - return getShoppingCart(mapping,form,request,response); - } - - public static final String RELOAD_CART = "reloadCart"; - public ActionForward reloadCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - return getShoppingCart(mapping,form,request,response); - } - - public static final String UPDATE_PRICELIST = "updatePriceList"; - public ActionForward updatePriceList(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx=TmkJSPEnv.getCtx(request); - - OrderLineForm of = (OrderLineForm) form; - OrderLineBean bean = (OrderLineBean) of.getBean(); - - Integer priceListId = bean.getPriceListId(); - int oldPriceListId = ShoppingcartManager.getPriceList(request); - - if(oldPriceListId != priceListId) - { - try - { - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - StockManager.setPOSItemPrices(ctx, priceListId, items, true); - request.getSession().setAttribute(Constants.SHOPPING_ORDER_CART_ITEMS, items); - request.getSession().setAttribute(Constants.ORDER_PRICE_LIST, priceListId); - } - catch(ProductNotOnPriceListException e) - { - postGlobalError("error.product.price.not.found", e.getMessage(), request); - } - catch(OperationException e) - { - postGlobalError("error.process", e.getMessage(), request); - } - } - - return getShoppingCart(mapping,form,request,response); - } - - public static final String RESET_USER = "resetUser"; - public ActionForward resetUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx=TmkJSPEnv.getCtx(request); - OrderLineForm of = (OrderLineForm) form; - OrderLineBean bean = (OrderLineBean) of.getBean(); - - StringBuffer sb = new StringBuffer(); - - try - { - MRole role = new MRole(ctx, bean.getRoleId(), null); - float discountAllowed = role.getUserDiscount().floatValue(); - boolean overrideLimit = role.isOverwritePriceLimit(); - boolean discountUptoPriceLimit = role.isDiscountUptoLimitPrice(); - boolean discountOnTotal = role.isDiscountAllowedOnTotal(); - - CheckoutForm cf = (CheckoutForm) request.getSession().getAttribute("CheckoutForm"); - if(cf == null) - { - cf = new CheckoutForm(); - } - - cf.setDiscountLimit(discountAllowed + ""); - cf.setIsOverwritePriceLimit(overrideLimit + ""); - cf.setIsDiscountOnTotal(discountOnTotal + ""); - cf.setIsDiscountUptoLimitPrice(discountUptoPriceLimit + ""); - - request.getSession().setAttribute("CheckoutForm", cf); - - sb.append("{ roleId:").append(role.getAD_Role_ID()).append(","); - sb.append("discountLimit:").append(discountAllowed).append(","); - sb.append("overrideLimit:").append(overrideLimit).append(","); - sb.append("discountOnTotal:").append(discountOnTotal).append(","); - sb.append("discountUptoPriceLimit:").append(discountUptoPriceLimit).append("}"); - - } - catch (Exception e) - { - sb.append("{error:'" + e.getMessage() + "'}"); - } - - PrintWriter writer = response.getWriter(); - writer.write(sb.toString()); - writer.close(); - - return null; - } - - - public static final String VALIDATE_PIN = "validatePIN"; - public ActionForward validatePIN(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - String pin = request.getParameter("pin"); - Properties ctx=TmkJSPEnv.getCtx(request); - - StringBuffer sb = new StringBuffer(); - - try - { - int ad_role_id = UserManager.getRoleId(ctx, pin, null); - float discountAllowed = UserManager.getDiscountAllowed(ctx, pin, null).floatValue(); - boolean overrideLimit = UserManager.isOverridePriceLimitAllowed(ctx, pin, null); - boolean discountUptoPriceLimit = UserManager.isDiscountUptoPriceLimit(ctx, pin, null); - boolean discountOnTotal = UserManager.isDiscountAllowedOnTotal(ctx, pin, null); - - CheckoutForm cf = (CheckoutForm) request.getSession().getAttribute("CheckoutForm"); - if(cf == null) - { - cf = new CheckoutForm(); - } - - cf.setDiscountLimit(discountAllowed + ""); - cf.setIsOverwritePriceLimit(overrideLimit + ""); - cf.setIsDiscountOnTotal(discountOnTotal + ""); - cf.setIsDiscountUptoLimitPrice(discountUptoPriceLimit + ""); - - request.getSession().setAttribute("CheckoutForm", cf); - - sb.append("{ roleId:").append(ad_role_id).append(","); - sb.append("discountLimit:").append(discountAllowed).append(","); - sb.append("overrideLimit:").append(overrideLimit).append(","); - sb.append("discountOnTotal:").append(discountOnTotal).append(","); - sb.append("discountUptoPriceLimit:").append(discountUptoPriceLimit).append("}"); - - } - catch (UserNotFoundException e) - { - sb.append("{error:'Invalid PIN!'}"); - } - catch (RoleNotFoundException e) - { - sb.append("{error:'Invalid PIN!'}"); - } - - PrintWriter writer = response.getWriter(); - writer.write(sb.toString()); - writer.close(); - - return null; - } - - /** - * This method is called from the order screens - * Parameters supplied are: - * 1. amountTendered - * 2. cardNo - * 3. chequeNo - * 4. cashAmt - * 5. chequeAmt - * 6. cardAmount - * 7. bpartnerId - * 8. tenderType - * 9. discounts - * 10. orderType - * 11. discountLimit - */ - public static final String CHECKOUT = "checkout"; - public ActionForward checkout(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - CheckoutForm cf = (CheckoutForm) form; - CheckoutBean bean = (CheckoutBean) cf.getBean(); - String input = ""; - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - int c_order_id = -1; - - try - { - trx.start(); - //Bug fix for credit sales - //set order type to credit order if tender type is credit - /* - if("Credit".equals(bean.getTenderType()) && - UDIOrderTypes.POS_ORDER.getOrderType().compareTo(bean.getOrderType()) == 0) - { - bean.setOrderType(UDIOrderTypes.CREDIT_ORDER.getOrderType()); - } - */ - - if(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equalsIgnoreCase(bean.getOrderType())) - { - input = "/CreatePOSOrderScreen.do"; - c_order_id = POSManager.createGoodsReceiveNote(ctx, bean, request, trx.getTrxName()); - } - - if(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equalsIgnoreCase(bean.getOrderType())) - { - input = "/CreatePOSOrderScreen.do"; - c_order_id = POSManager.createGoodsReturnNote(ctx, bean, request, trx.getTrxName()); - } - - if(UDIOrderTypes.POS_ORDER.getOrderType().equalsIgnoreCase(bean.getOrderType()) - || UDIOrderTypes.CREDIT_ORDER.getOrderType().equalsIgnoreCase(bean.getOrderType())) - { - input = "/CreatePOSOrderScreen.do"; - //get shopping cart items - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - c_order_id = POSManager.checkoutOrder(ctx, bean, items, trx.getTrxName()); - } - - /* - if(UDIOrderTypes.CREDIT_ORDER.getOrderType().equalsIgnoreCase(bean.getOrderType())) - { - input = "/CreatePOSOrderScreen.do"; - //get shopping cart items - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - c_order_id = POSManager.checkoutOrder(ctx, bean, items, trx.getTrxName()); - } - */ - - if(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equalsIgnoreCase(bean.getOrderType())) - { - input = "/CreatePOSOrderScreen.do"; - //get shopping cart items - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_ORDER_CART_ITEMS); - c_order_id = POSManager.createCustomerReturnOrder(ctx, bean, request, trx.getTrxName()); - } - - trx.commit(); - } - catch (Exception e) - { - trx.rollback(); - postGlobalError("error.process", e.getMessage(), request); - e.printStackTrace(); - - return new ActionForward(input); - } - finally - { - trx.close(); - } - - ShoppingcartManager.clearShoppingcart(request); - request.getSession().removeAttribute(Constants.BPARTNER_ID); - request.getSession().removeAttribute(Constants.BPARTNER_NAME); - request.getSession().removeAttribute(Constants.BPARTNER_CREDIT); - request.getSession().removeAttribute(Constants.ORDER_PRICE_LIST); - //return mapping.findForward(CHECKOUT); - return new ActionForward("/ViewPOSOrder.do?orderType=" + bean.getOrderType() + "&orderId=" + c_order_id); - } - - public ActionForward clearCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ShoppingcartManager.clearShoppingcart(request); - - return getShoppingCart(mapping, form, request, response); - } - - public static String SET_DISCOUNT = "setDiscount"; - public ActionForward setDiscount(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - CheckoutForm cf = (CheckoutForm) form; - CheckoutBean bean = (CheckoutBean) cf.getBean(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - try - { - trx.start(); - POSManager.setDiscount(ctx, bean, request, trx.getTrxName()); - trx.commit(); - } - catch (DiscountLimitException e) - { - postGlobalError("error.process", e.getMessage(), request); - trx.rollback(); - } - catch(OperationException e) - { - postGlobalError("error.process", e.getMessage(), request); - trx.rollback(); - } - finally - { - trx.close(); - } - return new ActionForward("/CreatePOSOrderScreen.do"); - } - - public ActionForward setQuickDiscount(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - CheckoutForm cf = (CheckoutForm) form; - CheckoutBean bean = (CheckoutBean) cf.getBean(); - StringBuffer sb = new StringBuffer(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - try - { - trx.start(); - POSManager.setQuickDiscount(ctx, bean, request, trx.getTrxName()); - sb.append("{status: 'OK'}"); - trx.commit(); - } - catch (DiscountLimitException e) - { - trx.rollback(); - sb.append("{error:'" + e.getMessage() + "'}"); - - } - catch(OperationException e) - { - trx.rollback(); - sb.append("{error:'" + e.getMessage() + "'}"); - } - finally - { - trx.close(); - } - - PrintWriter writer = response.getWriter(); - writer.write(sb.toString()); - writer.close(); - - return null; - - } - - - public static final String LOAD_ORDER_SCREEN = "loadOrderScreen"; - public ActionForward loadOrderScreen(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - Object isSales = request.getParameter(Constants.IS_SOTRX); - if (isSales == null) - { - return mapping.getInputForward(); - } - String isSO = String.valueOf(isSales); - Boolean isSOTrx = Boolean.valueOf(isSO); - Configuration config = Configuration.getConfiguration(request); - - DefaultForm df = (DefaultForm) form; - String orderType = df.getOrderType(); - - if(orderType == null) - { - if (isSOTrx) - { - orderType = UDIOrderTypes.POS_ORDER.getOrderType(); - } - else - { - orderType = UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType(); - } - } - else - { - if(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(orderType)) - { - isSOTrx = false; - config.setPaymentRule(Constants.PAYMENT_RULE_CREDIT); - } - - if(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equals(orderType)) - { - isSOTrx = true; - config.setPaymentRule(Constants.PAYMENT_RULE_CREDIT); - } - } - - config.setOrderType(orderType); - config.setIsSOTrx(isSOTrx); - - return new ActionForward("/CreatePOSOrderScreen.do"); - } - - - public static final String LOAD_ADVANCED_ORDER_SCREEN = "loadAdvancedOrderScreen"; - public ActionForward loadAdvancedOrderScreen(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - Object isSO = request.getParameter(Constants.IS_SOTRX); - Boolean isSOTrx = Boolean.valueOf(String.valueOf(isSO)); - Object pListId = request.getSession().getAttribute(Constants.ORDER_PRICE_LIST); - Integer priceListId = PriceListManager.getDefaultPriceListId(ctx, isSOTrx); - try - { - if (pListId != null) - { - String prListId = String.valueOf(pListId); - priceListId = Integer.valueOf(prListId); - } - } - catch (NumberFormatException e) - { - } - - int roleId = Env.getAD_Role_ID(ctx); - float discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null).floatValue(); - boolean isAllowedOverridePriceLimit = RoleManager.isOverridePriceLimitAllowed(ctx, roleId, null); - - String orderType = String.valueOf(request.getSession().getAttribute(Constants.ORDER_TYPE)); - - return new ActionForward("/CreateAdvancedPOSOrderScreen.do?discountAllowed="+discountAllowed+ - "&isAllowedOverridePriceLimit="+isAllowedOverridePriceLimit+"&orderType="+orderType+"&priceListId="+ priceListId); - } - - public ActionForward saveBPartnerInfo(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd= init(mapping,form,request,response); - if (fwd!=null) - { - return fwd; - } - - Properties ctx=TmkJSPEnv.getCtx(request); - String bp = String.valueOf(request.getParameter("bPartnerId")); - String plId = String.valueOf(request.getParameter("priceListId")); - try - { - Integer bPartnerId = Integer.valueOf(bp); - String name = String.valueOf(request.getParameter("name")); - String creditLimit = String.valueOf(request.getParameter("creditLimit")); - Integer priceListId = Integer.valueOf(plId); - - request.getSession().setAttribute(Constants.ORDER_PRICE_LIST, priceListId); - request.getSession().setAttribute(Constants.BPARTNER_ID, bPartnerId); - request.getSession().setAttribute(Constants.BPARTNER_NAME, name); - request.getSession().setAttribute(Constants.BPARTNER_CREDIT, creditLimit); - } - catch (NumberFormatException e) - { - } - - return null; - } - - public static ShoppingCartBean ComputeTotalLinePriceForDiscount(HttpServletRequest request, ShoppingCartBean cartBean) throws Exception - { - CheckoutBean checkoutBean = (CheckoutBean) request.getSession().getAttribute(Constants.CHECKOUT_BEAN); - - if(checkoutBean == null) - { - return cartBean; - } - - BigDecimal[] totalLinePrices = checkoutBean.getDiscountedPrice(); - BigDecimal[] qtyPerLine = checkoutBean.getQtyPerLine(); - - ArrayList itemList = cartBean.getItems(); - Iterator itr = itemList.iterator(); - - for(int i=0; i< totalLinePrices.length; i++) - { - ItemBean itemBean = cartBean.getItems().get(i); - BigDecimal totalLinePrice = itemBean.getPrice(); - - - //When increasing or decreasing quantity after giving discount on percentage, give the same percentage - //discount on this new totalLine - if (itemBean.getIsDiscountOnPercentage()) - { - if (itemBean.getDiscountPercent().doubleValue() > 0) - { - totalLinePrice = totalLinePrice.multiply(((Env.ONEHUNDRED.subtract(itemBean.getDiscountPercent()))).divide(Env.ONEHUNDRED)); - totalLinePrice = totalLinePrice.setScale(2, RoundingMode.HALF_UP); - - } - } - - //When increasing or decreasing quantity, if discount was given on total line, retain the same - //total value if quantity of this item is not changed - else if (itemBean.getIsDiscountOnTotal() && (qtyPerLine[i].compareTo(itemBean.getQty()) == 0)) - { - totalLinePrice = totalLinePrices[i]; - } - else if (!itemBean.getIsDiscountOnInclUnitPrice()) - { - itemBean.setDiscountPercent(Env.ZERO); - } - - itemBean.setPrice(totalLinePrice); - - } - - cartBean.setItems(itemList); - return cartBean; - } - -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSPriceListAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSPriceListAction.java deleted file mode 100644 index 88d511584f..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSPriceListAction.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 19, 2005 by praveen - * - */ -package org.posterita.struts.pos; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.util.Env; -import org.compiere.util.Trx; - -import org.posterita.Constants; -import org.posterita.beans.EditPriceBean; -import org.posterita.beans.PriceListBean; -import org.posterita.beans.ProductPriceBean; -import org.posterita.businesslogic.ProductCart; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.SystemException; -import org.posterita.form.PriceListForm; -import org.posterita.lib.UdiConstants; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - -public class POSPriceListAction extends BaseDispatchAction -{ - public static final String INIT_PRICE_LIST = "initPriceList"; - public ActionForward initPriceList(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - String searchText = df.getSearchText(); - - int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); - - ArrayList productPriceList = PriceListManager.getProductPriceList(ctx, priceListVersionId, searchText, null, null); - - request.getSession().setAttribute(Constants.POS_SALES_PRICE_LIST, productPriceList); - request.getSession().setAttribute(Constants.PRICE_LIST, productPriceList); - return mapping.findForward(INIT_PRICE_LIST); - } - - public static final String INIT_EDIT_PRICE_LIST = "initEditPriceList"; - public ActionForward initEditPriceList(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - PriceListForm df = (PriceListForm) form; - - df.validate(mapping,request); - - PriceListBean bean = (PriceListBean) df.getBean(); - - if(bean.getProductIds() == null || bean.getProductIds().length == 0) - { - postGlobalError("error.product.not.selected", request); - return mapping.getInputForward(); - } - - request.getSession().setAttribute(Constants.PRODUCT_IDS, bean.getProductIds()); - - - return mapping.findForward(INIT_EDIT_PRICE_LIST); - } - - public static final String EDIT_PRICELIST = "editPriceList"; - public ActionForward editPriceList(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException, SystemException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - EditPriceBean bean = (EditPriceBean) df.getBean(); - - BigDecimal priceEntered = bean.getPrice(); - - ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); - Integer productIds[] = cart.getProductIDs(); - - - int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - int priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - - try - { - trx.start(); - PriceListManager.editProductPrices(ctx,productIds, priceListVersionId, priceEntered, trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - throw e; - } - catch (SystemException e) - { - trx.rollback(); - throw e; - } - finally - { - trx.close(); - } - - return mapping.findForward(EDIT_PRICELIST); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSProductAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSProductAction.java deleted file mode 100644 index 67c7cd09df..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSProductAction.java +++ /dev/null @@ -1,1035 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on May 22, 2006 - */ - - -package org.posterita.struts.pos; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.PrintWriter; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MLocator; -import org.compiere.model.MProduct; -import org.compiere.model.MProductPrice; -import org.compiere.model.MStorage; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.ProductBean; -import org.posterita.beans.ProductDetailsBean; -import org.posterita.beans.ProductSalesInfoBean; -import org.posterita.beans.ProductSalesSummaryBean; -import org.posterita.businesslogic.POSGoodsManager; -import org.posterita.businesslogic.POSProductManager; -import org.posterita.businesslogic.ProductCart; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.businesslogic.administration.WarehouseManager; -import org.posterita.businesslogic.performanceanalysis.CSVReportManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.RandomStringGenerator; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.BarcodeAlreadyExistsException; -import org.posterita.exceptions.CannotInactivateProductException; -import org.posterita.exceptions.InvalidBarcodeException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductAlreadyExistException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.form.POSProductForm; -import org.posterita.lib.UdiConstants; -import org.posterita.struts.core.DefaultForm; - - - -public class POSProductAction extends POSDispatchAction -{ - public static final String CREATE_OR_UPDATE_PRODUCT = "createOrUpdateProduct"; - public ActionForward createOrUpdateProduct(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - { - return fwd; - } - - Properties ctx=TmkJSPEnv.getCtx(request); - POSProductForm pf = (POSProductForm)form; - ProductBean bean = (ProductBean)pf.getBean(); - ProductBean productBean = new ProductBean(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - POSProductManager.createOrUpdateProduct(ctx,bean,trx.getTrxName()); - productBean = POSProductManager.viewPOSProduct(ctx, bean.getProductId(), trx.getTrxName()); - - postGlobalMessage("message.product.saved", request); - trx.commit(); - } - catch(ProductAlreadyExistException e1) - { - postGlobalError("error.product.already.exists",request); - trx.rollback(); - return mapping.getInputForward(); - } - catch(BarcodeAlreadyExistsException e2) - { - postGlobalError("error.barcode.already.exists",request); - trx.rollback(); - return mapping.getInputForward(); - } - catch(NumberFormatException e3) - { - postGlobalError("error.numberformatexception.price",request); - trx.rollback(); - trx.close(); - return mapping.getInputForward(); - } - catch(OperationException e) - { - postGlobalError("error.process", e.getMessage(), request); - trx.rollback(); - trx.close(); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.VIEW_POS_PRODUCTS); - if (list == null) - { - list = new ArrayList(); - } - list.add(productBean); - ArrayList productPriceLists = PriceListManager.getProductPriceLists(ctx, bean.getProductId(), bean.getOrgId(), null); - request.getSession().setAttribute(Constants.PRODUCT_PRICE_LISTS, productPriceLists); - - pf.populate(productBean); - return mapping.findForward(CREATE_OR_UPDATE_PRODUCT); - } - - public static final String VIEW_PRODUCT = "viewProduct"; - public ActionForward viewProduct(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - { - return fwd; - } - Properties ctx=TmkJSPEnv.getCtx(request); - POSProductForm pf = (POSProductForm)form; - Integer productId = Integer.valueOf(request.getParameter("productId")); - String next =request.getParameter("isNext"); - - Boolean isNext= null; - if ("true".equals(next)) - { - isNext = true; - } - else if ("false".equals(next)) - { - isNext = false; - } - - ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.VIEW_POS_PRODUCTS); - ProductBean bean = null; - - bean = POSProductManager.getProductBean(ctx, list, productId, isNext); - pf.populate(bean); - - ArrayList productPriceLists = PriceListManager.getProductPriceLists(ctx, productId, bean.getOrgId(), null); - ArrayList uomList = POSProductManager.getUoms(ctx, null); - ArrayList taxList = POSGoodsManager.getAllTaxCategory(ctx); - - request.getSession().setAttribute(Constants.UOM_LIST, uomList); - request.getSession().setAttribute(Constants.EXISTING_BAR_CODE,bean.getBarCode()); - request.getSession().setAttribute(Constants.TAX_CATEGORY_ID,taxList); - request.getSession().setAttribute(Constants.PRODUCT_PRICE_LISTS, productPriceLists); - - return mapping.findForward(VIEW_PRODUCT); - } - - - /*public static final String UPDATE_PRODUCT_DETAILS="updateProductDetails"; - public ActionForward updateProductDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - ProductBean bean = (ProductBean)df.getBean(); - bean.setFile(df.getFile()); - String existingBarCode = (String)request.getSession().getAttribute(Constants.EXISTING_BAR_CODE); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - POSProductManager.editProduct(ctx,bean,existingBarCode,trx.getTrxName()); - trx.commit(); - } - catch(BarcodeAlreadyExistsException e1) - { - - trx.rollback(); - postGlobalError("error.barcode.already.exists",request); - return mapping.getInputForward(); - } - catch(CannotInactivateProductException e2) - { - trx.rollback(); - postGlobalError("error.product.cannot.inactivate", e2.getMessage(), request); - return mapping.getInputForward(); - - } - catch(InvalidContentTypeException e3) - { - trx.rollback(); - postGlobalError("error.invalid.content", e3.getMessage(), request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - ProductBean productBean= POSProductManager.viewPOSProduct(ctx,bean.getProductId().intValue(), null); - - ArrayList list = new ArrayList(); - list.add(productBean); - - refreshProductList(request, list); - - request.getSession().setAttribute(Constants.PRODUCT_DETAILS,productBean); - return mapping.findForward(UPDATE_PRODUCT_DETAILS); - }*/ - - public static final String VIEW_ALL_POS_PRODUCTS="viewAllPOSProducts"; - public static final String LIST_PRICE_LISTS = "listPriceLists"; - public ActionForward viewAllPOSProducts(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - ProductBean bean = (ProductBean) df.getBean(); - ArrayList list=null; - - String fromDeletePriceOnPriceList = request.getParameter("isFromDeletePriceOnPriceList"); - Integer priceListId; - Integer priceListVersionId; - - //Check if user just clicked on the delete price on priceList submenu - if(fromDeletePriceOnPriceList != null && fromDeletePriceOnPriceList.equals("true")) - { - priceListId = Integer.valueOf(request.getParameter("priceListId")); - priceListVersionId = PriceListManager.getPriceListVersionID(ctx, priceListId, null); - - list = new ArrayList(); - - list = POSProductManager.getProductBeans(ctx, priceListVersionId, null); - - if(list.isEmpty()) - { - postGlobalError("error.no.product.found.on.pricelist", request); - request.setAttribute(Constants.IS_FROM_DELETE_PRODUCT_PRICE, "true"); - return mapping.findForward(LIST_PRICE_LISTS); - } - else - { - request.getSession().setAttribute(Constants.PRICE_LIST_VERSION_ID, priceListVersionId); - request.setAttribute(Constants.IS_FROM_DELETE_PRODUCT_PRICE, "true"); - } - } - else - { - try - { - list=new ArrayList(); - list=POSProductManager.viewAllProducts(ctx,bean.getProductName(),bean.getBarCode(), bean.getDescription()); - - } - catch(ProductNotFoundException e1) - { - postGlobalError("error.product.not.defined.client",request); - return mapping.getInputForward(); - - } - } - - //for export - ArrayList exportProductData = null; - try - { - exportProductData = POSProductManager.getExportData(ctx, list); - } - catch (IOException e) - { - postGlobalError("error.process",request); - return mapping.getInputForward(); - } - String csvReport = CSVReportManager.generateCSVReport(ctx,exportProductData); - String csvURI = ReportManager.getReportURI(csvReport,request); - - request.getSession().setAttribute(Constants.CSV_FILE,csvURI); - request.getSession().setAttribute(Constants.VIEW_POS_PRODUCTS,list); - return mapping.findForward(VIEW_ALL_POS_PRODUCTS); - } - - - public static final String VIEW_POS_PRODUCT_DETAIL="viewPOSProductDetails"; - public static final String ERROR_VIEW_PRODUCT_DETAIL = "errorViewProductDetails"; - - public ActionForward viewPOSProductDetailInfo(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - ProductDetailsBean bean = (ProductDetailsBean) df.getBean(); - - try - { - int productId = bean.getProductId().intValue(); - ProductDetailsBean prodDetailsBean = ProductManager.getProductDetailInfo(ctx, productId, null); - - request.setAttribute(Constants.PRODUCT_DETAIL_INFO, prodDetailsBean); - - return mapping.findForward(VIEW_POS_PRODUCT_DETAIL); - } - catch(Exception ex) - { - return mapping.findForward(ERROR_VIEW_PRODUCT_DETAIL); - } - } - - public ActionForward validateProductName(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - DefaultForm df = (DefaultForm) form; - String productName = df.getProductName(); - Properties ctx=TmkJSPEnv.getCtx(request); - - boolean isNameInvalid = (ProductManager.getSimilarProduct(ctx, productName, null) != 0); - - response.setContentType("text/plain"); - PrintWriter out = response.getWriter(); - out.print(isNameInvalid); - out.flush(); - out.close(); - - return null; - } - - public ActionForward validateProductBarcode(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - DefaultForm df = (DefaultForm) form; - String barcode = df.getBarCode(); - Properties ctx=TmkJSPEnv.getCtx(request); - - boolean isBarcodeValid = ProductManager.isBarCodePresent(ctx, barcode, null); - - response.setContentType("text/plain"); - PrintWriter out = response.getWriter(); - out.print(isBarcodeValid); - out.flush(); - out.close(); - - return null; - } - - public static final String SEARCH_POS_PRODUCTS = "searchPOSProducts" ; - - public ActionForward searchPOSProducts (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - viewAllPOSProducts(mapping, form, request, response); - - return mapping.findForward(SEARCH_POS_PRODUCTS); - } - - - public ActionForward addAllProducts (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - Properties ctx=TmkJSPEnv.getCtx(request); - HttpSession session = request.getSession(); - - ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); - ArrayList productList = (ArrayList) session.getAttribute(Constants.VIEW_POS_PRODUCTS); - - if(productList == null) - { - return mapping.findForward(VIEW_ALL_POS_PRODUCTS); - } - - if(cart == null) - { - cart = new ProductCart(ctx); - } - - for(ProductBean bean:productList) - { - Integer productId = bean.getProductId(); - - if(productId == null) continue; - if(cart.hasProduct(productId.intValue())) continue; - - cart.addProduct(productId.intValue()); - } - - session.setAttribute(Constants.PRODUCT_CART,cart); - - return mapping.findForward(VIEW_ALL_POS_PRODUCTS); - - } - - public ActionForward addToCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - ProductBean bean = (ProductBean) df.getBean(); - - Integer productId = bean.getProductId(); - HttpSession session = request.getSession(); - - ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); - - if( cart == null ) - { - cart = new ProductCart( ctx ); - } - - cart.addProduct( productId.intValue() ); - session.setAttribute(Constants.PRODUCT_CART, cart); - - String script = "productAdded("+ productId +");setCartCounter("+ cart.getNoOfProducts() +")"; - - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - - public ActionForward removeFromCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - ProductBean bean = (ProductBean) df.getBean(); - - Integer productId = bean.getProductId(); - HttpSession session = request.getSession(); - - ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); - - if( cart == null ) - { - cart = new ProductCart( ctx ); - } - - cart.removeProduct( productId.intValue() ); - session.setAttribute(Constants.PRODUCT_CART, cart); - - String script = "productRemoved("+ productId +");setCartCounter("+ cart.getNoOfProducts() +")"; - - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - - public ActionForward clearCart (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - HttpSession session = request.getSession(); - session.removeAttribute(Constants.PRODUCT_CART); - request.getSession().removeAttribute(Constants.VIEW_POS_PRODUCTS); - - String script = "clearAll();"; - PrintWriter writer = response.getWriter(); - writer.print( script ); - writer.flush(); - writer.close(); - - return null; - } - - public static final String VIEW_CART = "viewCart"; - public ActionForward viewCart(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - HttpSession session = request.getSession(); - ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); - - ArrayList productList = null; - - if(cart != null) - { - productList = cart.getProducts(); - session.setAttribute(Constants.PRODUCT_DETAILS, productList); - } - - return mapping.findForward(VIEW_CART); - } - - public static final String REMOVE = "remove"; - public ActionForward remove(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - HttpSession session = request.getSession(); - ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); - - DefaultForm df = (DefaultForm) form; - ProductBean bean = (ProductBean) df.getBean(); - Integer productId = bean.getProductId(); - - if(cart != null) - { - cart.removeProduct( productId.intValue() ); - session.setAttribute(Constants.PRODUCT_CART, cart); - } - - return mapping.findForward(REMOVE); - } - - //---------------------------------------------------------------------------------------------------------------------------------------------------- - - public static final String EXPORT_CSV = "exportCSV"; - public ActionForward exportCSV(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - HttpSession session = request.getSession(); - ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); - - if(cart == null) - { - String msg = "Cannot print barcode. Reason: cart is empty!"; - throw new OperationException( msg ); - } - - String reportName = POSProductManager.getProductCartAsCSV( ctx, cart ); - String reportURI = ReportManager.getReportURI( reportName, request ); - response.sendRedirect(reportURI); - - //return mapping.findForward(EXPORT_CSV); - return null; - } - - - public static final String PRINT_BARCODE = "printBarcode"; - public ActionForward printBarcode(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - HttpSession session = request.getSession(); - ProductCart cart = (ProductCart) session.getAttribute(Constants.PRODUCT_CART); - - if(cart == null) - { - String msg = "Cannot print barcode. Reason: cart is empty!"; - throw new OperationException( msg ); - } - - String printData = POSProductManager.getPrintBarcodeData( ctx, cart, null ); - //send it to client - - String filename = RandomStringGenerator.randomstring() + ".txt"; - String filepath = ReportManager.getReportPath( filename ); - - FileOutputStream fos = new FileOutputStream( new File( filepath ) ); - fos.write( printData.getBytes() ); - fos.flush(); - fos.close(); - - String fileURL = ReportManager.getReportURI( filename, request ); - response.sendRedirect( fileURL ); - - return null; - } - -// public static final String GENERATE_PROD_PDF ="generateproductpdf"; -// public ActionForward generateproductpdf(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException -// { -// ActionForward fwd = init(mapping,form,request,response); -// if (fwd!=null) -// return fwd; -// -// Properties ctx = TmkJSPEnv.getCtx(request); -// -// String reportName=POSProductManager.productcatalogue(ctx); -// -// ReportManager.writeReport(reportName, response); -// -// -// return null; -// } -// - - public static final String VIEW_PRODUCT_SALES_DETAILS = "viewProductSalesDetails"; - public ActionForward viewProductSalesDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - HttpSession session = request.getSession(); - - DefaultForm df = (DefaultForm) form; - ProductBean bean = (ProductBean) df.getBean(); - Integer productId = bean.getProductId(); - - ProductSalesSummaryBean summaryBean = POSProductManager.getProductSalesInfoSummary( ctx, productId.intValue(), null ); - ArrayList salesDetails = POSProductManager.getProductSalesInfoDetails( ctx, productId.intValue(), null ); - - ProductSalesSummaryBean[] bucket = POSProductManager.getSalesBucket(ctx, productId.intValue(), null); - - - session.setAttribute( Constants.PRODUCT_SALES_SUMMARY, summaryBean ); - session.setAttribute( Constants.PRODUCT_SALES_DETAILS, salesDetails ); - session.setAttribute( Constants.PRODUCT_SALES_BUCKET, bucket ); - - return mapping.findForward( VIEW_PRODUCT_SALES_DETAILS ); - } - - - public static final String UPDATE_BULK_PRODUCT_DETAILS="updateBulkProductDetails"; - public ActionForward updateBulkProductDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - df.validate(mapping,request); - - ProductBean bean = (ProductBean)df.getBean(); - bean.setFile(df.getFile()); - - ProductCart cart = (ProductCart) request.getSession().getAttribute(Constants.PRODUCT_CART); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - Integer[] productIds = cart.getProductIDs(); - - try - { - trx.start(); - POSProductManager.editBulkProduct(ctx,productIds,bean,trx.getTrxName()); - trx.commit(); - } - catch(BarcodeAlreadyExistsException e1) - { - - trx.rollback(); - postGlobalError("error.barcode.already.exists",request); - return mapping.getInputForward(); - } - catch(CannotInactivateProductException e2) - { - trx.rollback(); - postGlobalError("error.product.cannot.inactivate", e2.getMessage(), request); - return mapping.getInputForward(); - - } - finally - { - trx.close(); - } - - - ArrayList list = new ArrayList(); - - for(int product_id : productIds) - { - ProductBean productBean = POSProductManager.viewPOSProduct(ctx, product_id, null); - list.add(productBean); - } - refreshProductList(request, list); - - return mapping.findForward(UPDATE_BULK_PRODUCT_DETAILS); - } - - - public static final String INIT_UPDATE_BULK_PRODUCT_DETAILS = "initUpdateBulkProductDetails"; - public ActionForward initUpdateBulkProductDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException - { - Properties ctx=TmkJSPEnv.getCtx(request); - ArrayList taxList = POSGoodsManager.getAllTaxCategory(ctx); - - request.setAttribute(Constants.TAX_CATEGORY_ID,taxList); - return mapping.findForward(INIT_UPDATE_BULK_PRODUCT_DETAILS); - } - - /*public static final String VIEW_PRODUCT = "viewProduct"; - public ActionForward viewProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - viewProductForUpdate(mapping,form,request,response); - - return mapping.findForward(VIEW_PRODUCT); - }*/ - - public static final String ACTIVATE_PRODUCT = "activateProduct"; - public ActionForward activateProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - df.validate(mapping,request); - - ProductBean bean = (ProductBean)df.getBean(); - Integer productId = bean.getProductId(); - - ProductManager.activateProducts(ctx, new Integer[]{productId},null); - - ProductBean productBean= POSProductManager.viewPOSProduct(ctx,bean.getProductId().intValue(), null); - ArrayList list = new ArrayList(); - list.add(productBean); - - // Refresh product list - refreshProductList(request, list); - - return mapping.findForward(ACTIVATE_PRODUCT); - } - - public static final String DEACTIVATE_PRODUCT = "deactivateProduct"; - public ActionForward deactivateProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - df.validate(mapping,request); - - ProductBean bean = (ProductBean)df.getBean(); - Integer productId = bean.getProductId(); - - try - { - ProductManager.inactivateProducts(ctx, new Integer[]{productId},null); - } - catch(CannotInactivateProductException e2) - { - postGlobalError("error.product.cannot.inactivate", e2.getMessage(), request); - return mapping.getInputForward(); - } - - ProductBean productBean= POSProductManager.viewPOSProduct(ctx,bean.getProductId().intValue(), null); - ArrayList list = new ArrayList(); - list.add(productBean); - - // Refresh product list - refreshProductList(request, list); - - return mapping.findForward(DEACTIVATE_PRODUCT); - } - - public static final String PRICE_CHECK = "priceCheck"; - public ActionForward priceCheck(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd=init(mapping,form,request,response); - - if(fwd!=null) - { - return fwd; - } - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - String barcode = df.getBarCode(); - - ProductBean productBean = null; - try - { - productBean = POSProductManager.getProduct(ctx, barcode, null); - request.setAttribute(Constants.PRODUCT_DETAILS, productBean); - } - catch (InvalidBarcodeException e) - { - postGlobalError("error.invalid.barcode", "barcode", request); - return mapping.getInputForward(); - } - catch (ProductNotFoundException e) - { - postGlobalError("error.notfound", "Product", request); - return mapping.getInputForward(); - } - - return mapping.findForward(PRICE_CHECK); - } - - - /** - * This method is called to update product list present in session - * @param request - * @param list - */ - private void refreshProductList(HttpServletRequest request, ArrayList productList) - { - ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.VIEW_POS_PRODUCTS); - if(list == null) - { - return; - } - - if(!list.isEmpty()) - { - for(ProductBean bean : productList) - { - int index = list.indexOf(bean); - if(index != -1) - { - list.set(index, bean); - } - } - - request.getSession().setAttribute(Constants.VIEW_POS_PRODUCTS, list); - } - - } - - - public static final String GET_PRODUCT_DETAILS = "getProductDetails"; - public ActionForward getProductDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException, IOException - { - ActionForward fwd=init(mapping,form,request,response); - - if(fwd!=null) - { - return fwd; - } - - Properties ctx=TmkJSPEnv.getCtx(request); - - String productIdAsStr = request.getParameter("productId"); - String priceListIdAsStr = request.getParameter("priceListId"); - int productId = Integer.parseInt(productIdAsStr); - int priceListId = Integer.parseInt(priceListIdAsStr); - - Env.setContext(ctx, UdiConstants.PRICELIST_CTX_PARAM, priceListId); - String currSymbol = PriceListManager.getCurrency(ctx, priceListId); - - ProductBean details = POSProductManager.viewPOSProduct(ctx, productId, priceListId, null); - - StringBuffer sb = new StringBuffer(); - sb.append("{"); - sb.append("name: \"" + details.getProductName() + "\""); - sb.append(", id: \"" + details.getProductId() + "\""); - sb.append(", description: \"" + details.getDescription() + "\""); - sb.append(", barcode: '" + details.getBarCode() + "'"); - sb.append(", taxCategory: '" + details.getTaxCategoryName() + "'"); - sb.append(", productCategory: '" + details.getProductCategoryName() + "'"); - sb.append(", priceStd: '" + details.getPriceStandard() + "'"); - sb.append(", priceList: '" + details.getPriceList() + "'"); - sb.append(", priceLimit: '" + details.getPriceLimit() + "'"); - sb.append(", priceListID: '" + details.getPriceListId() + "'"); - sb.append(", taxRate: '" + details.getTaxRate() + "'"); - sb.append(", isTaxIncluded: '" + details.getIsTaxIncluded() + "'"); - sb.append(", currSymbol: '" + currSymbol + "'"); - sb.append(", stockQty: '" + details.getQtyOnHand() + "'"); - sb.append(", unitsPerPack: '" + details.getUnitsPerPack() + "'"); - sb.append("}"); - - PrintWriter writer = response.getWriter(); - writer.print( sb.toString() ); - writer.flush(); - writer.close(); - - return null; - } - - public static final String GET_PRODUCT_DETAILS_FOR_INVENTORY = "getProductDetailsForInventory"; - public ActionForward getProductDetailsForInventory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException, IOException - { - ActionForward fwd=init(mapping,form,request,response); - - if(fwd!=null) - { - return fwd; - } - - Properties ctx=TmkJSPEnv.getCtx(request); - - String productIdAsStr = request.getParameter("productId"); - String priceListIdAsStr = request.getParameter("priceListId"); - int productId = Integer.parseInt(productIdAsStr); - int priceListId = Integer.parseInt(priceListIdAsStr); - - Env.setContext(ctx, UdiConstants.PRICELIST_CTX_PARAM, priceListId); - String currSymbol = PriceListManager.getCurrency(ctx, priceListId); - - ProductBean details = POSProductManager.viewPOSProductForInventory(ctx, productId, priceListId, null); - - StringBuffer sb = new StringBuffer(); - sb.append("{"); - sb.append("name: '" + details.getProductName() + "'"); - sb.append(", id: '" + details.getProductId() + "'"); - sb.append(", description: '" + details.getDescription() + "'"); - sb.append(", barcode: '" + details.getBarCode() + "'"); - sb.append(", taxCategory: '" + details.getTaxCategoryName() + "'"); - sb.append(", productCategory: '" + details.getProductCategoryName() + "'"); - sb.append(", priceStd: '" + details.getPriceStandard() + "'"); - sb.append(", priceList: '" + details.getPriceList() + "'"); - sb.append(", priceLimit: '" + details.getPriceLimit() + "'"); - sb.append(", priceListID: '" + details.getPriceListId() + "'"); - sb.append(", taxRate: '" + details.getTaxRate() + "'"); - sb.append(", currSymbol: '" + currSymbol + "'"); - sb.append(", stockQty: '" + details.getQtyOnHand() + "'"); - sb.append("}"); - - PrintWriter writer = response.getWriter(); - writer.print( sb.toString() ); - writer.flush(); - writer.close(); - - return null; - } - - public static final String POS_SUB_MENU_ITEMS = "POSSubMenuItems"; - public ActionForward deleteProductPricesOnPriceList(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd=init(mapping,form,request,response); - - if(fwd!=null) - { - return fwd; - } - - ArrayList list = new ArrayList(); - list = (ArrayList)request.getSession().getAttribute(Constants.VIEW_POS_PRODUCTS); - - Iterator itr = list.iterator(); - Integer productId; - Integer priceListVersionId = (Integer)request.getSession().getAttribute(Constants.PRICE_LIST_VERSION_ID); - Properties ctx = TmkJSPEnv.getCtx(request); - - while(itr.hasNext()) - { - ProductBean productBean = itr.next(); - if (productBean != null) - { - productId = productBean.getProductId(); - - if(productId != null && productId != 0 && priceListVersionId != null) - { - MProductPrice productPrice = MProductPrice.get(ctx, priceListVersionId, productId, null); - productPrice.delete(true); - } - } - } - - return mapping.findForward(POS_SUB_MENU_ITEMS); - } - - public static String GET_CREATE_PRODUCT_FORM = "getCreateProductForm"; - public ActionForward getCreateProductForm(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - viewProduct(mapping, form, request, response); - - return mapping.findForward(GET_CREATE_PRODUCT_FORM); - } - - public static final String VIEW_PRODUCT_SALES_SUMMARY = "viewProductSalesSummary"; - public ActionForward viewProductSalesSummary(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - HttpSession session = request.getSession(); - - String productIdStr = request.getParameter("productId"); - - if(productIdStr != null && !productIdStr.equals("")) - { - int productIdInt = Integer.parseInt(productIdStr); - StringBuffer sb = new StringBuffer(); - - ProductSalesSummaryBean[] summaryBeans = POSProductManager.getSalesBucket( ctx, productIdInt, null ); - - int warehouseId = WarehouseManager.getDefaultWarehouse(ctx).getM_Warehouse_ID(); - MLocator locator = MLocator.get(ctx, warehouseId, "", "0", "0", "0"); - BigDecimal qtyAvailable = MStorage.getQtyAvailable(warehouseId, locator.get_ID(), productIdInt, 0, null); - - MProduct product = new MProduct(ctx, productIdInt, null); - - sb.append("{"); - sb.append("name:'" + product.getName() + "'"); - sb.append(", id:'" + product.getM_Product_ID() + "'"); - sb.append(", qtyOnHand:'" + qtyAvailable + "'"); - - for(int i = 0; i < summaryBeans.length; i++) - { - if(i != 2 || i != 3) // skip sales figures for 2 and 3 months - { - sb.append(", qtySold" + i +":'" + summaryBeans[i].getQtySold() + "'"); - sb.append(", totalAmt" + i + ":'" + summaryBeans[i].getTotalAmount() + "'"); - } - } - - sb.append("}"); - - PrintWriter writer = response.getWriter(); - writer.print( sb.toString() ); - writer.flush(); - writer.close(); - - } - return null; - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSReportAction.java deleted file mode 100644 index 03f66c080d..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSReportAction.java +++ /dev/null @@ -1,1601 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 9, 2006 - */ - - -package org.posterita.struts.pos; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sf.jasperreports.engine.JasperExportManager; -import net.sf.jasperreports.engine.JasperPrint; - -import org.apache.ecs.XhtmlDocument; -import org.apache.ecs.xhtml.tr; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; -import org.compiere.model.MProcess; -import org.compiere.model.MProcessPara; -import org.compiere.model.MProduct; -import org.compiere.print.MPrintFormat; -import org.compiere.print.PrintData; -import org.compiere.print.ReportEngine; -import org.compiere.process.ProcessInfo; -import org.compiere.report.ReportStarter; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.MimeType; -import org.posterita.Constants; -import org.posterita.beans.POSHistoryBean; -import org.posterita.beans.ReportBean; -import org.posterita.beans.StockMovementBean; -import org.posterita.businesslogic.POSProductManager; -import org.posterita.businesslogic.POSStockManager; -import org.posterita.businesslogic.ProcessManager; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.businesslogic.performanceanalysis.CSVReportManager; -import org.posterita.businesslogic.performanceanalysis.POSReportManager; -import org.posterita.businesslogic.performanceanalysis.POSSalesReportManager; -import org.posterita.businesslogic.performanceanalysis.ReportDateManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.businesslogic.stock.InventoryManager; -import org.posterita.businesslogic.stock.MMovementManager; -import org.posterita.core.TabularReport; -import org.posterita.core.TabularReport2; -import org.posterita.core.TabularReportMerge; -import org.posterita.core.TimestampConvertor; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.factory.WebComponentFactory; -import org.posterita.form.POSHistoryForm; -import org.posterita.form.ReportForm; -import org.posterita.form.SellingItemForm; -import org.posterita.form.StockEnquiryForm; -import org.posterita.lib.UdiConstants; -import org.posterita.order.UDIOrderTypes; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; -import org.posterita.util.PathInfo; - -import com.lowagie.text.DocumentException; - - -public class POSReportAction extends BaseDispatchAction -{ - - public static final String GET_MIN_SOLD_ITEMS="getMinSoldItems"; - public static HashMap monthMap = new HashMap(); - - public ActionForward getMinSoldItems(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - ReportBean bean = (ReportBean) df.getBean(); - - Timestamp fromdate = ReportDateManager.getFromDate(bean); - Timestamp todate = ReportDateManager.getToDate(bean); - - ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"asc",fromdate,todate); - request.getSession().setAttribute(Constants.MIN_SOLD_ITEMS,list); - - return mapping.findForward(GET_MIN_SOLD_ITEMS); - } - - - public static final String GET_MAX_SOLD_ITEMS="getMaxSoldItems"; - public ActionForward getMaxSoldItems(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - ReportBean bean = (ReportBean) df.getBean(); - - Timestamp fromdate = ReportDateManager.getFromDate(bean); - Timestamp todate = ReportDateManager.getToDate(bean); - - ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"desc",fromdate,todate); - request.getSession().setAttribute(Constants.MAX_SOLD_ITEMS,list); - - return mapping.findForward(GET_MAX_SOLD_ITEMS); - } - - public static final String GET_STOCK_MOVEMENT="getStockMovement"; - public ActionForward getStockMovement(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - ReportBean bean = (ReportBean) df.getBean(); - - Timestamp fromdate = ReportDateManager.getFromDate(bean); - Timestamp todate = ReportDateManager.getToDate(bean); - - ArrayList list=POSReportManager.getStockMovementReport(ctx,fromdate,todate); - request.getSession().setAttribute(Constants.STOCK_MOVEMENT,list); - - return mapping.findForward(GET_STOCK_MOVEMENT); - } - - - public static final String INIT_POS_HISTORY="initPOSHistory"; - public ActionForward initPOSHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - ArrayList orderTypeList=POSReportManager.getAllOrderTypes(ctx); - ArrayList paymentRuleList=POSReportManager.getAllPaymentRule(ctx); - request.getSession().setAttribute(Constants.ORDER_TYPES,orderTypeList); - request.getSession().setAttribute(Constants.PAYMENT_RULES,paymentRuleList); - request.setAttribute(Constants.ALL_ORDER_HISTORY,"allOrderHistory"); - getPOSHistory(mapping,new POSHistoryForm(),request,response); - - return mapping.findForward(INIT_POS_HISTORY); - } - - - public static final String GET_POS_HISTORY="getPOSHistory"; - - public ActionForward getPOSHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - POSHistoryBean bean = (POSHistoryBean) df.getBean(); - - if(bean.getHistoryType()==null) - { - String historyType = (String)request.getAttribute(Constants.ALL_ORDER_HISTORY); - bean.setHistoryType(historyType); - } - - if(bean.getHistoryType()==null || !bean.getHistoryType().equalsIgnoreCase(Constants.ALL_ORDER_HISTORY)) - { - if(bean.getOrderType()==null) - { - String orderType=(String)request.getSession().getAttribute(Constants.POS_HISTORY_ORDER_TYPE); - bean.setOrderType(orderType); - } - } - ArrayList list=POSReportManager.getOrderHistory(ctx,bean.getOrderType(),bean.getDocStatus(),bean.getMonth(),bean.getYear(),bean.getPaymentRule(),null); - request.setAttribute(Constants.POS_HISTORY,list); - if(bean.getOrderType()!=null) - { - request.getSession().setAttribute(Constants.POS_HISTORY_ORDER_TYPE,bean.getOrderType()); - } - else - { - String orderType=(String)request.getSession().getAttribute(Constants.POS_HISTORY_ORDER_TYPE); - request.getSession().setAttribute(Constants.POS_HISTORY_ORDER_TYPE,orderType); - } - - - return mapping.findForward(GET_POS_HISTORY); - } - - //----------------------------------------------------------------------------------------------------- - - public static final String GET_CUSTOM_REPORT = "getCustomReport"; - public static final String GET_CUSTOM_MOVING_ITEMS = "getCustomMovingItems"; - public ActionForward getCustomFastSlowMovingItems(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - ReportBean bean = (ReportBean) df.getBean(); - - String title = " Moving Items Report"; - String subtitle = "subtitle"; - - String reportType = bean.getReportType(); - if(reportType.equalsIgnoreCase("asc")) - { - title = "Slow" + title; - } - else if(reportType.equalsIgnoreCase("desc")) - { - title = "Fast" + title; - } - else - { - throw new OperationException("invalid report type: " + reportType); - } - - String dateRange = bean.getDateRange(); - String timePeriod = bean.getTimePeriod(); - - Timestamp fromDate = null; - Timestamp toDate = null; - - //setting from and to dates - if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) - { - if(timePeriod==null) - { - throw new OperationException("Invalid Parameter for timePeriod. timePeriod is null"); - } - - Date startDate = ReportDateManager.getStartDateForPeriod(timePeriod); - Date endDate = ReportDateManager.getEndDateForPeriod(timePeriod); - - fromDate = new Timestamp(startDate.getTime()); - toDate = new Timestamp(endDate.getTime()); - - subtitle = "For " + timePeriod; - } - else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) - { - boolean error = false; - ActionMessages messages = new ActionMessages(); - ActionMessage message = null; - - - if((bean.getFromDate()==null)||(bean.getFromDate()=="")) - { - message = new ActionMessage("error.required.fromDate"); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - error = true; - } - - if((bean.getToDate()==null)||(bean.getToDate()=="")) - { - message = new ActionMessage("error.required.toDate"); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - error = true; - } - - if(error) - { - saveErrors(request, messages); - return mapping.getInputForward(); - } - else - { - fromDate = ReportDateManager.getFromDate(bean); - toDate = ReportDateManager.getToDate(bean); - - } - - - subtitle = "For period:"+fromDate+" to "+toDate; - } - else - { - throw new OperationException("Invalid Parameter for dateRange :" + dateRange); - } - - - ArrayList reportData = POSReportManager.getMaxMinSoldProductReportData(ctx,reportType,fromDate,toDate); - - //constructing the table - TabularReport tReport = new TabularReport(reportData); - tReport.setSortable(false); - tReport.setStyle("display"); - tReport.setTitle(title); - tReport.setSubtitle(subtitle); - tReport.createReport(); - - String csvReport = CSVReportManager.generateCSVReport(ctx,reportData); - String csvURI = ReportManager.getReportURI(csvReport,request); - - request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA,tReport.toString()); - request.getSession().setAttribute(Constants.CSV_FILE,csvURI); - - return mapping.findForward(GET_CUSTOM_REPORT); - } - - //Partial POS History action - public static final String INIT_PARTIAL_POS_HISTORY="initPartialPOSHistory"; - public ActionForward initPartialPOSHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - ArrayList list=POSReportManager.getAllOrderTypes(ctx); - request.getSession().setAttribute(Constants.ORDER_TYPES,list); - - getPartialPOSHistory(mapping,new POSHistoryForm(),request,response); - - return mapping.findForward(INIT_PARTIAL_POS_HISTORY); - } - - - public static final String GET_PARTIAL_POS_HISTORY="getPartialPOSHistory"; - public ActionForward getPartialPOSHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - POSHistoryBean bean = (POSHistoryBean) df.getBean(); - - String orderType = UDIOrderTypes.POS_ORDER.getOrderType(); - - ArrayList list=POSReportManager.getPartialOrderHistory(ctx,orderType,bean.getMonth(),bean.getYear()); - request.getSession().setAttribute(Constants.POS_HISTORY,list); - - return mapping.findForward(GET_PARTIAL_POS_HISTORY); - } - - public static final String GET_SALES_REPORT = "getSalesReport"; - public ActionForward getSalesOrPurchaseReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - df.validate(mapping, request); - - ReportBean bean = (ReportBean) df.getBean(); - - String isSalesRPT = bean.getIsSalesReport(); - - boolean isSalesReport = Boolean.parseBoolean(isSalesRPT); - - String title = "Sales Report"; - - if(!(isSalesReport)) - { - title = "Purchase Report"; - } - - String subtitle = "subtitle"; - - - String dateRange = bean.getDateRange(); - String timePeriod = bean.getTimePeriod(); - - Timestamp fromDate = null; - Timestamp toDate = null; - - Date startDate = null; - Date endDate = null; - - //setting from and to dates - if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) - { - if(timePeriod==null) - { - throw new OperationException("Invalid Parameter for timePeriod. timePeriod is null"); - } - - startDate = ReportDateManager.getStartDateForPeriod(timePeriod); - endDate = ReportDateManager.getEndDateForPeriod(timePeriod); - - fromDate = new Timestamp(startDate.getTime()); - toDate = new Timestamp(endDate.getTime()); - - subtitle = "For " + timePeriod + ": " + startDate; - } - else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) - { - boolean error = false; - ActionMessages messages = new ActionMessages(); - ActionMessage message = null; - - - if((bean.getFromDate()==null)||(bean.getFromDate()=="")) - { - message = new ActionMessage("error.required.fromDate"); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - error = true; - } - - if((bean.getToDate()==null)||(bean.getToDate()=="")) - { - message = new ActionMessage("error.required.toDate"); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - error = true; - } - - if(error) - { - saveErrors(request, messages); - return mapping.getInputForward(); - } - else - { - fromDate = ReportDateManager.getFromDate(bean); - toDate = ReportDateManager.getToDate(bean); - - } - - - subtitle = "For period:"+fromDate+" to "+toDate; - } - else - { - throw new OperationException("Invalid Parameter for dateRange :" + dateRange); - } - boolean isFullDetails = false; - - if (Constants.FULL_DETAILS.equals(bean.getFullDetails())) - { - isFullDetails = true; - } - - ArrayList reportData = POSSalesReportManager.getSalesOrPurchaseReportData(ctx, bean, null); - - //constructing the table - TabularReport2 tReport = new TabularReport2(reportData); - tReport.setSortable(false); - tReport.setStyle("display"); - tReport.setTitle(title); - tReport.setSubtitle(subtitle); - tReport.setFromDate(fromDate); - tReport.setSalesReport(isSalesReport); - tReport.setFullDetails(isFullDetails); - tReport.setToDate(toDate); - tReport.createReport(); - - String csvReport = CSVReportManager.generateCSVReport(ctx,reportData); - String csvURI = ReportManager.getReportURI(csvReport,request); - - String pdfReport = tReport.createPDFReport(); - String pdfURI = ReportManager.getReportURI(pdfReport,request); - - request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA,tReport.toString()); - request.getSession().setAttribute(Constants.CSV_FILE,csvURI); - request.getSession().setAttribute(Constants.PDF_FILE,pdfURI); - - return mapping.findForward(GET_SALES_REPORT); - } - - public static final String GET_DETAILED_SALES_REPORT = "getDetailedSalesReport"; - public ActionForward getDetailedSalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, ParseException, FileNotFoundException, DocumentException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - String salesType = request.getParameter("salesType"); - String date1 = request.getParameter("date1"); - String date2 = request.getParameter("date2"); - boolean isSalesReport = Boolean.parseBoolean(request.getParameter("isSalesReport")); - - Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); - Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); - // sales types - // 1 -> Sales Excluding VAT - // 2 -> Credit Note Excluding VAT - // 3 -> Exempt Sales - // 4 -> Exempt Credit Note - - ArrayList list = null; - try - { - list =POSSalesReportManager.getDetailedSalesReport(ctx, salesType, isSalesReport, fromDate, toDate, null); - } - catch (OperationException e) - { - postGlobalError("error.process",e.getMessage(),request); - return mapping.getInputForward(); - } - request.getSession().setAttribute(Constants.DETAILED_SALES_REPORT,list); - - return mapping.findForward(GET_DETAILED_SALES_REPORT); - } - - public static String GET_MONTHLY_SALES_REPORT = "getMonthlySalesReport"; - public ActionForward getMonthlySalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, ParseException, FileNotFoundException, DocumentException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - String productName = request.getParameter("productName"); - - String orgIds = getOrgIds(ctx, request); - - String date1 = request.getParameter("date1"); - String date2 = request.getParameter("date2"); - - Timestamp d1 = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); - Timestamp d2 = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); - - Calendar fd = Calendar.getInstance(); - fd.setTimeInMillis(d1.getTime()); - fd.set(Calendar.DATE, 1); - - Calendar td = Calendar.getInstance(); - td.setTimeInMillis(d2.getTime()); - td.set(Calendar.DATE, td.getMaximum(Calendar.DAY_OF_MONTH)); - - Timestamp fromDate = new Timestamp(fd.getTimeInMillis()); - Timestamp toDate = new Timestamp(td.getTimeInMillis()); - - // Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); - //Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); - - int[] productIds = ProductManager.getProducts(ctx, productName, Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM), null, null, null); - - if (productIds == null || productIds.length == 0) - { - throw new OperationException ("no products found with product name " + productName); - } - ArrayList reportData = null; - try - { - reportData = new ArrayList(); - Object[] header = {"Month", "Qty Sold"}; - reportData.add(header); - int precision = ProductManager.getUOMPrecision(ctx, productIds[0]); - - HashMap monthQtyMap = POSProductManager.getOrderQtyInfoPerProduct(ctx, true, productIds[0], - orgIds, fromDate, toDate, null); - - reportData = POSReportManager.formatStockSalesReportData(reportData, monthQtyMap, - fromDate, toDate, precision); - } - catch (OperationException e) - { - postGlobalError("error.process",e.getMessage(),request); - return mapping.getInputForward(); - } - - TabularReport tReport = new TabularReport(reportData); - tReport.setSortable(false); - tReport.setStyle("display"); - tReport.setTitle("Monthly Sales Report from " + date1 + " to "+date2 ); - tReport.setSubtitle("Product: "+productName); - tReport.setFromDate(fromDate); - tReport.setToDate(toDate); - tReport.createReport("SalesReportAction.do?action=getSalesDetailsPerProduct", productIds[0]); - - request.getSession().setAttribute(Constants.MONTHLY_SALES_REPORT_DATA,tReport.toString()); - - - return mapping.findForward(GET_MONTHLY_SALES_REPORT); - } - - public static String GET_SALES_DETAILS_PER_PRODUCT = "getSODetailsPerProduct"; - public ActionForward getSalesDetailsPerProduct(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - String productId = request.getParameter("productId"); - - String orgIds = getOrgIds(ctx, request); - - String date1 = request.getParameter("date1"); - String date2 = request.getParameter("date2"); - - Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.BIRTH_DATE); - Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.BIRTH_DATE); - - ArrayList list = null; - try - { - list = POSSalesReportManager.getOrderDetailsPerProduct(ctx, true, productId, orgIds, fromDate, toDate); - } - catch (OperationException e) - { - postGlobalError("error.process",e.getMessage(),request); - return mapping.getInputForward(); - } -/* request.getSession().setAttribute(Constants.DETAILED_SALES_REPORT_PER_PRODUCT,list);*/ - request.getSession().setAttribute(Constants.POS_HISTORY,list); - request.getSession().setAttribute(Constants.POS_HISTORY_ORDER_TYPE,UDIOrderTypes.POS_ORDER.getOrderType()); - - return mapping.findForward(GET_SALES_DETAILS_PER_PRODUCT); - } - - public static String GET_GRN_DETAILS_PER_PRODUCT = "getPODetailsPerProduct"; - public ActionForward getGRNDetailsPerProduct(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - String productId = request.getParameter("productId"); - - String orgIds = getOrgIds(ctx, request); - - String date1 = request.getParameter("date1"); - String date2 = request.getParameter("date2"); - - Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.BIRTH_DATE); - Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.BIRTH_DATE); - - ArrayList list = null; - try - { - list = POSSalesReportManager.getOrderDetailsPerProduct(ctx, false, productId, orgIds, fromDate, toDate); - } - catch (OperationException e) - { - postGlobalError("error.process",e.getMessage(),request); - return mapping.getInputForward(); - } - request.getSession().setAttribute(Constants.POS_HISTORY,list); - request.getSession().setAttribute(Constants.POS_HISTORY_ORDER_TYPE,UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType()); - - return mapping.findForward(GET_GRN_DETAILS_PER_PRODUCT); - } - - /*********************************************************************************/ - - public static final String INIT_BEST_SELLING_REPORT = "initBestSellingReport"; - - /** - * Initialise Best Selling Items Report - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws ApplicationException - * @throws OperationException - */ - public ActionForward initBestSellingReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - SellingItemForm reportForm = (SellingItemForm) form; - - //setting defaults - String timePeriod = ReportDateManager.TODAY; - String dateRange = Constants.FIXED_DATE_RANGE; - - reportForm.setTimePeriod(timePeriod); - reportForm.setDateRange(dateRange); - reportForm.setFromDate(""); - reportForm.setToDate(""); - - reportForm.validate(mapping,request); - - return mapping.findForward(INIT_BEST_SELLING_REPORT); - } - - - public static final String GET_BEST_SELLING_ITEMS = "getBestSellingItems"; - - /** - * Generate Best Selling Items - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws ApplicationException - * @throws OperationException - * @throws DocumentException - * @throws IOException - * @throws SQLException - * @throws ParseException - */ - public ActionForward getBestSellingItems(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, DocumentException, IOException, SQLException, ParseException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - SellingItemForm sf = (SellingItemForm)form; - ReportBean bean = (ReportBean) sf.getBean(); - - String dateRange = bean.getDateRange(); - String timePeriod = bean.getTimePeriod(); - Timestamp fromDate = null; - Timestamp toDate = null; - - //setting from and to dates - if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) - { - if(timePeriod == null) - { - throw new OperationException("Invalid Parameter for timePeriod. TimePeriod is null"); - } - - fromDate = ReportDateManager.getStartDateForPeriod(timePeriod); - toDate = ReportDateManager.getEndDateForPeriod(timePeriod); - - } - else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) - { - fromDate = ReportDateManager.getFromDate(bean); - toDate = ReportDateManager.getToDate(bean); - - } - else - { - throw new OperationException("Invalid Parameter for dateRange :" + dateRange); - } - - - ArrayList reportData = POSReportManager.getBestSellingItemsData(ctx, fromDate, toDate, null); - - String title = "BEST 100 SELLING ITEMS"; - String subtitle = null; - - String sql = "Select Upper(Name) from AD_Org where AD_org_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - - pstmt = DB.prepareStatement(sql.toString(), null); - pstmt.setInt(1, Env.getAD_Org_ID(ctx)); - - try - { - rs = pstmt.executeQuery(); - - if (rs.next()) - { - subtitle = rs.getString(1); - } - - } - catch(SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs); - DB.close(pstmt); - } - - SimpleDateFormat dateFormat2 = new SimpleDateFormat("dd-MMM-yyyy"); - - //constructing the table - TabularReport tReport = new TabularReport(reportData); - tReport.setSortable(false); - tReport.setStyle("display"); - tReport.setTitle(title); - tReport.setFromDate(fromDate); - tReport.setToDate(toDate); - tReport.setSubtitle(subtitle); - tReport.createReport(); - - response.setContentType("x-application/pdf"); - response.setHeader("Content-Disposition","inline;filename=BestSellingItemsReport("+System.currentTimeMillis()+").pdf"); - response.getOutputStream().write(tReport.getSellingItemsData()); - - - return mapping.findForward(GET_BEST_SELLING_ITEMS); - } - - public static final String INIT_STOCK_ENQUIRY_REPORT = "initStockEnquiryReport"; - - public ActionForward initStockEnquiryReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - StockEnquiryForm reportForm = (StockEnquiryForm) form; - - //setting defaults - String timePeriod = ReportDateManager.TODAY; - String dateRange = Constants.FIXED_DATE_RANGE; - - reportForm.setTimePeriod(timePeriod); - reportForm.setDateRange(dateRange); - reportForm.setFromDate(""); - reportForm.setToDate(""); - - reportForm.validate(mapping,request); - - return mapping.findForward(INIT_STOCK_ENQUIRY_REPORT); - } - - public static final String GET_STOCK_ENQUIRY_REPORT = "getStockEnquiryReport"; - - - /** - * Get Stock Enquiry Report - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws ApplicationException - * @throws OperationException - * @throws DocumentException - * @throws IOException - * @throws SQLException - * @throws ParseException - */ - public ActionForward getStockEnquiryReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, DocumentException, IOException, SQLException, ParseException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - StockEnquiryForm sf = (StockEnquiryForm)form; - ReportBean bean = (ReportBean) sf.getBean(); - - String dateRange = bean.getDateRange(); - String timePeriod = bean.getTimePeriod(); - Timestamp fromDate = null; - Timestamp toDate = null; - - //setting from and to dates - if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) - { - if(timePeriod == null) - { - throw new OperationException("Invalid Parameter for timePeriod. TimePeriod is null"); - } - - fromDate = ReportDateManager.getStartDateForPeriod(timePeriod); - toDate = ReportDateManager.getEndDateForPeriod(timePeriod); - - } - else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) - { - fromDate = ReportDateManager.getFromDate(bean); - toDate = ReportDateManager.getToDate(bean); - - } - else - { - throw new OperationException("Invalid Parameter for dateRange :" + dateRange); - } - - ArrayList reportData = POSReportManager.getStockEnquiryData(ctx, fromDate, toDate, null); - - String title = "STOCK ENQUIRY REPORT"; - String subtitle = null; - - String sql = "Select Upper(Name) from AD_Org where AD_org_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - - pstmt = DB.prepareStatement(sql.toString(), null); - pstmt.setInt(1, Env.getAD_Org_ID(ctx)); - - try - { - rs = pstmt.executeQuery(); - - if (rs.next()) - { - subtitle = rs.getString(1); - } - - } - catch(SQLException e) - { - throw new OperationException(e); - } - finally - { - DB.close(rs); - DB.close(pstmt); - } - - SimpleDateFormat dateFormat2 = new SimpleDateFormat("dd-MMM-yyyy"); - - //constructing the table - TabularReport tReport = new TabularReport(reportData); - tReport.setSortable(false); - tReport.setStyle("display"); - tReport.setTitle(title); - tReport.setFromDate(fromDate); - tReport.setToDate(toDate); - tReport.setSubtitle(subtitle); - tReport.createReport(); - - response.setContentType("x-application/pdf"); - response.setHeader("Content-Disposition","inline;filename=StockEnquiryReport("+System.currentTimeMillis()+").pdf"); - response.getOutputStream().write(tReport.getStockEnquiryData()); - - - return mapping.findForward(GET_STOCK_ENQUIRY_REPORT); - } - - public static final String GET_STOCK_SALES_REPORT = "getStockSalesReport"; - public ActionForward getStockSalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SQLException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - - if (fwd!=null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - - ReportForm sf = (ReportForm)form; - ReportBean bean = (ReportBean) sf.getBean(); - - Integer productId = bean.getProductId(); - String description = bean.getDescription(); - String barCode = bean.getBarCode(); - Integer orgId = bean.getOrgId(); - - String fromDate = bean.getFromDate(); - String toDate = bean.getToDate(); - - Timestamp thisDate = TimestampConvertor.getCurrentDateTimeTimestamp(); - Timestamp startDate = thisDate; - Timestamp endDate = thisDate; - - String productName = bean.getProductName(); - - HashSet orgIds = (HashSet)request.getSession().getAttribute(Constants.STOCK_SALES_REPORT_ORGS); - if (orgIds == null) - { - orgIds = new HashSet(); - } - orgIds.add(orgId); - - if (fromDate != null) - { - startDate = TimestampConvertor.getTimestamp(fromDate, TimestampConvertor.BIRTH_DATE); - } - if (toDate != null) - { - endDate = TimestampConvertor.getTimestamp(toDate, TimestampConvertor.BIRTH_DATE); - } - Timestamp oldFromDate = (Timestamp)request.getSession().getAttribute(Constants.FROM_DATE); - Timestamp oldToDate = (Timestamp)request.getSession().getAttribute(Constants.TO_DATE); - - if (!startDate.equals(oldFromDate) || !endDate.equals(oldToDate)) - { - clear(request, true); - clear(request, false); - } - - description = description == null? "":description; - barCode = barCode == null?"": barCode; - - ArrayList reportSalesData = getReportData(request, true, orgId); - ArrayList reportStockData = getReportData(request, false, orgId); - - HashSet productSalesCompleteSet = (HashSet) request.getSession().getAttribute(Constants.PRODUCT_SALES_COMPLETE_SET); - HashSet productStockCompleteSet = (HashSet) request.getSession().getAttribute(Constants.PRODUCT_STOCK_COMPLETE_SET); - - - HashMap> prodOrgStockMap = (HashMap>)request.getSession().getAttribute(Constants.PRODUCT_ORG_STOCK_MAP); - HashMap> prodOrgSalesMap = (HashMap>)request.getSession().getAttribute(Constants.PRODUCT_ORG_SALES_MAP); - - - productSalesCompleteSet = productSalesCompleteSet == null? new HashSet() : productSalesCompleteSet; - productStockCompleteSet = productStockCompleteSet == null? new HashSet() : productStockCompleteSet; - prodOrgStockMap = prodOrgStockMap == null? new HashMap>() : prodOrgStockMap; - prodOrgSalesMap = prodOrgSalesMap == null? new HashMap>() : prodOrgSalesMap; - - - ArrayList salesBackup = POSReportManager.doBackup(reportSalesData); - ArrayList stockBackup = POSReportManager.doBackup(reportStockData); - - - if (orgId != null) - { - boolean isComplete = false; - if (orgId == 0) - { - isComplete = true; - } - try - { - - int[] productIds = null ; - - if (productName == null) - { - productIds = ProductManager.getProducts(ctx, "", description, barCode, null); - if (productIds.length == 0) - { - throw new OperationException("no products found matching that description and/or barcode"); - } - } - else - { - productIds = new int[]{productId}; - } - - clear(request, !isComplete); - - if (orgId == 0) - { - - for (int prodId: productIds) - { - reportSalesData = POSReportManager.getStockSalesReportComplete(ctx, productSalesCompleteSet, true, reportSalesData, prodId, orgId, startDate, endDate); - reportStockData = POSReportManager.getStockSalesReportComplete(ctx, productStockCompleteSet,false, reportStockData, prodId, orgId, startDate, endDate); - } - } - else - { - - for (int prodId: productIds) - { - reportSalesData = POSReportManager.getStockSalesReport(ctx, prodOrgSalesMap, reportSalesData, true, prodId, orgId, startDate, endDate); - reportStockData = POSReportManager.getStockSalesReport(ctx, prodOrgStockMap,reportStockData, false, prodId, orgId, startDate, endDate); - } - } - } - catch (OperationException e) - { - reportStockData = stockBackup; - reportSalesData = salesBackup; - - if (orgId != 0) - { - request.getSession().setAttribute(Constants.SALES_REPORT_LIST, reportSalesData); - request.getSession().setAttribute(Constants.STOCK_REPORT_LIST, reportStockData); - } - else - { - request.getSession().setAttribute(Constants.SALES_REPORT_LIST_COMPLETE, reportSalesData); - request.getSession().setAttribute(Constants.STOCK_REPORT_LIST_COMPLETE, reportStockData); - - } - postGlobalError("error.process",e.getMessage(),request); - return mapping.getInputForward(); - } - - //constructing the table - TabularReportMerge tReport = new TabularReportMerge("Stock Sales Report", 2); - tReport.setFromDate(startDate); - tReport.setToDate(endDate); - tReport.setSortable(false); - tReport.setStyle("display"); - try - { - if (orgId == 0) - { - tReport.createReport(reportSalesData, Constants.SALES_TYPE, "Sales (Qty Sold)"); - tReport.createReport(reportStockData, Constants.STOCK_TYPE, "Stock (Qty On Hand)"); - } - else - { - tReport.createReport(reportSalesData, Constants.SALES_TYPE, "Sales (Qty Sold)"); - tReport.createReport(reportStockData, Constants.STOCK_TYPE, "Stock (Qty On Hand)"); - } - } - catch (OperationException e) - { - postGlobalError("error.process",e.getMessage(),request); - return mapping.getInputForward(); - } - request.getSession().setAttribute(Constants.STOCK_SALES_REPORT_DATA,tReport.toString()); - request.getSession().setAttribute(Constants.STOCK_SALES_REPORT_ORGS, orgIds); - - if (orgId != 0) - { - request.getSession().setAttribute(Constants.SALES_REPORT_LIST, reportSalesData); - request.getSession().setAttribute(Constants.STOCK_REPORT_LIST, reportStockData); - request.getSession().setAttribute(Constants.PRODUCT_ORG_STOCK_MAP, prodOrgStockMap); - request.getSession().setAttribute(Constants.PRODUCT_ORG_SALES_MAP, prodOrgSalesMap); - - } - else - { - request.getSession().setAttribute(Constants.SALES_REPORT_LIST_COMPLETE, reportSalesData); - request.getSession().setAttribute(Constants.STOCK_REPORT_LIST_COMPLETE, reportStockData); - request.getSession().setAttribute(Constants.PRODUCT_SALES_COMPLETE_SET, productSalesCompleteSet); - request.getSession().setAttribute(Constants.PRODUCT_STOCK_COMPLETE_SET, productStockCompleteSet); - } - } - - request.getSession().setAttribute(Constants.FROM_DATE, startDate); - request.getSession().setAttribute(Constants.TO_DATE, endDate); - - return mapping.findForward(GET_STOCK_SALES_REPORT); - - } - - public static final String CLEAR_STOCK_SALES_REPORT = "clearStockSalesReport"; - public ActionForward clearStockSalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, DocumentException, IOException, SQLException, ParseException - { - ActionForward fwd= init(mapping,form,request,response); - - if (fwd!=null) - { - return fwd; - } - - clear(request, true); - clear(request, false); - request.getSession().removeAttribute(Constants.STOCK_SALES_REPORT_ORGS); - request.getSession().removeAttribute(Constants.STOCK_SALES_REPORT_DATA); - - return mapping.findForward(GET_STOCK_SALES_REPORT); - } - - private void clear(HttpServletRequest request, boolean isComplete) - { - if (!isComplete) - { - request.getSession().removeAttribute(Constants.PRODUCT_ORG_STOCK_MAP); - request.getSession().removeAttribute(Constants.PRODUCT_ORG_SALES_MAP); - request.getSession().removeAttribute(Constants.SALES_REPORT_LIST); - request.getSession().removeAttribute(Constants.STOCK_REPORT_LIST); - } - else - { - request.getSession().removeAttribute(Constants.PRODUCT_SALES_COMPLETE_SET); - request.getSession().removeAttribute(Constants.PRODUCT_STOCK_COMPLETE_SET); - request.getSession().removeAttribute(Constants.SALES_REPORT_LIST_COMPLETE); - request.getSession().removeAttribute(Constants.STOCK_REPORT_LIST_COMPLETE); - } - } - - private ArrayList getReportData(HttpServletRequest request, boolean isSales, int orgId) - { - - if (isSales) - { - if (orgId == 0) - { - return (ArrayList) request.getSession().getAttribute(Constants.SALES_REPORT_LIST_COMPLETE); - } - else - { - return (ArrayList)request.getSession().getAttribute(Constants.SALES_REPORT_LIST); - } - } - else - { - if (orgId == 0) - { - return (ArrayList) request.getSession().getAttribute(Constants.STOCK_REPORT_LIST_COMPLETE); - } - else - { - return (ArrayList)request.getSession().getAttribute(Constants.STOCK_REPORT_LIST); - } - } - } - - public ActionForward getMonthlyStockReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, ParseException, FileNotFoundException, DocumentException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - String productName = request.getParameter("productName"); - String orgIds = getOrgIds(ctx, request); - String date1 = request.getParameter("date1"); - String date2 = request.getParameter("date2"); - - Timestamp d1 = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); - Timestamp d2 = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); - - Calendar fd = Calendar.getInstance(); - fd.setTimeInMillis(d1.getTime()); - fd.set(Calendar.DATE, 1); - - Calendar td = Calendar.getInstance(); - td.setTimeInMillis(d2.getTime()); - td.set(Calendar.DATE, td.getMaximum(Calendar.DAY_OF_MONTH)); - - Timestamp fromDate = new Timestamp(fd.getTimeInMillis()); - Timestamp toDate = new Timestamp(td.getTimeInMillis()); - - int[] productIds = ProductManager.getProducts(ctx, productName, Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM), null, null, null); - - if (productIds == null || productIds.length == 0) - { - throw new OperationException ("no products found with product name " + productName); - } - ArrayList reportData = null; - try - { - reportData = new ArrayList(); - Object[] header = new Object[]{"Month", "Qty Sold", "GRN", "Stock Adjustments"}; - reportData.add(header); - - HashMap monthQtySales = POSProductManager.getOrderQtyInfoPerProduct(ctx, true, productIds[0], - orgIds, fromDate, toDate, null); - - reportData = POSReportManager.formatStockSalesReportData(reportData, monthQtySales, fromDate, toDate, 2); - - HashMap monthQtyGRN = POSProductManager.getOrderQtyInfoPerProduct(ctx, false, productIds[0], - orgIds, fromDate, toDate, null); - - reportData = POSReportManager.formatStockSalesReportData(reportData, monthQtyGRN,fromDate, toDate, 2); - - HashMap monthStockAdjust = POSStockManager.getMonthlyStockAdjustments(ctx, - productIds[0], orgIds, fromDate, toDate, null); - reportData = POSReportManager.formatStockSalesReportData(reportData, monthStockAdjust,fromDate, toDate, 2); - - } - catch (OperationException e) - { - postGlobalError("error.process",e.getMessage(),request); - return mapping.getInputForward(); - } - - TabularReport tReport = new TabularReport(reportData); - tReport.setSortable(false); - tReport.setStyle("display"); - tReport.setTitle("Monthly Stock and Sales Report from " + date1 + " to "+date2 ); - tReport.setSubtitle("Product: "+productName); - tReport.setFromDate(fromDate); - tReport.setToDate(toDate); - tReport.createReport("SalesReportAction.do?action=getGRNDetailsPerProduct", productIds[0]); // need to find another way to generate reports with links on data - - request.getSession().setAttribute(Constants.MONTHLY_SALES_REPORT_DATA,tReport.toString()); - - - return mapping.findForward(GET_MONTHLY_SALES_REPORT); - } - - public static String GET_STOCK_ADJUSTMENTS_PER_PRODUCT = "getStockAdjustmentsPerProduct"; - public ActionForward getStockAdjustmentsPerProduct(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - String prodId = request.getParameter("productId"); - String orgIds = getOrgIds(ctx, request); - int productId = Integer.parseInt(prodId); - String date1 = request.getParameter("date1"); - String date2 = request.getParameter("date2"); - Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.BIRTH_DATE); - Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.BIRTH_DATE); - MProduct product = MProduct.get(ctx, productId); - - ArrayList reportData = new ArrayList(); - - - reportData = POSStockManager.getStockAdjustments(ctx, reportData, productId, orgIds, fromDate, toDate, null); - - TabularReport tReport = new TabularReport(reportData); - tReport.setSortable(false); - tReport.setStyle("display"); - tReport.setTitle("Stock Adjustments Report from " + date1 + " to "+date2 ); - tReport.setSubtitle("Product: "+product.getName()); - tReport.setFromDate(fromDate); - tReport.setToDate(toDate); - tReport.createReport(ctx, productId); - - request.getSession().setAttribute(Constants.STOCK_ADJUSTMENTS_REPORT_DATA,tReport.toString()); - - - return mapping.findForward(GET_STOCK_ADJUSTMENTS_PER_PRODUCT); - } - - public static final String VIEW_INVENTORY_HISTORY="viewInventoryHistory"; - public ActionForward viewInventoryHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - - Properties ctx = TmkJSPEnv.getCtx(request); - String prodId = request.getParameter("productId"); - String org_Id = request.getParameter("orgId"); - int orgId = Integer.parseInt(org_Id); - int productId = Integer.parseInt(prodId); - - String date1 = request.getParameter("date1"); - String date2 = request.getParameter("date2"); - - Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); - Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); - - ArrayList list = InventoryManager.viewInventoryHistory(ctx,orgId, productId, fromDate, toDate, null); - request.setAttribute(Constants.INVENTORY_HISTORY_LIST,list); - return mapping.findForward(VIEW_INVENTORY_HISTORY); - } - - public static final String VIEW_INVENTORY_MOVE_HISTORY = "viewInventoryMoveHistory"; - public ActionForward viewInventoryMoveHistory(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - Properties ctx = TmkJSPEnv.getCtx(request); - String prodId = request.getParameter("productId"); - String orgId = request.getParameter("orgId"); - String type = request.getParameter("type"); - int productId = Integer.parseInt(prodId); - String date1 = request.getParameter("date1"); - String date2 = request.getParameter("date2"); - - Timestamp fromDate = TimestampConvertor.getTimestamp(date1, TimestampConvertor.XML_DATE_PATTERN); - Timestamp toDate = TimestampConvertor.getTimestamp(date2, TimestampConvertor.XML_DATE_PATTERN); - - ArrayList list = MMovementManager.getMMovement(ctx, orgId, type, productId, fromDate, toDate); - - request.setAttribute(Constants.INVENTORY_MOVE_HISTORY, list); - return mapping.findForward(VIEW_INVENTORY_MOVE_HISTORY); - } - - private String getOrgIds(Properties ctx, HttpServletRequest request) - { - HashSet orgIdSet = (HashSet)request.getSession().getAttribute(Constants.STOCK_SALES_REPORT_ORGS); - StringBuffer orgIds = new StringBuffer(); - Iterator iter = orgIdSet.iterator(); - while (iter.hasNext()) - { - Integer orgId = iter.next(); - - if (orgId ==0) - { - return Env.getContext(ctx,UdiConstants.ROLE_EDITABLE_ORGS_CTX_PARAM); - } - else - { - orgIds = orgIds.append(orgId); - if (iter.hasNext()) - { - orgIds = orgIds.append(","); - } - } - } - - return orgIds.toString(); - } - - - public static final String GENERATE_REPORT_INPUT = "generateReportInput"; - public ActionForward generateReportInput(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - - if (fwd!=null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - StringBuffer componentList = new StringBuffer(); - String processDescription = null; - String processComment = null; - - int processId = 0; - try - { - processId = Integer.valueOf(request.getParameter("processId")); - MProcess process = MProcess.get(ctx, processId); - MProcessPara[] processPara = process.getParameters(); - processDescription = process.getDescription(); - processComment = process.getHelp(); - - for (MProcessPara parameter:processPara) - { - tr component = new tr(); - try - { - component = (tr)WebComponentFactory.getWebComponent(ctx, parameter); - } - catch (Exception e) - { - postGlobalError("error.process", e.getMessage(), request); - return mapping.getInputForward(); - - } - componentList.append(component.toString()); - } - } - catch (NumberFormatException e) - { - return mapping.getInputForward(); - } - request.getSession().setAttribute(Constants.PROCESS_ID, processId); - request.getSession().setAttribute(Constants.REPORT_DESCRIPTION, processDescription); - request.getSession().setAttribute(Constants.REPORT_COMMENT, processComment); - request.getSession().setAttribute(Constants.WEB_COMPONENTS, componentList.toString()); - return mapping.findForward(GENERATE_REPORT_INPUT); - } - - - public static final String GENERATE_REPORT_OUTPUT = "generateReportOutput"; - public ActionForward generateReportOutput(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - - String reportType = df.getReportType(); - // Load process - int processId = Integer.valueOf(request.getSession().getAttribute(Constants.PROCESS_ID).toString()); - MProcess process = MProcess.get(ctx, processId); - - Map map = request.getParameterMap(); - ProcessInfo pi = null; - // Create a new process instance and populate its parameters with the web user's input - try - { - pi = POSReportManager.createProcessInstance(ctx, processId, map, null); - } - catch (OperationException e) - { - postGlobalError("error.process",e.getMessage(), request); - return mapping.getInputForward(); - } - try - { - ProcessManager.startProcess(ctx, process.getClassname(), pi, null); - } - catch (InstantiationException e) - { - return mapping.getInputForward(); - } - catch (IllegalAccessException e) - { - return mapping.getInputForward(); - } - catch (ClassNotFoundException e) - { - return mapping.getInputForward(); - } - - if (POSReportManager.isJasperReport(process.getClassname())) - { - JasperPrint jasperPrint = ReportStarter.getJasperPrint(); - if (Constants.HTML.equals(reportType)) - { - XhtmlDocument doc = new XhtmlDocument(); - File file = File.createTempFile ("Jasper", ".html", new File(PathInfo.PROJECT_HOME)); - JasperExportManager.exportReportToHtmlFile(jasperPrint, file.getAbsolutePath()); - - StringBuffer contents = new StringBuffer(); - try - { - BufferedReader input = new BufferedReader(new FileReader(file)); - try - { - String line = null; - while (( line = input.readLine()) != null){ - contents.append(line); - contents.append(System.getProperty("line.separator")); - } - } - finally - { - input.close(); - } - } - catch (IOException ex) - { - ex.printStackTrace(); - } - PrintWriter writer = response.getWriter(); - writer.write(contents.toString()); - doc.output(writer); - writer.flush(); - writer.close(); - } - if (Constants.PDF.equals(reportType)) - { - response.setContentType(MimeType.getMimeType(".pdf")); - response.setHeader("Content-Disposition:", "attachment;filename=\""+process.getName()+".pdf\""); - byte[] pdfData = JasperExportManager.exportReportToPdf(jasperPrint); - response.getOutputStream().write(pdfData); - } - } - else - { - MPrintFormat printFormat = POSReportManager.loadPrintFormat(ctx, process, null); - PrintData printData = POSReportManager.getPrintData(ctx, printFormat, pi); - - ReportEngine reportEngine = POSReportManager.getReportEngine(ctx, printFormat, pi); - - if (Constants.PDF.equals(reportType)) - { - response.setContentType(MimeType.getMimeType(".pdf")); - response.setHeader("Content-Disposition:", "attachment;filename=\""+process.getName()+".pdf\""); - - byte[] pdfData = reportEngine.createPDFData(); - response.getOutputStream().write(pdfData); - } - if (Constants.CSV.equals(reportType)) - { - response.setContentType(MimeType.getMimeType(".csv")); - response.setHeader("Content-Disposition:", "attachment;filename=\""+process.getName()+".csv\""); - PrintWriter writer = new PrintWriter(response.getOutputStream()); - reportEngine.createCSV(writer, ',', printFormat.getLanguage()); - } - if (Constants.HTML.equals(reportType)) - { - PrintWriter printWriter = new PrintWriter(response.getOutputStream()); - HashMap paramMap = POSReportManager.getReportParameters(ctx, pi.getAD_PInstance_ID(), null); - POSReportManager.createHTML(printWriter, process.getName(), paramMap, printData, printFormat); - } - } - response.getOutputStream().flush(); - response.getOutputStream().close(); - return null; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSRoleAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSRoleAction.java deleted file mode 100644 index 6bfccda4bf..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSRoleAction.java +++ /dev/null @@ -1,357 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MRole; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.RoleBean; -import org.posterita.businesslogic.MenuManager; -import org.posterita.businesslogic.administration.RoleManager; -import org.posterita.core.MenuItem; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.NoAccessToEditObjectException; -import org.posterita.exceptions.NoCheckBoxSelectedException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.RoleAlreadyExistsException; -import org.posterita.exceptions.SystemException; -import org.posterita.form.RoleForm; -import org.posterita.struts.core.DefaultForm; - -public class POSRoleAction extends POSDispatchAction -{ - public static final String CREATE_ROLE = "createRole"; - public static final String INIT_ROLE = "initRole"; - public static final String LIST_ROLES = "listRoles"; - public static final String VIEW_ROLE = "viewRole"; - public static final String DELETE_ROLE = "deleteRole"; - - public ActionForward createRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - RoleBean bean = (RoleBean) df.getBean(); - - - //Create Role and assign menus - MRole role; - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - try - { - trx.start(); - role = RoleManager.createRole(ctx, bean.getOrgId(), bean.getName(),bean.getIsAccessAllOrgs(), bean.getCheckBox(), bean.getUserDiscount(), bean.getIsOverwritePriceLimit(), bean.getIsDiscountAllowedOnTotal(), bean.getIsDiscountUptoLimitPrice(), bean.getCanCreateOrder(), bean.getCanAlterOrder(), bean.getCanViewOrder(), trx.getTrxName()); - trx.commit(); - ArrayList menus = MenuManager.getMenus(ctx, role.get_ID()); - MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); - - request.getSession().setAttribute(Constants.ROLE,bean); - request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); - } - catch (RoleAlreadyExistsException e) - { - trx.rollback(); - postGlobalError("error.role.already.exists",request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return mapping.findForward(CREATE_ROLE); - - } - - public ActionForward initRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - //ArrayList menuList = MenuKeyNamePair.getKeyNamePairs(ctx); - - //String menu = MenuItem.getMenu(ctx, null); - - //request.getSession().setAttribute(Constants.MENUS,menu); - - ArrayList menus = MenuManager.getMenusForOrganisationType(ctx); - MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); - - //request.getSession().setAttribute(Constants.ROLE,bean); - request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); - - return mapping.findForward(CREATE_ROLE); - - } - - public ActionForward listRoles(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - ArrayList roles = new ArrayList(); - - if (df.getFirst() != null && df.getFirst().equals("1")) - { - request.getSession().setAttribute(Constants.ALL_ROLES,roles); - return mapping.findForward(LIST_ROLES); - } - else - roles = RoleManager.getRoles(ctx, df.getName()); - - request.getSession().setAttribute(Constants.ALL_ROLES,roles); - - return mapping.findForward(LIST_ROLES); - - } - - public ActionForward deleteRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - Integer roleId = Integer.valueOf(df.getRoleId()); - - RoleManager.deleteRole(ctx,roleId.intValue()); - - return mapping.findForward(DELETE_ROLE); - } - - - public ActionForward viewRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - Integer roleId = Integer.valueOf(df.getRoleId()); - - RoleBean bean = RoleManager.getRole(ctx,roleId.intValue()); - - //ArrayList menus = MenuItem.getMenu(ctx,roleId.intValue()); - - //request.getSession().setAttribute(Constants.MENUS,menus); - - ArrayList menus = MenuManager.getMenus(ctx, roleId.intValue()); - MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); - - request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); - request.getSession().setAttribute(Constants.ROLE,bean); - - return mapping.findForward(VIEW_ROLE); - - } - - private static final String INIT_EDIT_ROLE = "initEditRole"; - public ActionForward initEditRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm)form; - - Integer roleId = Integer.valueOf(df.getRoleId()); - - RoleBean bean = RoleManager.getRole(ctx,roleId.intValue()); - MenuItem menuItem = RoleManager.getAvailableMenus(ctx, roleId); - - request.getSession().setAttribute(Constants.ROLE_MENUS, menuItem.getSubMenus()); - request.getSession().setAttribute(Constants.ROLE,bean); - - return mapping.findForward(INIT_EDIT_ROLE); - } - - - private static final String INIT_ROLE_ORG_ACCESS = "initRoleOrgAccess"; - public ActionForward initEditRoleOrgAccess(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - RoleForm rf = (RoleForm) form; - - RoleBean bean = (RoleBean) rf.getBean(); - - ArrayList list = RoleManager.getRoleOrgAccess(ctx, bean.getRoleId()); - RoleBean myRoleBean = RoleManager.getRole(ctx, bean.getRoleId()); - - request.getSession().setAttribute(Constants.ROLE_ORG_ACCESS_LIST, list); - request.getSession().setAttribute(Constants.ROLE, myRoleBean); - - - return mapping.findForward(INIT_ROLE_ORG_ACCESS); - } - - private static final String EDIT_ROLE_ORG_ACCESS = "editRoleOrgAccess"; - public ActionForward editRoleOrgAccess(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - //RoleBean bean = (RoleBean) rf.getBean(); - - ArrayList roleBeanList = df.getRoleOrgAccessList(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - trx.start(); - - - try - { - RoleManager.editRoleOrgAccess(ctx, roleBeanList, trx.getTrxName()); - trx.commit(); - } - catch(OperationException ex) - { - trx.rollback(); - postGlobalError("error.role.org.access.edit", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return mapping.findForward(EDIT_ROLE_ORG_ACCESS); - } - - - public static final String EDIT_ROLE = "editRole"; - public ActionForward editRole(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, SystemException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm)form; - - RoleBean roleBean = (RoleBean)df.getBean(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - trx.start(); - try - { - RoleManager.editRole(ctx, roleBean.getRoleId(), roleBean.getName(), roleBean.getIsAccessAllOrgs(), roleBean.getCheckBox(), roleBean.getUserDiscount(), roleBean.getIsOverwritePriceLimit(), roleBean.getIsDiscountUptoLimitPrice(), roleBean.getIsDiscountAllowedOnTotal() ,trx.getTrxName()); - trx.commit(); - } - catch(RoleAlreadyExistsException ex) - { - trx.rollback(); - postGlobalError("error.role.already.exists",request); - return mapping.getInputForward(); - } - catch (NoAccessToEditObjectException e) - { - trx.rollback(); - postGlobalError("error.no.edit.access", request); - return mapping.getInputForward(); - } - catch(NoCheckBoxSelectedException e) - { - trx.rollback(); - postGlobalError("error.no.checkbox.selected",request); - return mapping.getInputForward(); - } - catch(OperationException ex) - { - trx.rollback(); - postGlobalError("error.role.edit", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - RoleBean bean = RoleManager.getRole(ctx, roleBean.getRoleId()); - ArrayList menus = MenuManager.getMenus(ctx, roleBean.getRoleId()); - MenuItem rootItem = MenuManager.buildMenuTree(ctx, menus); - - request.getSession().setAttribute(Constants.ROLE_MENUS, rootItem.getSubMenus()); - request.getSession().setAttribute(Constants.ROLE, bean); - - ArrayList roles = RoleManager.getRoles(ctx, null); - - request.getSession().setAttribute(Constants.ALL_ROLES,roles); - - return mapping.findForward(EDIT_ROLE); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSSalesReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSSalesReportAction.java deleted file mode 100644 index cf354502a9..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSSalesReportAction.java +++ /dev/null @@ -1,288 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 17-Jul-2006 14:12:03 by praveen - * - */ - -package org.posterita.struts.pos; - -import java.awt.Color; -import java.sql.Timestamp; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MAttribute; -import org.compiere.model.MAttributeSet; -import org.jfree.chart.axis.DateAxis; -import org.jfree.chart.plot.XYPlot; -import org.posterita.Constants; -import org.posterita.beans.ReportBean; -import org.posterita.businesslogic.performanceanalysis.ReportDateManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.businesslogic.performanceanalysis.SalesAnalysisReportManager; -import org.posterita.core.PieChart; -import org.posterita.core.RandomStringGenerator; -import org.posterita.core.SessionStorage; -import org.posterita.core.TimeSeriesChart; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.form.SalesReportForm; -import org.posterita.struts.core.DefaultForm; - -public class POSSalesReportAction extends POSDispatchAction -{ - public static final String GET_CUSTOM_REPORT = "getCustomReport"; - public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - ReportBean bean = (ReportBean) df.getBean(); - Timestamp fromDate = ReportDateManager.getFromDate(bean); - Timestamp toDate = ReportDateManager.getToDate(bean); - String timeperiod = bean.getTimePeriod(); - String chartType = bean.getChartType(); - String salesGroup = bean.getSalesGroup(); - - String reportDir = ReportManager.getReportDirectoryFromServletContext(this.servlet); - String filename = RandomStringGenerator.randomstring(); - - String subtitle = null; - String title = null; - - if(timeperiod!=null) - { - subtitle = "For " + timeperiod; - } - else - { - subtitle = "For period:"+fromDate+" to "+toDate; - } - - - if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)||salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) - { - title = "Sales By " + salesGroup; - } - else - { - String[] s = salesGroup.split("_"); - - if(s.length!=2) - { - throw new OperationException("Cannot generate sql. Unknown salesGroup parameter:"+salesGroup); - } - - int attributeSetId = Integer.parseInt(s[0]); - int attributeId = Integer.parseInt(s[1]); - - String attributeSetName = null; - String attributeName = null; - - attributeSetName = MAttributeSet.get(ctx,attributeSetId).getName(); - attributeName = new MAttribute(ctx,attributeId,null).getName(); - - title = "Sales By " + attributeName + " For " + attributeSetName; - } - - - if(chartType.equals(PieChart.CHART_TYPE)) - { - //draw pie chart - String pieChartSQL = SalesAnalysisReportManager.getPieChartDataSetSQL(ctx,Integer.valueOf(1),fromDate,toDate,salesGroup); - PieChart pieChart = new PieChart(); - - pieChart.setTitle(title); - pieChart.setSubtitle(subtitle); - pieChart.getDataSetFromSQL(pieChartSQL); - pieChart.getChart().setBackgroundPaint(Color.white); - pieChart.saveChartAsJPEG(reportDir+filename+".jpg",700,600); - } - else if(chartType.equals(TimeSeriesChart.CHART_TYPE)) - { - //draw timeseries - String timeSeriesChartSQL = SalesAnalysisReportManager.getTimeSeriesDataSetSQL(ctx,Integer.valueOf(1),fromDate,toDate,salesGroup); - TimeSeriesChart timeSeriesChart = new TimeSeriesChart(); - - timeSeriesChart.setTitle(title); - timeSeriesChart.setSubtitle(subtitle); - timeSeriesChart.setShowShapes(true); - timeSeriesChart.getDataSetFromSQL(timeSeriesChartSQL); - - - XYPlot plot = (XYPlot) timeSeriesChart.getChart().getPlot(); - DateAxis axis = (DateAxis) plot.getDomainAxis(); - - axis.setRange(fromDate, toDate); - //axis.setTickUnit(new DateTickUnit(DateTickUnit.MONTH,1,new SimpleDateFormat("MMM-yyyy"))); - - timeSeriesChart.getChart().setBackgroundPaint(Color.white); - timeSeriesChart.saveChartAsJPEG(reportDir+filename+".jpg",700,600); - } - else - { - throw new OperationException("Invalid Chart type:" + chartType); - } - - String imgURL = request.getContextPath() + "/config/reports/"+filename+".jpg"; - request.getSession().setAttribute(Constants.REPORT_URL,imgURL); - - return mapping.findForward(GET_CUSTOM_REPORT); - //return getGroupedSalesReport(mapping,form,request,response); - } - - public static final String INIT_CUSTOM_REPORT = "initCustomReport"; - public ActionForward initCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - SalesReportForm salesReportForm = (SalesReportForm) form; - ReportBean reportBean = (ReportBean) salesReportForm.getBean(); - - salesReportForm.setChartType(PieChart.CHART_TYPE); - reportBean.setChartType(PieChart.CHART_TYPE); - - boolean error = false; - - if((salesReportForm.getFromDate()==null)||(salesReportForm.getFromDate()=="")) - { - postGlobalError("error.required.startDate",request); - error = true; - } - - if((salesReportForm.getToDate()==null)||(salesReportForm.getToDate()=="")) - { - postGlobalError("error.required.endDate",request); - error = true; - } - - if(error) - { - return mapping.getInputForward(); - } - - SessionStorage.putSalesGroupFilter(ctx,request,reportBean); - - return mapping.findForward(INIT_CUSTOM_REPORT); - } - - public static final String INIT_CUSTOM_SALES_REPORT = "initCustomSalesReport"; - public ActionForward initCustomSalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - SalesReportForm reportForm = (SalesReportForm) form; - ReportBean reportBean = (ReportBean) reportForm.getBean(); - - if(reportBean.getFromDate()==null) - { - String timeperiod = reportBean.getTimePeriod(); - if(timeperiod==null) - { - throw new OperationException("No period parameter found!"); - } - - Date startDate = ReportDateManager.getStartDateForPeriod(timeperiod); - Date endDate = ReportDateManager.getEndDateForPeriod(timeperiod); - - SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); - String fromDate = sdf.format(startDate); - String toDate = sdf.format(endDate); - - reportForm.setFromDate(fromDate); - reportForm.setToDate(toDate); - reportForm.setStartHour("0"); - reportForm.setStartMinute("0"); - reportForm.setChartType(PieChart.CHART_TYPE); - - reportBean.setFromDate(fromDate); - reportBean.setToDate(toDate); - reportBean.setStartHour("0"); - reportBean.setStartMinute("0"); - reportBean.setChartType(PieChart.CHART_TYPE); - - Calendar cal = Calendar.getInstance(); - - reportForm.setToDate(toDate); - reportForm.setEndHour(cal.get(Calendar.HOUR_OF_DAY)+""); - reportForm.setEndMinute(cal.get(Calendar.MINUTE)+""); - - reportBean.setToDate(toDate); - reportBean.setEndHour(cal.get(Calendar.HOUR_OF_DAY)+""); - reportBean.setEndMinute(cal.get(Calendar.MINUTE)+""); - - SessionStorage.putSalesGroupFilter(ctx,request,reportBean); - - } - - return mapping.findForward(INIT_CUSTOM_SALES_REPORT); - } - - public static final String SALES_BY_ATTRIBUTESET = "salesByAttributeSet"; - public static final String SALES_BY_REVENUE_RECOGNITION = "salesByRevenueRecognition"; - - public static final String GET_GROUPED_SALES_REPORT = "getGroupedSalesReport"; - public ActionForward getGroupedSalesReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - SalesReportForm reportForm = (SalesReportForm) form; - ReportBean reportBean = (ReportBean) reportForm.getBean(); - - String salesGroup = reportBean.getSalesGroup(); - - if(salesGroup.equalsIgnoreCase(Constants.REVENUE_RECOGNITION)) - { - return mapping.findForward(SALES_BY_REVENUE_RECOGNITION); - } - else if(salesGroup.equalsIgnoreCase(Constants.ATTRIBUTESET)) - { - return mapping.findForward(SALES_BY_ATTRIBUTESET); - } - else - { - throw new OperationException("Invalid Sales Grouping: "+ salesGroup); - } - - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSStockAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSStockAction.java deleted file mode 100644 index dd609b9343..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSStockAction.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Created on May 8, 2006 - */ - - -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.Constants; -import org.posterita.beans.AttributeBean; -import org.posterita.businesslogic.POSStockManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - - -public class POSStockAction extends BaseDispatchAction -{ - public static final String initPOSStock="initPOSStock"; - public ActionForward initPOSStock(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - - request.getSession().removeAttribute(Constants.PRODUCTS); - ArrayList list=POSStockManager.getAllAttributeSet(ctx); - request.getSession().setAttribute(Constants.PRODUCT_ATTRIBUTE_SET,list); - - return mapping.findForward(GET_POS_STOCK); - - } - - public static final String GET_POS_STOCK="getPOSStock"; - public ActionForward getPOSStock(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - - request.removeAttribute(Constants.PRODUCTS); - ArrayList list=POSStockManager.getAllAttributeSet(ctx); - request.getSession().setAttribute(Constants.PRODUCT_ATTRIBUTE_SET,list); - - ArrayList list2=POSStockManager.getStockFromSearch(ctx, null, null, null); - request.getSession().setAttribute(Constants.PRODUCTS,list2); - - return mapping.findForward(GET_POS_STOCK); - - - } - - public static final String GET_STOCK="getStock"; - public ActionForward getStock(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - AttributeBean bean = (AttributeBean) df.getBean(); - ArrayList list=POSStockManager.getAllAttributeFromAttributeSet(ctx,bean); - request.getSession().setAttribute(Constants.ATTRIBUTE_SET_ID,bean.getAttributeSetId()); - request.getSession().setAttribute(Constants.PRODUCT_ATTRIBUTE_LIST,list); - request.removeAttribute(Constants.PRODUCTS); - ArrayList productList=POSStockManager.getAllProducts(ctx, bean.getAttributeSetId()); - request.getSession().setAttribute(Constants.PRODUCTS,productList); - - return mapping.findForward(GET_STOCK); - } - - - public static final String GET_PRODUCTS="getProducts"; - public ActionForward getProducts(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Integer attributeSetId=(Integer)request.getSession().getAttribute(Constants.ATTRIBUTE_SET_ID); - Properties ctx =TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - AttributeBean bean = (AttributeBean) df.getBean(); - ArrayList list=POSStockManager.getProducts(ctx,bean); - request.setAttribute(Constants.PRODUCTS,list); - - bean.setAttributeSetId(attributeSetId); - - ArrayList attriList=POSStockManager.getAllAttributeFromAttributeSet(ctx,bean); - request.getSession().setAttribute(Constants.PRODUCT_ATTRIBUTE_LIST,attriList); - - return mapping.findForward(GET_PRODUCTS); - } - - - public static final String GET_STOCK_FROM_SEARCH="getStockFromSearch"; - public ActionForward getStockFromSearch(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - if (isDisplayTagAction(request)) - { - return mapping.findForward(GET_STOCK_FROM_SEARCH); - } - - Properties ctx =TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - - String filter=null; - if(df.getQtyFilter()!=null && df.getQtyFilter().length()!=0) - filter=df.getQtyFilter(); - - ArrayList list = POSStockManager.getStockFromSearch(ctx,df.getProductName(),df.getBarCode(),filter); - request.getSession().setAttribute(Constants.PRODUCTS,list); - - return mapping.findForward(GET_STOCK_FROM_SEARCH); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/POSUserAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/POSUserAction.java deleted file mode 100644 index 2e6441cf8b..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/POSUserAction.java +++ /dev/null @@ -1,293 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 29, 2005 by praveen - * - */ -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MCountry; -import org.compiere.util.Trx; - -import org.posterita.Constants; -import org.posterita.beans.UserBean; -import org.posterita.businesslogic.administration.RoleManager; -import org.posterita.businesslogic.administration.UserManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.DuplicateUserPinException; -import org.posterita.exceptions.NoAccessToEditObjectException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.UserAlreadyExistsException; -import org.posterita.form.UserForm; -import org.posterita.keyname.RegionKeyNamePair; -import org.posterita.struts.core.DefaultForm; - -public class POSUserAction extends POSDispatchAction -{ - - public static final String CREATE_USER = "createUser"; - public ActionForward createUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - DefaultForm df = (DefaultForm) form; - - UserBean bean = (UserBean) df.getBean(); - - Properties ctx = TmkJSPEnv.getCtx(request); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - try - { - trx.start(); - MCountry country = MCountry.getDefault(ctx); - UserManager.createUser(ctx, bean.getOrgId(), bean.getUsername(),bean.getUsername(), bean.getIsSalesRep().booleanValue(),bean.getAddress1(),bean.getPostalAddress(),bean.getCity(),bean.getPassword(),bean.getEmail(),bean.getIsActive().booleanValue(),bean.getPhone(),0, bean.getRoleId().intValue(), country.get_ID(),bean.getUserPIN(),bean.getUserDiscount(),bean.getDocBasisType(),bean.getAmtMultiplier(),bean.getFrequencyType(),bean.getSubtractAmt(),bean.getIsFullAccess(),trx.getTrxName()); - trx.commit(); - } - catch(DuplicateUserPinException e) - { - trx.rollback(); - postGlobalError("error.duplicate.userpin", request); - return mapping.getInputForward(); - } - catch(UserAlreadyExistsException e) - { - trx.rollback(); - postGlobalError("error.usernameAlreadyUsed", request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return mapping.findForward(CREATE_USER); - } - - public static final String EDIT_USER = "editUser"; - public ActionForward editUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - DefaultForm df = (DefaultForm) form; - - UserBean bean = (UserBean) df.getBean(); - - Properties ctx = TmkJSPEnv.getCtx(request); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - try - { - trx.start(); - UserManager.editUser(ctx, bean.getOrgId(), bean.getUserId().intValue(),bean.getRoleId().intValue(),bean.getPassword(),bean.getEmail(),bean.getPhone(),bean.getAddress1(),bean.getPostalAddress(),bean.getCity(),bean.getIsSalesRep().booleanValue(),bean.getIsActive().booleanValue(),bean.getUserPIN(),bean.getUserDiscount(),bean.getDocBasisType(),bean.getAmtMultiplier(),bean.getFrequencyType(),bean.getSubtractAmt(),bean.getIsFullAccess(),trx.getTrxName()); - trx.commit(); - } - catch(DuplicateUserPinException e) - { - trx.rollback(); - postGlobalError("error.duplicate.userpin", request); - return mapping.getInputForward(); - } - catch(NoAccessToEditObjectException e) - { - trx.rollback(); - postGlobalError("error.no.edit.access", request); - return mapping.getInputForward(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.editing.user", request); - mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return mapping.findForward(EDIT_USER); - } - - public static final String DELETE_USER = "deleteUser"; - @SuppressWarnings("unchecked") - public ActionForward deleteUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - UserForm uf = (UserForm) form; - - Properties ctx = TmkJSPEnv.getCtx(request); - - int userId = Integer.valueOf(uf.getUserId()).intValue(); - - UserManager.deleteUser(ctx,userId); - - ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.ALL_USERS); - - ArrayList newList = UserManager.updateUserListStatus(list, userId, false); - - request.getSession().setAttribute(Constants.ALL_USERS,newList); - - return mapping.findForward(DELETE_USER); - } - - public static final String ACTIVATE_USER = "activateUser"; - @SuppressWarnings("unchecked") - public ActionForward activateUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - UserForm uf = (UserForm) form; - - Properties ctx = TmkJSPEnv.getCtx(request); - - int userId = Integer.valueOf(uf.getUserId()).intValue(); - - UserManager.activateUser(ctx,userId); - - ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.ALL_USERS); - - ArrayList newList = UserManager.updateUserListStatus(list, userId, true); - - request.getSession().setAttribute(Constants.ALL_USERS,newList); - - return mapping.findForward(ACTIVATE_USER); - } - - public static final String INIT_CREATE_USER = "initCreateUser"; - public ActionForward initCreateUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList roles = RoleManager.getAllRoles(ctx); - - ArrayList regions = RegionKeyNamePair.getKeyNamePairs(ctx); - - request.getSession().setAttribute(Constants.ROLES,roles); - - request.getSession().setAttribute(Constants.REGIONS,regions); - - return mapping.findForward(INIT_CREATE_USER); - } - - public static final String INIT_EDIT_USER = "initEditUser"; - public ActionForward initEditUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - UserForm uf = (UserForm) form; - - int userId = Integer.valueOf(uf.getUserId()).intValue(); - - UserBean bean = UserManager.getUser(ctx,userId); - - uf.populate(bean); - - ArrayList roles = RoleManager.getAllRoles(ctx); - - request.getSession().setAttribute(Constants.ROLES,roles); - - request.getSession().setAttribute(Constants.USER_DETAILS,bean); - - return mapping.findForward(INIT_EDIT_USER); - } - - public static final String LIST_USERS = "listUsers"; - public ActionForward listUsers(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - ArrayList users = new ArrayList(); - - if (df.getFirst() != null && df.getFirst().equals("1")) - { - request.getSession().setAttribute(Constants.ALL_USERS,users); - return mapping.findForward(LIST_USERS); - } - else - users = UserManager.getUsers(ctx, df.getName()); - - request.getSession().setAttribute(Constants.ALL_USERS,users); - - return mapping.findForward(LIST_USERS); - } - - public static final String VIEW_USER = "viewUser"; - public ActionForward viewUser(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - UserForm uf = (UserForm) form; - - int userId = Integer.valueOf(uf.getUserId()).intValue(); - - UserBean userBean = UserManager.getUser(ctx,userId); - - request.getSession().setAttribute(Constants.USER_DETAILS,userBean); - - return mapping.findForward(VIEW_USER); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/PartialPOSOrderAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/PartialPOSOrderAction.java deleted file mode 100644 index 8b6d2e618f..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/PartialPOSOrderAction.java +++ /dev/null @@ -1,762 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * */ - - -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; -import java.math.BigDecimal; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MOrder; -import org.compiere.util.Env; -import org.compiere.util.Trx; - -import org.posterita.Constants; -import org.posterita.beans.ItemBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.ShoppingCartBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.businesslogic.OrderReferenceManager; -import org.posterita.businesslogic.OrderManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.PartialPOSManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.businesslogic.administration.RoleManager; -import org.posterita.businesslogic.stock.StockManager; -import org.posterita.core.SessionStorage; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.BPartnerNoLocationException; -import org.posterita.exceptions.BPartnerOverCreditLimitException; -import org.posterita.exceptions.DiscountLimitException; -import org.posterita.exceptions.InputQuantityLessThanZeroException; -import org.posterita.exceptions.InsufficientQtyException; -import org.posterita.exceptions.InvalidInvokeOrderStatusException; -import org.posterita.exceptions.InvalidOrderIDException; -import org.posterita.exceptions.InvalidOrderTypeException; -import org.posterita.exceptions.InvalidTenderedAmountException; -import org.posterita.exceptions.NoOrderLineFoundException; -import org.posterita.exceptions.NoOrderLineSelectedException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.exceptions.ProductNotOnPriceListException; -import org.posterita.exceptions.QuantityNotAvailableException; -import org.posterita.exceptions.UOMValuePrecisionNotValidException; -import org.posterita.form.InvokeOrderForm; -import org.posterita.lib.UdiConstants; -import org.posterita.struts.core.DefaultForm; - - -public class PartialPOSOrderAction extends POSDispatchAction -{ - public static final String CREATE_POS_ORDER="createPOSOrder"; - public ActionForward createPOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, DiscountLimitException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - //validate payment type - - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - - if(cartBean==null ||cartBean.getItems() == null||cartBean.getItems().size()==0) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - - MOrder posOrder = null; - - Integer bPartnerId = bean.getBpartnerId(); - - if(bPartnerId==null) - bPartnerId = (Integer) request.getSession().getAttribute(Constants.BPARTNER); - - if(bPartnerId==null) - { - bPartnerId=Integer.valueOf(POSTerminalManager.getCashBPartner(ctx).get_ID()); - } - else - { - boolean isBPartnerPresent = BPartnerManager.isBPartnerPresent(ctx,bPartnerId.intValue(),null); - - if( !isBPartnerPresent ) - { - postGlobalError("error.pos.invalid.customerID",request); - return mapping.getInputForward(); - } - } - - request.getSession().setAttribute(Constants.BPARTNER, bPartnerId); - - bean.setBpartnerId(bPartnerId); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - posOrder= PartialPOSManager.createPOSOrder(ctx,bean,cartBean.getItems(),null/*trx.getTrxName()*/); - trx.commit(); - } - catch(BPartnerOverCreditLimitException e1) - { - trx.rollback(); - postGlobalError("error.bpartner.over.credit.limit",e1.getMessage(),request); - return mapping.getInputForward(); - } - catch(BPartnerNoLocationException ex) - { - trx.rollback(); - postGlobalError("error.bpartner.nolocation", request); - return mapping.getInputForward(); - } - catch(InvalidTenderedAmountException e) - { - trx.rollback(); - postGlobalError("error.pos.incorrect.tendered.amount",request); - return mapping.getInputForward(); - } - catch(InsufficientQtyException e3) - { - trx.rollback(); - postGlobalError("error.insufficient.qty",e3.getMessage(),request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - bean.setOrderId(Integer.valueOf(posOrder.get_ID())); - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, posOrder); - if(posOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) - { - if(bean.getPaymentByCash()!=null) - webBean.setPaymentByCash(bean.getPaymentByCash()); - if(bean.getPaymentByCard()!=null) - webBean.setPaymentByCard(bean.getPaymentByCard()); - if(bean.getPaymentByChq()!=null) - webBean.setPaymentbyCheque(bean.getPaymentByChq()); - } - - - ArrayList list = PartialPOSManager.populateOrderLines(ctx,posOrder); - WebDocumentBean documentBean=PartialPOSManager.calculateOrderTotals(list); - request.getSession().setAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID,posOrder.get_ID()); - request.getSession().setAttribute(Constants.ORDER_LINE_BEAN,bean); - request.setAttribute(Constants.PARTIAL_POS_ORDER_LINES,list); - /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ - - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - - return mapping.findForward(CREATE_POS_ORDER); - - - - } - - public static final String COMPLETE_POS_ORDER="completePOSOrder"; - public ActionForward completePOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - OrderLineBean bean=(OrderLineBean) request.getSession().getAttribute(Constants.ORDER_LINE_BEAN); - Integer orderId = (Integer)request.getSession().getAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); - MOrder completedPOSOrder=null; - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - completedPOSOrder=PartialPOSManager.completePOSOrder(ctx,orderId.intValue(),bean,trx.getTrxName()); - trx.commit(); - } - catch(NoOrderLineFoundException e) - { - trx.rollback(); - postGlobalError("error.pos.no.orderline",request); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); - - return mapping.getInputForward(); - } - catch(OperationException e) - { - trx.rollback(); - throw e; - } - finally - { - trx.close(); - } - - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedPOSOrder); - - if(completedPOSOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) - { - PartialPOSManager.getAmountForMixedPayment(ctx,completedPOSOrder,webBean); - } - - ArrayList list = PartialPOSManager.populateOrderLines(ctx,completedPOSOrder); - WebDocumentBean documentBean=PartialPOSManager.calculateOrderTotals(list); - request.setAttribute(Constants.POS_ORDER_LINES,list); - - /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ - request.getSession().removeAttribute(Constants.BPARTNER); - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); - request.setAttribute(Constants.ORDER_NAME,"POS ORDER"); - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - - return mapping.findForward(COMPLETE_POS_ORDER); - } - - - public static final String GET_POS_PAYMENT_DETAILS="getPOSPaymentDetails"; - public ActionForward getPOSPaymentDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - // Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - df.populate(new OrderLineBean()); - request.getSession().setAttribute(Constants.BPARTNER, bean.getBpartnerId()); - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - - if(cartBean==null ||cartBean.getItems() == null||cartBean.getItems().size()==0) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - - request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART, cartBean); - request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS, cartBean.getItems()); - return mapping.findForward(GET_POS_PAYMENT_DETAILS); - - - } - - public static final String DELETE_POS_ORDERLINE = "deletePOSOrderLine"; - public ActionForward deletePOSOrderLine(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - String forward = DELETE_POS_ORDERLINE; - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - forward = PartialPOSManager.deleteOrderLines(ctx,bean.getPosOrderLineIds(),trx.getTrxName()); - trx.commit(); - } - catch (NoOrderLineSelectedException e) - { - trx.rollback(); - SessionStorage.putPOSOrderInfo(ctx,bean,request,forward); - - postGlobalError("error.order.noOrderline.selected",request); - return mapping.getInputForward(); - } - catch (OperationException e) - { - trx.rollback(); - throw e; - } - finally - { - trx.close(); - } - - Integer orderId = (Integer)request.getSession().getAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); - //validating order - //if lines == 0 goto createpartialOrder - - if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) - { - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); - return new ActionForward("/CreatePartialPOSOrder.do"); - } - - //reload shopping cart - ShoppingCartBean cart = PartialPOSManager.getShoppingCartForOrder(ctx,orderId.intValue(),null); - request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART,cart); - request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS,cart.getItems()); - - - - SessionStorage.putPOSOrderInfo(ctx,bean,request,forward); - df.populate(new OrderLineBean()); - - return mapping.findForward(DELETE_POS_ORDERLINE); - } - - - public static final String ADD_TO_SHOPPING_CART = "addToShoppingCart"; - public ActionForward addToShoppingCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - OrderLineBean bean = (OrderLineBean) df.getBean(); - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - - - try - { - // PartialPOSManager.getQtyAndItem(bean); - if(bean.getProductId()==null && bean.getBarCode()==null) - { - postGlobalError("error.barcode.required", request); - return mapping.getInputForward(); - } - - cartBean = StockManager.addToPOSCart(ctx, bean, cartBean,true,Boolean.parseBoolean(bean.getIfAdd())); - } - catch (InputQuantityLessThanZeroException e1) - { - postGlobalError("error.invalid.inputQty", request); - return mapping.getInputForward(); - } - catch (ProductNotFoundException e2) - { - postGlobalError("error.product.not.found", e2.getMessage(), request); - return mapping.getInputForward(); - } - catch(QuantityNotAvailableException e3) - { - postGlobalError("error.quantity.notAvailable", e3.getMessage(), request); - return mapping.getInputForward(); - } - - catch(ProductNotOnPriceListException e4) - { - postGlobalError("error.product.price.not.found", e4.getMessage(), request); - return mapping.getInputForward(); - } - - catch (UOMValuePrecisionNotValidException e) - { - postGlobalError("error.precision", e.getMessage(), request); - return mapping.getInputForward(); - } - - request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART, cartBean); - request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS, cartBean.getItems()); - - df.setQtyAndItem(""); - - return mapping.findForward(ADD_TO_SHOPPING_CART); - } - - - - public static final String COMPLETE_PARTIAL_POS_ORDER="completePartialPOSOrder"; - public ActionForward completePartialPOSOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - Integer orderId = (Integer)request.getSession().getAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); - - //MOrder posOrder=(MOrder) request.getSession().getAttribute(Constants.CURRENT_POS_ORDER); - //MOrder completedPOSOrder=null; - //boolean error = false; - - if (orderId == null) - { - return mapping.getInputForward(); - } - if(OrderManager.isOrderEmpty(ctx,orderId.intValue(),null)) - { - postGlobalError("error.pos.no.orderline",request); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); - return mapping.getInputForward(); - } - - //completedPOSOrder=PartialPOSManager.completePOSOrder(ctx,posOrder,bean); - MOrder completedPOSOrder = OrderManager.prepareOrder(ctx,orderId.intValue(),null); - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, completedPOSOrder); - - if(completedPOSOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) - { - PartialPOSManager.getAmountForMixedPayment(ctx,completedPOSOrder,webBean); - } - - ArrayList list = PartialPOSManager.populateOrderLines(ctx,completedPOSOrder); - WebDocumentBean documentBean=PartialPOSManager.calculateOrderTotals(list); - request.getSession().setAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID,orderId); - request.setAttribute(Constants.POS_ORDER_LINES,list); - - /*request.removeAttribute(Constants.POS_ORDER_LINES);*/ - request.getSession().removeAttribute(Constants.BPARTNER); - request.getSession().removeAttribute(Constants.ALL_CUSTOMERS); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - request.getSession().removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); - request.getSession().removeAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - request.setAttribute(Constants.ORDER_NAME,"POS ORDER"); - - return mapping.findForward(COMPLETE_PARTIAL_POS_ORDER); - } - - - public static final String INVOKE_PARTIAL_ORDER = "invokePartialOrder"; - public ActionForward invokePartialOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - InvokeOrderForm f = (InvokeOrderForm) form; - OrderLineBean bean = (OrderLineBean) f.getBean(); - - String documentNo = bean.getDocumentNo(); - - MOrder order = null; - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - order = PartialPOSManager.invokePartialOrder(ctx,documentNo,trx.getTrxName()); - trx.commit(); - } - catch (InvalidOrderIDException e) - { - trx.rollback(); - postGlobalError("error.invalid.orderId",request); - return mapping.getInputForward(); - } - catch (InvalidOrderTypeException e) - { - trx.rollback(); - postGlobalError("error.invalid.orderType",request); - return mapping.getInputForward(); - } - catch (NoOrderLineFoundException e) - { - trx.rollback(); - postGlobalError("error.pos.invoke.no.orderline",request); - return mapping.getInputForward(); - } - catch (InvalidInvokeOrderStatusException e) - { - trx.rollback(); - postGlobalError("error.invoke.status",e.getStatus(),request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - int bPartnerId = order.getC_BPartner_ID(); - ShoppingCartBean cart = PartialPOSManager.getShoppingCartForOrder(ctx,order.get_ID(),null); - ArrayList cartItems = cart.getItems(); - - BigDecimal discountAllowed = RoleManager.getDiscountAllowed(ctx, Env.getAD_Role_ID(ctx),null); - - //putting cart & other info in session - request.getSession().setAttribute(Constants.BPARTNER, Integer.valueOf(bPartnerId)); - request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART, cart); - request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS, cartItems); - request.getSession().setAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID,Integer.valueOf(order.get_ID())); - request.getSession().setAttribute(Constants.DISCOUNT_ALLOWED, discountAllowed); - - return mapping.findForward(INVOKE_PARTIAL_ORDER); - - } - - public static final String SET_POS_PAYMENT_DETAILS = "setPOSPaymentDetails"; - public ActionForward setPOSPaymentDetails(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - //mapping.setInput("/GetPartialPOSPaymentDetails.do"); - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - OrderLineBean bean=(OrderLineBean) df.getBean(); - - ShoppingCartBean cartBean = (ShoppingCartBean) request.getSession().getAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - - if(cartBean==null) - { - postGlobalError("error.pos.shoppingcart.empty",request); - return mapping.getInputForward(); - } - - //validate discount entered - String[] discountPercentage = df.getDiscountPercent(); - String[] actualPrice = df.getActualPrice(); - - for(String s : discountPercentage) - { - if(s == null || s == "") - { - continue; - } - - try - { - Double.parseDouble(s); - } - catch (NumberFormatException e) - { - postGlobalError("errors.double","Discount(s)",request); - return mapping.getInputForward(); - } - } - - for(String s : actualPrice) - { - if(s == null || s == "") - { - continue; - } - - try - { - Double.parseDouble(s); - } - catch (NumberFormatException e) - { - postGlobalError("errors.double","Price(s)",request); - return mapping.getInputForward(); - } - } - - Integer orderId = (Integer) request.getSession().getAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); - Integer bPartnerId = bean.getBpartnerId(); - - if(bPartnerId==null) - bPartnerId = (Integer) request.getSession().getAttribute(Constants.BPARTNER); - if(bPartnerId==null) - bPartnerId=Integer.valueOf(POSTerminalManager.getCashBPartner(ctx).get_ID()); - - bean.setBpartnerId(bPartnerId); - MOrder posOrder = null; - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - try - { - trx.start(); - posOrder= PartialPOSManager.setOrderPaymentDetails(ctx,orderId,bean,cartBean.getItems(), trx.getTrxName()); - trx.commit(); - } - catch(InvalidTenderedAmountException e) - { - trx.rollback(); - postGlobalError("error.pos.incorrect.tendered.amount",request); - return mapping.getInputForward(); - } - catch (OperationException e) - { - trx.rollback(); - throw e; - } - finally - { - trx.close(); - } - - bean.setOrderId(Integer.valueOf(posOrder.get_ID())); - - df.populate(new OrderLineBean()); - WebDocumentBean webBean = OrderReferenceManager.getWebOrderBean(ctx, posOrder); - if(posOrder.getPaymentRule().equals(UdiConstants.PAYMENTRULE_MIXED)) - { - if(bean.getPaymentByCash()!=null) - webBean.setPaymentByCash(bean.getPaymentByCash()); - if(bean.getPaymentByCard()!=null) - webBean.setPaymentByCard(bean.getPaymentByCard()); - if(bean.getPaymentByChq()!=null) - webBean.setPaymentbyCheque(bean.getPaymentByChq()); - } - - - ArrayList list = PartialPOSManager.populateOrderLines(ctx,posOrder); - WebDocumentBean documentBean=PartialPOSManager.calculateOrderTotals(list); - //TODO put id only - request.getSession().setAttribute(Constants.CURRENT_POS_ORDER_ID,Integer.valueOf(orderId)); - request.getSession().setAttribute(Constants.ORDER_LINE_BEAN,bean); - request.setAttribute(Constants.POS_ORDER_LINES,list); - request.setAttribute(Constants.PARTIAL_POS_OREDR,"partialPOSOrder"); - - SessionStorage.putCompleteOrderInfo(ctx,request,webBean,documentBean); - - - return mapping.findForward(SET_POS_PAYMENT_DETAILS); - } - - public static final String DELETE_PARTIAL_ORDER = "deletePartialOrder"; - public ActionForward deletePartialOrder(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - InvokeOrderForm f = (InvokeOrderForm) form; - OrderLineBean bean = (OrderLineBean) f.getBean(); - - int orderId = bean.getOrderId().intValue(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - OrderManager.deleteDraftedOrder(ctx,orderId,trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - throw e; - } - finally - { - trx.close(); - } - - return mapping.findForward(DELETE_PARTIAL_ORDER); - } - - //methods called using AJAX - public static final String INCREMENT_QTY = "incrementQty"; - public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - addToShoppingCart(mapping,form,request,response); - return new ActionForward("/jsp/pos/partialPOSOrderShoppingCart.jsp"); - } - - public static final String DECREMENT_QTY = "decrementQty"; - public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - addToShoppingCart(mapping,form,request,response); - return new ActionForward("/jsp/pos/partialPOSOrderShoppingCart.jsp"); - } - - public static final String DELETE_FROM_POS_CART = "deleteFromPOSCart"; - public ActionForward deleteFromPOSCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - OrderLineBean bean = (OrderLineBean) df.getBean(); - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); - ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),true); - request.getSession().setAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS, itemsInCart); - - return new ActionForward("/jsp/pos/partialPOSOrderShoppingCart.jsp"); - } - - public static final String DELETE_ORDER = "deleteOrder"; - public ActionForward deleteOrder(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - OrderLineBean bean = (OrderLineBean) df.getBean(); - - int orderId = bean.getOrderId().intValue(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - OrderManager.deleteDraftedOrder(ctx,orderId,trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - throw e; - } - finally - { - trx.close(); - } - - //removing cart & other info in session - HttpSession session = request.getSession(); - - session.removeAttribute(Constants.BPARTNER); - session.removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART); - session.removeAttribute(Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS); - session.removeAttribute(Constants.CURRENT_PARTIAL_POS_ORDER_ID); - - return mapping.getInputForward(); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/PaymentAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/PaymentAction.java deleted file mode 100644 index a5387dcc95..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/PaymentAction.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 08-Dec-2006 14:01:58 by praveen - * - */ - -package org.posterita.struts.pos; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MPayment; -import org.compiere.util.Trx; -import org.posterita.beans.PaymentBean; -import org.posterita.businesslogic.PaymentAllocationManager; -import org.posterita.businesslogic.PaymentManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.AllocatedAmtMoreThanOpenAmtException; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.BPartnerNotFoundException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.PayAmtNotEqualToAllocateAmtException; -import org.posterita.form.GeneralPaymentForm; -import org.posterita.form.PaymentForm; - -public class PaymentAction extends POSDispatchAction -{ - public static String CREATE_PAYMENT = "createPayment"; - public ActionForward createPayment(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - GeneralPaymentForm pf = (GeneralPaymentForm) form; - PaymentBean bean = (PaymentBean) pf.getBean(); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - MPayment payment; - try - { - trx.start(); - payment= PaymentManager.createPayment(ctx,bean,trx.getTrxName()); - trx.commit(); - } - catch(BPartnerNotFoundException e) - { - trx.rollback(); - postGlobalError("error.required.bpartnerId",request); - return mapping.getInputForward(); - } - catch(OperationException e) - { - trx.rollback(); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return new ActionForward("/ViewWebstorePaymentAction.do?action=viewOrder&documentId="+payment.get_ID()); - } - - - - public static String CREATE_PAYMENT_FOR_MULTIPLE_INVOICE = "createPaymentForMultipleInvoice"; - public ActionForward createPaymentForMultipleInvoice(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - PaymentForm pf = (PaymentForm) form; - PaymentBean bean = (PaymentBean) pf.getBean(); - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - MPayment payment=null; - try - { - trx.start(); - payment= PaymentManager.createPayment(ctx,bean,trx.getTrxName()); - PaymentAllocationManager.allocatepaymentWithInvoices(ctx,bean.getInvoiceIds(),bean.getAllocateAmount(),payment.get_ID(),trx.getTrxName()); - trx.commit(); - } - catch(AllocatedAmtMoreThanOpenAmtException e1) - { - trx.rollback(); - postGlobalError("error.allocate.amt.exceeds",e1.getMessage(),request); - return mapping.getInputForward(); - } - catch(PayAmtNotEqualToAllocateAmtException e2) - { - trx.rollback(); - postGlobalError("error.allocate.amt.payamt.notequal",e2.getMessage(),request); - return mapping.getInputForward(); - } - catch(OperationException e) - { - trx.rollback(); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return new ActionForward("/ViewWebstorePaymentAction.do?action=viewOrder&documentId="+payment.get_ID()); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/PaymentTermAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/PaymentTermAction.java deleted file mode 100644 index aa75b82edc..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/PaymentTermAction.java +++ /dev/null @@ -1,237 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 31, 2006 - */ - - -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.PaymentTermBean; -import org.posterita.businesslogic.PaymentTermManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.CannotDeactivatePaymentTermException; -import org.posterita.exceptions.InvalidNetDaysException; -import org.posterita.exceptions.MandatoryNameException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.PaymentTermAlreadyExistsException; -import org.posterita.form.PaymentTermForm; -import org.posterita.form.PaymentTermForm2; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - - -public class PaymentTermAction extends BaseDispatchAction -{ - public static final String VIEW_ALL_PAYMENT_TERMS = "viewAllPaymentTerms"; - public ActionForward viewAllPaymentTerms(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - ArrayList paymentTermList = PaymentTermManager.getAllPaymentTerm(ctx,false); - request.setAttribute(Constants.ALL_PAYMENT_TERMS,paymentTermList); - return mapping.findForward(VIEW_ALL_PAYMENT_TERMS); - } - - public static final String CREATE_PAYMENT_TERM = "createPaymentTerm"; - public ActionForward createPaymentTerm(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df= (DefaultForm) form; - PaymentTermBean bean=(PaymentTermBean) df.getBean(); - Properties ctx=TmkJSPEnv.getCtx(request); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - PaymentTermManager.createEditPaymentTerm(ctx,bean,trx.getTrxName()); - trx.commit(); - } - catch(MandatoryNameException e) - { - trx.rollback(); - postGlobalError("error.name.mandatory",request); - return mapping.getInputForward(); - } - catch(InvalidNetDaysException e1) - { - trx.rollback(); - postGlobalError("error.net.days.cannot.be.negative",request); - return mapping.getInputForward(); - } - catch(PaymentTermAlreadyExistsException e2) - { - trx.rollback(); - postGlobalError("error.paymentTermName.duplicate",request); - return mapping.getInputForward(); - } - catch(CannotDeactivatePaymentTermException e3) - { - trx.rollback(); - postGlobalError("error.cannot.deactivate.paymentTermName",request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - ArrayList paymentTermList = PaymentTermManager.getAllPaymentTerm(ctx,false); - request.setAttribute(Constants.ALL_PAYMENT_TERMS,paymentTermList); - return mapping.findForward(CREATE_PAYMENT_TERM); - } - - public static final String DEACTIVATE_PAYMENT_TERM = "deActivatePaymentTerm"; - public ActionForward deActivatePaymentTerm(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - PaymentTermForm2 df= (PaymentTermForm2) form; - PaymentTermBean bean=(PaymentTermBean) df.getBean(); - Properties ctx=TmkJSPEnv.getCtx(request); - ArrayList paymentTermList = PaymentTermManager.getAllPaymentTerm(ctx,false); - request.setAttribute(Constants.ALL_PAYMENT_TERMS,paymentTermList); - try - { - PaymentTermManager.activatePaymentTerm(ctx,bean.getPaymentTermId(),false); - } - catch(CannotDeactivatePaymentTermException e3) - { - - postGlobalError("error.cannot.deactivate.paymentTermName",request); - return mapping.getInputForward(); - } - - - return mapping.findForward(DEACTIVATE_PAYMENT_TERM); - } - - - public static final String ACTIVATE_PAYMENT_TERM = "activatePaymentTerm"; - public ActionForward activatePaymentTerm(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - PaymentTermForm2 df= (PaymentTermForm2) form; - PaymentTermBean bean=(PaymentTermBean) df.getBean(); - Properties ctx=TmkJSPEnv.getCtx(request); - - PaymentTermManager.activatePaymentTerm(ctx,bean.getPaymentTermId(),true); - ArrayList paymentTermList = PaymentTermManager.getAllPaymentTerm(ctx,false); - request.setAttribute(Constants.ALL_PAYMENT_TERMS,paymentTermList); - return mapping.findForward(ACTIVATE_PAYMENT_TERM); - } - - public static final String INIT_EDIT_PAYMENT_TERM = "initEditPaymentTerm"; - public ActionForward initEditPaymentTerm(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - PaymentTermForm ptf = (PaymentTermForm) form; - int paymentTermId = new Integer (ptf.getPaymentTermId()).intValue(); - Properties ctx=TmkJSPEnv.getCtx(request); - PaymentTermBean bean= PaymentTermManager.getPaymentTerm(ctx,paymentTermId); - ptf.populate(bean); - request.setAttribute(Constants.EDIT_PAYMENT_TERM,bean); - return mapping.findForward(INIT_EDIT_PAYMENT_TERM); - } - - public static final String EDIT_PAYMENT_TERM = "editPaymentTerm"; - public ActionForward editPaymentTerm(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df= (DefaultForm) form; - PaymentTermBean bean=(PaymentTermBean) df.getBean(); - Properties ctx=TmkJSPEnv.getCtx(request); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - PaymentTermManager.createEditPaymentTerm(ctx,bean,trx.getTrxName()); - trx.commit(); - } - catch(MandatoryNameException e) - { - trx.rollback(); - postGlobalError("error.name.mandatory",request); - return mapping.getInputForward(); - } - catch(InvalidNetDaysException e1) - { - trx.rollback(); - postGlobalError("error.net.days.cannot.be.negative",request); - return mapping.getInputForward(); - } - - catch(PaymentTermAlreadyExistsException e) - { - trx.rollback(); - postGlobalError("error.paymentTermName.duplicate",request); - return mapping.getInputForward(); - } - catch(CannotDeactivatePaymentTermException e3) - { - trx.rollback(); - postGlobalError("error.cannot.deactivate.paymentTermName",request); - return mapping.getInputForward(); - } - catch(OperationException e) - { - trx.rollback(); - throw e; - } - finally - { - trx.close(); - } - ArrayList paymentTermList = PaymentTermManager.getAllPaymentTerm(ctx,false); - request.setAttribute(Constants.ALL_PAYMENT_TERMS,paymentTermList); - return mapping.findForward(EDIT_PAYMENT_TERM); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/PostingAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/PostingAction.java deleted file mode 100644 index 1148f59b3b..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/PostingAction.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * - * Copyright (c) 2007 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. TAMAK ICT SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * 21 Dec 2007 17:36:26 by shameem - * - */ - -package org.posterita.struts.pos; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.businesslogic.PostingManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.BaseDispatchAction; - -public class PostingAction extends BaseDispatchAction -{ - - public static final String RESUBMIT_POSTING="resubmitPosting"; - - public ActionForward resubmitPosting(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx =TmkJSPEnv.getCtx(request); - - PostingManager.resubmitPostingForInvoice(ctx); - - return mapping.findForward(RESUBMIT_POSTING); - - - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/PriceListAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/PriceListAction.java deleted file mode 100644 index 9755d38f25..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/PriceListAction.java +++ /dev/null @@ -1,216 +0,0 @@ -package org.posterita.struts.pos; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Properties; -import java.util.logging.Level; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MPriceList; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.PriceListBean; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.core.SessionStorage; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.form.PriceListForm; -import org.posterita.struts.core.BaseDispatchAction; - -public class PriceListAction extends BaseDispatchAction -{ - - private static CLogger logger = CLogger.getCLogger(PriceListAction.class); - - public static final String CREATE_OR_UPDATE_PRICE_LIST = "createOrUpdatePriceList"; - public ActionForward createOrUpdatePriceList(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, InstantiationException, IllegalAccessException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - PriceListForm priceListForm = (PriceListForm)form; - PriceListBean priceListBean = (PriceListBean)priceListForm.getBean(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - try - { - trx.start(); - PriceListManager.createOrUpdatePriceList(ctx, priceListBean, trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - logger.log(Level.SEVERE, e.getMessage()); - postGlobalError("error.process", e.getMessage(), request); - } - finally - { - trx.close(); - } - - request.getSession().setAttribute(Constants.PRICE_LIST, priceListBean); - SessionStorage.putPriceLists(ctx, request); - priceListForm.populate(priceListBean); - return mapping.findForward(CREATE_OR_UPDATE_PRICE_LIST); - } - - - public static final String LIST_PRICE_LISTS = "listPriceLists"; - public ActionForward listPriceLists(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - PriceListForm priceListForm = (PriceListForm)form; - PriceListBean priceListBean = (PriceListBean)priceListForm.getBean(); - - String name = priceListBean.getName(); - ArrayList list = PriceListManager.getPriceLists(ctx, 0, name, null, null, null, null, null); - - request.getSession().setAttribute(Constants.LIST_PRICE_LISTS, list); - - String fromDeletePriceOnPriceList = request.getParameter("isFromDeletePriceOnPriceList"); - - if(fromDeletePriceOnPriceList != null && fromDeletePriceOnPriceList.equals("true")) - { - request.setAttribute(Constants.IS_FROM_DELETE_PRODUCT_PRICE, "true"); - } - - return mapping.findForward(LIST_PRICE_LISTS); - - } - - public static final String VIEW_PRICE_LIST = "viewPriceList"; - public ActionForward viewPriceList(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - Integer priceListId = Integer.valueOf(request.getParameter("priceListId")); - String next =request.getParameter("isNext"); - Boolean isNext= null; - if ("true".equals(next)) - { - isNext = true; - } - else if ("false".equals(next)) - { - isNext = false; - } - - PriceListForm priceListform = (PriceListForm)form; - - ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.LIST_PRICE_LISTS); - PriceListBean priceListBean = null; - - priceListBean = PriceListManager.getPriceListBean(ctx, list, priceListId, isNext); - priceListform.populate(priceListBean); - - request.getSession().setAttribute(Constants.PRICE_LIST, priceListBean); - - return mapping.findForward(VIEW_PRICE_LIST); - } - - - public static final String SET_DEFAULT_PRICE_LIST = "setDefaultPriceList"; - public ActionForward setDefaultPriceList(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - int priceListId = 0; - try - { - priceListId = Integer.parseInt(String.valueOf(request.getParameter("priceListId"))); - MPriceList priceList = MPriceList.get(ctx, priceListId, null); - PriceListManager.setDefaultPriceList(ctx, priceList, true, null); - } - catch (NumberFormatException e) - { - return mapping.getInputForward(); - } - ArrayList list = (ArrayList)request.getSession().getAttribute(Constants.LIST_PRICE_LISTS); - ArrayList n_list = new ArrayList(); - for (PriceListBean pBean : list) - { - pBean = PriceListManager.getPriceList(ctx, pBean.getPriceListId(), null); - n_list.add(pBean); - } - request.getSession().setAttribute(Constants.LIST_PRICE_LISTS, n_list); - return mapping.findForward(LIST_PRICE_LISTS); - - } - - public static final String LOAD_PRICE_LISTS = "loadPriceLists"; - - public ActionForward loadPriceLists(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - PriceListForm priceListForm = (PriceListForm)form; - PriceListBean priceListBean = (PriceListBean)priceListForm.getBean(); - - int ad_org_id = Env.getAD_Org_ID(ctx); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - String name = priceListBean.getName(); - ArrayList list = PriceListManager.getPriceLists(ctx, ad_org_id , name, true, null, true, true, trx.getTrxName()); - String priceListHTML = PriceListManager.loadPriceListAsHTMLSelect(ctx, list); - - PrintWriter writer = response.getWriter(); - writer.print(priceListHTML); - writer.flush(); - writer.close(); - - return null; - - } - - public ActionForward fromDeletePriceOnPriceList(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - request.setAttribute(Constants.IS_FROM_DELETE_PRODUCT_PRICE, "true"); - return mapping.findForward(LIST_PRICE_LISTS); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SalesAnalysisReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SalesAnalysisReportAction.java deleted file mode 100644 index 6c36d000ab..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/SalesAnalysisReportAction.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - - -package org.posterita.struts.pos; - - -public class SalesAnalysisReportAction extends POSDispatchAction -{ - /*public static final String GET_CURRENT_DAY_REPORT = "getCurrentDayReport"; - public ActionForward getCurrentDayReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - Calendar cal = Calendar.getInstance(); - - Timestamp toDate = new Timestamp(cal.getTimeInMillis()); - - cal.set(Calendar.HOUR_OF_DAY,0); - cal.set(Calendar.MINUTE,0); - cal.set(Calendar.SECOND,0); - cal.set(Calendar.MILLISECOND,0); - - Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); - - ArrayList list=POSReportManager.getSalesAnalysisReport(ctx,fromDate,toDate); - request.getSession().setAttribute(org.posterita.Constants.SALES_ANALYSIS,list); - - return mapping.findForward(GET_CURRENT_DAY_REPORT); - }*/ - - /*public static final String GET_CURRENT_MONTH_REPORT = "getCurrentMonthReport"; - public ActionForward getCurrentMonthReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - Calendar cal = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat(TimestampConvertor.DEFAULT_DATE_PATTERN1); - - String toDate = sdf.format(new Date(cal.getTimeInMillis())); - - cal.set(Calendar.DATE,1); - cal.set(Calendar.HOUR_OF_DAY,0); - cal.set(Calendar.MINUTE,0); - cal.set(Calendar.SECOND,0); - cal.set(Calendar.MILLISECOND,0); - - String fromDate = sdf.format(new Date(cal.getTimeInMillis())); - - //String report = SalesAnalysisReportManager.getPDFReport(ctx,fromDate,toDate); - - ArrayList list=POSReportManager.getSalesAnalysisReport(ctx,fromDate,toDate); - request.getSession().setAttribute(org.posterita.Constants.SALES_ANALYSIS,list); - - return mapping.findForward(GET_CURRENT_MONTH_REPORT); - } - */ - /*public static final String GET_CUSTOM_REPORT = "getCustomReport"; - public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - ReportBean bean = (ReportBean) df.getBean(); - Timestamp fromDate = ReportDateManager.getFromDate(bean); - Timestamp toDate = ReportDateManager.getToDate(bean); - - ArrayList list=POSReportManager.getSalesAnalysisReport(ctx,fromDate,toDate); - request.getSession().setAttribute(org.posterita.Constants.SALES_ANALYSIS,list); - - return mapping.findForward(GET_CUSTOM_REPORT); - }*/ - - /*public static final String GET_JPEG_REPORT = "getJpegReport"; - public ActionForward getJpegReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException - { - try - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - - String reportDir = ReportManager.getReportDirectoryFromServletContext(this.servlet); - - String filename = RandomStringGenerator.randomstring(); - - PieChart pieChart = new PieChart(); - pieChart.getDataSetFromSQL("" + - " select t.ATTR_MODEL \"Model\"," + - " sum(AMTACCTCR) \"Sum\"" + - " from FACT_ACCT f,M_PRODUCT p,U_TSHIRT_V t" + - " where f.AD_CLIENT_ID = 1016840" + - " and f.M_PRODUCT_ID = p.M_PRODUCT_ID" + - " and f.AMTACCTCR > 0" + - " and t.M_PRODUCT_ID = p.M_PRODUCT_ID" + - " having sum(AMTACCTCR) < 1000" + - " group by t.ATTR_MODEL"); - - pieChart.saveChartAsJPEG(reportDir+filename+".jpg",700,600); - - String imgSrc = request.getContextPath() + "/config/reports/"+filename+".jpg"; - String imagemaptag = pieChart.getImageMap(filename); - String imagetag = ""; - - request.getSession().setAttribute("CHART",imagemaptag+imagetag); - - } - catch (Exception e) - { - e.printStackTrace(); - } - - return mapping.findForward(GET_JPEG_REPORT); - }*/ - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SearchCustomerAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SearchCustomerAction.java deleted file mode 100644 index 7c6c14eaa4..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/SearchCustomerAction.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 12-Dec-2006 10:00:02 by praveen - * - */ - -package org.posterita.struts.pos; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.Action; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MPriceList; -import org.posterita.beans.CustomerBean; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.administration.CustomerManager; -import org.posterita.businesslogic.administration.VendorManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.bean.ElementBean; -import org.posterita.core.businesslogic.ElementManager; -import org.posterita.order.UDIOrderTypes; - -/** - * This action is called using AJAX form the vendor panel - */ -public class SearchCustomerAction extends Action -{ - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx = TmkJSPEnv.getCtx(request); - String customerName = request.getParameter("customerQuery"); - String orderType = request.getParameter("orderType"); - int priceListId = -1; - - ArrayList customerList = null; - - if(UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equals(orderType) || - UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(orderType)) - { - customerList = VendorManager.searchVendors(ctx,customerName,true); - priceListId = POSTerminalManager.getPOPriceListId(ctx); - } - else - { - customerList = CustomerManager.searchCustomers(ctx,customerName,false); - priceListId = POSTerminalManager.getSOPriceListId(ctx); - } - - CustomerBean bean = null; - - ElementBean elementBean = null; - elementBean = ElementManager.getMsg(ctx, "not.found"); - - StringWriter sw = new StringWriter(); - PrintWriter out = new PrintWriter(sw); - - if (customerList == null || customerList.size() == 0) - { - out.print("
      "); - out.print("
    • "); - out.print("
    "); - out.print("
    "); - } - else - { - String priceListName = MPriceList.get(ctx, priceListId, null).getName(); - - - int size = customerList.size(); - size = (size > customerList.size())? customerList.size() : size; - - out.print("
      "); - - for(int i=0;i"); - out.print(vendorName); - out.print(""); - } - - out.print("
    "); - - elementBean = ElementManager.getMsg(ctx, "search.result.displaying"); - String msg = elementBean.getName(); - - out.print("
    "); - } - - response.getOutputStream().print(sw.toString()); - response.getOutputStream().flush(); - response.getOutputStream().close(); - - return null; - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SearchPOSProductAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SearchPOSProductAction.java deleted file mode 100644 index 6efae86cba..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/SearchPOSProductAction.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.Constants; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.core.TmkJSPEnv; - -public class SearchPOSProductAction extends POSDispatchAction -{ - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - String productName = request.getParameter("productName"); - - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList productList = ProductManager.getProductList(ctx,productName,true,true); - - request.getSession().setAttribute(Constants.PRODUCT_LIST,productList); - - return mapping.findForward("displayProducts"); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductAction.java deleted file mode 100644 index 54a37a6e72..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductAction.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 12-Dec-2006 10:00:02 by praveen - * - */ - -package org.posterita.struts.pos; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Properties; -import java.util.logging.Level; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.Action; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.util.CLogger; -import org.posterita.beans.ProductStatusBean; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.core.TmkJSPEnv; - -/** - * This action is called using AJAX form the product panel - */ -public class SearchProductAction extends Action -{ - private static final CLogger logger = CLogger.getCLogger(SearchProductAction.class); - - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx = TmkJSPEnv.getCtx(request); - String description = request.getParameter("description"); - String productName = request.getParameter("productName"); - String strPriceListId = request.getParameter("priceListId"); - - int priceListId = 0; - if (strPriceListId != null && strPriceListId.trim().length() != 0) - { - try - { - priceListId = Integer.parseInt(strPriceListId); - } - catch (Exception ex) - { - logger.log(Level.SEVERE, "Could not parse Price List Id, priceListId: " + strPriceListId, ex); - } - } - else - { - priceListId = POSTerminalManager.getSOPriceListId(ctx); - } - - int adOrgId = POSTerminalManager.getOrgId(ctx); - int warehouseId = POSTerminalManager.getWarehouseId(ctx); - ArrayList productList = null; - - if(productName != null) - { - productName = productName.replaceAll("#", "&#"); - productList = ProductManager.searchProducts(ctx, adOrgId, productName, "", priceListId, warehouseId, null); - } - else if(description != null) - { - description = description.replaceAll("#", "&#"); - productList = ProductManager.searchProducts(ctx, adOrgId, "", description, priceListId, warehouseId, null); - } - else - { - productList = ProductManager.searchProducts(ctx, adOrgId, "", "", priceListId, warehouseId, null); - } - - ProductStatusBean bean = null; - StringWriter sw = new StringWriter(); - PrintWriter out = new PrintWriter(sw); - - if(productList == null || productList.size() == 0) - { - out.print("
    "); - } - else - { - int size = productList.size(); - - size = (size > productList.size())? productList.size() : size; - - int i = 0; - - if(size > 0) - { - out.print("
      "); - - for(i=0;i< size;i++) - { - bean = (ProductStatusBean)productList.get(i); - - if(i % 2 == 0) - { - out.print("
    • "); - - out.print(bean.getProductName() + "-" + bean.getDescription()+">qty:"+bean.getQtyOnHand()+ ">price:"+bean.getPriceStandard()); - - out.print("
    • "); - } - else - { - out.print("
    • "); - - out.print(bean.getProductName() + "-" + bean.getDescription()+">qty:"+bean.getQtyOnHand()+ ">price:"+bean.getPriceStandard()); - - out.print("
    • "); - - } - - - } - - out.print("
    "); - } - - out.print("
    "); - } - - response.getOutputStream().print(sw.toString()); - response.getOutputStream().flush(); - response.getOutputStream().close(); - - return null; - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductsInStockAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductsInStockAction.java deleted file mode 100644 index 662e341587..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/SearchProductsInStockAction.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.posterita.struts.pos; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.Action; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.ProductStatusBean; -import org.posterita.businesslogic.administration.ProductManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.lib.UdiConstants; - -public class SearchProductsInStockAction extends Action -{ - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - String productName = request.getParameter("productName"); - Integer orgId = (Integer)request.getSession().getAttribute(Constants.ORG_FROM_ID); - Properties ctx = TmkJSPEnv.getCtx(request); - - if (orgId == null) - { - orgId = Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM); - } - - productName = productName.replaceAll("#", "&#"); - - ArrayList productList =ProductManager.searchProductsFromStock(ctx, orgId, productName, null); - - ProductStatusBean bean = null; - StringWriter sw = new StringWriter(); - PrintWriter out = new PrintWriter(sw); - - if(productList == null || productList.size() == 0) - { - out.print("
    "); - } - else - { - int size = productList.size(); - - size = (size > productList.size())? productList.size() : size; - - if(size > 0) - { - out.print("
      "); - - for(int i=0;i< size;i++) - { - bean = (ProductStatusBean)productList.get(i); - - out.print("
    • "); - out.print(bean.getProductName()); - out.print("
    • "); - } - - out.print("
    "); - } - - out.print("
    "); - - } - response.getOutputStream().print(sw.toString()); - response.getOutputStream().flush(); - response.getOutputStream().close(); - - return null; - - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SearchVendorAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SearchVendorAction.java deleted file mode 100644 index 036b17c1c5..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/SearchVendorAction.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 12-Dec-2006 10:00:02 by praveen - * - */ - -package org.posterita.struts.pos; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.Action; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; - -import org.posterita.beans.CustomerBean; -import org.posterita.businesslogic.administration.VendorManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.bean.ElementBean; -import org.posterita.core.businesslogic.ElementManager; - -/** - * This action is called using AJAX form the vendor panel - */ -public class SearchVendorAction extends Action -{ - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx = TmkJSPEnv.getCtx(request); - String customerName = request.getParameter("customerQuery"); - - ArrayList customerList = VendorManager.searchVendors(TmkJSPEnv.getCtx(request),customerName,true); - CustomerBean bean = null; - - ElementBean elementBean = null; - elementBean = ElementManager.getMsg(ctx, "not.found"); - - StringWriter sw = new StringWriter(); - PrintWriter out = new PrintWriter(sw); - - if (customerList == null || customerList.size() == 0) - { - out.print("
      "); - out.print("
    • "); - out.print("
    "); - out.print("
    "); - } - else - { - int size = 15; - size = (size > customerList.size())? customerList.size() : size; - - out.print("
      "); - - for(int i=0;i"); - out.print(vendorName); - out.print(""); - } - - out.print("
    "); - - elementBean = ElementManager.getMsg(ctx, "search.result.displaying"); - String msg = elementBean.getName(); - - out.print("
    "); - } - - response.getOutputStream().print(sw.toString()); - response.getOutputStream().flush(); - response.getOutputStream().close(); - - return null; - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/SlowMovingItemReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/SlowMovingItemReportAction.java deleted file mode 100644 index 2f0d52bba0..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/SlowMovingItemReportAction.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - -package org.posterita.struts.pos; - -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.Constants; -import org.posterita.beans.ReportBean; -import org.posterita.businesslogic.performanceanalysis.POSReportManager; -import org.posterita.businesslogic.performanceanalysis.ReportDateManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.DefaultForm; - -public class SlowMovingItemReportAction extends POSDispatchAction -{ - public static final String GET_CURRENT_DAY_REPORT = "getCurrentDayReport"; - public ActionForward getCurrentDayReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - Calendar cal = Calendar.getInstance(); - - Timestamp toDate = new Timestamp(cal.getTimeInMillis()); - - cal.set(Calendar.HOUR_OF_DAY,0); - cal.set(Calendar.MINUTE,0); - cal.set(Calendar.SECOND,0); - cal.set(Calendar.MILLISECOND,0); - - Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); - - ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"asc",fromDate,toDate); - request.getSession().setAttribute(Constants.MIN_SOLD_ITEMS,list); - - return mapping.findForward(GET_CURRENT_DAY_REPORT); - } - - public static final String GET_CURRENT_MONTH_REPORT = "getCurrentMonthReport"; - public ActionForward getCurrentMonthReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - Calendar cal = Calendar.getInstance(); - Timestamp toDate = new Timestamp(cal.getTimeInMillis()); - - cal.set(Calendar.DATE,1); - cal.set(Calendar.HOUR_OF_DAY,0); - cal.set(Calendar.MINUTE,0); - cal.set(Calendar.SECOND,0); - cal.set(Calendar.MILLISECOND,0); - - Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); - - ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"asc",fromDate,toDate); - request.getSession().setAttribute(Constants.MIN_SOLD_ITEMS,list); - - return mapping.findForward(GET_CURRENT_MONTH_REPORT); - } - - public static final String GET_CUSTOM_REPORT = "getCustomReport"; - public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - - ReportBean bean = (ReportBean) df.getBean(); - Timestamp fromDate = ReportDateManager.getFromDate(bean); - Timestamp toDate = ReportDateManager.getToDate(bean); - - ArrayList list=POSReportManager.getMaxMinSoldProducts(ctx,"asc",fromDate,toDate); - request.getSession().setAttribute(Constants.MIN_SOLD_ITEMS,list); - - return mapping.findForward(GET_CUSTOM_REPORT); - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/StockMovementReportAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/StockMovementReportAction.java deleted file mode 100644 index 99c5c85b90..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/StockMovementReportAction.java +++ /dev/null @@ -1,197 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - -package org.posterita.struts.pos; - -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; - -import org.posterita.Constants; -import org.posterita.beans.ReportBean; -import org.posterita.businesslogic.performanceanalysis.CSVReportManager; -import org.posterita.businesslogic.performanceanalysis.POSReportManager; -import org.posterita.businesslogic.performanceanalysis.ReportDateManager; -import org.posterita.businesslogic.performanceanalysis.ReportManager; -import org.posterita.core.TabularReport; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.DefaultForm; - -public class StockMovementReportAction extends POSDispatchAction -{ - public static final String GET_CURRENT_DAY_REPORT = "getCurrentDayReport"; - public ActionForward getCurrentDayReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - Calendar cal = Calendar.getInstance(); - - Timestamp toDate = new Timestamp(cal.getTimeInMillis()); - - cal.set(Calendar.HOUR_OF_DAY,0); - cal.set(Calendar.MINUTE,0); - cal.set(Calendar.SECOND,0); - cal.set(Calendar.MILLISECOND,0); - - Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); - - ArrayList list=POSReportManager.getStockMovementReport(ctx,fromDate,toDate); - request.getSession().setAttribute(Constants.STOCK_MOVEMENT,list); - - return mapping.findForward(GET_CURRENT_DAY_REPORT); - } - - public static final String GET_CURRENT_MONTH_REPORT = "getCurrentMonthReport"; - public ActionForward getCurrentMonthReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - Calendar cal = Calendar.getInstance(); - Timestamp toDate = new Timestamp(cal.getTimeInMillis()); - - cal.set(Calendar.DATE,1); - cal.set(Calendar.HOUR_OF_DAY,0); - cal.set(Calendar.MINUTE,0); - cal.set(Calendar.SECOND,0); - cal.set(Calendar.MILLISECOND,0); - - Timestamp fromDate = new Timestamp(cal.getTimeInMillis()); - - ArrayList list=POSReportManager.getStockMovementReport(ctx,fromDate,toDate); - request.getSession().setAttribute(Constants.STOCK_MOVEMENT,list); - - return mapping.findForward(GET_CURRENT_MONTH_REPORT); - } - - public static final String GET_CUSTOM_REPORT = "getCustomReport"; - public ActionForward getCustomReport(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df= (DefaultForm) form; - ReportBean bean = (ReportBean) df.getBean(); - - String title = "Stock Movement Report"; - String subtitle = ""; - - String dateRange = bean.getDateRange(); - String timePeriod = bean.getTimePeriod(); - - Timestamp fromDate = null; - Timestamp toDate = null; - - //setting from and to dates - if(dateRange.endsWith(Constants.FIXED_DATE_RANGE)) - { - if(timePeriod==null) - { - throw new OperationException("Invalid Parameter for timePeriod : Time period is null "); - } - - fromDate = ReportDateManager.getStartDateForPeriod(timePeriod); - toDate = ReportDateManager.getEndDateForPeriod(timePeriod); - - subtitle = "For " + timePeriod; - } - else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) - { - boolean error = false; - ActionMessages messages = new ActionMessages(); - ActionMessage message = null; - - if((bean.getFromDate()==null)||(bean.getFromDate()=="")) - { - message = new ActionMessage("error.required.fromDate"); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - error = true; - } - - if((bean.getToDate()==null)||(bean.getToDate()=="")) - { - message = new ActionMessage("error.required.toDate"); - messages.add(ActionMessages.GLOBAL_MESSAGE, message); - error = true; - } - - if(error) - { - saveErrors(request, messages); - return mapping.getInputForward(); - } - else - { - fromDate = ReportDateManager.getFromDate(bean); - toDate = ReportDateManager.getToDate(bean); - - } - - - subtitle = "For period:"+fromDate+" to "+toDate; - } - else - { - throw new OperationException("Invalid Parameter for dateRange :" + dateRange); - } - - ArrayList reportData = POSReportManager.getStockMovementReportData(ctx,fromDate,toDate); - - //constructing the table - TabularReport tReport = new TabularReport(reportData); - tReport.setSortable(false); - tReport.setStyle("display"); - tReport.setTitle(title); - tReport.setSubtitle(subtitle); - tReport.createReport(); - - String csvReport = CSVReportManager.generateCSVReport(ctx,reportData); - String csvURI = ReportManager.getReportURI(csvReport,request); - - request.getSession().setAttribute(Constants.TABULAR_REPORT_DATA,tReport.toString()); - request.getSession().setAttribute(Constants.CSV_FILE,csvURI); - - return mapping.findForward(GET_CUSTOM_REPORT); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/TaxAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/TaxAction.java deleted file mode 100644 index 5e4a7ca925..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/TaxAction.java +++ /dev/null @@ -1,287 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Nov 28, 2006 - */ - - -package org.posterita.struts.pos; - -import java.io.IOException; -import java.io.PrintWriter; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MTax; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.TaxBean; -import org.posterita.businesslogic.administration.TaxManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.CannotInactivateTaxException; -import org.posterita.exceptions.InvalidNetDaysException; -import org.posterita.exceptions.MandatoryException; -import org.posterita.exceptions.MandatoryNameException; -import org.posterita.exceptions.NoAccessToEditObjectException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.TaxNameAlreadyExistsException; -import org.posterita.exceptions.TaxRateAlreadyExistsException; -import org.posterita.form.TaxForm; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - - -public class TaxAction extends BaseDispatchAction -{ - public static final String VIEW_ALL_TAX = "viewAllTax"; - - public ActionForward viewAllTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - - ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); - request.setAttribute(Constants.ALL_TAX_RATE,taxList); - return mapping.findForward(VIEW_ALL_TAX); - } - - public static final String CREATE_TAX = "createTax"; - public ActionForward createTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df= (DefaultForm) form; - TaxBean bean=(TaxBean) df.getBean(); - Properties ctx=TmkJSPEnv.getCtx(request); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - TaxManager.createEditTaxCategoryAndTax(ctx,bean,trx.getTrxName()); - trx.commit(); - } - catch(MandatoryNameException e) - { - trx.rollback(); - postGlobalError("error.name.mandatory",request); - return mapping.getInputForward(); - } - catch(MandatoryException e1) - { - trx.rollback(); - postGlobalError("error.required.field",e1.getMessage(),request); - return mapping.getInputForward(); - } - catch(TaxNameAlreadyExistsException e3) - { - trx.rollback(); - postGlobalError("error.taxname.duplicate",request); - return mapping.getInputForward(); - } - catch(TaxRateAlreadyExistsException e4) - { - trx.rollback(); - postGlobalError("error.taxrate.duplicate",request); - return mapping.getInputForward(); - } - catch(InvalidNetDaysException e5) - { - trx.rollback(); - postGlobalError("error.tax.rate.nagative",request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); - request.setAttribute(Constants.ALL_TAX_RATE,taxList); - return mapping.findForward(CREATE_TAX); - } - - public static final String DEACTIVATE_TAX = "deActivateTax"; - public ActionForward deActivateTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df= (DefaultForm) form; - TaxBean bean=(TaxBean) df.getBean(); - Properties ctx=TmkJSPEnv.getCtx(request); - - try - { - TaxManager.activateTax(ctx,bean.getTaxId(),false); - } - - catch(CannotInactivateTaxException e) - { - ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); - request.setAttribute(Constants.ALL_TAX_RATE,taxList); - postGlobalError("cannot.inactivate.tax",request); - return mapping.getInputForward(); - } - ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); - request.setAttribute(Constants.ALL_TAX_RATE,taxList); - - return mapping.findForward(DEACTIVATE_TAX); - } - - - public static final String ACTIVATE_TAX = "activateTax"; - public ActionForward activateTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df= (DefaultForm) form; - TaxBean bean=(TaxBean) df.getBean(); - Properties ctx=TmkJSPEnv.getCtx(request); - - TaxManager.activateTax(ctx,bean.getTaxId(),true); - ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); - request.setAttribute(Constants.ALL_TAX_RATE,taxList); - return mapping.findForward(ACTIVATE_TAX); - } - - public static final String INIT_EDIT_TAX = "initEditTax"; - public ActionForward initEditTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - TaxForm tf = (TaxForm) form; - int taxId = new Integer (tf.getTaxId()).intValue(); - Properties ctx=TmkJSPEnv.getCtx(request); - TaxBean bean= TaxManager.getTaxRate(ctx,taxId); - tf.populate(bean); - request.setAttribute(Constants.EDIT_TAX,bean); - return mapping.findForward(INIT_EDIT_TAX); - } - - public static final String EDIT_TAX = "editTax"; - public ActionForward editTax(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df= (DefaultForm) form; - TaxBean bean=(TaxBean) df.getBean(); - Properties ctx=TmkJSPEnv.getCtx(request); - - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - try - { - trx.start(); - TaxManager.createEditTaxCategoryAndTax(ctx,bean,trx.getTrxName()); - trx.commit(); - } - catch(MandatoryException e1) - { - trx.rollback(); - postGlobalError("error.required.field",e1.getMessage(),request); - return mapping.getInputForward(); - } - catch (NoAccessToEditObjectException e) - { - trx.rollback(); - postGlobalError("error.no.edit.access", request); - return mapping.getInputForward(); - } - catch(MandatoryNameException e2) - { - trx.rollback(); - postGlobalError("error.name.required",request); - return mapping.getInputForward(); - } - catch(InvalidNetDaysException e3) - { - trx.rollback(); - postGlobalError("error.tax.rate.nagative",request); - return mapping.getInputForward(); - } - catch(TaxNameAlreadyExistsException e) - { - trx.rollback(); - postGlobalError("error.taxname.duplicate",request); - return mapping.getInputForward(); - } - catch(TaxRateAlreadyExistsException e) - { - trx.rollback(); - postGlobalError("error.taxrate.duplicate",request); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - ArrayList taxList = TaxManager.getAllTaxRates(ctx,false); - request.setAttribute(Constants.ALL_TAX_RATE,taxList); - return mapping.findForward(EDIT_TAX); - } - - public static final String GET_TAX_RATE = "getTaxRate"; - public ActionForward getTaxRate(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - Properties ctx=TmkJSPEnv.getCtx(request); - Object taxCatId = request.getParameter("taxCategoryId"); - Integer taxCategoryId = 0; - BigDecimal taxRate = Env.ZERO; - if (taxCatId != null) - { - taxCategoryId = Integer.parseInt(taxCatId.toString()); - - MTax tax = TaxManager.getTaxFromCategory(ctx, taxCategoryId, null); - - taxRate = tax.getRate(); - } - - String res = taxRate.toString(); - PrintWriter writer = response.getWriter(); - writer.print(res); - writer.flush(); - writer.close(); - - return null; - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/TerminalAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/TerminalAction.java deleted file mode 100644 index ddff7df5f4..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/TerminalAction.java +++ /dev/null @@ -1,477 +0,0 @@ -/****************************************************************************** - * Product: Posterita Web-Based POS and Adempiere Plugin * - * Copyright (C) 2008 Posterita Ltd * - * This file is part of POSterita * - * * - * POSterita is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - *****************************************************************************/ -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MPOSTerminal; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.BankAccountBean; -import org.posterita.beans.CashBookBean; -import org.posterita.beans.PriceListBean; -import org.posterita.beans.TerminalBean; -import org.posterita.beans.UDIBean; -import org.posterita.beans.WarehouseBean; -import org.posterita.businesslogic.BankManager; -import org.posterita.businesslogic.CashManager; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.administration.WarehouseManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.InvalidTerminalCashBookException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.TerminalInactivateException; -import org.posterita.form.TerminalForm; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - -/** - * @author Ashley G Ramdass - * Apr 14, 2008 - */ -public class TerminalAction extends BaseDispatchAction -{ - private void populateData(HttpServletRequest request, TerminalBean terminalBean, int adOrgId, String trxName) - throws OperationException - { - Properties ctx = TmkJSPEnv.getCtx(request); - - ArrayList accessibleOrgs = OrganisationManager.getUserOrgPairs(ctx, false); - request.getSession().setAttribute(Constants.ACCESSIBLE_ORGS, accessibleOrgs); - - ArrayList purchasePriceLists = PriceListManager.getPriceLists(ctx, 0, false, trxName); - request.getSession().setAttribute(Constants.PURCHASE_PRICELISTS, purchasePriceLists); - - ArrayList salesPriceLists = PriceListManager.getPriceLists(ctx, 0, true, trxName); - request.getSession().setAttribute(Constants.SALES_PRICELISTS, salesPriceLists); - - ArrayList warehouseList = WarehouseManager.getAllWarehouses(ctx, adOrgId); - request.getSession().setAttribute(Constants.WAREHOUSES, warehouseList); - - ArrayList cashBookList = CashManager.getCashBooksForTerminal(ctx, adOrgId, terminalBean.getTerminalId(), trxName); - request.getSession().setAttribute(Constants.CASH_BOOK, cashBookList); - - ArrayList accessibleCashBookList = CashManager.getCashBooks(ctx, trxName); - request.getSession().setAttribute(Constants.ACCESSIBLE_CASHBOOKS, accessibleCashBookList); - - ArrayList bankAccountList = BankManager.getBankAccounts(ctx, adOrgId, trxName); - request.getSession().setAttribute(Constants.BANK_ACCOUNTS, bankAccountList); - - ArrayList accessibleBankAccountList = BankManager.getBankAccounts(ctx, trxName); - request.getSession().setAttribute(Constants.ACCESSIBLE_BANKACCOUNTS, accessibleBankAccountList); - } - - public static final String INIT_SEARCH_TERMINAL = "initSearchTerminal"; - public ActionForward initSearchTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - request.getSession().setAttribute(Constants.TERMINALS, null); - - return mapping.findForward(INIT_SEARCH_TERMINAL); - } - - public static final String SEARCH_TERMINAL = "searchTerminal"; - public ActionForward searchTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx=TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - UDIBean bean = (UDIBean)df.getBean(); - - String searchText = bean.getSearchText(); - - ArrayList terminalList = POSTerminalManager.getTerminals(ctx, searchText, null); - - request.setAttribute(Constants.TERMINALS, terminalList); - - return mapping.findForward(SEARCH_TERMINAL); - } - - public static final String INIT_CREATE_TERMINAL = "initCreateTerminal"; - public ActionForward initCreateTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm)form; - TerminalBean terminalBean = new TerminalBean(); - terminalBean.setIsActive(true); - - int orgId = Env.getAD_Org_ID(ctx); - - populateData(request, terminalBean, orgId, null); - int warehouseId = WarehouseManager.getOrganisationWarehouse(ctx, orgId, null); - terminalBean.setOrgId(orgId); - terminalBean.setWarehouseId(warehouseId); - df.populate(terminalBean); - df.setAction(CREATE_TERMINAL); - df.setReadOnly(false); - - return mapping.findForward(INIT_CREATE_TERMINAL); - } - - - public static final String CREATE_TERMINAL = "createTerminal"; - public ActionForward createTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - TerminalForm terminalForm = (TerminalForm)form; - TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); - - Trx trx = Trx.get(Trx.createTrxName(), true); - trx.start(); - - try - { - MPOSTerminal terminal = POSTerminalManager.createUpdatePOSTerminal(ctx, terminalBean, trx.getTrxName()); - terminalBean.setTerminalId(terminal.get_ID()); - trx.commit(); - } - catch (InvalidTerminalCashBookException invalidTerminalCashBookException) - { - postGlobalError("error.terminal.cashbook", request); - return mapping.getInputForward(); - } - catch (TerminalInactivateException terminalInactivateException) - { - postGlobalError("error.deactivate.terminal", request); - return mapping.getInputForward(); - } - catch (Exception ex) - { - postGlobalError("error.operation", request); - return mapping.getInputForward(); - } - finally - { - trx.rollback(); - trx.close(); - } - - terminalForm.populate(terminalBean); - viewTerminal(mapping, form, request, response); - - return mapping.findForward(CREATE_TERMINAL); - } - - public static final String EDIT_TERMINAL = "editTerminal"; - public ActionForward editTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - TerminalForm terminalForm = (TerminalForm)form; - TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); - - terminalBean = POSTerminalManager.getTerminalBean(ctx, terminalBean.getTerminalId(), null); - populateData(request, terminalBean, terminalBean.getOrgId(), null); - terminalForm.populate(terminalBean); - terminalForm.setAction(SAVE_TERMINAL); - terminalForm.setReadOnly(false); - return mapping.findForward(EDIT_TERMINAL); - } - - public static final String SAVE_TERMINAL = "saveTerminal"; - public ActionForward saveTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - return createTerminal(mapping, form, request, response); - } - - public static final String VIEW_TERMINAL = "viewTerminal"; - public ActionForward viewTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - TerminalForm terminalForm = (TerminalForm)form; - TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); - - terminalBean = POSTerminalManager.getTerminalBean(ctx, terminalBean.getTerminalId(), null); - - populateData(request, terminalBean, terminalBean.getOrgId(), null); - - terminalForm.populate(terminalBean); - terminalForm.setAction(VIEW_TERMINAL); - terminalForm.setReadOnly(true); - - return mapping.findForward(VIEW_TERMINAL); - } - - public static final String COPY_TERMINAL = "copyTerminal"; - public ActionForward copyTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - TerminalForm terminalForm = (TerminalForm)form; - TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); - - terminalBean = POSTerminalManager.getTerminalBean(ctx, terminalBean.getTerminalId(), null); - terminalBean.setTerminalId(0); - - populateData(request, terminalBean, Env.getAD_Org_ID(ctx), null); - - terminalForm.populate(terminalBean); - terminalForm.setAction(SAVE_TERMINAL); - terminalForm.setReadOnly(false); - - return mapping.findForward(COPY_TERMINAL); - } - - public static final String DEACTIVATE_TERMINAL = "deactivateTerminal"; - public ActionForward deactivateTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - TerminalForm terminalForm = (TerminalForm)form; - TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); - - Trx trx = Trx.get(Trx.createTrxName(), true); - trx.start(); - - try - { - terminalBean = POSTerminalManager.updateTerminalStatus(ctx, terminalBean.getTerminalId(), false, trx.getTrxName()); - trx.commit(); - } - catch (TerminalInactivateException terminalInactivateException) - { - postGlobalError("error.deactivate.terminal", request); - } - catch (Exception ex) - { - postGlobalError("error.operation", request); - } - finally - { - trx.rollback(); - trx.close(); - } - - searchTerminal(mapping, form, request, response); - - return mapping.findForward(SEARCH_TERMINAL); - } - - public static final String ACTIVATE_TERMINAL = "activateTerminal"; - public ActionForward activateTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - TerminalForm terminalForm = (TerminalForm)form; - TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); - - Trx trx = Trx.get(Trx.createTrxName(), true); - trx.start(); - - try - { - terminalBean = POSTerminalManager.updateTerminalStatus(ctx, terminalBean.getTerminalId(), true, trx.getTrxName()); - trx.commit(); - } - catch (InvalidTerminalCashBookException invalidTerminalCashBookException) - { - postGlobalError("error.terminal.cashbook", request); - } - catch (Exception ex) - { - postGlobalError("error.operation", request); - } - finally - { - trx.rollback(); - trx.close(); - } - - searchTerminal(mapping, form, request, response); - - return mapping.findForward(SEARCH_TERMINAL); - } - - public static final String RESET_CURRENT_TERMINAL = "resetCurrentTerminal"; - public ActionForward resetCurrentTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - POSTerminalManager.resetTerminalInCookie(response); - searchTerminal(mapping, form, request, response); - postGlobalMessage("current.terminal.reset", request); - return mapping.findForward(SEARCH_TERMINAL); - } - - public static final String UPDATE_CURRENT_TERMINAL = "updateCurrentTerminal"; - public ActionForward updateCurrentTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - TerminalForm terminalForm = (TerminalForm)form; - TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); - - POSTerminalManager.setTerminalInCookie(response, terminalBean.getTerminalId()); - - searchTerminal(mapping, form, request, response); - postGlobalMessage("current.terminal.updated", request); - return mapping.findForward(SEARCH_TERMINAL); - } - - public static final String CHANGE_ORGANISATION = "changeOrganisation"; - public ActionForward changeOrganisation(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - TerminalForm terminalForm = (TerminalForm)form; - TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); - - terminalBean.setBpartnerId(0); - terminalBean.setCashBookId(0); - terminalBean.setCashbookTransferBankAccountId(0); - terminalBean.setCashbookTransferCashbookId(0); - terminalBean.setCashbookTransferType(null); - terminalBean.setCheckBankAccountId(0); - terminalBean.setCheckTransferBankAccountId(0); - terminalBean.setCheckTransferCashbookId(0); - terminalBean.setCheckTransferType(null); - terminalBean.setCardBankAccountId(0); - terminalBean.setCardTransferBankAccountId(0); - terminalBean.setCardTransferCashbookId(0); - terminalBean.setCardTransferType(null); - terminalBean.setLastLockTime(null); - terminalBean.setPurchasePriceListId(0); - terminalBean.setSalesPriceListId(0); - terminalBean.setTemplateBPartnerId(0); - terminalBean.setWarehouseId(0); - - populateData(request, terminalBean, terminalBean.getOrgId(), null); - - terminalForm.populate(terminalBean); - terminalForm.setAction(CREATE_TERMINAL); - terminalForm.setReadOnly(false); - - return mapping.getInputForward(); - } - - public static final String LOCK_TERMINAL = "lockTerminal"; - public ActionForward lockTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - TerminalForm terminalForm = (TerminalForm)form; - TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); - - Trx trx = Trx.get(Trx.createTrxName(), true); - trx.start(); - - try - { - POSTerminalManager.setTerminalLockStatus(ctx, terminalBean.getTerminalId(), true, trx.getTrxName()); - trx.commit(); - } - catch (Exception ex) - { - postGlobalError("error.operation", request); - } - finally - { - trx.rollback(); - trx.close(); - } - - return viewTerminal(mapping, form, request, response); - } - - public static final String UNLOCK_TERMINAL = "unlockTerminal"; - public ActionForward unlockTerminal(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - TerminalForm terminalForm = (TerminalForm)form; - TerminalBean terminalBean = (TerminalBean)terminalForm.getBean(); - - Trx trx = Trx.get(Trx.createTrxName(), true); - trx.start(); - - try - { - POSTerminalManager.setTerminalLockStatus(ctx, terminalBean.getTerminalId(), false, trx.getTrxName()); - trx.commit(); - } - catch (Exception ex) - { - postGlobalError("error.operation", request); - } - finally - { - trx.rollback(); - trx.close(); - } - - return viewTerminal(mapping, form, request, response); - } -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/UOMAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/UOMAction.java deleted file mode 100644 index b1641a19a6..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/UOMAction.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.posterita.struts.pos; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; - -public class UOMAction extends POSDispatchAction -{ - - public static final String CREATE_OR_UPDATE_UOM = "createOrUpdateUOM"; - public ActionForward createOrUpdateUOM(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - return null; - } - - public static final String VIEW_UOM = "viewUOM"; - public ActionForward viewUOM(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - return null; - } - - public static final String LIST_UOMS = "listUOMs"; - public ActionForward listUOMs(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - - if (fwd!=null) - { - return fwd; - } - Properties ctx=TmkJSPEnv.getCtx(request); - - return null; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/pos/VendorAction.java b/posterita/posterita/src/main/org/posterita/struts/pos/VendorAction.java deleted file mode 100644 index f3e7051acb..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/pos/VendorAction.java +++ /dev/null @@ -1,288 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on 25-Jul-2005 by alok - * - */ - -package org.posterita.struts.pos; - -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.PriceListBean; -import org.posterita.beans.VendorBean; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.administration.VendorManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.NoAccessToEditObjectException; -import org.posterita.exceptions.OperationException; -import org.posterita.form.VendorForm; -import org.posterita.struts.core.DefaultForm; - -public class VendorAction extends POSDispatchAction -{ - public static final String SAVE_VENDOR = "saveVendor"; - public ActionForward saveVendor(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - VendorBean bean = (VendorBean) df.getBean(); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - Integer partnerId = 0; - - if (bean.getBpartnerId() != null) - partnerId = bean.getBpartnerId(); - - try - { - trx.start(); - VendorManager.saveVendor(ctx, partnerId, bean, trx.getTrxName()); - trx.commit(); - } - catch(NoAccessToEditObjectException e) - { - trx.rollback(); - postGlobalError("error.no.edit.access", request); - return mapping.getInputForward(); - } - catch(OperationException ex) - { - trx.rollback(); - throw ex; - } - finally - { - trx.close(); - } - request.setAttribute(Constants.VENDOR_DETAILS,bean); - - return mapping.findForward(SAVE_VENDOR); - } - - public static final String VIEW_VENDOR = "viewVendorDetails"; - public ActionForward viewVendorDetails1(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - VendorForm uf = (VendorForm) form; - - int vendorId = Integer.valueOf(uf.getBpartnerId()).intValue(); - - VendorBean vendorBean = VendorManager.getVendor(ctx,vendorId); - - request.getSession().setAttribute(Constants.VENDOR_DETAILS,vendorBean); - - return mapping.findForward(VIEW_VENDOR); - } - - - public static final String INIT_SEARCH_VENDOR = "initSearchVendors"; - public ActionForward initSearchVendors(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - request.getSession().removeAttribute(Constants.VENDOR_LIST); - - return mapping.findForward(INIT_SEARCH_VENDOR); - } - - - public static final String SEARCH_VENDOR = "searchVendors"; - public ActionForward searchVendors(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd=init(mapping,form,request,response); - - if (fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - ArrayList vendorList = VendorManager.searchVendors(ctx, df.getName()); - - request.getSession().setAttribute(Constants.VENDOR_LIST,vendorList); - - return mapping.findForward(SEARCH_VENDOR); - } - - - public static final String INIT_EDIT_VENDOR = "initEditVendor"; - public ActionForward initEditVendor(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - - VendorForm f = (VendorForm) form; - f.validate(mapping,request); - - VendorBean bean = (VendorBean) f.getBean(); - - Integer bpartnerId = bean.getBpartnerId(); - if(bpartnerId==null) - { - throw new OperationException("Cannot edit vendor. Cause vendor id cannot be null!"); - } - - bean = VendorManager.getVendor(ctx,bpartnerId.intValue()); - f.populate(bean); - - ArrayList activePriceLists = PriceListManager.getPriceLists(ctx,0,"",true,null,null,false,null); - ArrayList priceListsKNP = PriceListManager.getKeyNamePair(ctx, activePriceLists); - request.getSession().setAttribute(Constants.USER_PRICE_LISTS, priceListsKNP); - - return mapping.findForward(INIT_EDIT_VENDOR); - } - - - public static final String ACTIVATE_VENDOR = "activateVendor"; - @SuppressWarnings("unchecked") - public ActionForward activateVendor(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - - VendorForm f = (VendorForm) form; - f.validate(mapping,request); //copying the value from the form to the bean - - VendorBean bean = (VendorBean) f.getBean(); - - Integer bpartnerId = bean.getBpartnerId(); - - if(bpartnerId==null) - { - throw new OperationException("Cannot edit vendor. Cause: Vendor id cannot be null!"); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - - try - { - trx.start(); - VendorManager.activateVendor(ctx,bpartnerId.intValue(), trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.activate.vendor", request); - mapping.getInputForward(); - } - finally - { - trx.close(); - } - - ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.VENDOR_LIST); - ArrayList vendorBeanList = list; - - ArrayList newList = VendorManager.updateVendorListStatus(vendorBeanList, bpartnerId, true); - - request.getSession().setAttribute(Constants.VENDOR_LIST, newList); - - - return mapping.findForward(SEARCH_VENDOR); - } - - public static final String DEACTIVATE_VENDOR = "deactivateVendor"; - @SuppressWarnings("unchecked") - public ActionForward deactivateVendor(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - - ActionForward fwd=init(mapping,form,request,response); - if (fwd!=null) - return fwd; - Properties ctx = TmkJSPEnv.getCtx(request); - - VendorForm f = (VendorForm) form; - f.validate(mapping,request); //copying the value from the form to the bean - - VendorBean bean = (VendorBean) f.getBean(); - - Integer bpartnerId = bean.getBpartnerId(); - if(bpartnerId==null) - { - throw new OperationException("Cannot edit vendor. Cause vendor id cannot be null!"); - } - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - try - { - trx.start(); - VendorManager.deactivateVendor(ctx,bpartnerId.intValue(), trx.getTrxName()); - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.deactivate.vendor", request); - mapping.getInputForward(); - } - finally - { - trx.close(); - } - - ArrayList list = (ArrayList) request.getSession().getAttribute(Constants.VENDOR_LIST); - ArrayList vendorBeanList = list; - - ArrayList newList = VendorManager.updateVendorListStatus(vendorBeanList, bpartnerId, false); - - request.getSession().setAttribute(Constants.VENDOR_LIST, newList); - - return mapping.findForward(SEARCH_VENDOR); - } - - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/stock/StockAction.java b/posterita/posterita/src/main/org/posterita/struts/stock/StockAction.java deleted file mode 100644 index 02903b9ad5..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/stock/StockAction.java +++ /dev/null @@ -1,237 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.posterita.struts.stock; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.posterita.Constants; -import org.posterita.beans.ItemBean; -import org.posterita.beans.ShoppingCartBean; -import org.posterita.businesslogic.stock.StockManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotOnPriceListException; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; -import org.posterita.struts.pos.POSGoodsAction; - - -public class StockAction extends BaseDispatchAction -{ - - - - public static final String DELETE_FROM_CART = "deleteFromCart"; - public ActionForward deleteFromCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm df = (DefaultForm) form; - - ItemBean bean = (ItemBean) df.getBean(); - - ArrayList cartItems = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_CART_ITEMS); - ShoppingCartBean cartBeans = (ShoppingCartBean) request.getSession().getAttribute(Constants.SHOPPING_CART); - - if (cartItems == null || cartItems.size() == 0) - return mapping.findForward(DELETE_FROM_CART); - - cartItems = StockManager.deleteItemFromList(cartItems, bean.getProductId()); - BigDecimal grandTotal = StockManager.setGrandTotal(cartItems); - cartBeans.setTotalPrice(grandTotal); - - request.getSession().setAttribute(Constants.SHOPPING_CART_ITEMS, cartItems); - request.getSession().setAttribute(Constants.SHOPPING_CART, cartBeans); - - return mapping.findForward(DELETE_FROM_CART); - } - - public static final String DELETE_FROM_POS_CART = "deleteFromPOSCart"; - public ActionForward deleteFromPOSCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - String orderType = df.getOrderType(); - ItemBean bean = (ItemBean) df.getBean(); - - if(orderType==null) - { - orderType=(String)request.getSession().getAttribute(Constants.ORDER_TYPE); - } - - String shoppingCartItem = null; - String path=null; - if(orderType.equalsIgnoreCase(Constants.CREDIT_ORDER)) - { - shoppingCartItem = Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS; - path="/jsp/pos/creditOrderShoppingCart.jsp"; - } - else - { - shoppingCartItem = Constants.SHOPPING_ORDER_CART_ITEMS; - path="/jsp/pos/posShoppingCartFirstPage.jsp"; - - } - ArrayList items = (ArrayList) request.getSession().getAttribute(shoppingCartItem); - ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),true); - request.getSession().setAttribute(shoppingCartItem, itemsInCart); - return new ActionForward(path); - } - - - - public static final String DELETE_FROM_CREDIT_ORDER_CART = "deleteFromCreditOrderCart"; - public ActionForward deleteFromCreditOrderCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - //String orderType = df.getOrderType(); - ItemBean bean = (ItemBean) df.getBean(); - - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS); - - ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),true); - - - request.getSession().setAttribute(Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS, itemsInCart); - - return new ActionForward("/jsp/pos/creditOrderShoppingCart.jsp"); - } - - public static final String DELETE_FROM_POS_GRN_CART = "deleteFromPOSGRNCart"; - public ActionForward deleteFromPOSGRNCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - DefaultForm df = (DefaultForm) form; - ItemBean bean = (ItemBean) df.getBean(); - - String orderType = df.getOrderType(); - //String shoppingCart = null; - String shoppingCartItem = null; - - if(orderType.equals(Constants.GOODS_RECEIVE_NOTE)) - { - //shoppingCart = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART; - shoppingCartItem = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS; - } - else if(orderType.equals(Constants.GOODS_RETURN_NOTE)) - { - //shoppingCart = Constants.GOODS_RETURN_NOTE_SHOPPING_CART; - shoppingCartItem = Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS; - } - else if(orderType.equals(Constants.CUSTOMER_RETURN_ORDER)) - { - //shoppingCart = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART; - shoppingCartItem = Constants.CUSTOMER_RETURN_ORDER_SHOPPING_CART_ITEMS; - } - - - ArrayList items = (ArrayList) request.getSession().getAttribute(shoppingCartItem); - - ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),false); - - request.getSession().setAttribute(shoppingCartItem, itemsInCart); - - POSGoodsAction action = new POSGoodsAction(); - ActionForward forward = action.getShoppingCart(mapping,form,request,response); - - return forward; - } - - public static final String DELETE_FROM_POS_RET_CART = "deleteFromPOSRetCart"; - public ActionForward deleteFromPOSRetCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, ProductNotOnPriceListException, OperationException - { - - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - ItemBean bean = (ItemBean) df.getBean(); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_GRN_CART_ITEMS); - - ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),false); - - request.getSession().setAttribute(Constants.SHOPPING_GRN_CART_ITEMS, itemsInCart); - - return mapping.findForward(DELETE_FROM_POS_RET_CART); - } - - - public static final String DELETE_FROM_CUST_RET_CART = "deleteFromCustRetCart"; - public ActionForward deleteFromCustRetCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, ProductNotOnPriceListException, OperationException - { - ActionForward fwd = init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - - ItemBean bean = (ItemBean) df.getBean(); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.SHOPPING_GRN_CART_ITEMS); - - ArrayList itemsInCart = StockManager.deleteItemFromPOSList(ctx,items, bean.getProductId(),true); - - request.getSession().setAttribute(Constants.SHOPPING_GRN_CART_ITEMS, itemsInCart); - - return mapping.findForward(DELETE_FROM_CUST_RET_CART); - } - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/struts/stock/StockMovementAction.java b/posterita/posterita/src/main/org/posterita/struts/stock/StockMovementAction.java deleted file mode 100644 index d5a1f65822..0000000000 --- a/posterita/posterita/src/main/org/posterita/struts/stock/StockMovementAction.java +++ /dev/null @@ -1,912 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on May 22, 2006 by alok - */ -package org.posterita.struts.stock; - -import java.io.IOException; -import java.io.PrintWriter; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; -import org.apache.struts.util.MessageResources; -import org.compiere.model.MMovement; -import org.compiere.model.MProduct; -import org.compiere.util.Env; -import org.compiere.util.Trx; -import org.posterita.Constants; -import org.posterita.beans.ItemBean; -import org.posterita.beans.MMovementCartBean; -import org.posterita.beans.StockMovementBean; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.businesslogic.stock.MMovementManager; -import org.posterita.businesslogic.stock.StockManager; -import org.posterita.core.TimestampConvertor; -import org.posterita.core.TmkJSPEnv; -import org.posterita.core.TrxPrefix; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.InputQuantityLessThanZeroException; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.ProductNotFoundException; -import org.posterita.exceptions.ProductNotOnPriceListException; -import org.posterita.exceptions.QuantityNotAvailableException; -import org.posterita.form.StockMovementForm; -import org.posterita.lib.UdiConstants; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.struts.core.DefaultForm; - -public class StockMovementAction extends BaseDispatchAction -{ - public static final String VIEW_STOCK = "viewStock"; - public ActionForward viewStock(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean bean = (StockMovementBean)stockForm.getBean(); - - - Integer orgFromId = bean.getOrgFromId(); - int orgToId = bean.getOrgToId(); - String productName = bean.getProductName() == null? "" : bean.getProductName(); - String description = bean.getDescription() == null? "" : bean.getDescription(); - String barcode = bean.getBarCode() == null? "" : bean.getBarCode(); - - Integer preOrgFromId = (Integer)request.getSession().getAttribute(Constants.PRE_ORG_FROM_ID); - preOrgFromId = preOrgFromId == null?0:preOrgFromId; - HashMap stockProductList = (HashMap) request.getSession().getAttribute(Constants.STOCK_PRODUCT_LIST); - ArrayList stockList = (ArrayList) request.getSession().getAttribute(Constants.MATERIAL_MOVEMENT_ITEMS); - - stockProductList = stockProductList == null? new HashMap(): stockProductList; - stockList = stockList == null? new ArrayList():stockList; - - try - { - ArrayList productList = MMovementManager.getAvailableProducts(ctx, orgFromId, productName, - description, barcode, null); - - stockList = MMovementManager.convertToBeanList(ctx,stockList, stockProductList, productList, preOrgFromId, orgFromId, orgToId, null); - } - catch (ProductNotFoundException e) - { - postGlobalError("error.product.not.found", e.getMessage(),request); - } - - request.getSession().setAttribute(Constants.MATERIAL_MOVEMENT_ITEMS, stockList); - request.getSession().setAttribute(Constants.STOCK_PRODUCT_LIST, stockProductList); - request.getSession().setAttribute(Constants.PRE_ORG_FROM_ID, orgFromId); - return mapping.findForward(VIEW_STOCK); - - } - - public static final String VIEW_OR_EDIT_MMOVEMENT = "viewOrEditMMovement"; - public ActionForward viewOrEditMMovement (ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean bean = (StockMovementBean)stockForm.getBean(); - - return null; - } - - public static final String VIEW_MATERIAL_MOVEMENT_HISTORY="viewMMovementHistory"; - public ActionForward viewMMovementHistory(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd= init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - DefaultForm sf = (DefaultForm)form; - StockMovementBean bean = (StockMovementBean) sf.getBean(); - - Properties ctx =TmkJSPEnv.getCtx(request); - ArrayList list = MMovementManager.viewMMovementHistory(ctx, bean.getDocStatus(), bean.getMonth(), bean.getYear()); - request.setAttribute(Constants.MATERIAL_MOVEMENT_LIST, list); - return mapping.findForward(VIEW_MATERIAL_MOVEMENT_HISTORY); - } - - public static final String VIEW_MATERIAL_MOVEMENT = "viewMMovement"; - public ActionForward viewMMovement(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean bean = (StockMovementBean)stockForm.getBean(); - - int orgId = Env.getAD_Org_ID(ctx); - String docStatus = bean.getDocStatus(); - String f_Date = bean.getFromDate(); - String t_Date = bean.getToDate(); - String docNo = bean.getDocumentNo(); - Timestamp fromDate = TimestampConvertor.getCurrentDateTimeTimestamp(); - Timestamp toDate = TimestampConvertor.getCurrentDateTimestamp(); - - if (f_Date != null) - { - fromDate = TimestampConvertor.getTimestamp(f_Date, TimestampConvertor.BIRTH_DATE); - } - if (t_Date!=null) - { - toDate = TimestampConvertor.getTimestamp(t_Date, TimestampConvertor.BIRTH_DATE); - } - - ArrayList m_list = MMovementManager.getMovementByOrgFrom(ctx,orgId, docStatus, docNo, fromDate, toDate); - - request.getSession().setAttribute(Constants.MATERIAL_MOVEMENT, m_list); - return mapping.findForward(VIEW_MATERIAL_MOVEMENT); - - } - - public static final String VIEW_MOVE_CONFIRM = "viewMoveConfirm"; - public ActionForward viewMoveConfirm(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - - int orgToId = Env.getAD_Org_ID(ctx); - - ArrayList m_list = MMovementManager.getMoveConfirmByOrgTo(ctx, orgToId, null); - - request.getSession().setAttribute(Constants.MOVE_CONFIRM, m_list); - - return mapping.findForward(VIEW_MOVE_CONFIRM); - - } - - public static final String VIEW_MATERIAL_MOVEMENT_LINES = "viewMMovementLines"; - public ActionForward viewMMovementLines(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean bean = (StockMovementBean)stockForm.getBean(); - int movementId = bean.getMovementId(); - - StockMovementBean movementBean = MMovementManager.getBean(ctx, movementId); - ArrayList m_list = MMovementManager.getMovementLines(ctx,movementId); - - request.getSession().setAttribute(Constants.MMOVEMENT, movementBean); - request.getSession().setAttribute(Constants.MATERIAL_MOVEMENT_LINES, m_list); - return mapping.findForward(VIEW_MATERIAL_MOVEMENT_LINES); - } - - public static final String VIEW_MATERIAL_MOVEMENT_LINES_HISTORY = "viewMoveLinesHistory"; - public ActionForward viewMoveLinesHistory(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean bean = (StockMovementBean)stockForm.getBean(); - int movementId = bean.getMovementId(); - - StockMovementBean movementBean = MMovementManager.getBean(ctx, movementId); - ArrayList m_list = MMovementManager.getMovementLines(ctx,movementId); - - request.getSession().setAttribute(Constants.MMOVEMENT, movementBean); - request.getSession().setAttribute(Constants.MATERIAL_MOVEMENT_LINES, m_list); - return mapping.findForward(VIEW_MATERIAL_MOVEMENT_LINES_HISTORY); - } - - public static final String VIEW_MOVE_CONFIRM_LINES = "viewMoveConfirmLines"; - public ActionForward viewMoveConfirmLines(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - - Properties ctx = TmkJSPEnv.getCtx(request); - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean bean = (StockMovementBean)stockForm.getBean(); - int movementId = bean.getMovementId(); - int moveConfirmId = bean.getMoveConfirmId(); - StockMovementBean movementBean = MMovementManager.getBean(ctx, movementId); - movementBean.setMoveConfirmId(moveConfirmId); - ArrayList m_list = MMovementManager.getMovementLines(ctx,movementId); - request.getSession().setAttribute(Constants.MMOVEMENT, movementBean); - request.getSession().setAttribute(Constants.MOVE_CONFIRM_LINES, m_list); - return mapping.findForward(VIEW_MOVE_CONFIRM_LINES); - } - - public static final String CREATE_MATERIAL_MOVEMENT = "createMMovement"; - public ActionForward createMMovement(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - Properties ctx = TmkJSPEnv.getCtx(request); - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); - - String movementCart = Constants.MMOVEMENT_CART; - String movementCartItems = Constants.MMOVEMENT_CART_ITEMS; - - String description = request.getParameter("description"); - String priceListIdAsStr = request.getParameter("priceListId"); - String movementIdAsStr = request.getParameter("movementId"); - String orgFromIdAsStr = request.getParameter("orgFromId"); - String orgToIdAsStr = request.getParameter("orgToId"); - int priceListId = Integer.parseInt(priceListIdAsStr); - int movementId = Integer.parseInt(movementIdAsStr); - Integer orgFromId = Integer.parseInt(orgFromIdAsStr); - Integer orgToId = Integer.parseInt(orgToIdAsStr); - - stockMovementBean.setMovementId(movementId); - stockMovementBean.setDescription(description); - stockMovementBean.setPriceListId(priceListId); - stockMovementBean.setOrgFromId(orgFromId); - stockMovementBean.setOrgToId(orgToId); - stockForm.populate(stockMovementBean); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - String docNo = null; - String docStatus = null; - String docInfo = null; - - ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.MMOVEMENT_CART_ITEMS); - - if(stockMovementBean.getMovementId() == null || stockMovementBean.getMovementId() == 0) - { - MMovement mmovement = MMovementManager.createInventoryMove(ctx, stockMovementBean.getDescription(), null); - docNo = mmovement.getDocumentNo(); - docInfo = mmovement.getDocumentInfo(); - docStatus = mmovement.getDocStatus(); - stockMovementBean.setDocumentNo(docNo); - stockMovementBean.setMovementId(mmovement.getM_Movement_ID()); - - } - else - { - MMovement mmovement2 = new MMovement(ctx, stockMovementBean.getMovementId(), null); - mmovement2.setDescription(stockMovementBean.getDescription()); - docNo = mmovement2.getDocumentNo(); - docInfo = mmovement2.getDocumentInfo(); - docStatus = mmovement2.getDocStatus(); - stockMovementBean.setDocumentNo(docNo); - stockMovementBean.setMovementId(mmovement2.getM_Movement_ID()); - mmovement2.save(); - - MMovementManager.deleteMovementLines(ctx, mmovement2.getM_Movement_ID()); - - } - - try - { - trx.start(); - - for (ItemBean itemBean : itemList) - { - MMovementManager.createOrUpdateMaterialMovementLine(ctx, stockMovementBean.getMovementId(), itemBean.getProductId(), itemBean.getQtyToMove(), stockMovementBean.getOrgFromId(), stockMovementBean.getOrgToId(), trx.getTrxName()); - } - - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - postGlobalError("error.process", e.getMessage(), request); - } - finally - { - trx.close(); - } - - stockForm.populate(stockMovementBean); - - request.getSession().setAttribute(Constants.DOC_NO, docNo); - request.getSession().setAttribute(Constants.DOC_STATUS, docStatus); - request.getSession().setAttribute(Constants.MMOVEMENT_ID, stockMovementBean.getMovementId()); - request.getSession().setAttribute(Constants.DESCRIPTION, description); - - Env.setContext(ctx, Constants.MMOVEMENT_ID, stockMovementBean.getMovementId()); - - - if((MMovement.DOCSTATUS_Drafted).equals(docStatus)) - { - docStatus = "DRAFTED"; - } - - if((MMovement.DOCSTATUS_Completed).equals(docStatus)) - { - docStatus = "COMPLETED"; - } - - if((MMovement.DOCSTATUS_Closed).equals(docStatus)) - { - docStatus = "CLOSED"; - } - - if((MMovement.DOCSTATUS_InProgress).equals(docStatus)) - { - docStatus = "IN PROGRESS"; - } - - if((MMovement.DOCSTATUS_Approved).equals(docStatus)) - { - docStatus = "APPROVED"; - } - - - StringBuffer sb = new StringBuffer(); - sb.append("{"); - sb.append("movementId: \"" + stockMovementBean.getMovementId() + "\""); - sb.append(", docNo: \"" + docNo + "\""); - sb.append(", docStatus: \"" + docStatus + "\""); - sb.append(", docInfo: \"" + docInfo + "\""); - sb.append(", description: \"" + stockMovementBean.getDescription() + "\""); - sb.append("}"); - - PrintWriter writer = response.getWriter(); - writer.print( sb.toString() ); - writer.flush(); - writer.close(); - - return null; - } - - public static final String COMPLETE_MATERIAL_MOVEMENT = "completeMMovement"; - public ActionForward completeMMovement(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - Properties ctx = TmkJSPEnv.getCtx(request); - - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); - - ArrayList itemList = (ArrayList) request.getSession().getAttribute(Constants.MMOVEMENT_CART_ITEMS); - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - - try - { - if(stockMovementBean.getMovementId() == null || stockMovementBean.getMovementId() == 0) - { - MMovement mmovement = MMovementManager.createInventoryMove(ctx, stockMovementBean.getReference(), null); - stockMovementBean.setMovementId(mmovement.get_ID()); - stockMovementBean.setDocumentNo(mmovement.getDocumentNo()); - stockMovementBean.setDocStatus(mmovement.getDocStatus()); - mmovement.save(); - - trx.start(); - - for (ItemBean itemBean : itemList) - { - MMovementManager.createOrUpdateMaterialMovementLine(ctx, stockMovementBean.getMovementId(), itemBean.getProductId(), itemBean.getQtyToMove(), stockMovementBean.getOrgFromId(), stockMovementBean.getOrgToId(), trx.getTrxName()); - } - - trx.commit(); - - MMovementManager.completeMaterialMovement(ctx, stockMovementBean.getMovementId(), trx.getTrxName()); - } - else - { - MMovementManager.deleteMovementLines(ctx, stockMovementBean.getMovementId()); - - trx.start(); - - for (ItemBean itemBean : itemList) - { - MMovementManager.createOrUpdateMaterialMovementLine(ctx, stockMovementBean.getMovementId(), itemBean.getProductId(), itemBean.getQtyToMove(), stockMovementBean.getOrgFromId(), stockMovementBean.getOrgToId(), trx.getTrxName()); - } - - trx.commit(); - - MMovementManager.completeMaterialMovement(ctx, stockMovementBean.getMovementId(), trx.getTrxName()); - - } - } - catch (OperationException e) - { - trx.rollback(); - trx.close(); - } - - ArrayList list = MMovementManager.getMovementLines(ctx, stockMovementBean.getMovementId()); - request.getSession().setAttribute(Constants.MATERIAL_MOVEMENT, list); - - MMovementManager.clearCart(ctx, request); - return mapping.findForward(VIEW_MATERIAL_MOVEMENT); - - } - - public static final String COMPLETE_MOVE_CONFIRM = "completeMoveConfirm"; - public ActionForward completeMoveConfirm(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - Properties ctx = TmkJSPEnv.getCtx(request); - - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); - - int moveConfirmId = stockMovementBean.getMoveConfirmId(); - - - Trx trx = Trx.get(TrxPrefix.getPrefix(), true); - ArrayList bean = null; - try - { - trx.start(); - MMovementManager.completeMoveConfirm(ctx, moveConfirmId, trx.getTrxName()); - - trx.commit(); - } - catch (OperationException e) - { - trx.rollback(); - trx.close(); - } - ArrayList list = (ArrayList)request.getSession().getAttribute(Constants.MOVE_CONFIRM); - bean = MMovementManager.getConfirmList(ctx, list, moveConfirmId); - - request.getSession().setAttribute(Constants.MOVE_CONFIRM, bean); - return mapping.findForward(VIEW_MOVE_CONFIRM); - - } - - public ActionForward setOrgFrom(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - Properties ctx = TmkJSPEnv.getCtx(request); - - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); - Integer orgFromId = stockMovementBean.getOrgFromId(); - - if (orgFromId != null) - { - request.getSession().setAttribute(Constants.ORG_FROM_ID, orgFromId); - } - - return null; - } - - - public ActionForward setQtyToMove(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - Properties ctx = TmkJSPEnv.getCtx(request); - String qtyToMove = request.getParameter("qtyToMove"); - String index = request.getParameter("index"); - String salesPriceListId = request.getParameter("salesPriceListId"); - - Double qty = Double.valueOf(qtyToMove); - BigDecimal qtyToMov = BigDecimal.valueOf(qty); - Integer ind = Integer.valueOf(index); - Integer salesPrId = 0; - if (salesPriceListId != null) - { - salesPrId = Integer.valueOf(salesPriceListId); - } - ArrayList stockList = (ArrayList)request.getSession().getAttribute(Constants.MATERIAL_MOVEMENT_ITEMS); - BigDecimal stockValue = MMovementManager.setQtyToMove(ctx, qtyToMov, ind, salesPrId, stockList); - - return null; - } - - - //--------------------------------------------------------------------------------------------------------------// - - public static final String ADD_TO_MMOVEMENT_CART = "addToMMovementCart"; - public ActionForward addToMMovementCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - { - return fwd; - } - Properties ctx = TmkJSPEnv.getCtx(request); - - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); - - String movementCart = Constants.MMOVEMENT_CART; - String movementCartItems = Constants.MMOVEMENT_CART_ITEMS; - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - MMovementCartBean mmovementBean = (MMovementCartBean) request.getSession().getAttribute(movementCart); - - try - { - if(stockMovementBean.getProductId()==null && stockMovementBean.getBarCode()==null) - { - postGlobalError("error.barcode.required", request); - return mapping.getInputForward(); - } - - BigDecimal qty = stockMovementBean.getQtyToMove(); - if(qty != null && qty.doubleValue() < 0.0) - { - throw new InputQuantityLessThanZeroException(""); - } - - - trx.start(); - mmovementBean = StockManager.addToMovementCart(ctx, stockMovementBean, mmovementBean, false, Boolean.parseBoolean(stockMovementBean.getIfAdd())); - trx.commit(); - } - catch (InputQuantityLessThanZeroException e) - { - postGlobalError("error.invalid.inputQty", request); - trx.rollback(); - return mapping.getInputForward(); - } - catch (ProductNotFoundException e) - { - postGlobalError("error.product.not.found", e.getMessage(), request); - trx.rollback(); - return mapping.getInputForward(); - } - catch(QuantityNotAvailableException e) - { - postGlobalError("error.quantity.notAvailable", e.getMessage(), request); - trx.rollback(); - return mapping.getInputForward(); - } - - catch(ProductNotOnPriceListException e) - { - postGlobalError("error.product.price.not.found", e.getMessage(), request); - trx.rollback(); - return mapping.getInputForward(); - } - catch(OperationException e) - { - postGlobalError("error.inventory.not.available", e.getMessage(), request); - trx.rollback(); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - int priceListId = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - String currSymboleSales = PriceListManager.getCurrency(ctx, priceListId); - request.setAttribute(Constants.CURRENCY_SYMBOLE,currSymboleSales); - - request.getSession().setAttribute(movementCart, mmovementBean); - request.getSession().setAttribute(movementCartItems, mmovementBean.getItems()); - - return mapping.findForward(ADD_TO_MMOVEMENT_CART); - } - - public ActionForward addProduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException, OperationException, IOException, ParseException - { - // Bug fix for null pointer - StockMovementForm stockForm = (StockMovementForm)form; - if(stockForm.getQtyToMove() == null) - { - stockForm.setQtyToMove("1"); - } - - addToMMovementCart(mapping,form,request,response); - - return getMMovementCart(mapping,form,request,response); - } - - - public static final String INCREMENT_QTY = "incrementQty"; - public ActionForward incrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); - stockMovementBean.setQtyToMove(new BigDecimal(1)); - - addToMMovementCart(mapping,form,request,response); - return getMMovementCart(mapping,form,request,response); - } - - public static final String DECREMENT_QTY = "decrementQty"; - public ActionForward decrementQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); - stockMovementBean.setQtyToMove(new BigDecimal(1)); - - addToMMovementCart(mapping,form,request,response); - return getMMovementCart(mapping,form,request,response); - } - - public ActionForward getMMovementCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException - { - DefaultForm df = (DefaultForm) form; - String orderType = df.getOrderType(); - - String mmovementCart = MMovementManager.getMMovementCartAsHTML(request); - - PrintWriter writer = response.getWriter(); - writer.write(mmovementCart); - - - ActionMessages errors = (ActionMessages) request.getAttribute("org.apache.struts.action.ERROR"); - if(errors != null && !errors.isEmpty()) - { - MessageResources messageResources = getResources(request); - - Iterator iter = errors.get(); - while(iter.hasNext()) - { - ActionMessage message = iter.next(); - String key = message.getKey(); - Object[] values = message.getValues(); - - String errMsg = messageResources.getMessage(key, values); - writer.write(""); - } - - } - - writer.close(); - - return null; - } - - public static final String UPDATE_QTY = "updateQty"; - public ActionForward updateQty(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx=TmkJSPEnv.getCtx(request); - - // Bug fix for null pointer - StockMovementForm stockForm = (StockMovementForm)form; - Trx trx = Trx.get(TrxPrefix.getPrefix(),true); - - if(stockForm.getQtyToMove() == null) - { - stockForm.setQtyToMove("1"); - } - - StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); - Integer product_id = stockMovementBean.getProductId(); - Integer quantity = stockMovementBean.getQtyToMove().intValue(); - Integer priceListId = stockMovementBean.getPriceListId(); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.MMOVEMENT_CART_ITEMS); - - try - { - trx.start(); - StockManager.updateItemFromMMovementList(ctx, priceListId, items, product_id, quantity); - trx.commit(); - } - catch(OperationException e) - { - postGlobalError("error.inventory.not.available", e.getMessage(), request); - trx.rollback(); - return mapping.getInputForward(); - } - finally - { - trx.close(); - } - - return getMMovementCart(mapping,form,request,response); - } - - public static final String UPDATE_NO_OF_PACK = "updateNoOfPack"; - public ActionForward updateNoOfPack(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception - { - Properties ctx=TmkJSPEnv.getCtx(request); - - // Bug fix for null pointer - StockMovementForm stockForm = (StockMovementForm)form; - - if(stockForm.getNoOfPack() == null) - { - stockForm.setNoOfPack("1"); - } - - StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); - Integer product_id = stockMovementBean.getProductId(); - Integer noOfPack = stockMovementBean.getNoOfPack(); - Integer priceListId = stockMovementBean.getPriceListId(); - - ArrayList items = (ArrayList) request.getSession().getAttribute(Constants.MMOVEMENT_CART_ITEMS); - StockManager.updateNoOfPack(ctx, priceListId, items, product_id, noOfPack); - - return getMMovementCart(mapping,form,request,response); - } - - public static final String RELOAD_BARCODE_CART = "reloadBarcodeCart"; - public ActionForward reloadBarcodeCart(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, IOException, ParseException, ApplicationException - { - ActionForward fwd=init(mapping,form,request,response); - if(fwd!=null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - StockMovementForm stockForm = (StockMovementForm)form; - StockMovementBean stockMovementBean = (StockMovementBean)stockForm.getBean(); - - String movementCart = Constants.MMOVEMENT_CART; - String movementCartItems = Constants.MMOVEMENT_CART_ITEMS; - - MMovementCartBean cartBean = (MMovementCartBean) request.getSession().getAttribute(movementCart); - ArrayList itemBeans= cartBean.getItems(); - - String priceListIdAsStr = request.getParameter("priceListId"); - String productIdAsStr = request.getParameter("productId"); - int productId = Integer.parseInt(productIdAsStr); - int priceListId = Integer.parseInt(priceListIdAsStr); - - BigDecimal qty = BigDecimal.ZERO; - - for(int i=0; i webDocStatusMap; - static LinkedHashMap docStatusMap; - - static - { - webDocStatusMap = new LinkedHashMap(); - webDocStatusMap.putAll(UDIMap.docStatusMap); - } - - static - { - docStatusMap = new LinkedHashMap(); - docStatusMap.putAll(webDocStatusMap); - docStatusMap.put(DocumentEngine.STATUS_Approved,"Approved"); - docStatusMap.put(DocumentEngine.STATUS_NotApproved,"Not Approved"); - docStatusMap.put(DocumentEngine.STATUS_Reversed,"Reversed"); - docStatusMap.put(DocumentEngine.STATUS_Unknown,"??"); - docStatusMap.put(DocumentEngine.STATUS_WaitingPayment,"Waiting Payment"); - docStatusMap.put(DocumentEngine.STATUS_WaitingConfirmation,"Waiting Confirmation"); - docStatusMap.put(DocumentEngine.STATUS_Invalid,"Invalid"); - } - - - - public static LinkedHashMap getWebDocStatusMap() - { - return webDocStatusMap; - } - - public static void setWebDocStatusMap(LinkedHashMap webDocStatusMap) - { - OrderStatus.webDocStatusMap = webDocStatusMap; - } - - public String formatValue(Object valueToFormat) throws JspException - { - if (valueToFormat instanceof String == false) - throw new JspException("Expected java.lang.String, obtained" + valueToFormat.getClass().getName()); - - String strValueToFormat = (String) valueToFormat; - - return format(strValueToFormat); - } - - - - - - private String format(String strValueToFormat) - { - if (docStatusMap.containsKey(strValueToFormat)) - return (String) docStatusMap.get(strValueToFormat); - - - return (String) docStatusMap.get(DocumentEngine.STATUS_Unknown); - } - - - @SuppressWarnings("deprecation") - public int doStartTag() throws JspException - { - - HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); - - request.getSession().getAttribute(WebUserInfo.NAME); - - if (ignore) - { - if (RequestUtils.lookup(pageContext, name, scope) == null) - return (SKIP_BODY); - } - - Object value = RequestUtils.lookup(pageContext, name, property, scope); - if (value == null) - return (SKIP_BODY); - - String output = formatValue(value); - - org.apache.struts.util.ResponseUtils.write(pageContext, output); - - return (SKIP_BODY); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/taglib/ProductName.java b/posterita/posterita/src/main/org/posterita/taglib/ProductName.java deleted file mode 100644 index 7a7fc036bb..0000000000 --- a/posterita/posterita/src/main/org/posterita/taglib/ProductName.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 11, 2005 by Alok - */ - -package org.posterita.taglib; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.jsp.JspException; - -import org.apache.struts.taglib.bean.WriteTag; -import org.apache.struts.util.RequestUtils; -import org.compiere.model.MAttributeValue; - -import org.posterita.core.TmkJSPEnv; - -public class ProductName extends WriteTag -{ - /** - * - */ - private static final long serialVersionUID = 1L; - - - - - public String formatValue(Object valueToFormat) throws JspException - { - if (valueToFormat instanceof Integer == false) - throw new JspException("Expected java.lang.Integer, obtained" + valueToFormat.getClass().getName()); - - Integer id = (Integer) valueToFormat; - - return format(id); - } - - private String format(Integer integerValueToFormat) - { - - if (integerValueToFormat == null) - return ""; - - HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); - - Properties ctx = TmkJSPEnv.getCtx(request); - - MAttributeValue attributeValue = new MAttributeValue(ctx, integerValueToFormat.intValue(),null); - - - return attributeValue.getName(); - } - - - - - @SuppressWarnings("deprecation") - public int doStartTag() throws JspException - { - - if (ignore) - { - if (RequestUtils.lookup(pageContext, name, scope) == null) - return (SKIP_BODY); - } - - Object value = RequestUtils.lookup(pageContext, name, property, scope); - if (value == null) - return (SKIP_BODY); - - String output = formatValue(value); - - org.apache.struts.util.ResponseUtils.write(pageContext, output); - - return (SKIP_BODY); - } -} diff --git a/posterita/posterita/src/main/org/posterita/user/WebUserInfo.java b/posterita/posterita/src/main/org/posterita/user/WebUserInfo.java deleted file mode 100644 index c354a15664..0000000000 --- a/posterita/posterita/src/main/org/posterita/user/WebUserInfo.java +++ /dev/null @@ -1,303 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 11, 2005 by Alok - */ - -package org.posterita.user; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.model.MLocation; -import org.compiere.model.MOrg; -import org.compiere.model.MRole; -import org.compiere.model.MUser; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Secure; -import org.compiere.util.WebInfo; -import org.compiere.util.WebUser; - -import org.posterita.exceptions.DataException; -import org.posterita.exceptions.OperationException; - - -/** - * @author fred - * - *This Info is breaking convention because it is using Info that calls some business logic when - *invoking it in the jsp. But should be fine for now. - * - */ -public class WebUserInfo -{ - - public static final String NAME = "webUserInfo"; - protected WebUser user; - protected WebInfo info; - protected Properties ctx; - protected String orgName; - protected String roleName; - protected Integer roleId; - protected Integer orgId; - protected ArrayList menuItem; - protected Integer unreadMessageCount; - protected Boolean canAlterOrder; - protected Boolean canCreateOrder; - protected Boolean canViewOrder; - - - - public Boolean getCanAlterOrder() { - return canAlterOrder; - } - public void setCanAlterOrder(Boolean canAlterOrder) { - this.canAlterOrder = canAlterOrder; - } - public Boolean getCanCreateOrder() { - return canCreateOrder; - } - public void setCanCreateOrder(Boolean canCreateOrder) { - this.canCreateOrder = canCreateOrder; - } - public Boolean getCanViewOrder() { - return canViewOrder; - } - public void setCanViewOrder(Boolean canViewOrder) { - this.canViewOrder = canViewOrder; - } - - public Integer getUnreadMessageCount() - { - return unreadMessageCount; - } - - public void setUnreadMessageCount(Integer unreadMessageCount) - { - this.unreadMessageCount = unreadMessageCount; - } - - public ArrayList getMenuItem() - { - return menuItem; - } - - public void setMenuItem(ArrayList menuItem) - { - this.menuItem = menuItem; - } - - public Integer getOrgId() - { - return orgId; - } - - public void setOrgId(Integer orgId) - { - this.orgId = orgId; - } - - - public Integer getRoleId() - { - return roleId; - } - - public void setRoleId(Integer roleId) - { - this.roleId = roleId; - Env.setContext(ctx,"#AD_Role_ID",roleId.intValue()); - } - public WebUserInfo(Properties ctx, WebUser user, WebInfo info) throws DataException, OperationException - { - this.user = user; - this.ctx =ctx; - this.info = info; - - MUser muser = new MUser(ctx, user.getAD_User_ID(), null); - - // TODO think about this Little hack -// Env.setContext(ctx, "#AD_Org_ID", muser.getAD_Org_ID()); - -// setOriginalUserID(ctx, muser); - - orgId = Integer.valueOf(muser.getAD_Org_ID()); - - KeyNamePair[] roles = getRoles(muser.getName(),muser.getPassword()); - - - if (roles == null || roles.length == 0) - throw new DataException("No role has been set for your user, Please check with your administrator to assign one for you."); - - /* - if (roles.length > 1 ) - throw new DataException("You have been assigned many roles. You are permitted to have one role only. Please check with your administrator"); - */ - - setRoleId( Integer.valueOf(roles[0].getKey())); - setRoleName(); - - } - - /*public void setOriginalUserID(Properties ctx, MUser originalUser) - { - int originalUserID = Env.getContextAsInt(ctx, "#AD_OriginalUser_ID"); - - if (originalUserID == 0) - Env.setContext(ctx, "#AD_OriginalUser_ID", originalUser.getAD_User_ID()); - }*/ - - private KeyNamePair[] getRoles (String app_user, String app_pwd) throws OperationException - { - - if (app_user == null) - return null; - - KeyNamePair[] retValue = null; - ArrayList list = new ArrayList(); - // - String sql = "SELECT AD_User.AD_User_ID, AD_User.Description," - + " AD_Role.AD_Role_ID, AD_Role.Name " - + "FROM AD_User, AD_User_Roles, AD_Role " - + "WHERE AD_User.AD_User_ID=AD_User_Roles.AD_User_ID" - + " AND AD_User_Roles.AD_Role_ID=AD_Role.AD_Role_ID" - + " AND AD_User.Name=? AND AD_User.AD_CLIENT_ID=" + Env.getAD_Client_ID(ctx) // #1 - + " AND AD_User.IsActive='Y' AND AD_Role.IsActive='Y' AND AD_User_Roles.IsActive='Y'"; - if (app_pwd != null) - sql += " AND (AD_User.Password=? OR AD_User.Password=?)"; // #2/3 - sql += " ORDER BY AD_Role.Name"; - - PreparedStatement pstmt = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setString(1, app_user); - if (app_pwd != null) - { - pstmt.setString(2, app_pwd); - pstmt.setString(3, new Secure().getDigest(app_pwd)); - } - // execute a query - ResultSet rs = pstmt.executeQuery(); - - while (rs.next()) - { - - int AD_Role_ID = rs.getInt("AD_Role_ID"); - String Name = rs.getString("Name"); - KeyNamePair p = new KeyNamePair(AD_Role_ID, Name); - list.add(p); - } - - rs.close(); - pstmt.close(); - pstmt = null; - // - retValue = new KeyNamePair[list.size()]; - list.toArray(retValue); - } - catch (SQLException ex) - { - ex.printStackTrace(); - retValue = null; - } - // - try - { - if (pstmt != null) - pstmt.close(); - pstmt = null; - } - catch (Exception e) - { - pstmt = null; - } - return retValue; - } // getRoles - - - /** - * @return Returns the info. - */ - public WebInfo getInfo() - { - return info; - } - /** - * @param info The info to set. - */ - public void setInfo(WebInfo info) - { - this.info = info; - } - /** - * @return Returns the user. - */ - public WebUser getUser() - { - return user; - } - /** - * @param user The user to set. - */ - public void setUser(WebUser user) - { - this.user = user; - } - - public String getOrgName() - { - if (orgName ==null) - { - MUser muser = new MUser(ctx,user.getAD_User_ID(),null); - MOrg org = new MOrg (ctx,muser.getAD_Org_ID(),null); - orgName = org.getName(); - } - - return orgName; - - } - - public String getRoleName() - { - MRole role = new MRole(ctx, getRoleId().intValue(),null); - return role.getName(); - } - - public MLocation getLocation() - { - - MUser muser = new MUser(ctx, user.getAD_User_ID(),null); - MOrg org = new MOrg(ctx,muser.getAD_Org_ID(),null); - - int locationId = org.getInfo().getC_Location_ID(); - MLocation mlocation = MLocation.get(ctx, locationId, null); - - return mlocation; - } - - public void setRoleName() - { - this.roleName = getRoleName(); - } -} diff --git a/posterita/posterita/src/main/org/posterita/util/AbstractPrintFormatter.java b/posterita/posterita/src/main/org/posterita/util/AbstractPrintFormatter.java deleted file mode 100644 index 39d06cb302..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/AbstractPrintFormatter.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -package org.posterita.util; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.Map; -import java.util.StringTokenizer; - -import org.posterita.exceptions.OperationException; - - -/** - * @author alok - */ - -public abstract class AbstractPrintFormatter implements IPrintFormatter -{ - private Map arguments; - - protected int _lineWidth = 40; - protected int _halfLineWidth = 20; - protected String _lineTop= ""; - protected String _lineBottom = ""; - protected boolean _showLogo = false; - protected boolean _showBarcode = false; - protected boolean _showDiscount = false; - protected boolean _showFooter = false; - protected boolean _priceWithVat = false; - protected String _footerMessage = ""; - - protected String trxName = null; - - public AbstractPrintFormatter(String args) - { - parseArguments(args); - initFormatter(); - } - - private void parseArguments(String args) - { - arguments = new HashMap(); - - if( args == null || args.length() == 0) - { - return; - } - - StringTokenizer params = new StringTokenizer(args,";"); - StringTokenizer s = null; - - while(params.hasMoreTokens()) - { - s = new StringTokenizer(params.nextToken(), "="); - - if(s.hasMoreTokens()) - { - String key = s.nextToken(); - - if(s.hasMoreTokens()) - { - String value = s.nextToken(); - - arguments.put(key, value); - } - } - }//while - - } - - public String getArgumentValue(String argumentName) - { - if(arguments != null) - { - return arguments.get(argumentName); - } - - return null; - } - - protected void setArgumentValue(String argumentName, String value) throws OperationException - { - try - { - Field field = getClass().getField(argumentName); - Class c = field.getType().getClass(); - - Constructor con = c.getConstructor(new Class[]{String.class}); - Object obj = con.newInstance(new Object[]{value}); - - field.set(this,obj); - } - catch (Exception e) - { - throw new OperationException(e); - } - } - - public void initFormatter() - { - String value; - - value = getArgumentValue("showBarcode"); - if(value != null) - { - _showBarcode = Boolean.parseBoolean(value); - } - - value = getArgumentValue("showLogo"); - if(value != null) - { - _showLogo = Boolean.parseBoolean(value); - } - - value = getArgumentValue("lineLength"); - if(value != null) - { - _lineWidth = Integer.parseInt(value); - } - - value = getArgumentValue("footer"); - if(value != null) - { - _footerMessage = value; - } - - value = getArgumentValue("showDiscount"); - if(value != null) - { - _showDiscount = Boolean.parseBoolean(value); - } - - value = getArgumentValue("showFooter"); - if(value != null) - { - _showFooter = Boolean.parseBoolean(value); - } - - value = getArgumentValue("priceWithVat"); - if(value != null) - { - _priceWithVat = Boolean.parseBoolean(value); - } - - String lineSeparator = ""; - - for(int i = 0; i < _lineWidth; i++) - { - lineSeparator = lineSeparator + "-"; - } - - _lineTop = lineSeparator; - _lineBottom = lineSeparator; - - _halfLineWidth = _lineWidth/2; - } -} diff --git a/posterita/posterita/src/main/org/posterita/util/BarcodeFormatter.java b/posterita/posterita/src/main/org/posterita/util/BarcodeFormatter.java deleted file mode 100644 index d0ad551976..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/BarcodeFormatter.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * 04-Oct-2006 09:52:44 by praveen - * - */ - -package org.posterita.util; - -import java.io.PrintWriter; -import java.io.StringWriter; - -import org.posterita.beans.PrintBarcodeBean; -import org.posterita.exceptions.FormattingException; -import org.posterita.formatter.Formatter; - -public class BarcodeFormatter extends Formatter -{ - boolean showPrice = true; - boolean showTitle = true; - boolean showSubtitle = true; - - public Object format(Object target) throws FormattingException - { - - PrintBarcodeBean bean = null; - bean = (PrintBarcodeBean) target; - - int qty = 0; - String title = null; - String barcode = null; - String price = null; - String subtitle = null; - - title = bean.getTitle(); - barcode = bean.getBarcode(); - price = bean.getPrice(); - subtitle = bean.getSubtitle(); - qty = bean.getQty(); - - //setting defaults if params are null - title = ( title == null ) ? "" : title; - barcode = ( barcode == null ) ? "" : barcode; - price = ( price == null ) ? "" : price; - subtitle = ( subtitle == null ) ? "" : subtitle; - qty = ( qty == 0 ) ? 1 : qty; - - StringWriter sw = new StringWriter(); - PrintWriter w = new PrintWriter(sw); - - w.println("^Q24,3"); - w.println("^W75"); - w.println("^H10"); - w.println("^P1"); - w.println("^S4"); - w.println("^AD"); - w.println("^C$qty"); //<-- qty - w.println("^R2"); - w.println("~Q+3"); - w.println("^O0"); - w.println("^D0"); - w.println("^E10"); - w.println("~R200"); - w.println("^L"); - w.println("Dy2-me-dd"); - w.println("Th:m:s"); - - if( showTitle ) - { - w.println("AA,22,12,1,1,0,0,$title"); //<--title1 - w.println("AA,22,12,1,1,0,0,$title"); //<--title1 - } - - w.println("BE,42,62,2,5,100,0,1,$barcode"); //<--barcode - w.println("BE,42,62,2,5,100,0,1,$barcode"); //<--barcode - - if( showPrice ) - { - w.println("AC,222,27,1,1,0,0,$price"); //<-- price - w.println("AC,222,27,1,1,0,0,$price"); //<-- price - } - - if( showSubtitle ) - { - w.println("AA,22,32,1,1,0,0,$subtitle"); //<-- title2 - w.println("AA,22,32,1,1,0,0,$subtitle"); //<-- title2 - } - - w.println("E"); - w.flush(); - - String printData = sw.getBuffer().toString(); - - printData = printData.replace("$qty", qty+""); - printData = printData.replace("$title", title); - printData = printData.replace("$subtitle", subtitle); - printData = printData.replace("$barcode", barcode); - printData = printData.replace("$price", price); - - return printData; - } - - - public Object unformat(Object target) throws FormattingException - { - throw new FormattingException("Operartion not supported"); - } - - - public boolean isShowPrice() { - return showPrice; - } - - - public void setShowPrice(boolean showPrice) { - this.showPrice = showPrice; - } - - - public boolean isShowSubtitle() { - return showSubtitle; - } - - - public void setShowSubtitle(boolean showSubtitle) { - this.showSubtitle = showSubtitle; - } - - - public boolean isShowTitle() { - return showTitle; - } - - - public void setShowTitle(boolean showTitle) { - this.showTitle = showTitle; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/util/EmailUtil.java b/posterita/posterita/src/main/org/posterita/util/EmailUtil.java deleted file mode 100644 index b8c545fec2..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/EmailUtil.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Servansingh - * */ - -package org.posterita.util; - -import java.util.Properties; - -import javax.mail.internet.InternetAddress; - -import org.compiere.model.MCountry; -import org.compiere.util.EMail; -import org.posterita.beans.UserBean; -import org.posterita.exceptions.InvalidEmailException; - -public class EmailUtil -{ - public static final String DEFAULT_SMTP_SERVER = "mail.tamakict.com"; - public static final String SUPPORT_EMAIL_ADDRESS = "support@posterita.org"; - public static final String DEFAULT_USER_AUTH_NAME = "admin@tamakict.com"; - public static final String DEFAULT_USER_AUTH_PWD = "kaizen"; - - public static boolean send(Properties ctx, String smtpHost, String from, String to, - String subject, String message, String username, String password) - { - EMail email = new EMail(ctx, smtpHost, from, to, subject, message); - - email.createAuthenticator(username, password); - String retMsg = email.send(); - - return EMail.SENT_OK.equals(retMsg); - } - - /** - * Validates an email address. Throws InvalidEmailException if mail address - * is not valid - * @param emailAddress - * @throws InvalidEmailException - */ - public static void checkEMail(String emailAddress) throws InvalidEmailException - { - if (emailAddress == null) - { - throw new InvalidEmailException("No email provided"); - } - - try - { - InternetAddress iNetAddress = new InternetAddress(emailAddress); - iNetAddress.validate(); - } - catch (Exception ex) - { - throw new InvalidEmailException(ex.getMessage(), ex); - } - } - - public static boolean sendRegistrationEmail(Properties ctx, UserBean userBean) - { - if (userBean == null) - { - throw new IllegalArgumentException("User cannot be null"); - } - - MCountry country = MCountry.get(ctx, userBean.getCountryId()); - StringBuffer msg = new StringBuffer(); - msg.append("Full Name: " + userBean.getName() + " " + userBean.getUserSurname()); - msg.append("\n\nAddress: " + userBean.getAddress1()); - msg.append("\n\nCity: " + userBean.getCity()); - msg.append("\n\nCountry: " + country.getName()); - msg.append("\n\nCompany: " + userBean.getCompany()); - msg.append("\n\nIndustry: " + userBean.getIndustry()); - msg.append("\n\nEmail: " + userBean.getEmail()); - msg.append("\n\nRemarks: " + userBean.getComments()); - - String subject = "Posterita POS User Registration"; - String from = userBean.getEmail(); - - return send(ctx, DEFAULT_SMTP_SERVER, from, - SUPPORT_EMAIL_ADDRESS, subject, msg.toString(), - DEFAULT_USER_AUTH_NAME, DEFAULT_USER_AUTH_PWD); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/util/HtmlOrderPrintFormatter.java b/posterita/posterita/src/main/org/posterita/util/HtmlOrderPrintFormatter.java deleted file mode 100644 index 454ffbcfc1..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/HtmlOrderPrintFormatter.java +++ /dev/null @@ -1,732 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 23, 2006 - */ - - -package org.posterita.util; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.Calendar; -import java.util.Date; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MCashLine; -import org.compiere.model.MInvoice; -import org.compiere.model.MLocation; -import org.compiere.model.MOrder; -import org.compiere.model.MOrg; -import org.compiere.model.MPayment; -import org.compiere.model.MUser; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.BPartnerBean; -import org.posterita.beans.ItemBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.ShoppingCartBean; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.exceptions.FormattingException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.order.UDIOrderTypes; - - - -public class HtmlOrderPrintFormatter extends AbstractPrintFormatter -{ - public HtmlOrderPrintFormatter(String args) - { - super(args); - } - - public HtmlOrderPrintFormatter(String args, String trxName) - { - super(args); - this.trxName = trxName; - } - - public String format(Properties ctx, int recordId, Object... args) throws Exception - { - //require UDIBean - OrderLineBean orderLineBean = null; - if( args != null && args.length > 0) - { - orderLineBean = (OrderLineBean) args[0]; - } - - //----------------------------------------------------------------------------------------------------------------------------- - - //set some default values - String vatRegNumber = ""; - String companyName1 = ""; - String companyName2 = ""; - String companyPhone = ""; - String companyAddress = ""; - String footerMsg = ""; - - //setting receipt header - try - { - MOrg myorg = OrganisationManager.getMyOrg(ctx); - int bpartnerId = myorg.getLinkedC_BPartner_ID(trxName); - - - MBPartner bpartner = BPartnerManager.loadBPartner(ctx,bpartnerId,trxName); - BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartnerId, trxName); - - vatRegNumber = bpartner.getTaxID(); - companyName1 = bean.getPartnerName(); - companyName2 = bean.getName2(); - companyPhone = bean.getPhone(); - - String add = bean.getAddress1(); - add = (add==null) ? "" : add; - - companyAddress = add; - - add = bean.getAddress2(); - - if(add!=null){ - companyAddress = companyAddress + " " + add; - } - - add = bean.getCity(); - add = (add==null) ? "" : add; - - companyAddress = companyAddress + ", " + add; - - - } catch (OperationException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - String title = null; - String customerName = null; - String salesRep = null; - String docStatus = null; - String payment = null; - String customerAddress = null; - String refNo = null; - - //load the order - MOrder order = new MOrder(ctx, recordId, trxName); - - String paymentRule = null; - int priceListId = order.getM_PriceList_ID(); - String currency = PriceListManager.getCurrency(ctx, priceListId); - - //setting payment - paymentRule = order.getPaymentRule(); - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) - { - payment = Constants.PAYMENT_RULE_CASH; - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) - { - payment = Constants.PAYMENT_RULE_CARD; - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) - { - payment = Constants.PAYMENT_RULE_CHEQUE; - } - - if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) - { - payment = Constants.PAYMENT_RULE_MIXED; - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_OnCredit)) - { - payment = "On Credit"; - } - - //setting ref no - refNo = order.getDocumentNo(); - - //getting orgInfo - MOrg org = new MOrg(ctx,order.getAD_Org_ID(),trxName); - footerMsg = org.getInfo().getReceiptFooterMsg(); - int location_id = org.getInfo().getC_Location_ID(); - MLocation location = new MLocation(ctx,location_id,trxName); - - // orgName = org.getName(); - - String address1 = (location.getAddress1() == null)? " " : location.getAddress1(); - String address2 = (location.getAddress2() == null)? " " : location.getAddress2(); - // orgAddress = (address1 + " " + address2).trim(); - - - //getting orderInfo - docStatus = order.getDocStatusName(); - - //getting salesrep - int saleRep_id = order.getSalesRep_ID(); - MUser user = new MUser(ctx,saleRep_id,null); - salesRep = user.getName(); - - //getting customer info - int bpartner_id = order.getBill_BPartner_ID(); - BPartnerBean bean; - try - { - bean = BPartnerManager.getBpartner(ctx,bpartner_id,trxName); - } - catch(Exception e) - { - throw new FormattingException("Formatting Error", e); - } - - - String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); - String name2 = (bean.getName2() == null)? " " : bean.getName2(); - customerName = (name1 + " " + name2).trim(); - - address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); - address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); - customerAddress = (address1 + " " + address2).trim(); - - - ///////////////////////////////drawing the order//////////////////////////////// - StringBuffer reportData = new StringBuffer();//TmkPrinterConstants.LOGO1); - - if(_showLogo) - { - reportData.append(""); - } - - //adding header - reportData.append(_lineTop).append("
    "); - - if(companyName1!=null) - reportData.append("

    ").append(companyName1).append("

    "); - - - if(companyName2!=null) - if(companyName2.trim().length() > 0) - reportData.append("

    ").append("(" + companyName2 + ")").append("

    "); - - if(companyAddress!=null) - reportData.append(companyAddress).append("
    "); - - if(companyPhone!=null) - reportData.append("Tel:" + companyPhone).append("
    "); - - if(vatRegNumber!=null) - reportData.append("VAT Reg No:" + vatRegNumber).append("
    "); - - reportData.append(_lineTop).append("
    "); - - //adding title - - if ( UDIOrderTypes.POS_ORDER.getOrderType().equals(order.getOrderType())) - { - title = "Sales Receipt"; - } - else if ( UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equals(order.getOrderType())) - { - title = "Goods Received Note"; - } - else if ( UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(order.getOrderType())) - { - title = "Goods Returned Note"; - } - else if ( UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equals(order.getOrderType())) - { - title = "Customer Returned Order"; - } - else if ( UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) - { - title = "Credit Order"; - } - else - { - throw new OperationException("Unknown order type!"); - } - - reportData.append("

    ") - .append(title) - .append("

    "); - - //adding customer name - customerName = String.format("%1$-" + _halfLineWidth + "s", customerName); - reportData.append(customerName); - - //adding sales rep - salesRep = "Sales Rep:" + salesRep; - salesRep = String.format("%1$"+ _halfLineWidth + "s", salesRep); - reportData.append(salesRep) - .append("
    "); - - //adding customer address - customerAddress = String.format("%1$-" + _lineWidth + "s",customerAddress); - reportData.append(customerAddress) - .append("
    "); - - //adding status - docStatus = "Status:" + docStatus; - docStatus = String.format("%1$-" + _lineWidth + "s",docStatus); - reportData.append(docStatus) - .append("
    "); - - //adding payment - String paymentDetails = String.format("%1$-" + _lineWidth + "s","Payment:" + payment); - reportData.append(paymentDetails) - .append("
    "); - - //adding reference no - refNo = "Ref No:" + refNo; - refNo = String.format("%1$-" + _lineWidth + "s",refNo); - reportData.append(refNo) - .append("
    "); - - //adding date - Calendar c = Calendar.getInstance(); - c.setTime(new Date(order.getCreated().getTime())); - String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); - date = String.format("%1$-" + _lineWidth + "s",date); - reportData.append(date) - .append("
    "); - - //adding orderlines - //1.header - reportData.append(_lineTop).append("
    "); - - String headerFormat; - if(_showDiscount) - { - headerFormat = "%1$-" + (_lineWidth - ( 7 + 5 + 8 + 10 )) + "s" + - "%2$7s" + - "%3$5s" + - "%4$8s" + - "%5$10s"; - } - else - { - headerFormat = "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + - "%2$7s" + - "%3$5s" + - //"%4$8s" + - "%5$13s"; - } - - String header = String.format(headerFormat,"Name","Unit","Qty","Dis","Total"); - reportData.append(header).append("
    "); - - reportData.append(_lineBottom) - .append("
    "); - - //2.body - ShoppingCartBean cart = null; - - try - { - cart = POSManager.getShoppingCartForOrder(ctx, recordId, trxName); - } - catch(Exception e) - { - throw new FormattingException("Formatting Error", e); - } - - String name = null; - int qty; - BigDecimal discount = null; - BigDecimal taxAmt = null; - BigDecimal total; - BigDecimal unitPrice; - - int totalQty = 0; - double grandTotal = 0.0d; - double totalTax = 0.0d; - String orderline = ""; - String orderlineFormat = null; - - int nameWidth = 0; - - - if(_showDiscount) - { - orderlineFormat = "" + - "%1$-" + (_lineWidth - ( 7 + 5 + 8 + 10 )) + "s" + //1.product name OR description - "%2$7.2f" + //2.unit price - "%3$5d" + //3.quantity - "%4$8.2f" + //4.discount amount - "%5$10.2f"; //5.total price - - nameWidth = _lineWidth - ( 7 + 5 + 8 + 10 ); - } - else - { - orderlineFormat = "" + - "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + //1.product name OR description - "%2$7.2f" + //2.unit price - "%3$5d" + //3.quantity - //"%4$8.2f" + //4.discount amount - "%5$13.2f"; //5.total price - - nameWidth = _lineWidth - ( 7 + 5 + 13 ); - } - - - - for(ItemBean item : cart.getItems()) - { - taxAmt = item.getTaxAmt(); - name = item.getDescription(); - qty = item.getQty().intValue(); - discount = item.getDiscountPercent(); - total = item.getPrice(); - unitPrice = item.getUnitPrice(); - - if( _priceWithVat ) - { - unitPrice = total.divide(item.getQty(), 2, RoundingMode.HALF_EVEN); - } - - - if(name.length() > nameWidth) - { - // print on multiple lines - int beginIndex = 0; - int endIndex = 0; - endIndex = nameWidth; - - while(endIndex < name.length()) - { - String s = name.substring(beginIndex, endIndex); - beginIndex = endIndex; - endIndex = endIndex + nameWidth; - - orderline = String.format("%1$-" + _lineWidth + "s", s); - reportData.append(orderline) - .append("
    "); - } - - name = name.substring(beginIndex); - } - - discount = (discount==null)? new BigDecimal(0.0) : discount; - taxAmt = (taxAmt==null)? new BigDecimal(0.0) : taxAmt; - - double discountAmt = 0.0; - discountAmt = (total.doubleValue() * 100.0)/(100.0 - discount.doubleValue()) - total.doubleValue(); - - totalQty += qty; - grandTotal += total.doubleValue(); - totalTax += taxAmt.doubleValue(); - - if(taxAmt.intValue() == 0) - { - name = name + "*"; - } - - orderline = String.format(orderlineFormat,name,unitPrice,qty,discountAmt,total); - reportData.append(orderline) - .append("
    "); - } - - //3.footer - reportData.append(_lineBottom) - .append("
    "); - - String footerFormat = null; - if(_showDiscount) - { - footerFormat = "" + - "%1$-" + (_lineWidth - ( 5 + 8 + 10 )) + "s" + - "%2$5d" + - "%3$8.2s" + - "%4$10.2f"; - } - else - { - footerFormat = "" + - "%1$-" + (_lineWidth - ( 5 + 3 + 10 )) + "s" + - "%2$5d" + - "%3$3s" + - "%4$10.2f"; - } - - //4.amount tendered & refunded - BigDecimal cashAmountTendered = order.getAmountTendered(); - if(cashAmountTendered == null) - { - cashAmountTendered = new BigDecimal(0.0); - } - BigDecimal cashAmountRefunded = Env.ZERO; - if (MOrder.PAYMENTRULE_Cash.equals(order.getPaymentRule())) - { - cashAmountRefunded = order.getAmountRefunded(); - } - if(cashAmountRefunded == null) - { - cashAmountRefunded = new BigDecimal(0.0); - } - - BigDecimal cardAmountTendered = new BigDecimal(0.0d); - BigDecimal chequeAmountTendered = new BigDecimal(0.0d); - - - if(orderLineBean != null) - { - Double cardAmt = orderLineBean.getPaymentByCard(); - Double chequeAmt = orderLineBean.getPaymentByChq(); - - if(cardAmt == null) - { - cardAmountTendered = new BigDecimal(0.0d); - } - else - { - cardAmountTendered = new BigDecimal(cardAmt.doubleValue()); - } - - if(chequeAmt == null) - { - chequeAmountTendered = new BigDecimal(0.0d); - } - else - { - chequeAmountTendered = new BigDecimal(chequeAmt.doubleValue()); - } - } - else - { - - if(MOrder.STATUS_Completed.equalsIgnoreCase(order.getDocStatus())) - if(order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) - { - try - { - cardAmountTendered = POSManager.getPayment(ctx, order.get_ID(), MPayment.TENDERTYPE_CreditCard, trxName); - chequeAmountTendered = POSManager.getPayment(ctx, order.get_ID(), MPayment.TENDERTYPE_Check, trxName); - } - catch (OperationException e) - { - throw new FormattingException("Cannot get payment",e); - } - } - else - { - cardAmountTendered = new BigDecimal(0.0d); - chequeAmountTendered = new BigDecimal(0.0d); - } - - } - - BigDecimal discountAmt = Env.ZERO; - BigDecimal writeOffAmt = Env.ZERO; - BigDecimal paymentAmt = Env.ZERO; - String writeOff = ""; - String actualPayment = ""; - String seperator = ""; - - MInvoice invoice = new MInvoice(ctx, order.getC_Invoice_ID(), trxName); - - if(invoice == null) - { - throw new OperationException("Could not load Invoice."); - } - - MCashLine cashLine = new MCashLine(ctx, invoice.getC_CashLine_ID(), trxName); - - if(cashLine == null) - { - throw new OperationException("Could not load CashLine"); - } - else - { - writeOffAmt = cashLine.getWriteOffAmt(); - paymentAmt = cashLine.getAmount(); - discountAmt = cashLine.getDiscountAmt(); - - if(writeOffAmt.doubleValue() == 0.0) - { - writeOffAmt = new BigDecimal(0.0d); - } - - if(discountAmt.doubleValue() == 0.0) - { - discountAmt = new BigDecimal(0.0d); - } - } - - String orderFooter = ""; - - if(discountAmt.doubleValue() > 0.0d) - { - orderFooter = String.format(footerFormat,"Sub Total",totalQty,currency,grandTotal); - } - else - { - orderFooter = String.format(footerFormat,"Grand Total",totalQty,currency,grandTotal); - } - reportData.append(orderFooter) - .append("
    "); - - reportData.append(_lineTop) - .append("
    "); - - if(!order.getOrderType().equalsIgnoreCase(UDIOrderTypes.CREDIT_ORDER.getOrderType())) - { - if(order.getOrderType().equalsIgnoreCase("POS Order")) - { - BigDecimal totalAfterDiscount = order.getGrandTotal().subtract(discountAmt); - - if(discountAmt.doubleValue() > 0.0d) - { - String str = String.format("%1$25s%2$4s:%3$10.2f","Less Discount", currency, discountAmt); - reportData.append(str).append("
    "); - - String totalAfterDiscountStr = String.format("%1$25s%2$4s:%3$10.2f","Grand Total", currency, totalAfterDiscount); - reportData.append(totalAfterDiscountStr).append("
    "); - - seperator = String.format("%1$25s%2$15s","","------------"); - reportData.append(seperator).append("
    "); - } - - if(payment.equalsIgnoreCase(Constants.PAYMENT_RULE_CASH)) - { - writeOff = String.format("%1$25s%2$4s:%3$10.2f","Write Off Amt", currency, writeOffAmt); - reportData.append(writeOff).append("
    "); - - actualPayment = String.format("%1$25s%2$4s:%3$10.2f","Payment Amt", currency, paymentAmt); - reportData.append(actualPayment).append("
    "); - } - - } - - String amountTendered = String.format("%1$25s%2$4s:%3$10.2f","Cash Tendered",currency,cashAmountTendered); - String amountRefunded = String.format("%1$25s%2$4s:%3$10.2f","Cash Refunded",currency,cashAmountRefunded); - - String cardTendered = String.format("%1$25s%2$4s:%3$10.2f","Card Tendered",currency,cardAmountTendered); - String chequeTendered = String.format("%1$25s%2$4s:%3$10.2f","Cheque Tendered",currency,chequeAmountTendered); - - if(cashAmountTendered.doubleValue() > 0.0d) - { - reportData.append(amountTendered).append("
    "); - } - - if(cardAmountTendered.doubleValue() > 0.0d) - { - reportData.append(cardTendered).append("
    "); - } - - if(chequeAmountTendered.doubleValue() > 0.0d) - { - reportData.append(chequeTendered).append("
    "); - } - - if(cashAmountTendered.doubleValue() > 0.0d && MOrder.PAYMENTRULE_Cash.equals(order.getPaymentRule())) - { - reportData.append(amountRefunded).append("
    "); - } - } - - - String totalVAT = String.format("%1$.2f",totalTax); - String vat = String.format("%1$-" + _lineWidth + "s","Total VAT:" + currency + totalVAT); - reportData.append("
    ") - .append(vat) - .append("
    "); - - String noVAT = String.format("%1$-" + _lineWidth + "s","* NO VAT"); - - - - reportData.append(noVAT) - .append("
    ") - .append("
    "); - - if(_showBarcode) - { - String barcode = order.getDocumentNo(); - reportData.append(barcode) - .append("
    "); - } - - - //reportData.append("*** Thank you ***") - reportData.append("
    "); - - - if(_showFooter) - if( _footerMessage.length() > 0 ) - { - reportData.append("
    ") - .append(_footerMessage) - .append("
    "); - } - - - if( order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType()) ) - { - /* - reportData.append("
    ") - .append("*Goods once sold cannot be returned."); - */ - reportData.append("
    "); - reportData.append("
    "); - - if(footerMsg != null && footerMsg.length() != 0) - { - if(footerMsg.length() > 43) - { - String temp = ""; - String formattedFooterMsg = ""; - - while(footerMsg.length() > 43) - { - temp = footerMsg.substring(0, 42); - - if(!(temp.endsWith(" "))) - { - temp = temp.substring(0, temp.lastIndexOf(" ")); - formattedFooterMsg = formattedFooterMsg + temp.concat("
    "); - } - else - { - formattedFooterMsg = formattedFooterMsg + temp.concat("
    "); - } - - footerMsg = footerMsg.substring(temp.lastIndexOf(" ") +1); - } - - formattedFooterMsg = formattedFooterMsg.concat(footerMsg); - reportData.append(formattedFooterMsg); - } - else - { - reportData.append(footerMsg); - } - } - } - - return reportData.toString(); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/util/IPrintFormatter.java b/posterita/posterita/src/main/org/posterita/util/IPrintFormatter.java deleted file mode 100644 index cc328ab18c..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/IPrintFormatter.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -package org.posterita.util; - -import java.util.Properties; - -/** - * @author alok - */ - -public interface IPrintFormatter -{ - public String format(Properties ctx,int recordId, Object ...args) throws Exception; -} - diff --git a/posterita/posterita/src/main/org/posterita/util/InvoiceFormatter.java b/posterita/posterita/src/main/org/posterita/util/InvoiceFormatter.java deleted file mode 100644 index d3d869098e..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/InvoiceFormatter.java +++ /dev/null @@ -1,308 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Sep 26, 2006 - */ - - -package org.posterita.util; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.Properties; - -import org.compiere.model.MDocType; -import org.compiere.model.MInvoice; -import org.compiere.model.MLocation; -import org.compiere.model.MOrder; -import org.compiere.model.MOrg; -import org.compiere.model.MUser; - -import org.posterita.Constants; -import org.posterita.beans.BPartnerBean; -import org.posterita.beans.WebOrderLineBean; -import org.posterita.businesslogic.InvoiceManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.core.ContextId; -import org.posterita.exceptions.FormattingException; -import org.posterita.formatter.Formatter; -import org.posterita.lib.UdiConstants; - - -public class InvoiceFormatter extends Formatter -{ - - @Override - public Object format(Object target) throws FormattingException - { - - ContextId ctxId = (ContextId) target; - - Properties ctx = ctxId.getCtx(); - int recordId = ctxId.getId(); - - String title = null; - String customerName = null; - String salesRep = null; - String docStatus = null; - String payment = null; - String customerAddress = null; - String orderType=null; - //String dateOrdered = null; - String refNo = null; - - //load the order - MInvoice invoice = new MInvoice(ctx, recordId, null); - - String paymentRule = null; - - //setting payment - paymentRule = invoice.getPaymentRule(); - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) - { - payment = Constants.PAYMENT_RULE_CASH; - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) - { - payment = Constants.PAYMENT_RULE_CARD; - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) - { - payment = Constants.PAYMENT_RULE_CHEQUE; - } - - if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) - { - payment = Constants.PAYMENT_RULE_MIXED; - } - //setting ref no - refNo = invoice.getDocumentNo(); - - //getting orgInfo - MOrg org = new MOrg(ctx,invoice.getAD_Org_ID(),null); - int location_id = org.getInfo().getC_Location_ID(); - MLocation location = new MLocation(ctx,location_id,null); - - - String address1 = (location.getAddress1() == null)? " " : location.getAddress1(); - String address2 = (location.getAddress2() == null)? " " : location.getAddress2(); - - //getting order type - int docTypeId = invoice.getC_DocType_ID(); - MDocType docType = new MDocType(ctx, docTypeId, null); - - orderType = docType.getName(); - - //getting orderInfo - docStatus = invoice.getDocStatusName(); - - - //getting salesrep - int saleRep_id = invoice.getSalesRep_ID(); - MUser user = new MUser(ctx,saleRep_id,null); - salesRep = user.getName(); - - //getting customer info - int bpartner_id = invoice.getC_BPartner_ID(); - BPartnerBean bean; - try - { - bean = BPartnerManager.getBpartner(ctx,bpartner_id,null); - } - catch(Exception e) - { - throw new FormattingException("Formatting",e); - } - - - String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); - String name2 = (bean.getName2() == null)? " " : bean.getName2(); - customerName = (name1 + " " + name2).trim(); - - address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); - address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); - customerAddress = (address1 + " " + address2).trim(); - - - ///////////////////////////////drawing the order//////////////////////////////// - StringBuffer reportData = new StringBuffer(TmkPrinterConstants.LOGO1); - //adding title - title = orderType; - reportData.append(TmkPrinterConstants.BIG_FONT) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(title) - .append(TmkPrinterConstants.LINE_FEED); - - //setting small font - reportData.append(TmkPrinterConstants.SMALL_FONT); - reportData.append(TmkPrinterConstants.LEFT_ALIGN); - - //adding customer name - customerName = String.format("%1$-30s",customerName); - reportData.append(customerName); - - //adding sales rep - salesRep = "Sales Rep:" + salesRep; - salesRep = String.format("%1$30s",salesRep); - reportData.append(salesRep) - .append(TmkPrinterConstants.LINE_FEED); - - //adding customer address - customerAddress = String.format("%1$-60s",customerAddress); - reportData.append(customerAddress) - .append(TmkPrinterConstants.LINE_FEED); - - //adding status - docStatus = "Status:" + docStatus; - docStatus = String.format("%1$-60s",docStatus); - reportData.append(docStatus) - .append(TmkPrinterConstants.LINE_FEED); - - //adding payment - payment = "Payment:" + payment; - payment = String.format("%1$-60s",payment); - reportData.append(payment) - .append(TmkPrinterConstants.LINE_FEED); - - //adding reference no - refNo = "Ref No:" + refNo; - refNo = String.format("%1$-60s",refNo); - reportData.append(refNo) - .append(TmkPrinterConstants.LINE_FEED); - - //adding date - Calendar c = Calendar.getInstance(); - c.setTime(new Date(invoice.getCreated().getTime())); - String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); - date = String.format("%1$-60s",date); - reportData.append(date) - .append(TmkPrinterConstants.LINE_FEED); - - //adding orderlines - //1.header - reportData.append(TmkPrinterConstants.H_FULL_LINE_TOP).append("\n"); - - String headerFormat = "" + - "%1$-40s" + - "%2$5s" + - "%3$5s" + - "%4$10s"; - - String header = String.format(headerFormat,"Name","Qty","","Total"); - reportData.append(header).append("\n"); - - reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) - .append(TmkPrinterConstants.LINE_FEED); - - ArrayList invoiceLineList; - - //2.body - try - { - invoiceLineList = InvoiceManager.populateInvoiceLines(ctx,invoice,false); - } - catch(Exception e) - { - throw new FormattingException("Formatting Error", e); - } - - - String name = null; - int qty; - - BigDecimal taxAmt = null; - BigDecimal total; - - int totalQty = 0; - double grandTotal = 0.0d; - double totalTax = 0.0d; - String orderline = ""; - - String orderlineFormat = "" + - "%1$-40s" + - "%2$5d" + - "%3$5s" + - "%4$10.2f"; - - for(WebOrderLineBean wbean : invoiceLineList) - { - taxAmt = wbean.getTaxAmt(); - name = wbean.getDescription(); - qty = wbean.getQtyOrdered().intValue(); - total = wbean.getLineTotalAmt(); - - taxAmt = (taxAmt==null)? new BigDecimal(0.0) : taxAmt; - - totalQty += qty; - grandTotal += total.doubleValue(); - totalTax += taxAmt.doubleValue(); - - if(taxAmt.intValue() == 0) - { - name = name + "*"; - } - - orderline = String.format(orderlineFormat,name,qty,"",total); - reportData.append(orderline) - .append(TmkPrinterConstants.LINE_FEED); - } - - //3.footer - reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) - .append(TmkPrinterConstants.LINE_FEED); - - String footerFormat = "" + - "%1$-40s" + - "%2$5d" + - "%3$5s" + - "%4$10.2f"; - - String footer = String.format(footerFormat,"Grand Total",totalQty,"Rs",grandTotal); - reportData.append(footer) - .append(TmkPrinterConstants.LINE_FEED); - - reportData.append(TmkPrinterConstants.H_FULL_LINE_TOP) - .append(TmkPrinterConstants.LINE_FEED); - - - String totalVAT = String.format("%1$.2f",totalTax); - String vat = String.format("%1$-60s","Total VAT:Rs"+totalVAT); - reportData.append(vat) - .append(TmkPrinterConstants.LINE_FEED); - - String noVAT = String.format("%1$-60s","* NO VAT"); - reportData.append(noVAT) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.PAPER_CUT); - - - return reportData.toString(); - } - - @Override - public Object unformat(Object target) - { - return null; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/util/ListUtil.java b/posterita/posterita/src/main/org/posterita/util/ListUtil.java deleted file mode 100644 index 2f36dce1a1..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/ListUtil.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* -* Created on Oct 3, 2006 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.util; - -import java.util.ArrayList; - -public class ListUtil -{ - public static ArrayList getListFromArray(T[] a) - { - ArrayList retList = new ArrayList(); - if(a != null) - { - for(T t : a) - retList.add(t); - } - return retList; - } -} diff --git a/posterita/posterita/src/main/org/posterita/util/MinOutFormatter.java b/posterita/posterita/src/main/org/posterita/util/MinOutFormatter.java deleted file mode 100644 index cedd4e2b68..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/MinOutFormatter.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Sep 26, 2006 - */ - - -package org.posterita.util; - -import org.posterita.formatter.Formatter; - - -public class MinOutFormatter extends Formatter -{ - - @Override - public Object format(Object target) - { - return null; - } - - @Override - public Object unformat(Object target) - { - return null; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/util/OSBroOrderPrintFormatter1.java b/posterita/posterita/src/main/org/posterita/util/OSBroOrderPrintFormatter1.java deleted file mode 100644 index c6d29125f4..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/OSBroOrderPrintFormatter1.java +++ /dev/null @@ -1,650 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 23, 2006 - */ - - -package org.posterita.util; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.Properties; -import java.util.StringTokenizer; -import java.util.logging.Level; - -import org.compiere.model.MBPartner; -import org.compiere.model.MInvoice; -import org.compiere.model.MOrder; -import org.compiere.model.MOrg; -import org.compiere.model.MPOS; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.BPartnerBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.WebOrderLineBean; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.exceptions.FormattingException; -import org.posterita.exceptions.OperationException; -import org.posterita.order.UDIOrderTypes; - - - -public class OSBroOrderPrintFormatter1 extends AbstractPrintFormatter -{ - private static final CLogger log = CLogger.getCLogger(OSBroOrderPrintFormatter1.class); - - public OSBroOrderPrintFormatter1(String args) - { - super(args); - } - - public OSBroOrderPrintFormatter1(String args, String trxName) - { - super(args); - this.trxName = trxName; - } - - public String format(Properties ctx, int recordId, Object... args) throws Exception - { - - //require UDIBean - OrderLineBean orderLineBean = null; - if( args != null && args.length > 0) - { - orderLineBean = (OrderLineBean) args[0]; - } - - //----------------------------------------------------------------------------------------------------------------------------- - - //set some default values - String vatRegNumber = ""; - String companyName1 = ""; - String companyName2 = ""; - String companyPhone = ""; - String companyFax = ""; - String companyAddress = ""; - String footerMsg = ""; - String terminal = ""; - - //setting receipt header - try - { - MOrg myorg = OrganisationManager.getMyOrg(ctx); - int bpartnerId = myorg.getLinkedC_BPartner_ID(trxName); - - //get footer message - footerMsg = myorg.getInfo().getReceiptFooterMsg(); - - - MBPartner linkedBPartner = BPartnerManager.loadBPartner(ctx,bpartnerId,trxName); - BPartnerBean linkedBPartnerBean = BPartnerManager.getBpartner(ctx, bpartnerId, trxName); - - vatRegNumber = linkedBPartner.getTaxID(); - companyName1 = linkedBPartnerBean.getPartnerName(); - companyName2 = linkedBPartnerBean.getName2(); - companyPhone = linkedBPartnerBean.getPhone(); - companyFax = linkedBPartnerBean.getFax(); - - String address1 = linkedBPartnerBean.getAddress1(); - String address2 = linkedBPartnerBean.getAddress2(); - String city = linkedBPartnerBean.getCity(); - String postalAddress = linkedBPartnerBean.getPostalAddress(); - String postalCode = linkedBPartnerBean.getPostalCode(); - - String newLine = System.getProperty("line.separator"); - companyAddress = (address1==null) ? companyAddress : getFormattedText(address1, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN); - companyAddress = (address2==null) ? companyAddress : companyAddress + getFormattedText(address2, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN); - companyAddress = (postalAddress==null) ? companyAddress : companyAddress + getFormattedText(postalAddress, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN); - companyAddress = (city==null) ? companyAddress : companyAddress + getFormattedText(city, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN); - companyAddress = (postalCode==null) ? companyAddress : companyAddress + getFormattedText(postalCode, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN); - } - catch (OperationException e1) - { - log.log(Level.SEVERE, "Could not get details for linked business partner", e1); - } - - String title = null; - String customerName = null; - String salesRep = null; - String docStatus = null; - String payment = null; - String customerAddress = null; - String refNo = null; - - //load the order - MOrder order = new MOrder(ctx, recordId, trxName); - - // Load terminal info - MPOS posTerminal = new MPOS(ctx, order.getC_POS_ID(), trxName); - terminal = posTerminal.getName(); - - //getting customer info - int bpartner_id = order.getBill_BPartner_ID(); - BPartnerBean bean; - try - { - bean = BPartnerManager.getBpartner(ctx,bpartner_id,trxName); - } - catch(Exception e) - { - throw new FormattingException("Formatting Error", e); - } - - String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); - String name2 = (bean.getName2() == null)? " " : bean.getName2(); - customerName = (name1 + " " + name2).trim(); - - String address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); - String address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); - customerAddress = (address1 + " " + address2).trim(); - - MBPartner customer = BPartnerManager.loadBPartner(ctx,bean.getBpartnerId(),trxName); - String customerVAT = customer.getTaxID()==null?"":customer.getTaxID(); - - if ( UDIOrderTypes.POS_ORDER.getOrderType().equals(order.getOrderType()) - || order.getOrderType().equals(null) - || UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) - { - title = "Tax Invoice"; - } - if ( UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equals(order.getOrderType())) - { - title = "Goods Receive Note"; - } - if ( UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(order.getOrderType())) - { - title = "Goods Return Note"; - } - if ( UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equals(order.getOrderType())) - { - title = "Customer Return Order"; - } - - - ///////////////////////////////drawing the order//////////////////////////////// - StringBuffer reportData = new StringBuffer(); - - // add title - reportData.append(getFormattedText("***" + title + "***", TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - - // add company name - if(companyName1 != null) - { - // TODO Refactor code push code in getFormattedText(String text, String font, String alignment, boolean addLineFeed) method - int lineWidth = getLineWidth(TmkPrinterConstants.FONT_DOUBLE); - //split name1 - StringTokenizer st = new StringTokenizer(companyName1); - String line = ""; - - while(st.hasMoreTokens()) - { - String s = st.nextToken(); - - if((line + " " + s).length() > lineWidth) - { - reportData.append(getFormattedText(line, TmkPrinterConstants.FONT_DOUBLE, TmkPrinterConstants.LEFT_ALIGN)); - line = ""; - } - - line += s + " "; - - } - - reportData.append(getFormattedText(line, TmkPrinterConstants.FONT_DOUBLE, TmkPrinterConstants.LEFT_ALIGN)); - - } - - // add company branch - if(companyName2 != null) - { - if(companyName2.trim().length() > 0) - { - reportData.append(getFormattedText(companyName2, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - } - } - - reportData.append(TmkPrinterConstants.LINE_FEED); - - // add vat# - if(vatRegNumber != null) - { - reportData.append(getFormattedText("VAT NO: " + vatRegNumber, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - } - - // add phone# - if(companyPhone != null) - { - reportData.append(getFormattedText("TEL: " + companyPhone, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - } - - // add fax# - if(companyFax != null) - { - reportData.append(getFormattedText("FAX: " + companyFax, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - } - - reportData.append(TmkPrinterConstants.LINE_FEED); - - // add date & time - Calendar c = Calendar.getInstance(); - c.setTime(new Date(order.getCreated().getTime())); - String date = String.format("%1$te/%1$tm/%1$tY",c); - String time = String.format("%1$tH:%1$tM",c); - String dateTime = "DATE: " + date + " TIME: " + time; - - reportData.append(getFormattedText(dateTime, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - - // add till# - if(terminal != null) - { - reportData.append(getFormattedText("TILL : " + terminal, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - } - - if (companyAddress != null) - { - reportData.append(companyAddress); - } - - // add Invoice # - MInvoice[] invoices = order.getInvoices(); - if(invoices.length > 0) - { - MInvoice invoice = invoices[0]; - reportData.append(getFormattedText("INVOICE NO : " + invoice.getDocumentNo(), TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - } - - - // add BP account# followed by address and VAT# - // reportData.append(getFormattedText(customerActNumber, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - reportData.append(getFormattedText(customerName, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - reportData.append(getFormattedText(address1, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - reportData.append(getFormattedText(address2, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - reportData.append(getFormattedText("Client VAT No: " + customerVAT, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - - reportData.append(getFormattedText(_lineTop, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.CENTER_ALIGN)); - - // 1.body - ArrayList orderLineList; - - try - { - orderLineList = POSManager.populateOrderLines(ctx,order); - } - catch(Exception e) - { - throw new FormattingException("Formatting Error", e); - } - - BigDecimal lineQty = Env.ZERO; - BigDecimal lineDiscount = Env.ZERO; - BigDecimal lineTaxAmt = Env.ZERO; - BigDecimal lineTotal = Env.ZERO; - BigDecimal lineListPrice = Env.ZERO; - BigDecimal lineInclUnitPrice = Env.ZERO; - BigDecimal linePriceActual = Env.ZERO; - BigDecimal lineTaxRate = Env.ZERO; - BigDecimal orderTotalQty = Env.ZERO; - BigDecimal orderGrandTotal = Env.ZERO; - BigDecimal orderTotalTax = Env.ZERO; - Boolean isTaxIncluded = order.isTaxIncluded(); - - String orderline = ""; - String orderlineFormat = ""; - - orderlineFormat = "%1$-9.2f X %2$-10.2f %3$" + (_lineWidth - (9 + 10 + 4) + ".2f"); - - BigDecimal orderTotalDiscount = Env.ZERO; - for(WebOrderLineBean wbean : orderLineList) - { - String productName = wbean.getProductName(); - String productDesc = wbean.getDescription(); - int nameLength = productName.length(); - int space = 2; - int descLength = productDesc.length(); - - if ((nameLength + descLength + space) > _lineWidth) - { - int trunc = nameLength + descLength + space - _lineWidth; - productDesc = productDesc.substring(0, descLength-trunc-1); - } - - orderline = String.format("%1$-"+ (nameLength + space) +"s %2$-" + (_lineWidth - (nameLength + space + 1))+ "s", productName, productDesc); - reportData.append(TmkPrinterConstants.FONT_SMALL) - .append(orderline); - - lineTaxAmt = wbean.getTaxAmt()==null?Env.ZERO :wbean.getTaxAmt(); - lineTaxRate = wbean.getTaxRate() == null? Env.ZERO : wbean.getTaxRate(); - lineQty = wbean.getQtyOrdered(); - lineDiscount = wbean.getDiscountPercentage()==null?Env.ZERO :wbean.getDiscountPercentage(); - lineListPrice = wbean.getUnitPrice(); - linePriceActual = wbean.getPriceActual(); - - lineTotal = linePriceActual.multiply(lineQty); - - BigDecimal taxRateMulFactor = (lineTaxRate.divide(Env.ONEHUNDRED)).add(Env.ONE).setScale(2, RoundingMode.HALF_DOWN); - BigDecimal discountMulFactor = (lineDiscount.divide(Env.ONEHUNDRED)).add(Env.ONE).setScale(2, RoundingMode.HALF_DOWN); - BigDecimal discountAmt = lineListPrice.multiply(lineDiscount).multiply(taxRateMulFactor).setScale(2, RoundingMode.HALF_DOWN); - - if (isTaxIncluded) - { - lineInclUnitPrice = linePriceActual; - orderGrandTotal = orderGrandTotal.add(lineTotal); - } - else - { - lineInclUnitPrice = linePriceActual.multiply(taxRateMulFactor).setScale(2, RoundingMode.HALF_DOWN); - orderGrandTotal = orderGrandTotal.add(lineTotal).add(lineTaxAmt); - } - - orderTotalDiscount = orderTotalDiscount.add(discountAmt); - orderTotalQty = orderTotalQty.add(lineQty); - orderTotalTax = orderTotalTax.add(lineTaxAmt); - - orderline = String.format(orderlineFormat, lineQty, lineInclUnitPrice, lineInclUnitPrice.multiply(lineQty)); - reportData.append(TmkPrinterConstants.FONT_SMALL) - .append(orderline) - .append(TmkPrinterConstants.LINE_FEED); - - reportData.append(getFormattedText(_lineBottom, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.CENTER_ALIGN)); - } - - // 2.footer - String footerFormat = "%1$6s %2$" + (_lineWidth - (6 + 1)) + ".2f"; - String orderFooter = String.format(footerFormat,"TOTAL",orderGrandTotal); - reportData.append(TmkPrinterConstants.FONT_SMALL) - .append(orderFooter) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.LINE_FEED); - - footerFormat = "%1$6s %2$-" + (_lineWidth - (10)) + ".2f"; - orderFooter = String.format(footerFormat,"Total VAT",orderTotalTax); - reportData.append(TmkPrinterConstants.FONT_SMALL) - .append(orderFooter) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.LINE_FEED); - - // add messages - // align contents to left - reportData.append(TmkPrinterConstants.LEFT_ALIGN); - - reportData.append(TmkPrinterConstants.LINE_FEED).append(TmkPrinterConstants.LINE_FEED); - - reportData.append(getFormattedText("Total Items..... "+ String.format("%1$-9.2f",orderTotalQty), TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - - reportData.append(TmkPrinterConstants.LINE_FEED).append(TmkPrinterConstants.LINE_FEED); - - /*-----------------------------------------------------------------------------------*/ - - // 4.amount tendered & refunded - - if (UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) - { - MInvoice invoice = order.getInvoices()[0]; - reportData.append(getFormattedText("DEBTORS ACCOUNT SALES " + invoice.getDocumentNo() , TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - - BigDecimal openBalance = customer.getTotalOpenBalance(); - reportData.append(getFormattedText("Balance: " + String.format("%1$10.2f", openBalance) , TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - } - else - { - BigDecimal cashAmountTendered = order.getAmountTendered()==null? Env.ZERO : order.getAmountTendered(); - - BigDecimal cashAmountRefunded = Env.ZERO; - if (MOrder.PAYMENTRULE_Cash.equals(order.getPaymentRule())) - { - cashAmountRefunded = order.getAmountRefunded() == null? cashAmountRefunded : order.getAmountRefunded(); - } - - BigDecimal cardAmountTendered = Env.ZERO; - BigDecimal chequeAmountTendered = Env.ZERO; - BigDecimal writeOffAmt = Env.ZERO; - BigDecimal orderDiscount = Env.ZERO; - BigDecimal paymentAmt = Env.ZERO; - - if (MOrder.STATUS_Completed.equalsIgnoreCase(order.getDocStatus())) - { - if(order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) - { - try - { - orderDiscount = POSManager.getFromInvoice(ctx, order.getC_Invoice_ID(), Constants.ORDER_DICOUNT, trxName); - writeOffAmt = POSManager.getFromInvoice(ctx, order.getC_Invoice_ID(), Constants.ORDER_WRITE_OFF, trxName); - cardAmountTendered = POSManager.getFromInvoice(ctx, order.getC_Invoice_ID(), Constants.ORDER_CARD_AMOUNT, trxName); - chequeAmountTendered = POSManager.getFromInvoice(ctx, order.getC_Invoice_ID(), Constants.ORDER_CHECK_AMOUNT, trxName); - paymentAmt = POSManager.getFromInvoice(ctx, order.getC_Invoice_ID(), Constants.ORDER_PAYMENT, trxName); - - } - catch (OperationException e) - { - throw new FormattingException("Cannot get payment",e); - } - } - } - - boolean discountOnOrderLine = false; - - if (orderTotalDiscount.compareTo(Env.ZERO) == 1) - { - discountOnOrderLine = true; - } - orderTotalDiscount = orderTotalDiscount.add(orderDiscount); - - if (orderTotalDiscount.compareTo(Env.ZERO)==1 && !discountOnOrderLine) - { - String discountAmtStr = String.format("Discount Amt :%1$10.2f", orderTotalDiscount); - reportData.append(getFormattedText(discountAmtStr, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)).append(TmkPrinterConstants.LINE_FEED); - } - if (writeOffAmt.compareTo(Env.ZERO)==1 && MOrder.PAYMENTRULE_Cash.equals(order.getPaymentRule())) - { - String writeOff = String.format("Write Off Amt :%1$10.2f", writeOffAmt); - reportData.append(getFormattedText(writeOff, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); - } - if (paymentAmt.compareTo(Env.ZERO)==1) - { - String actualPayment = String.format("Payment Amt :%1$10.2f", paymentAmt); - reportData.append(getFormattedText(actualPayment, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); - } - - String amountTendered = String.format("Cash Tendered :%1$10.2f", cashAmountTendered); - String amountRefunded = String.format("Cash refunded :%1$10.2f", cashAmountRefunded); - String cardTendered = String.format("Card Tendered :%1$10.2f", cardAmountTendered); - String chequeTendered = String.format("Cheque Tendered:%1$10.2f", chequeAmountTendered); - - if (MOrder.PAYMENTRULE_Cash.equals(order.getPaymentRule()) || MOrder.PAYMENTRULE_Mixed.equals(order.getPaymentRule())) - { - if(cashAmountTendered.doubleValue() > 0.0d) - { - reportData.append(getFormattedText(amountTendered, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); - } - if (cashAmountRefunded.compareTo(Env.ZERO) == 1) - { - reportData.append(getFormattedText(amountRefunded, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); - } - } - if (MOrder.PAYMENTRULE_CreditCard.equals(order.getPaymentRule()) || MOrder.PAYMENTRULE_Mixed.equals(order.getPaymentRule())) - { - if(cardAmountTendered.doubleValue() > 0.0d) - { - reportData.append(getFormattedText(cardTendered, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); - } - } - if (MOrder.PAYMENTRULE_Check.equals(order.getPaymentRule()) || MOrder.PAYMENTRULE_Mixed.equals(order.getPaymentRule())) - { - if(chequeAmountTendered.doubleValue() > 0.0d) - { - reportData.append(getFormattedText(chequeTendered, TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN)); - } - } - } - - // show if credit sales - - if ( UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) - { - reportData.append(TmkPrinterConstants.LINE_FEED).append(TmkPrinterConstants.LINE_FEED) - .append(getFormattedText("------------------------------" , TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.CENTER_ALIGN)); - - reportData.append(getFormattedText("SIGNATURE OF BUYER" , TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.CENTER_ALIGN)); - - } - - reportData.append(TmkPrinterConstants.LINE_FEED); - - if( order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType()) ) - { - /*reportData.append(getFormattedText("*** Thank you ***", TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - reportData.append(TmkPrinterConstants.LINE_FEED) - .append(getFormattedText("*Goods once sold cannot be returned.", TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - reportData.append(TmkPrinterConstants.LINE_FEED);*/ - reportData.append(TmkPrinterConstants.LINE_FEED); - - if(footerMsg != null && footerMsg.length() != 0) - { - if(footerMsg.length() > 40) // 40 is the max no of chars that can fit in a single line - { - String temp = ""; - String splittedFooterMsg = ""; - - while(footerMsg.length() > 40) - { - temp = footerMsg.substring(0, 39); - - if(!(temp.endsWith(" "))) - { - splittedFooterMsg = temp.substring(0, temp.lastIndexOf(" ")); - - } - else - { - splittedFooterMsg = temp; - } - - footerMsg = footerMsg.substring(temp.lastIndexOf(" ") +1); - reportData.append(getFormattedText(splittedFooterMsg, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - } - - reportData.append(getFormattedText(footerMsg, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - } - else //footerMsg length < 40 - { - reportData.append(getFormattedText(footerMsg, TmkPrinterConstants.FONT_SMALL, TmkPrinterConstants.LEFT_ALIGN)); - } - } - } - - reportData.append(TmkPrinterConstants.PAPER_CUT).append(TmkPrinterConstants.LINE_FEED); - - return reportData.toString(); - - } - - public String format1(Properties ctx, int recordId, Object... args) throws Exception - { - StringBuffer reportData = new StringBuffer(); - - String text1 = getFormattedText("L", TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.LEFT_ALIGN); - String text2 = getFormattedText("R", TmkPrinterConstants.FONT_NORMAL, TmkPrinterConstants.RIGHT_ALIGN); - - reportData.append(text1); - reportData.append(text2); - - reportData.append(text1); - reportData.append("\r"); - reportData.append(text2); - reportData.append("\n"); - - return reportData.toString(); - } - - private int getLineWidth(String font) - { - if(TmkPrinterConstants.FONT_DOUBLE.equals(font)) - { - return 16; - } - - if(TmkPrinterConstants.FONT_NORMAL.equals(font)) - { - return 33; - } - - if(TmkPrinterConstants.FONT_SMALL.equals(font)) - { - return 40; - } - - return _lineWidth; - } - - public String getFormattedText(String text, String font, String alignment) - { - return getFormattedText(text, font, alignment, true); - } - - public String getFormattedText(String text, String font, String alignment, boolean addLineFeed) - { - int charPerLine = getLineWidth(font); - String formattedText = ""; - - if (TmkPrinterConstants.CENTER_ALIGN.equals(alignment)) - { - formattedText = font + TmkPrinterConstants.CENTER_ALIGN + text; - - if(addLineFeed) - { - formattedText = formattedText + TmkPrinterConstants.LINE_FEED; - } - return formattedText; - } - - if (TmkPrinterConstants.LEFT_ALIGN.equals(alignment)) - { - formattedText = font + String.format("%1$-" + charPerLine + "s", text); - - if(addLineFeed) - { - formattedText = formattedText + TmkPrinterConstants.LINE_FEED; - } - return formattedText; - } - - if (TmkPrinterConstants.RIGHT_ALIGN.equals(alignment)) - { - formattedText = font + String.format("%1$" + charPerLine + "s", text); - - if(addLineFeed) - { - formattedText = formattedText + TmkPrinterConstants.LINE_FEED; - } - return formattedText; - } - - return text; - } - - - - -} diff --git a/posterita/posterita/src/main/org/posterita/util/OrderFormatter.java b/posterita/posterita/src/main/org/posterita/util/OrderFormatter.java deleted file mode 100644 index 81d0f90e5a..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/OrderFormatter.java +++ /dev/null @@ -1,524 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Sep 26, 2006 - */ - - -package org.posterita.util; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.Properties; -import java.util.ResourceBundle; - -import org.compiere.model.MBPartner; -import org.compiere.model.MLocation; -import org.compiere.model.MOrder; -import org.compiere.model.MOrg; -import org.compiere.model.MPayment; -import org.compiere.model.MUser; - -import org.posterita.Constants; -import org.posterita.beans.BPartnerBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.WebOrderLineBean; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.core.ContextId; -import org.posterita.exceptions.FormattingException; -import org.posterita.exceptions.OperationException; -import org.posterita.formatter.Formatter; -import org.posterita.lib.UdiConstants; -import org.posterita.order.UDIOrderTypes; - -import org.posterita.util.TmkPrinterConstants; - - -public class OrderFormatter extends Formatter -{ - private boolean isVatIncluded = true; - - @Override - public Object format(Object target) throws FormattingException - { - ResourceBundle messageResource = ResourceBundle.getBundle("MessageResources"); - - String vatRegNumber = "VAT Reg No:" + messageResource.getString("receipt.VATRegNo"); - String companyName1 = messageResource.getString("receipt.company.name1"); - String companyName2 = messageResource.getString("receipt.company.name2"); - String companyPhone = messageResource.getString("receipt.company.phone"); - String companyAddress = messageResource.getString("receipt.company.address"); - - ContextId ctxId = (ContextId) target; - - Properties ctx = ctxId.getCtx(); - int id = ctxId.getId(); - - //setting receipt header - try - { - MOrg myorg = OrganisationManager.getMyOrg(ctx); - int bpartnerId = myorg.getLinkedC_BPartner_ID(null); - - - MBPartner bpartner = BPartnerManager.loadBPartner(ctx,bpartnerId,null); - BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartnerId, null); - - vatRegNumber = bpartner.getTaxID(); - companyName1 = bean.getPartnerName(); - companyName2 = bean.getName2(); - companyPhone = bean.getPhone(); - - String add = bean.getAddress1(); - add = (add==null) ? "" : add; - - companyAddress = add; - - add = bean.getAddress2(); - - if(add!=null){ - companyAddress = companyAddress + " " + add; - } - - add = bean.getCity(); - add = (add==null) ? "" : add; - - companyAddress = companyAddress + ", " + add; - - - } catch (OperationException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - String title = null; - String customerName = null; - String salesRep = null; - String docStatus = null; - String payment = null; - String customerAddress = null; - String orderType=null; - //String dateOrdered = null; - String refNo = null; - - //load the order - MOrder order = new MOrder(ctx, id, null); - - String paymentRule = null; - - //setting payment - paymentRule = order.getPaymentRule(); - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) - { - payment = Constants.PAYMENT_RULE_CASH; - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) - { - payment = Constants.PAYMENT_RULE_CARD; - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) - { - payment = Constants.PAYMENT_RULE_CHEQUE; - } - - if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) - { - payment = Constants.PAYMENT_RULE_MIXED; - } - //setting ref no - refNo = order.getDocumentNo(); - - //getting orgInfo - MOrg org = new MOrg(ctx,order.getAD_Org_ID(),null); - int location_id = org.getInfo().getC_Location_ID(); - MLocation location = new MLocation(ctx,location_id,null); - - // orgName = org.getName(); - - String address1 = (location.getAddress1() == null)? " " : location.getAddress1(); - String address2 = (location.getAddress2() == null)? " " : location.getAddress2(); - // orgAddress = (address1 + " " + address2).trim(); - - //getting order type - orderType = order.getOrderType(); - - //getting orderInfo - docStatus = order.getDocStatusName(); - - - //getting salesrep - int saleRep_id = order.getSalesRep_ID(); - MUser user = new MUser(ctx,saleRep_id,null); - salesRep = user.getName(); - - //getting customer info - int bpartner_id = order.getBill_BPartner_ID(); - BPartnerBean bean; - try - { - bean = BPartnerManager.getBpartner(ctx,bpartner_id,null); - } - catch(Exception e) - { - throw new FormattingException("Formatting Error", e); - } - - - String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); - String name2 = (bean.getName2() == null)? " " : bean.getName2(); - customerName = (name1 + " " + name2).trim(); - - address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); - address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); - customerAddress = (address1 + " " + address2).trim(); - - - ///////////////////////////////drawing the order//////////////////////////////// - StringBuffer reportData = new StringBuffer(TmkPrinterConstants.LOGO1); - //adding header - reportData.append(TmkPrinterConstants.SMALL_FONT) - .append(TmkPrinterConstants.H_FULL_LINE_TOP) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(TmkPrinterConstants.LINE_FEED); - - if(companyName1!=null) - reportData.append(TmkPrinterConstants.FONT_DOUBLE) - .append(companyName1) - .append(TmkPrinterConstants.LINE_FEED); - - if(companyName2!=null) - reportData.append(TmkPrinterConstants.CENTER_ALIGN) - .append(TmkPrinterConstants.BIG_FONT) - .append("(" + companyName2 + ")") - .append(TmkPrinterConstants.LINE_FEED); - - if(companyAddress!=null) - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append(companyAddress) - .append(TmkPrinterConstants.LINE_FEED); - - if(companyPhone!=null) - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append("Tel:" + companyPhone) - .append(TmkPrinterConstants.LINE_FEED); - - if(vatRegNumber!=null) - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append("VAT Reg No:" + vatRegNumber) - .append(TmkPrinterConstants.LINE_FEED); - - reportData.append(TmkPrinterConstants.SMALL_FONT) - .append(TmkPrinterConstants.H_FULL_LINE_TOP) - .append(TmkPrinterConstants.LINE_FEED); - - //adding title - title = orderType; - reportData.append(TmkPrinterConstants.BIG_FONT) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(title) - .append(TmkPrinterConstants.LINE_FEED); - - //setting small font - reportData.append(TmkPrinterConstants.SMALL_FONT); - reportData.append(TmkPrinterConstants.LEFT_ALIGN); - - //adding customer name - customerName = String.format("%1$-30s",customerName); - reportData.append(customerName); - - //adding sales rep - salesRep = "Sales Rep:" + salesRep; - salesRep = String.format("%1$30s",salesRep); - reportData.append(salesRep) - .append(TmkPrinterConstants.LINE_FEED); - - //adding customer address - customerAddress = String.format("%1$-60s",customerAddress); - reportData.append(customerAddress) - .append(TmkPrinterConstants.LINE_FEED); - - //adding status - docStatus = "Status:" + docStatus; - docStatus = String.format("%1$-60s",docStatus); - reportData.append(docStatus) - .append(TmkPrinterConstants.LINE_FEED); - - //adding payment - payment = "Payment:" + payment; - payment = String.format("%1$-60s",payment); - reportData.append(payment) - .append(TmkPrinterConstants.LINE_FEED); - - //adding reference no - refNo = "Ref No:" + refNo; - refNo = String.format("%1$-60s",refNo); - reportData.append(refNo) - .append(TmkPrinterConstants.LINE_FEED); - - //adding date - Calendar c = Calendar.getInstance(); - c.setTime(new Date(order.getCreated().getTime())); - String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); - date = String.format("%1$-60s",date); - reportData.append(date) - .append(TmkPrinterConstants.LINE_FEED); - - //adding orderlines - //1.header - reportData.append(TmkPrinterConstants.H_FULL_LINE_TOP).append("\n"); - - String headerFormat = "" + - "%1$-30s" + - "%2$7s" + - "%3$5s" + - "%4$8s" + - "%5$10s"; - - String header = String.format(headerFormat,"Name","Unit","Qty","Dis","Total"); - reportData.append(header).append("\n"); - - reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) - .append(TmkPrinterConstants.LINE_FEED); - - //2.body - ArrayList orderLineList; - try - { - orderLineList = POSManager.populateOrderLines(ctx,order); - } - catch(Exception e) - { - throw new FormattingException("Formatting Error", e); - } - - String name = null; - int qty; - BigDecimal discount = null; - BigDecimal taxAmt = null; - BigDecimal total; - BigDecimal unitPrice; - - int totalQty = 0; - double grandTotal = 0.0d; - double totalTax = 0.0d; - String orderline = ""; - - String orderlineFormat = "" + - "%1$-30s" + //1.product name OR description - "%2$7.2f" + //2.unit price - "%3$5d" + //3.quantity - "%4$8.2f" + //4.discount amount - "%5$10.2f"; //5.total price - - for(WebOrderLineBean wbean : orderLineList) - { - taxAmt = wbean.getTaxAmt(); - name = wbean.getDescription(); - qty = wbean.getQtyOrdered().intValue(); - discount = wbean.getDiscountPercentage(); - total = wbean.getLineTotalAmt(); - unitPrice = wbean.getUnitPrice(); - - if(isVatIncluded) - { - unitPrice = total.divide(new BigDecimal(qty)); - } - - - discount = (discount==null)? new BigDecimal(0.0) : discount; - taxAmt = (taxAmt==null)? new BigDecimal(0.0) : taxAmt; - - double discountAmt = 0.0; - discountAmt = (total.doubleValue() * 100.0)/(100.0 - discount.doubleValue()) - total.doubleValue(); - - totalQty += qty; - grandTotal += total.doubleValue(); - totalTax += taxAmt.doubleValue(); - - if(taxAmt.intValue() == 0) - { - name = name + "*"; - } - - orderline = String.format(orderlineFormat,name,unitPrice,qty,discountAmt,total); - reportData.append(orderline) - .append(TmkPrinterConstants.LINE_FEED); - } - - //3.footer - reportData.append(TmkPrinterConstants.H_FULL_LINE_BOTTOM) - .append(TmkPrinterConstants.LINE_FEED); - - String footerFormat = "" + - "%1$-37s" + - "%2$5d" + - "%3$8s" + - "%4$10.2f"; - - String footer = String.format(footerFormat,"Grand Total",totalQty,"Rs",grandTotal); - reportData.append(footer) - .append(TmkPrinterConstants.LINE_FEED); - - reportData.append(TmkPrinterConstants.H_FULL_LINE_TOP) - .append(TmkPrinterConstants.LINE_FEED); - - - //4.amount tendered & refunded - BigDecimal cashAmountTendered = order.getAmountTendered(); - if(cashAmountTendered == null) - { - cashAmountTendered = new BigDecimal(0.0); - } - - BigDecimal cashAmountRefunded = order.getAmountRefunded(); - if(cashAmountRefunded == null) - { - cashAmountRefunded = new BigDecimal(0.0); - } - - BigDecimal cardAmountTendered = null; - BigDecimal chequeAmountTendered = null; - - OrderLineBean orderLineBean = null; - if(ctxId.getBean() != null) - { - orderLineBean = (OrderLineBean) ctxId.getBean(); - Double cardAmt = orderLineBean.getPaymentByCard(); - Double chequeAmt = orderLineBean.getPaymentByChq(); - - if(cardAmt == null) - { - cardAmountTendered = new BigDecimal(0.0d); - } - else - { - cardAmountTendered = new BigDecimal(cardAmt.doubleValue()); - } - - if(chequeAmt == null) - { - chequeAmountTendered = new BigDecimal(0.0d); - } - else - { - chequeAmountTendered = new BigDecimal(chequeAmt.doubleValue()); - } - } - else - { - - if(order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) - { - try - { - cardAmountTendered = POSManager.getPayment(ctx, order.get_ID(),MPayment.TENDERTYPE_CreditCard,null); - chequeAmountTendered = POSManager.getPayment(ctx, order.get_ID(),MPayment.TENDERTYPE_Check,null); - } - catch (OperationException e) - { - throw new FormattingException("Cannot get payment",e); - } - } - else - { - cardAmountTendered = new BigDecimal(0.0d); - chequeAmountTendered = new BigDecimal(0.0d); - } - - } - - String amountTendered = String.format("%1$45s%2$4s:%3$10.2f","Cash Tendered","Rs",cashAmountTendered); - String amountRefunded = String.format("%1$45s%2$4s:%3$10.2f","Cash Refunded","Rs",cashAmountRefunded); - - String seperator = String.format("%1$45s%2$15s","","------------"); - - String cardTendered = String.format("%1$45s%2$4s:%3$10.2f","Card Tendered","Rs",cardAmountTendered); - String chequeTendered = String.format("%1$45s%2$4s:%3$10.2f","Cheque Tendered","Rs",chequeAmountTendered); - - if(cashAmountTendered.doubleValue() > 0.0d) - { - reportData.append(amountTendered).append(TmkPrinterConstants.LINE_FEED); - } - - if(cardAmountTendered.doubleValue() > 0.0d) - { - reportData.append(cardTendered).append(TmkPrinterConstants.LINE_FEED); - } - - if(chequeAmountTendered.doubleValue() > 0.0d) - { - reportData.append(chequeTendered).append(TmkPrinterConstants.LINE_FEED); - } - - if(cashAmountTendered.doubleValue() > 0.0d) - { - reportData.append(seperator).append(TmkPrinterConstants.LINE_FEED); - reportData.append(amountRefunded).append(TmkPrinterConstants.LINE_FEED); - } - - - String totalVAT = String.format("%1$.2f",totalTax); - String vat = String.format("%1$-60s","Total VAT:Rs"+totalVAT); - reportData.append(vat) - .append(TmkPrinterConstants.LINE_FEED); - - String noVAT = String.format("%1$-60s","* NO VAT"); - - //barcode - String barcode = ((char)0x1d ) + "H" + (char)2 + ((char)0x1d ) + "k" + (char)4 + order.getDocumentNo() + (char)0; - String barcodeDim = ((char)0x1d) + "h" + (char)50 + ((char)0x1d) + "w" + (char)3; - - reportData.append(noVAT) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(barcodeDim) - .append(barcode) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.FONT_NORMAL) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append("*** Thank you ***") - .append(TmkPrinterConstants.LINE_FEED); - - if( order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType()) ) - { - reportData.append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(TmkPrinterConstants.FONT_SMALL) - .append("*Goods once sold cannot be returned."); - } - - reportData.append(TmkPrinterConstants.PAPER_CUT) - .append(TmkPrinterConstants.LINE_FEED); - - - return reportData.toString(); - } - - @Override - public Object unformat(Object target) { - throw new RuntimeException("Method not implemented"); - } -} diff --git a/posterita/posterita/src/main/org/posterita/util/PathInfo.java b/posterita/posterita/src/main/org/posterita/util/PathInfo.java deleted file mode 100644 index 8905bd31a4..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/PathInfo.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -* Created on Mar 15, 2006 by ashley -* -*/ - -package org.posterita.util; - -import javax.servlet.Servlet; -import javax.servlet.ServletContext; - -public class PathInfo -{ - - public static String PROJECT_HOME = ""; - public static final String FILE_SEPARATOR = System.getProperty("file.separator"); - static - { - PROJECT_HOME = System.getProperty("user.dir"); - } - - public static void setPathInfo(Servlet servlet) - { - ServletContext serCtx = servlet.getServletConfig().getServletContext(); - - try - { - PROJECT_HOME = serCtx.getRealPath("") + FILE_SEPARATOR; - } - catch(Exception ex) - {} - - } -} diff --git a/posterita/posterita/src/main/org/posterita/util/PaymentFormatter.java b/posterita/posterita/src/main/org/posterita/util/PaymentFormatter.java deleted file mode 100644 index ab3cebf0bb..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/PaymentFormatter.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Sep 26, 2006 - */ - - -package org.posterita.util; - -import org.posterita.formatter.Formatter; - - -public class PaymentFormatter extends Formatter -{ - - @Override - public Object format(Object target) - { - return null; - } - - @Override - public Object unformat(Object target) - { - return null; - } - -} diff --git a/posterita/posterita/src/main/org/posterita/util/PoManager.java b/posterita/posterita/src/main/org/posterita/util/PoManager.java deleted file mode 100644 index fba4c3ab1a..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/PoManager.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * - * Copyright (c) 2007 Posterita. All Rights Reserved. - * - * This software is the confidential and proprietary information of - * Posterita. ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered into - * with Posterita. - * - * POSTERITA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE - * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT - * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR - * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Posterita SHALL NOT - * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, - * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - * May 22, 2007 11:46:27 AM by praveen - * - */ - -package org.posterita.util; - -import org.compiere.model.PO; -import org.compiere.model.X_C_Order; -import org.compiere.process.DocAction; -import org.compiere.util.CLogger; -import org.compiere.util.ValueNamePair; -import org.posterita.businesslogic.POSTerminalManager; -import org.posterita.exceptions.OperationException; -import org.posterita.exceptions.TerminalLockedException; - -public class PoManager -{ - public static void save(PO po) throws OperationException - { - boolean saved = po.save(); - if(! saved ) - { - handleError(po); - } - } - - private static void validatePO(PO po) throws OperationException - { - if (po instanceof X_C_Order) - { - X_C_Order order = (X_C_Order)po; - int terminalId = order.getC_POS_ID(); - if (terminalId > 0 && POSTerminalManager.isTerminalLocked(po.getCtx(), terminalId)) - { - throw new TerminalLockedException("Terminal is locked"); - } - } - } - - public static void save(PO po, String trxName) throws OperationException - { - validatePO(po); - boolean saved = po.save(trxName); - if(!saved) - { - handleError(po); - } - } - - private static void handleError(PO po) throws OperationException - { - Exception ex = CLogger.retrieveException(); - ValueNamePair error = CLogger.retrieveError(); - String msg = null; - if(error != null) - { - msg = error.getName(); - } - - if(ex != null) - { - throw new OperationException("Cannot save PO object. " + po.getClass().getName() + " Cause: " + ex.getMessage()); - } - - if(msg != null) - { - throw new OperationException("Cannot save PO object. " + po.getClass().getName() + " Cause: " + msg); - } - - throw new OperationException("Cannot save PO object. " + po.getClass().getName()); - } - - public static void processIt(PO po, String processAction) throws OperationException - { - validatePO(po); - boolean processed = false; - try - { - if(po instanceof DocAction) - { - DocAction docPo = (DocAction)po; - processed = docPo.processIt(processAction); - save(po); - - if (!processed) - { - throw new OperationException("Cannot process " + po.getClass().getName() + " to: " + processAction + " "+ docPo.getProcessMsg()); - } - } - } - catch (OperationException ex) // Should not wrap Operation exception instance - { - throw ex; - } - catch (Exception ex) - { - throw new OperationException(ex.getMessage(), ex); - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/util/RegenerateModels.java b/posterita/posterita/src/main/org/posterita/util/RegenerateModels.java deleted file mode 100644 index b0e4413797..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/RegenerateModels.java +++ /dev/null @@ -1,119 +0,0 @@ -/* -* -* Copyright (c) 2007 Posterita Ltd. All Rights Reserved. -* -* This software is the confidential and proprietary information of -* Tamak ICT Ltd. ("Confidential Information"). You shall not -* disclose such Confidential Information and shall use it only in -* accordance with the terms of the license agreement you entered into -* with Tamak ICT. -* -* Tamak ICT MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE -* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT -* NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR -* A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Tamak ICT SHALL NOT -* BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, -* MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. -* -* Created on Feb 6, 2007 by ashley -* -*/ - -/** - @author ashley - */ - -package org.posterita.util; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.logging.Level; - -import org.adempiere.util.ModelClassGenerator; -import org.adempiere.util.ModelInterfaceGenerator; -import org.compiere.Adempiere; -import org.compiere.util.CLogMgt; -import org.compiere.util.DB; - -public class RegenerateModels -{ - - private static final ArrayList tables = new ArrayList(); - private static final String PACKAGE_NAME = "org.compiere.model"; - private static final String DIRECTORY = PathInfo.PROJECT_HOME + "/posterita/src/main/org/compiere/model/"; - - static - { - tables.add("M_PriceList"); - /*tables.add("U_RoleMenu"); - tables.add("U_WEB_PROPERTIES"); - tables.add("U_BlackListCheque"); - tables.add("C_ORDER"); - tables.add("AD_USER"); - tables.add("AD_ROLE"); - tables.add("M_PRODUCT"); - tables.add("AD_PRINTFORMAT");*/ - } - - public static void main(String args[]) throws Exception - { - Adempiere.startupEnvironment(true); - CLogMgt.setLevel(Level.FINE); - - StringBuffer sqlStmt = new StringBuffer(); - - StringBuffer tableNames = new StringBuffer(); - - for (String tblName : tables) - { - tableNames.append(", '").append(tblName).append("'"); - } - - if (tableNames.length() > 0 && tables.size() > 0) - { - String tableInStmt = tableNames.substring(1); - tableInStmt = tableInStmt.toUpperCase(); - - String entityType = "'U','A','D','EXT'"; - sqlStmt.append("SELECT AD_Table_ID from AD_Table where "); - sqlStmt.append(" (TableName IN ('RV_WarehousePrice','RV_BPartner')"); - sqlStmt.append(" OR IsView='N')"); - sqlStmt.append(" AND Upper(TableName) in (").append(tableInStmt).append(") and"); - sqlStmt.append(" EntityType in (").append(entityType).append(")"); - sqlStmt.append(" ORDER BY TableName"); - - PreparedStatement pstmt = null; - try - { - pstmt = DB.prepareStatement(sqlStmt.toString(), null); - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) - { - int tableId = rs.getInt(1); - new ModelInterfaceGenerator(tableId, DIRECTORY, PACKAGE_NAME); - new ModelClassGenerator(tableId, DIRECTORY, PACKAGE_NAME); - } - rs.close(); - } - catch (SQLException ex) - { - throw ex; - } - finally - { - if (pstmt != null) - { - try - { - pstmt.close(); - } - catch (Exception ex){} - } - } - - } - - } -} diff --git a/posterita/posterita/src/main/org/posterita/util/TMKInvoicePrintFormatter.java b/posterita/posterita/src/main/org/posterita/util/TMKInvoicePrintFormatter.java deleted file mode 100644 index a86c667010..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/TMKInvoicePrintFormatter.java +++ /dev/null @@ -1,439 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 23, 2006 - */ - - -package org.posterita.util; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MDocType; -import org.compiere.model.MInvoice; -import org.compiere.model.MLocation; -import org.compiere.model.MOrder; -import org.compiere.model.MOrg; -import org.compiere.model.MUser; - -import org.posterita.Constants; -import org.posterita.beans.BPartnerBean; -import org.posterita.beans.WebOrderLineBean; -import org.posterita.businesslogic.InvoiceManager; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.exceptions.FormattingException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; - - - -public class TMKInvoicePrintFormatter extends AbstractPrintFormatter -{ - public TMKInvoicePrintFormatter(String args) - { - super(args); - } - - public String format(Properties ctx, int recordId, Object... args) throws Exception - { - //----------------------------------------------------------------------------------------------------------------------------- - - //set some default values - String vatRegNumber = ""; - String companyName1 = ""; - String companyName2 = ""; - String companyPhone = ""; - String companyAddress = ""; - - //setting receipt header - try - { - MOrg myorg = OrganisationManager.getMyOrg(ctx); - int bpartnerId = myorg.getLinkedC_BPartner_ID(null); - - - MBPartner bpartner = BPartnerManager.loadBPartner(ctx,bpartnerId,null); - BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartnerId, null); - - vatRegNumber = bpartner.getTaxID(); - companyName1 = bean.getPartnerName(); - companyName2 = bean.getName2(); - companyPhone = bean.getPhone(); - - String add = bean.getAddress1(); - add = (add==null) ? "" : add; - - companyAddress = add; - - add = bean.getAddress2(); - - if(add!=null){ - companyAddress = companyAddress + " " + add; - } - - add = bean.getCity(); - add = (add==null) ? "" : add; - - companyAddress = companyAddress + ", " + add; - - - } catch (OperationException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - String title = null; - String customerName = null; - String salesRep = null; - String docStatus = null; - String payment = null; - String customerAddress = null; - String orderType=null; - //String dateOrdered = null; - String refNo = null; - - //load the order - MInvoice invoice = new MInvoice(ctx, recordId, null); - - String paymentRule = null; - - //setting payment - paymentRule = invoice.getPaymentRule(); - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) - { - payment = Constants.PAYMENT_RULE_CASH; - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) - { - payment = Constants.PAYMENT_RULE_CARD; - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) - { - payment = Constants.PAYMENT_RULE_CHEQUE; - } - - if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) - { - payment = Constants.PAYMENT_RULE_MIXED; - } - //setting ref no - refNo = invoice.getDocumentNo(); - - //getting orgInfo - MOrg org = new MOrg(ctx,invoice.getAD_Org_ID(),null); - int location_id = org.getInfo().getC_Location_ID(); - MLocation location = new MLocation(ctx,location_id,null); - - - String address1 = (location.getAddress1() == null)? " " : location.getAddress1(); - String address2 = (location.getAddress2() == null)? " " : location.getAddress2(); - - //getting order type - int docTypeId = invoice.getC_DocType_ID(); - MDocType docType = new MDocType(ctx, docTypeId, null); - - orderType = docType.getName(); - - //getting orderInfo - docStatus = invoice.getDocStatusName(); - - - //getting salesrep - int saleRep_id = invoice.getSalesRep_ID(); - MUser user = new MUser(ctx,saleRep_id,null); - salesRep = user.getName(); - - //getting customer info - int bpartner_id = invoice.getC_BPartner_ID(); - BPartnerBean bean; - try - { - bean = BPartnerManager.getBpartner(ctx,bpartner_id,null); - } - catch(Exception e) - { - throw new FormattingException("Formatting",e); - } - - - String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); - String name2 = (bean.getName2() == null)? " " : bean.getName2(); - customerName = (name1 + " " + name2).trim(); - - address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); - address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); - customerAddress = (address1 + " " + address2).trim(); - - - ///////////////////////////////drawing the order//////////////////////////////// - StringBuffer reportData = new StringBuffer();//TmkPrinterConstants.LOGO1); - - if(_showLogo) - { - reportData.append(TmkPrinterConstants.LOGO1); - } - - //adding header - reportData.append(TmkPrinterConstants.FONT_SMALL) - .append(_lineTop) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(TmkPrinterConstants.LINE_FEED); - - if(companyName1!=null) - reportData.append(TmkPrinterConstants.FONT_DOUBLE) - .append(companyName1) - .append(TmkPrinterConstants.LINE_FEED); - - if(companyName2.trim().length() > 0) - if(companyName2!=null) - reportData.append(TmkPrinterConstants.CENTER_ALIGN) - .append(TmkPrinterConstants.BIG_FONT) - .append("(" + companyName2 + ")") - .append(TmkPrinterConstants.LINE_FEED); - - if(companyAddress!=null) - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append(companyAddress) - .append(TmkPrinterConstants.LINE_FEED); - - if(companyPhone!=null) - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append("Tel:" + companyPhone) - .append(TmkPrinterConstants.LINE_FEED); - - if(vatRegNumber!=null) - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append("VAT Reg No:" + vatRegNumber) - .append(TmkPrinterConstants.LINE_FEED); - - reportData.append(TmkPrinterConstants.FONT_SMALL) - .append(_lineTop) - .append(TmkPrinterConstants.LINE_FEED); - - //adding title - title = "Invoice"; - reportData.append(TmkPrinterConstants.BIG_FONT) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(title) - .append(TmkPrinterConstants.LINE_FEED); - - //setting small font - reportData.append(TmkPrinterConstants.FONT_SMALL); - reportData.append(TmkPrinterConstants.LEFT_ALIGN); - - //adding customer name - customerName = String.format("%1$-" + _halfLineWidth + "s", customerName); - reportData.append(customerName); - - //adding sales rep - salesRep = "Sales Rep:" + salesRep; - salesRep = String.format("%1$"+ _halfLineWidth + "s", salesRep); - reportData.append(salesRep) - .append(TmkPrinterConstants.LINE_FEED); - - //adding customer address - customerAddress = String.format("%1$-" + _lineWidth + "s",customerAddress); - reportData.append(customerAddress) - .append(TmkPrinterConstants.LINE_FEED); - - //adding status - docStatus = "Status:" + docStatus; - docStatus = String.format("%1$-" + _lineWidth + "s",docStatus); - reportData.append(docStatus) - .append(TmkPrinterConstants.LINE_FEED); - - //adding payment - payment = "Payment:" + payment; - payment = String.format("%1$-" + _lineWidth + "s",payment); - reportData.append(payment) - .append(TmkPrinterConstants.LINE_FEED); - - //adding reference no - refNo = "Ref No:" + refNo; - refNo = String.format("%1$-" + _lineWidth + "s",refNo); - reportData.append(refNo) - .append(TmkPrinterConstants.LINE_FEED); - - //adding date - Calendar c = Calendar.getInstance(); - c.setTime(new Date(invoice.getCreated().getTime())); - String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); - date = String.format("%1$-" + _lineWidth + "s",date); - reportData.append(date) - .append(TmkPrinterConstants.LINE_FEED); - - //adding orderlines - //1.header - reportData.append(_lineTop).append("\n"); - - String headerFormat = "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + - "%2$7s" + - "%3$5s" + - "%4$13s"; - - String header = String.format(headerFormat,"Name","Unit","Qty","Total"); - reportData.append(header).append("\n"); - - reportData.append(_lineBottom) - .append(TmkPrinterConstants.LINE_FEED); - - //2.body - ArrayList invoiceLineList; - try - { - invoiceLineList = InvoiceManager.populateInvoiceLines(ctx,invoice,false); - } - catch(Exception e) - { - throw new FormattingException("Formatting Error", e); - } - - String name = null; - int qty; - - BigDecimal taxAmt = null; - BigDecimal total; - BigDecimal unitPrice; - - int totalQty = 0; - double grandTotal = 0.0d; - double totalTax = 0.0d; - String orderline = ""; - - String orderlineFormat = "" + - "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + //1.product name OR description - "%2$7.2f" + //2.unit price - "%3$5d" + //3.quantity - "%4$13.2f"; //5.total price - - for(WebOrderLineBean wbean : invoiceLineList) - { - taxAmt = wbean.getTaxAmt(); - name = wbean.getDescription(); - qty = wbean.getQtyOrdered().intValue(); - total = wbean.getLineTotalAmt(); - unitPrice = wbean.getUnitPrice(); - - if( _priceWithVat ) - { - unitPrice = total.divide(wbean.getQtyOrdered()); - } - - if(name.length() > 10) - { - if(name.length() > 40) - name = name.substring(0,39); - - orderline = String.format("%1$-" + _lineWidth + "s", name); - reportData.append(orderline) - .append(TmkPrinterConstants.LINE_FEED); - - name = ""; - - } - - taxAmt = (taxAmt==null)? new BigDecimal(0.0) : taxAmt; - - totalQty += qty; - grandTotal += total.doubleValue(); - totalTax += taxAmt.doubleValue(); - - if(taxAmt.intValue() == 0) - { - name = name + "*"; - } - - orderline = String.format(orderlineFormat,name,unitPrice,qty,total); - reportData.append(orderline) - .append(TmkPrinterConstants.LINE_FEED); - } - - //3.footer - reportData.append(_lineBottom) - .append(TmkPrinterConstants.LINE_FEED); - - String footerFormat = "" + - "%1$-" + (_lineWidth - ( 5 + 3 + 10 )) + "s" + - "%2$5d" + - "%3$3s" + - "%4$10.2f"; - - String footer = String.format(footerFormat,"Grand Total",totalQty,"Rs",grandTotal); - reportData.append(footer) - .append(TmkPrinterConstants.LINE_FEED); - - reportData.append(_lineTop) - .append(TmkPrinterConstants.LINE_FEED); - - - String totalVAT = String.format("%1$.2f",totalTax); - String vat = String.format("%1$-" + _lineWidth + "s","Total VAT:Rs"+totalVAT); - reportData.append(vat) - .append(TmkPrinterConstants.LINE_FEED); - - String noVAT = String.format("%1$-" + _lineWidth + "s","* NO VAT"); - reportData.append(noVAT) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.LINE_FEED); - - if(_showBarcode) - { - String barcode = ((char)0x1d ) + "H" + (char)2 + ((char)0x1d ) + "k" + (char)4 + invoice.getDocumentNo() + (char)0; - String barcodeDim = ((char)0x1d) + "h" + (char)50 + ((char)0x1d) + "w" + (char)3; - reportData.append(TmkPrinterConstants.CENTER_ALIGN) - .append(barcodeDim) - .append(barcode) - .append(TmkPrinterConstants.LINE_FEED); - } - - - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append("*** Thank you ***") - .append(TmkPrinterConstants.LINE_FEED); - - - if(_showFooter) - if( _footerMessage.length() > 0 ) - { - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(_footerMessage) - .append(TmkPrinterConstants.LINE_FEED); - } - - reportData.append(TmkPrinterConstants.PAPER_CUT) - .append(TmkPrinterConstants.LINE_FEED); - - - return reportData.toString(); - - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/util/TMKOrderPrintFormatter.java b/posterita/posterita/src/main/org/posterita/util/TMKOrderPrintFormatter.java deleted file mode 100644 index 1f45043f43..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/TMKOrderPrintFormatter.java +++ /dev/null @@ -1,637 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 23, 2006 - */ - - -package org.posterita.util; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.Properties; - -import org.compiere.model.MBPartner; -import org.compiere.model.MLocation; -import org.compiere.model.MOrder; -import org.compiere.model.MOrg; -import org.compiere.model.MPayment; -import org.compiere.model.MUser; -import org.posterita.Constants; -import org.posterita.beans.BPartnerBean; -import org.posterita.beans.OrderLineBean; -import org.posterita.beans.WebOrderLineBean; -import org.posterita.businesslogic.OrganisationManager; -import org.posterita.businesslogic.POSManager; -import org.posterita.businesslogic.administration.BPartnerManager; -import org.posterita.businesslogic.administration.PriceListManager; -import org.posterita.exceptions.FormattingException; -import org.posterita.exceptions.OperationException; -import org.posterita.lib.UdiConstants; -import org.posterita.order.UDIOrderTypes; - - - -public class TMKOrderPrintFormatter extends AbstractPrintFormatter -{ - public TMKOrderPrintFormatter(String args) - { - super(args); - } - - public TMKOrderPrintFormatter(String args, String trxName) - { - super(args); - this.trxName = trxName; - } - - public String format(Properties ctx, int recordId, Object... args) throws Exception - { - //require UDIBean - OrderLineBean orderLineBean = null; - if( args != null && args.length > 0) - { - orderLineBean = (OrderLineBean) args[0]; - } - - //----------------------------------------------------------------------------------------------------------------------------- - - //set some default values - String vatRegNumber = ""; - String companyName1 = ""; - String companyName2 = ""; - String companyPhone = ""; - String companyAddress = ""; - - //setting receipt header - try - { - MOrg myorg = OrganisationManager.getMyOrg(ctx); - int bpartnerId = myorg.getLinkedC_BPartner_ID(trxName); - - - MBPartner bpartner = BPartnerManager.loadBPartner(ctx,bpartnerId,trxName); - BPartnerBean bean = BPartnerManager.getBpartner(ctx, bpartnerId, trxName); - - vatRegNumber = bpartner.getTaxID(); - companyName1 = bean.getPartnerName(); - companyName2 = bean.getName2(); - companyPhone = bean.getPhone(); - - String add = bean.getAddress1(); - add = (add==null) ? "" : add; - - companyAddress = add; - - add = bean.getAddress2(); - - if(add!=null){ - companyAddress = companyAddress + " " + add; - } - - add = bean.getCity(); - add = (add==null) ? "" : add; - - companyAddress = companyAddress + ", " + add; - - - } catch (OperationException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - String title = null; - String customerName = null; - String salesRep = null; - String docStatus = null; - String payment = null; - String customerAddress = null; - String refNo = null; - - //load the order - MOrder order = new MOrder(ctx, recordId, trxName); - - String paymentRule = null; - int priceListId = order.getM_PriceList_ID(); - String currency = PriceListManager.getCurrency(ctx, priceListId); - - //setting payment - paymentRule = order.getPaymentRule(); - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) - { - payment = Constants.PAYMENT_RULE_CASH; - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) - { - payment = Constants.PAYMENT_RULE_CARD; - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) - { - payment = Constants.PAYMENT_RULE_CHEQUE; - } - - if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) - { - payment = Constants.PAYMENT_RULE_MIXED; - } - //setting ref no - refNo = order.getDocumentNo(); - - //getting orgInfo - MOrg org = new MOrg(ctx,order.getAD_Org_ID(),trxName); - int location_id = org.getInfo().getC_Location_ID(); - MLocation location = new MLocation(ctx,location_id,trxName); - - // orgName = org.getName(); - - String address1 = (location.getAddress1() == null)? " " : location.getAddress1(); - String address2 = (location.getAddress2() == null)? " " : location.getAddress2(); - // orgAddress = (address1 + " " + address2).trim(); - - - //getting orderInfo - docStatus = order.getDocStatusName(); - - //getting salesrep - int saleRep_id = order.getSalesRep_ID(); - MUser user = new MUser(ctx,saleRep_id,null); - salesRep = user.getName(); - - //getting customer info - int bpartner_id = order.getBill_BPartner_ID(); - BPartnerBean bean; - try - { - bean = BPartnerManager.getBpartner(ctx,bpartner_id,trxName); - } - catch(Exception e) - { - throw new FormattingException("Formatting Error", e); - } - - - String name1 = (bean.getPartnerName() == null)? " " : bean.getPartnerName(); - String name2 = (bean.getName2() == null)? " " : bean.getName2(); - customerName = (name1 + " " + name2).trim(); - - address1 = (bean.getAddress1() == null)? " " : bean.getAddress1(); - address2 = (bean.getAddress2() == null)? " " : bean.getAddress2(); - customerAddress = (address1 + " " + address2).trim(); - - - ///////////////////////////////drawing the order//////////////////////////////// - StringBuffer reportData = new StringBuffer();//TmkPrinterConstants.LOGO1); - - if(_showLogo) - { - reportData.append(TmkPrinterConstants.LOGO1); - } - - //adding header - reportData.append(TmkPrinterConstants.FONT_SMALL) - .append(_lineTop) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(TmkPrinterConstants.LINE_FEED); - - if(companyName1!=null) - reportData.append(TmkPrinterConstants.FONT_DOUBLE) - .append(companyName1) - .append(TmkPrinterConstants.LINE_FEED); - - - if(companyName2!=null) - if(companyName2.trim().length() > 0) - reportData.append(TmkPrinterConstants.CENTER_ALIGN) - .append(TmkPrinterConstants.BIG_FONT) - .append("(" + companyName2 + ")") - .append(TmkPrinterConstants.LINE_FEED); - - if(companyAddress!=null) - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append(companyAddress) - .append(TmkPrinterConstants.LINE_FEED); - - if(companyPhone!=null) - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append("Tel:" + companyPhone) - .append(TmkPrinterConstants.LINE_FEED); - - if(vatRegNumber!=null) - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append("VAT Reg No:" + vatRegNumber) - .append(TmkPrinterConstants.LINE_FEED); - - reportData.append(TmkPrinterConstants.FONT_SMALL) - .append(_lineTop) - .append(TmkPrinterConstants.LINE_FEED); - - //adding title - - if ( UDIOrderTypes.POS_ORDER.getOrderType().equals(order.getOrderType()) || order.getOrderType().equals(null)) - { - title = "Sales Receipt"; - } - if ( UDIOrderTypes.POS_GOODS_RECEIVE_NOTE.getOrderType().equals(order.getOrderType())) - { - title = "Goods Received Note"; - } - if ( UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType().equals(order.getOrderType())) - { - title = "Goods Returned Note"; - } - if ( UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType().equals(order.getOrderType())) - { - title = "Customer Returned Order"; - } - if ( UDIOrderTypes.CREDIT_ORDER.getOrderType().equals(order.getOrderType())) - { - title = "Credit Order"; - } - - reportData.append(TmkPrinterConstants.BIG_FONT) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(title) - .append(TmkPrinterConstants.LINE_FEED); - - //setting small font - reportData.append(TmkPrinterConstants.FONT_SMALL); - reportData.append(TmkPrinterConstants.LEFT_ALIGN); - - //adding customer name - customerName = String.format("%1$-" + _halfLineWidth + "s", customerName); - reportData.append(customerName); - - //adding sales rep - salesRep = "Sales Rep:" + salesRep; - salesRep = String.format("%1$"+ _halfLineWidth + "s", salesRep); - reportData.append(salesRep) - .append(TmkPrinterConstants.LINE_FEED); - - //adding customer address - customerAddress = String.format("%1$-" + _lineWidth + "s",customerAddress); - reportData.append(customerAddress) - .append(TmkPrinterConstants.LINE_FEED); - - //adding status - docStatus = "Status:" + docStatus; - docStatus = String.format("%1$-" + _lineWidth + "s",docStatus); - reportData.append(docStatus) - .append(TmkPrinterConstants.LINE_FEED); - - //adding payment - payment = "Payment:" + payment; - payment = String.format("%1$-" + _lineWidth + "s",payment); - reportData.append(payment) - .append(TmkPrinterConstants.LINE_FEED); - - //adding reference no - refNo = "Ref No:" + refNo; - refNo = String.format("%1$-" + _lineWidth + "s",refNo); - reportData.append(refNo) - .append(TmkPrinterConstants.LINE_FEED); - - //adding date - Calendar c = Calendar.getInstance(); - c.setTime(new Date(order.getCreated().getTime())); - String date = String.format("%1$te %1$tb,%1$tY %1$tH:%1$tM:%1$tS",c); - date = String.format("%1$-" + _lineWidth + "s",date); - reportData.append(date) - .append(TmkPrinterConstants.LINE_FEED); - - //adding orderlines - //1.header - reportData.append(_lineTop).append("\n"); - - String headerFormat; - if(_showDiscount) - { - headerFormat = "%1$-" + (_lineWidth - ( 7 + 5 + 8 + 10 )) + "s" + - "%2$7s" + - "%3$5s" + - "%4$8s" + - "%5$10s"; - } - else - { - headerFormat = "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + - "%2$7s" + - "%3$5s" + - //"%4$8s" + - "%5$13s"; - } - - String header = String.format(headerFormat,"Name","Unit","Qty","Dis","Total"); - reportData.append(header).append("\n"); - - reportData.append(_lineBottom) - .append(TmkPrinterConstants.LINE_FEED); - - //2.body - ArrayList orderLineList; - try - { - orderLineList = POSManager.populateOrderLines(ctx,order); - } - catch(Exception e) - { - throw new FormattingException("Formatting Error", e); - } - - String name = null; - int qty; - BigDecimal discount = null; - BigDecimal taxAmt = null; - BigDecimal total; - BigDecimal unitPrice; - - int totalQty = 0; - double grandTotal = 0.0d; - double totalTax = 0.0d; - String orderline = ""; - String orderlineFormat = null; - - int nameWidth = 0; - - - if(_showDiscount) - { - orderlineFormat = "" + - "%1$-" + (_lineWidth - ( 7 + 5 + 8 + 10 )) + "s" + //1.product name OR description - "%2$7.2f" + //2.unit price - "%3$5d" + //3.quantity - "%4$8.2f" + //4.discount amount - "%5$10.2f"; //5.total price - - nameWidth = _lineWidth - ( 7 + 5 + 8 + 10 ); - } - else - { - orderlineFormat = "" + - "%1$-" + (_lineWidth - ( 7 + 5 + 13 )) + "s" + //1.product name OR description - "%2$7.2f" + //2.unit price - "%3$5d" + //3.quantity - //"%4$8.2f" + //4.discount amount - "%5$13.2f"; //5.total price - - nameWidth = _lineWidth - ( 7 + 5 + 13 ); - } - - - - for(WebOrderLineBean wbean : orderLineList) - { - taxAmt = wbean.getTaxAmt(); - name = wbean.getDescription(); - qty = wbean.getQtyOrdered().intValue(); - discount = wbean.getDiscountPercentage(); - total = wbean.getLineTotalAmt(); - unitPrice = wbean.getUnitPrice(); - - if( _priceWithVat ) - { - unitPrice = total.divide(wbean.getQtyOrdered(),BigDecimal.ROUND_UP); - } - - - if(name.length() > nameWidth) - { - // print on multiple lines - int beginIndex = 0; - int endIndex = 0; - endIndex = nameWidth; - - while(endIndex < name.length()) - { - String s = name.substring(beginIndex, endIndex); - beginIndex = endIndex; - endIndex = endIndex + nameWidth; - - orderline = String.format("%1$-" + _lineWidth + "s", s); - reportData.append(orderline) - .append(TmkPrinterConstants.LINE_FEED); - } - - name = name.substring(beginIndex); - } - - discount = (discount==null)? new BigDecimal(0.0) : discount; - taxAmt = (taxAmt==null)? new BigDecimal(0.0) : taxAmt; - - double discountAmt = 0.0; - discountAmt = (total.doubleValue() * 100.0)/(100.0 - discount.doubleValue()) - total.doubleValue(); - - totalQty += qty; - grandTotal += total.doubleValue(); - totalTax += taxAmt.doubleValue(); - - if(taxAmt.intValue() == 0) - { - name = name + "*"; - } - - unitPrice = unitPrice.add(BigDecimal.valueOf(discountAmt)); - - orderline = String.format(orderlineFormat,name,unitPrice,qty,discountAmt,total); - reportData.append(orderline) - .append(TmkPrinterConstants.LINE_FEED); - } - - //3.footer - reportData.append(_lineBottom) - .append(TmkPrinterConstants.LINE_FEED); - - String footerFormat = null; - if(_showDiscount) - { - footerFormat = "" + - "%1$-" + (_lineWidth - ( 5 + 8 + 10 )) + "s" + - "%2$5d" + - "%3$8.2s" + - "%4$10.2f"; - } - else - { - footerFormat = "" + - "%1$-" + (_lineWidth - ( 5 + 3 + 10 )) + "s" + - "%2$5d" + - "%3$3s" + - "%4$10.2f"; - } - - String orderFooter = String.format(footerFormat,"Grand Total",totalQty,currency,grandTotal); - reportData.append(orderFooter) - .append(TmkPrinterConstants.LINE_FEED); - - reportData.append(_lineTop) - .append(TmkPrinterConstants.LINE_FEED); - - - //4.amount tendered & refunded - BigDecimal cashAmountTendered = order.getAmountTendered(); - if(cashAmountTendered == null) - { - cashAmountTendered = new BigDecimal(0.0); - } - - BigDecimal cashAmountRefunded = order.getAmountRefunded(); - if(cashAmountRefunded == null) - { - cashAmountRefunded = new BigDecimal(0.0); - } - - BigDecimal cardAmountTendered = null; - BigDecimal chequeAmountTendered = null; - - - if(orderLineBean != null) - { - Double cardAmt = orderLineBean.getPaymentByCard(); - Double chequeAmt = orderLineBean.getPaymentByChq(); - - if(cardAmt == null) - { - cardAmountTendered = new BigDecimal(0.0d); - } - else - { - cardAmountTendered = new BigDecimal(cardAmt.doubleValue()); - } - - if(chequeAmt == null) - { - chequeAmountTendered = new BigDecimal(0.0d); - } - else - { - chequeAmountTendered = new BigDecimal(chequeAmt.doubleValue()); - } - } - else - { - - if(MOrder.STATUS_Completed.equalsIgnoreCase(order.getDocStatus())) - if(order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType())) - { - try - { - cardAmountTendered = POSManager.getPayment(ctx, order.get_ID(), MPayment.TENDERTYPE_CreditCard, trxName); - chequeAmountTendered = POSManager.getPayment(ctx, order.get_ID(), MPayment.TENDERTYPE_Check, trxName); - } - catch (OperationException e) - { - throw new FormattingException("Cannot get payment",e); - } - } - else - { - cardAmountTendered = new BigDecimal(0.0d); - chequeAmountTendered = new BigDecimal(0.0d); - } - - } - - String amountTendered = String.format("%1$25s%2$4s:%3$10.2f","Cash Tendered",currency ,cashAmountTendered); - String amountRefunded = String.format("%1$25s%2$4s:%3$10.2f","Cash Refunded",currency ,cashAmountRefunded); - - String seperator = String.format("%1$25s%2$15s","","------------"); - - String cardTendered = String.format("%1$25s%2$4s:%3$10.2f","Card Tendered",currency ,cardAmountTendered); - String chequeTendered = String.format("%1$25s%2$4s:%3$10.2f","Cheque Tendered",currency ,chequeAmountTendered); - - if(cashAmountTendered.doubleValue() > 0.0d) - { - reportData.append(amountTendered).append(TmkPrinterConstants.LINE_FEED); - } - - if(cardAmountTendered.doubleValue() > 0.0d) - { - reportData.append(cardTendered).append(TmkPrinterConstants.LINE_FEED); - } - - if(chequeAmountTendered.doubleValue() > 0.0d) - { - reportData.append(chequeTendered).append(TmkPrinterConstants.LINE_FEED); - } - - if(cashAmountTendered.doubleValue() > 0.0d) - { - reportData.append(seperator).append(TmkPrinterConstants.LINE_FEED); - reportData.append(amountRefunded).append(TmkPrinterConstants.LINE_FEED); - } - - - String totalVAT = String.format("%1$.2f",totalTax); - String vat = String.format("%1$-" + _lineWidth + "s","Total VAT:" + currency + totalVAT); - reportData.append(vat) - .append(TmkPrinterConstants.LINE_FEED); - - String noVAT = String.format("%1$-" + _lineWidth + "s","* NO VAT"); - - - - reportData.append(noVAT) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.LINE_FEED); - - if(_showBarcode) - { - String barcode = ((char)0x1d ) + "H" + (char)2 + ((char)0x1d ) + "k" + (char)4 + order.getDocumentNo() + (char)0; - String barcodeDim = ((char)0x1d) + "h" + (char)50 + ((char)0x1d) + "w" + (char)3; - reportData.append(TmkPrinterConstants.CENTER_ALIGN) - .append(barcodeDim) - .append(barcode) - .append(TmkPrinterConstants.LINE_FEED); - } - - - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append("*** Thank you ***") - .append(TmkPrinterConstants.LINE_FEED); - - - if(_showFooter) - if( _footerMessage.length() > 0 ) - { - reportData.append(TmkPrinterConstants.FONT_NORMAL) - .append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(_footerMessage) - .append(TmkPrinterConstants.LINE_FEED); - } - - if( order.getOrderType().equalsIgnoreCase(UDIOrderTypes.POS_ORDER.getOrderType()) ) - { - reportData.append(TmkPrinterConstants.LINE_FEED) - .append(TmkPrinterConstants.CENTER_ALIGN) - .append(TmkPrinterConstants.FONT_SMALL) - .append("*Goods once sold cannot be returned."); - } - - reportData.append(TmkPrinterConstants.PAPER_CUT) - .append(TmkPrinterConstants.LINE_FEED); - - return reportData.toString(); - - } -} diff --git a/posterita/posterita/src/main/org/posterita/util/TmkPrintUtil.java b/posterita/posterita/src/main/org/posterita/util/TmkPrintUtil.java deleted file mode 100644 index 90cb9a64ca..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/TmkPrintUtil.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 23, 2006 - */ - - -package org.posterita.util; - - -public class TmkPrintUtil -{ - - private static final int TOTAL_PAGE_LENGTH=40; - private static final int MAX_ALLOWED_FOR_FIELD=15; - public static String alignRight(String data) - { - int dataLength=data.length(); - String padding=" "; - for( int i=0;i14) - { - finaldata=finaldata+"\n"+initData.substring(0,MAX_ALLOWED_FOR_FIELD); - initData=initData.substring(MAX_ALLOWED_FOR_FIELD,initData.length()-1); - } - - } - - finaldata=finaldata+"\n"+initData; - - return finaldata.trim(); - - - } - - - public static String alignInCorners(String data1,String data2) - { - - - return null; - } -} diff --git a/posterita/posterita/src/main/org/posterita/util/TmkPrinterConstants.java b/posterita/posterita/src/main/org/posterita/util/TmkPrinterConstants.java deleted file mode 100644 index fad7179d72..0000000000 --- a/posterita/posterita/src/main/org/posterita/util/TmkPrinterConstants.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Aug 24, 2006 - */ - - -package org.posterita.util; - - -public class TmkPrinterConstants -{ - public static final String SLIP_PRINTER_THERMAL = "Slip - Thermal"; - public static final String SLIP_PRINTER_9PIN = "Slip - 9 Pin"; - public static final String NORMAL_PRINTER = "Normal"; - - public static final int PRINTER_9PIN_WIDTH = 40; - public static final int PRINTER_SLIP_WIDTH = 64; - public static final int PRINTER_DEFAULT_WIDTH = PRINTER_9PIN_WIDTH; - - public static final String PAPER_CUT = new String(new byte[]{10,29,86,66}); - // public static final String PAPER_CUT= new String (new byte[]{10,29,56,66}); - public static final String PAGE_MODE = new String (new byte[]{27,76}); - public static final String LOGO1= new String(new byte[]{28,112,1,48}); - public static final String STANDARD_MODE = new String (new byte[]{27,83}); - public static final String LINE_FEED= new String (new byte []{10}); - public static final String H_TAB = new String (new byte[]{9}); - public static final String SOUND_BUZZER=new String (new byte[]{27,30}); - public static final String ABS_POSITION=new String (new byte[]{}); - public static final String LEFT_ALIGN=new String (new byte[]{27,97,2}); - public static final String CENTER_ALIGN=new String (new byte[]{27,97,1}); - public static final String RIGHT_ALIGN=new String (new byte[]{27,97,2,80}); - public static final String MULTIPLE_LINE_FEED= new String (new byte []{27,100,2});//5 lines - public static final String SETTING_LEFT_MARGIN=new String (new byte[]{29,76,5,0}); - public static final String BIG_FONT=new String (new byte[]{27,33,8}); - public static final String SMALL_FONT=new String (new byte[]{27,33,1}); - public static final String ABS_POS_LOC1=new String (new byte[]{27,36,0,0}); - public static final String ABS_POS_LOC2=new String (new byte[]{27,36,100,1}); - public static final String ABS_POS_LOC3=new String (new byte[]{27,36,(byte)145,1}); - public static final String ABS_POS_LOC4=new String (new byte[]{27,36,(byte)200,1}); - public static final String ABS_POS_LOC5=new String (new byte[]{27,36,1,1}); - public static final String CHARACTER_SPACING=new String (new byte[]{27,32,0}); - public static final String H_FULL_LINE_TOP; - - public static final String FONT_NORMAL = ((char)0x1b) + "!" + ((char)0x00); - public static final String FONT_SMALL = ((char)0x1b) + "!" + ((char)0x01); - public static final String FONT_NORMAL_BOLD = ((char)0x1b) + "!" + ((char)0x08); - public static final String FONT_DOUBLE_HEIGHT = ((char)0x1b) + "!" + ((char)0x10); - public static final String FONT_DOUBLE_WIDTH = ((char)0x1b) + "!" + ((char)0x20); - public static final String FONT_DOUBLE = ((char)0x1b) + "!" + ((char)0x30); - - public static final String H_FULL_LINE_BOTTOM; - - static - { - int length = 60; - byte hFullLineTop[] = new byte[length]; - - for(int i = 0; i < length; i++) - hFullLineTop[i] = (byte)223; - - H_FULL_LINE_TOP = new String(hFullLineTop); - - byte hFullLineBottom[] = new byte[length]; - - for(int i = 0; i < length; i++) - hFullLineBottom[i] = (byte)220; - - H_FULL_LINE_BOTTOM = new String(hFullLineBottom); - } - -} diff --git a/posterita/posterita/src/main/org/posterita/webstore/action/DocumentHistoryAction.java b/posterita/posterita/src/main/org/posterita/webstore/action/DocumentHistoryAction.java deleted file mode 100644 index 105752a343..0000000000 --- a/posterita/posterita/src/main/org/posterita/webstore/action/DocumentHistoryAction.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.webstore.action; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Properties; -import java.util.TreeSet; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.compiere.model.MBPartner; -import org.compiere.process.DocAction; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.DocumentHistortFilterBean; -import org.posterita.beans.DocumentHistoryBean; -import org.posterita.businesslogic.performanceanalysis.POSReportManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.form.DocumentHistoryForm; -import org.posterita.order.UDIOrderTypes; -import org.posterita.struts.core.BaseDispatchAction; -import org.posterita.user.WebUserInfo; -import org.posterita.webstore.businesslogic.DocumentHistoryManager; - -public class DocumentHistoryAction extends BaseDispatchAction -{ - - public static final String INIT_HISTORY = "initHistory"; - public ActionForward initHistory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DocumentHistoryForm dhf = (DocumentHistoryForm) form; - DocumentHistoryBean bean = (DocumentHistoryBean) dhf.getBean(); - - Calendar calendar = Calendar.getInstance(); - int month = calendar.get(Calendar.MONTH) + 1 ; - int year = calendar.get(Calendar.YEAR); - - bean.setMonth( Integer.valueOf(month) ); - bean.setYear( Integer.valueOf(year) ); - bean.setOrderType( UDIOrderTypes.POS_ORDER .getOrderType()); - bean.setDocStatus( DocAction.STATUS_Completed ); - - dhf.populate( bean ); - - //TODO OrderType should be taken from the bean - ArrayList list = DocumentHistoryManager.getHistory(ctx, bean.getBpartnerId(), bean.getDocStatus(), bean.getMonth(), bean.getYear(), bean.getOrderType()); - - getWebstoreFilterBean(ctx, request, list); - - request.getSession().setAttribute(Constants.DOCUMENT_HISTORY, list); - - return mapping.findForward(GET_HISTORY); - } - - public static final String GET_HISTORY = "getHistory"; - public ActionForward getHistory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - - Properties ctx = TmkJSPEnv.getCtx(request); - - DocumentHistoryForm dhf = (DocumentHistoryForm) form; - DocumentHistoryBean bean = (DocumentHistoryBean) dhf.getBean(); - - //TODO OrderType should be taken from the bean - ArrayList list = DocumentHistoryManager.getHistory(ctx, bean.getBpartnerId(), bean.getDocStatus(), bean.getMonth(), bean.getYear(), bean.getOrderType()); - - getWebstoreFilterBean(ctx, request, list); - - request.getSession().setAttribute(Constants.DOCUMENT_HISTORY, list); - - return mapping.findForward(GET_HISTORY); - - } - - public static void getWebstoreFilterBean(Properties ctx, HttpServletRequest request, ArrayList orderHistory) throws OperationException - { - - DocumentHistortFilterBean filterBean = new DocumentHistortFilterBean(orderHistory); - - TreeSet docStatus = filterBean.getDocStatusList(); - request.getSession().setAttribute(Constants.DOC_STATUS, docStatus); - ArrayList orderTypeList=POSReportManager.getAllOrderTypes(ctx); - - request.getSession().setAttribute(Constants.ORDER_TYPES,orderTypeList); - - WebUserInfo wuInfo = (WebUserInfo) request.getSession().getAttribute(WebUserInfo.NAME); - int partnerId = wuInfo.getInfo().getC_BPartner_ID(); - MBPartner partner = new MBPartner(ctx, partnerId, null); - - - if (partner.getAD_Org_ID() != Env.getAD_Org_ID(ctx)) - { - TreeSet bPartners = (TreeSet)filterBean.getBPartnerList(); - request.getSession().setAttribute(Constants.BPARTNERS, bPartners); - - } - } - -} diff --git a/posterita/posterita/src/main/org/posterita/webstore/action/ViewCashPaymentAction.java b/posterita/posterita/src/main/org/posterita/webstore/action/ViewCashPaymentAction.java deleted file mode 100644 index cde8b771c3..0000000000 --- a/posterita/posterita/src/main/org/posterita/webstore/action/ViewCashPaymentAction.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Created on Oct 25, 2006 - */ - - -package org.posterita.webstore.action; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.Globals; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.config.ActionConfig; -import org.apache.struts.config.ForwardConfig; -import org.apache.struts.util.MessageResources; - -import org.posterita.Constants; -import org.posterita.beans.DocumentBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.businesslogic.CashManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.DefaultForm; -import org.posterita.struts.pos.POSDispatchAction; - - -public class ViewCashPaymentAction extends POSDispatchAction -{ - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - - MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); - - String operationException = resources.getMessage("error.operationException"); - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - DocumentBean bean = (DocumentBean) df.getBean(); - Integer paymentId = bean.getDocumentId(); - - // retrieve from cache - WebDocumentBean webBean = null; - webBean = CashManager.getWebCashPaymentBean(ctx, paymentId); - - request.getSession().setAttribute(Constants.WEB_PAYMENT_BEAN, webBean); - if (webBean == null) - webBean = (WebDocumentBean) request.getSession().getAttribute(Constants.WEB_PAYMENT_BEAN); - - if (webBean == null) - throw new OperationException(operationException); - - request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); - request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); - request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); - request.getSession().setAttribute(Constants.ME, webBean.getMe()); - request.getSession().setAttribute(Constants.YOU,webBean.getYou()); - request.getSession().setAttribute(Constants.MCASHLINE, webBean.getCashLine()); - request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); - request.setAttribute(Constants.CURRENCY_SYMBOLE,webBean.getCurrencySymbole()); - request.getSession().setAttribute(Constants.CASH_PAYMENT_MADE,bean); - ForwardConfig forwardConfig = getForward(ctx,webBean,mapping,form); - - ActionForward forward = new ActionForward(forwardConfig.getPath()); - - return forward; - } - - private ForwardConfig getForward(Properties ctx, WebDocumentBean webBean, ActionMapping mapping, ActionForm form) throws OperationException - { - ActionConfig config = mapping.getModuleConfig().findActionConfig("/ViewWebstoreCashPaymentAction"); - - return config.findForwardConfig(Constants.VIEW_PAYMENT); - } -} \ No newline at end of file diff --git a/posterita/posterita/src/main/org/posterita/webstore/action/ViewPaymentAction.java b/posterita/posterita/src/main/org/posterita/webstore/action/ViewPaymentAction.java deleted file mode 100644 index f03ec967a4..0000000000 --- a/posterita/posterita/src/main/org/posterita/webstore/action/ViewPaymentAction.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -package org.posterita.webstore.action; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts.Globals; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.config.ActionConfig; -import org.apache.struts.config.ForwardConfig; -import org.apache.struts.util.MessageResources; -import org.compiere.model.MPayment; - -import org.posterita.Constants; -import org.posterita.beans.DocumentBean; -import org.posterita.beans.WebDocumentBean; -import org.posterita.businesslogic.PaymentManager; -import org.posterita.core.TmkJSPEnv; -import org.posterita.exceptions.ApplicationException; -import org.posterita.exceptions.OperationException; -import org.posterita.struts.core.DefaultForm; -import org.posterita.struts.pos.POSDispatchAction; - - -public class ViewPaymentAction extends POSDispatchAction -{ - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws OperationException, ApplicationException - { - ActionForward fwd = init(mapping, form, request, response); - - if (fwd != null) - return fwd; - - MessageResources resources = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); - - String operationException = resources.getMessage("error.operationException"); - - Properties ctx = TmkJSPEnv.getCtx(request); - - DefaultForm df = (DefaultForm) form; - DocumentBean bean = (DocumentBean) df.getBean(); - Integer paymentId = bean.getDocumentId(); - - // retrieve from cache - WebDocumentBean webBean = null; - - MPayment payment = null; - if (paymentId!= null) - { - payment = new MPayment(ctx, paymentId.intValue(), null); - webBean = PaymentManager.getWebPaymentBean(ctx, payment); - request.getSession().setAttribute(Constants.WEB_PAYMENT_BEAN, webBean); - } - - if (webBean == null) - webBean = (WebDocumentBean) request.getSession().getAttribute(Constants.WEB_PAYMENT_BEAN); - - if (webBean == null) - throw new OperationException(operationException); - - request.getSession().setAttribute(Constants.ME_LOCATION, webBean.getMeLocation()); - request.getSession().setAttribute(Constants.YOU_LOCATION, webBean.getYouLocation()); - request.getSession().setAttribute(Constants.YOU_BP_LOCATION, webBean.getYoubpLocation()); - request.getSession().setAttribute(Constants.ME, webBean.getMe()); - request.getSession().setAttribute(Constants.MORDER, webBean.getOrder()); - request.getSession().setAttribute(Constants.YOU,webBean.getYou()); - request.getSession().setAttribute(Constants.MPAYMENT, webBean.getPayment()); - request.getSession().setAttribute(Constants.PAYMENT_TYPE, webBean.getTenderType()); - request.getSession().setAttribute(Constants.MINVOICE, webBean.getInvoice()); - request.getSession().setAttribute(Constants.SIMPLE_COMMAND,webBean.getSimpleCommand()); - request.getSession().setAttribute(Constants.COMPLEX_COMMAND,webBean.getComplexCommand()); - request.getSession().setAttribute(Constants.WEB_DOCUMENT_HEADER_BEAN, webBean.getHeaderBean()); - request.setAttribute(Constants.CURRENCY_SYMBOLE,webBean.getCurrencySymbole()); - ForwardConfig forwardConfig = getForward(ctx,webBean,mapping,form); - - ActionForward forward = new ActionForward(forwardConfig.getPath()); - - return forward; - } - - private ForwardConfig getForward(Properties ctx, WebDocumentBean webBean, ActionMapping mapping, ActionForm form) throws OperationException - { - ActionConfig config = mapping.getModuleConfig().findActionConfig("/ViewWebstorePaymentAction"); - - return config.findForwardConfig(Constants.VIEW_PAYMENT); - } -} diff --git a/posterita/posterita/src/main/org/posterita/webstore/businesslogic/DocumentHistoryManager.java b/posterita/posterita/src/main/org/posterita/webstore/businesslogic/DocumentHistoryManager.java deleted file mode 100644 index b4c33429e2..0000000000 --- a/posterita/posterita/src/main/org/posterita/webstore/businesslogic/DocumentHistoryManager.java +++ /dev/null @@ -1,186 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.webstore.businesslogic; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.posterita.beans.DocumentHistoryBean; -import org.posterita.core.UDIMap; -import org.posterita.exceptions.OperationException; - -public class DocumentHistoryManager -{ - - private static Integer getIntegerValue(int value) - { - if (value == 0) - return null; - else - return Integer.valueOf(value); - } - - - public static ArrayList getHistory(Properties ctx, Integer bpartnerId, String docStatus, Integer month, Integer year, String orderType) throws OperationException - { - StringBuffer sql = new StringBuffer(); - sql.append(" select"); - sql.append(" ord.c_order_id, "); //1.orderID - sql.append(" pay.c_payment_id, "); //2.paymentID - sql.append(" inv.c_invoice_id, "); //3.invoiceID - sql.append(" ship.m_inout_id, "); //4.shipmentID - sql.append(" partner.c_bpartner_id, "); //5.partnerID - sql.append(" partner.name, "); //6.partnerName - sql.append(" partner.name2, "); //7.partnerName2 - sql.append(" ord.created, "); //8.dateCreated - sql.append(" ship.docstatus,"); //9/docStatus - //sql.append(" DECODE(pay.docstatus, 'CO', 'Paid', 'Awaiting Payment') paymentStatus,"); - sql.append(" CASE WHEN pay.docstatus = 'CO' THEN 'Paid' ELSE 'Awaiting Payment' END AS paymentStatus,"); - //sql.append(" DECODE (ship.docstatus, 'CO', 'Shipped', 'Not Shipped') shipmentStatus,"); - sql.append(" CASE WHEN ship.docstatus= 'CO' THEN 'Shipped' ELSE 'Not Shipped' END AS shipmentStatus,"); - sql.append(" ord.documentNo,"); - sql.append(" inv.documentNo,"); - sql.append(" pay.documentNo,"); - sql.append(" ship.documentNo,"); - sql.append(" partner.isCustomer,"); - sql.append(" partner.isVendor from "); - sql.append("(((c_order ord left outer join c_invoice inv on ord.C_Order_ID=inv.C_Order_ID) left outer join M_InOut ship on ord.C_Order_ID=ship.C_Order_ID) left outer join c_payment pay on inv.c_invoice_id = pay.c_invoice_id)"); - sql.append(", c_bpartner partner"); - sql.append(" where ord.ad_client_id=" + Env.getAD_Client_ID(ctx)); - sql.append(" and ord.ad_org_id=" + Env.getAD_Org_ID(ctx)); - sql.append(" and partner.c_bpartner_id=ord.c_bpartner_id"); - sql.append(" and ord.isactive='Y'"); - - - if(orderType!=null) - { - sql.append(" and ord.ordertype='" + orderType + "'"); - } - - if (month != null) - { - String mm = String.valueOf(month); - if (mm.length() == 1) - { - mm = "0" + mm; - } - sql.append(" and to_char(ord.dateOrdered, 'mm') ='" + mm + "'"); - } - - if (year != null) - { - sql.append(" and to_char(ord.dateOrdered, 'yyyy') ='" + year+"'"); - } - - if (bpartnerId != null) - { - sql.append(" and ord.c_bpartner_id=" + bpartnerId); - } - - sql.append(" order by ord.c_order_id desc"); - - - - PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); - - ResultSet rs = null; - DocumentHistoryBean bean; - ArrayList list = new ArrayList(); - - try - { - rs = pstmt.executeQuery(); - - while(rs.next()) - { - bean = new DocumentHistoryBean(); - bean.setOrderId(getIntegerValue(rs.getInt(1))); - bean.setPaymentId(getIntegerValue(rs.getInt(2))); - bean.setInvoiceId(getIntegerValue(rs.getInt(3))); - bean.setMinOutId(getIntegerValue(rs.getInt(4))); - bean.setBpartnerId(getIntegerValue(rs.getInt(5))); - bean.setPartnerName(rs.getString(6) + " " + rs.getString(7)); - bean.setDateOrdered(rs.getTimestamp(8)); - - if (rs.getString(9) != null) - { - bean.setDocStatus(UDIMap.docStatusMap.get(rs.getString(9))); - bean.setDocStatusCode(rs.getString(9)); - } - - bean.setPaymentStatus(rs.getString(10)); - bean.setShipmentStatus(rs.getString(11)); - bean.setDocumentNo(rs.getString(12)); - bean.setInvoiceNo(rs.getString(13)); - bean.setPaymentNo(rs.getString(14)); - bean.setShipmentNo(rs.getString(15)); - - if(rs.getString(16).equals("Y")) - { - bean.setIsCustomer(Boolean.valueOf(true)); - } - else - { - bean.setIsCustomer(Boolean.valueOf(false)); - } - - if(rs.getString(17).equals("Y")) - { - bean.setIsVendor(Boolean.valueOf(true)); - } - else - { - bean.setIsVendor(Boolean.valueOf(false)); - } - - - list.add(bean); - } - - } - catch (SQLException e) - { - throw new OperationException(e.getMessage()); - } - finally - { - try - { - rs.close(); - pstmt.close(); - } - catch (Exception ex) - { - } - rs = null; - pstmt = null; - } - - return list; - } - - -} diff --git a/posterita/posterita/src/main/org/posterita/webstore/businesslogic/PaymentManager.java b/posterita/posterita/src/main/org/posterita/webstore/businesslogic/PaymentManager.java deleted file mode 100644 index 45abaae90c..0000000000 --- a/posterita/posterita/src/main/org/posterita/webstore/businesslogic/PaymentManager.java +++ /dev/null @@ -1,256 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - **/ -package org.posterita.webstore.businesslogic; - -import java.util.Properties; - -import org.compiere.model.MBankAccount; -import org.compiere.model.MDocType; -import org.compiere.model.MInOut; -import org.compiere.model.MOrder; -import org.compiere.model.MPayment; -import org.compiere.model.MPaymentValidate; -import org.compiere.process.DocumentEngine; -import org.compiere.util.Env; -import org.posterita.Constants; -import org.posterita.beans.CreditCardBean; -import org.posterita.exceptions.CreditCardExpiryInvalidException; -import org.posterita.exceptions.CreditCardNumberException; -import org.posterita.exceptions.CreditCardTypeNotSupportedException; -import org.posterita.exceptions.CreditCardVVInvalidException; -import org.posterita.exceptions.OperationException; -import org.posterita.order.UDIOrderTypes; -import org.posterita.util.PoManager; - -public class PaymentManager -{ - - public static MPayment createARReceipt(Properties ctx, int salesOrderId, String deliveryViaRule, String trxName) throws OperationException - { - return createPayment(ctx, salesOrderId, deliveryViaRule, MDocType.DOCBASETYPE_ARReceipt, null, null, null, null, null, trxName); - } - - - public static MPayment createARReceipt(Properties ctx, int salesOrderId, String deliveryViaRule, String creditCardType, String creditCardNumber, String cvv2, Integer expMonth, Integer expYear, String trxName) throws OperationException - { - return createPayment(ctx, salesOrderId, deliveryViaRule, MDocType.DOCBASETYPE_ARReceipt, creditCardType, creditCardNumber, cvv2, expMonth, expYear, trxName); - } - - - public static MPayment createPayment(Properties ctx, int orderId, String deliveryViaRule, String docBaseType, String creditCardType, String creditCardNumber, String cvv2, Integer expMonth, Integer expYear, String trxName) throws OperationException - { - MPayment payment; - MOrder order = new MOrder(ctx, orderId, trxName); - - try - { - int orgID = Env.getAD_Org_ID(ctx); - //get org's default bank Account - int bankAccIds[] = MBankAccount.getAllIDs(MBankAccount.Table_Name, " ad_org_id=" + orgID + " and ad_client_id=" + Env.getAD_Client_ID(ctx) + " and isDefault='Y'", trxName); - - if (bankAccIds.length == 0) - throw new OperationException("No default bank account found for org"); - - MBankAccount orgBankAc = new MBankAccount(ctx, bankAccIds[0], trxName); - - payment = new MPayment(ctx,0, trxName); - payment.setC_BankAccount_ID(bankAccIds[0]); - payment.setC_BPartner_ID(order.getC_BPartner_ID()); - payment.setC_Currency_ID(order.getC_Currency_ID()); - payment.setC_Order_ID(orderId); - - if (deliveryViaRule != null && deliveryViaRule.equals(MInOut.DELIVERYVIARULE_Shipper)) - { - payment.setTenderType(MPayment.TENDERTYPE_CreditCard); - - boolean creditcardDetailsValid = payment.setCreditCard(MPayment.TRXTYPE_Sales, creditCardType, creditCardNumber, cvv2,expMonth.intValue(), expYear.intValue()); - - if (!creditcardDetailsValid) - throw new OperationException("Credit Card Details Missing!!!"); - } - else - payment.setTenderType(MPayment.TENDERTYPE_Check); - - MDocType[] docTypes = MDocType.getOfDocBaseType(ctx, docBaseType); - - if (docTypes.length == 0) - throw new OperationException("not document type found for payment"); - - payment.setC_DocType_ID(docTypes[0].get_ID()); - - payment.setAccountNo(orgBankAc.getAccountNo()); - - payment.setPayAmt(order.getGrandTotal()); - - - if (docBaseType.equals(MDocType.DOCBASETYPE_APPayment)) - { - payment.setIsReceipt(false); - payment.setDescription("(AP Payment) Payment Made"); - } - - else - { - payment.setIsReceipt(true); - payment.setDescription("(AR Receipt) Payment Received"); - } - - PoManager.save(payment); - - } - catch(OperationException e) - { - throw e; - } - - return payment; - } - - - public static MPayment completePayment(Properties ctx, int paymentId, String trxName) throws OperationException - { - MPayment payment; - - try - { - payment = new MPayment(ctx, paymentId, trxName); - - - if (payment.getDocStatus().equals(DocumentEngine.STATUS_Completed)) - throw new OperationException("Cannot complete a payment which is already completed"); - - if (payment.getDocStatus().equals(DocumentEngine.STATUS_Voided)) - throw new OperationException("Cannot complete a payment which has been voided"); - - PoManager.processIt(payment, DocumentEngine.ACTION_Complete); - } - catch(OperationException e) - { - throw e; - } - - return payment; - } - - public static MPayment loadPayment(Properties ctx, MOrder order, String trxName) throws OperationException - { - if (!order.getOrderType().equals(UDIOrderTypes.WEBSTORE_ORDER.getOrderType())) - throw new OperationException("This method only loads payment for a webstore order!!"); - - int[] paymentIds = MPayment.getAllIDs(MPayment.Table_Name, "c_order_id=" + order.get_ID(), null); - - if (paymentIds.length > 1) - throw new OperationException("Error loading payment. Webstore does not support multiple payment for one order.Order Id is " + order.get_ID()); - - if (paymentIds.length < 0) - throw new OperationException("Error loading payment. No payment found for this order: " + order.get_ID()); - - //Assuming that there will be only one payment for this order - MPayment payment = new MPayment(ctx, paymentIds[0], trxName); - - return payment; - } - - - public static String isPaid(Properties ctx, int orderId, String trxName) - { - int[] paymentIds = MPayment.getAllIDs(MPayment.Table_Name, "c_order_id=" + orderId, trxName); - - if (paymentIds.length == 0) - return Constants.NO_CHAR; - - MPayment payment = new MPayment(ctx, paymentIds[0], trxName); - - if (payment.getDocStatus().equals(MPayment.DOCSTATUS_Completed)) - return Constants.YES_CHAR; - else - return Constants.NO_CHAR; - } - - - public static void validateCreditCardDetails(CreditCardBean cardBean) throws CreditCardTypeNotSupportedException, CreditCardNumberException, CreditCardExpiryInvalidException, CreditCardVVInvalidException - { - if(cardBean == null) - throw new IllegalArgumentException("CardBean cannot be null"); - - String creditCardNum = cardBean.getCreditCardNumber(); - String creditCardType = cardBean.getCreditCardType(); - - if(!(creditCardType != null - && (creditCardType.equals(MPayment.CREDITCARDTYPE_Amex) - || creditCardType.equals(MPayment.CREDITCARDTYPE_Discover) - || creditCardType.equals(MPayment.CREDITCARDTYPE_MasterCard) - || creditCardType.equals(MPayment.CREDITCARDTYPE_Visa)))) - { - throw new CreditCardTypeNotSupportedException("Credit Card type: " + creditCardType + " is not supported"); - } - - String numValResult = MPaymentValidate.validateCreditCardNumber(creditCardNum, creditCardType); - if(numValResult != "") - throw new CreditCardNumberException("Credit Card number is not valid, Reason: " + numValResult); - - Integer expMonth = cardBean.getCreditCardExpMonth(); - Integer expYear = cardBean.getCreditCardExpYear(); - - if(expMonth == null) - throw new CreditCardExpiryInvalidException("Expiry month cannot be null"); - if(expYear == null) - throw new CreditCardExpiryInvalidException("Expiry year cannot be null"); - - String expiryValResult = MPaymentValidate.validateCreditCardExp(expMonth.intValue(), expYear.intValue()); - - if(expiryValResult != "") - throw new CreditCardExpiryInvalidException("Credit Card Expiry date invalid"); - - String cvv = cardBean.getCvv(); - if(cvv == null) - throw new CreditCardVVInvalidException("Credit Card VV cannot be null"); - - String cvvValResult = MPaymentValidate.validateCreditCardVV(cvv, creditCardType); - if(cvvValResult != "") - throw new CreditCardVVInvalidException("Credit Card VV is not valid"); - } - - - public static String loadCreditCardTypeName(String creditCardType) throws OperationException - { - if(creditCardType == null) - throw new OperationException("Credit Card Type not present!!"); - - String creditCardTypeName = ""; - - if (creditCardType.equals(MPayment.CREDITCARDTYPE_Amex)) - creditCardTypeName = Constants.CREDITCARDTYPE_AMEX; - else - if (creditCardType.equals(MPayment.CREDITCARDTYPE_Discover)) - creditCardTypeName = Constants.CREDITCARDTYPE_DISCOVER; - else - if (creditCardType.equals(MPayment.CREDITCARDTYPE_MasterCard)) - creditCardTypeName = Constants.CREDITCARDTYPE_MASTERCARD; - else - if (creditCardType.equals(MPayment.CREDITCARDTYPE_Visa)) - creditCardTypeName = Constants.CREDITCARDTYPE_VISA; - - return creditCardTypeName; - - } - -} diff --git a/posterita/posterita/src/main/posterita.properties b/posterita/posterita/src/main/posterita.properties deleted file mode 100644 index 7ca992f448..0000000000 --- a/posterita/posterita/src/main/posterita.properties +++ /dev/null @@ -1,13 +0,0 @@ -## webstore Image Folder -webstore.automated.import=OFF -webstore.automated.time=1800000 -webstore.collection.folder=/home/posterita/images/Collections -webstore.inactive.folder=/home/posterita/images/Inactive -webstore.folder.errors=/home/posterita/images/Errors - - -webstore.shipping.promotion.status=ON -webstore.shipping.promotion.price=50 - -webstore.url=http://www.posterita.com -webstore.price.default=120 diff --git a/posterita/posterita/src/utils/ImportMessages.sh b/posterita/posterita/src/utils/ImportMessages.sh deleted file mode 100644 index c5fbac3538..0000000000 --- a/posterita/posterita/src/utils/ImportMessages.sh +++ /dev/null @@ -1 +0,0 @@ -java -DPropertyFile=../Adempiere.properties -cp ./trlImporter.jar:../lib/Adempiere.jar:../lib/CSTools.jar:../lib/CCTools.jar:../lib/oracle.jar:../lib/postgresql.jar:../lib/j2ee.jar:../lib/sqlj.jar com.tamak.core.utils.MsgImporter messages.csv diff --git a/posterita/posterita/src/utils/messages.csv b/posterita/posterita/src/utils/messages.csv deleted file mode 100644 index 2ec869dc47..0000000000 --- a/posterita/posterita/src/utils/messages.csv +++ /dev/null @@ -1,444 +0,0 @@ -"SEARCHKEY";"ENGTEXT";"ENGTIP";"FRENCHTXT";"FRENCHTIP" -"1000_rupees";"1000 Rupees";" ";"1000 Rupees";" " -"100_dollars";"100 dollars";" ";"100 dollars";" " -"100_rupees";"100 Rupees";" ";"100 Rupees";" " -"10_dollars";"10 dollars";" ";"10 dollars";" " -"10_rupees";"10 Rupees";" ";"10 Rupees";" " -"1_cent";"1 cent";"1 cent";"1 sous/centime";" " -"1_dollar";"1 dollar";" ";"1 dollar";" " -"1_rupee";"1 Rupee";" ";"1 Rupee";" " -"2000_rupees";"2000 Rupees";" ";"2000 Rupees";" " -"200_rupees";"200 Rupees";" ";"200 Rupees";" " -"20_cents";"20 cents";"20 cents";"20 sous/centimes";" " -"20_dollars";"20 dollars";" ";"20 dollars";" " -"25_rupees";"25 Rupees";" ";"25 Rupees";" " -"500_rupees";"500 Rupees";" ";"500 Rupees";" " -"50_cents";"50 cents";"50 cents";"50 sous/centimes";" " -"50_dollars";"50 dollars";" ";"50 dollars";" " -"50_rupees";"50 Rupees";" ";"50 Rupees";" " -"5_cents";"5 cents";"5 cents";"5 sous/centimes";" " -"5_dollars";"5 dollars";" ";"5 dollars";" " -"5_rupees";"5 Rupees";" ";"5 Rupees";" " -"Due0";"Due 0";" ";"D 0";" " -"Due0_30";"Due 0-30";" ";"D 0-30";" " -"account.type";"Account Type";" ";"Type de compte";" " -"accounts.receivable";"Accounts Receivable-Trade";" ";"Comptes clients";" " -"activate";"Activate";" ";"Activer";" " -"activate.vendor";"Activate Vendor";" ";"Activer fournisseur";" " -"actual.price";"Actual Price";" ";"Prix actuel";" " -"add";"Add";" ";"Ajouter";" " -"add.black.listed.cheque";"Add Black Listed Cheque";" ";"Ajouter aux ch�ues non valable";" " -"add.customer.fidelity.card";"Add Customer for fidelity card";" ";"Ajouter client �la liste des cartes de fid�it�;" " -"add.customer.for.fidelity.card";"Add Customer for fidelity card";" ";"Ajouter client �la liste des cartes de fid�it�;" " -"add.record";"Add Record";" ";"Ajouter";" " -"add.to.cart";"Add To Cart";" ";"Ajouter au Caddie";" " -"address";"Address";" ";"Adresse";" " -"adjust.cash.book";"Adjust Cash Book";" ";"Ajuster le livre de caisse";" " -"advanced";"Advanced";" ";"Avanc�";" " -"aging";"Aging";" ";"Balance �� du d�iteur";" " -"ajax.error";"Some error occured while communicating with the server. Please try again.";" ";"Une erreur s'est produite lors de la communication avec le serveur. Pri�e de r�ssayer";" " -"all";"All";" ";"Tout";" " -"all.products";"All products";" ";"Tous les produits";" " -"amount.difference";"Difference";" ";"Diff�ence";" " -"amount.expense";"Expense";" ";"D�enses";" " -"amount.receipt";"Receipt";" ";"Montant re�";" " -"amount.refunded";"Amount refunded";" ";"Montant rendu";" " -"amount.tendered";"Amount Tendered";" ";"Montant re�";" " -"amount.transfer";"Transfer";" ";"Montant transf��;" " -"application.name";"Application Name";" ";"Nom de l`application";" " -"application.version";"Application Version";" ";"Version de l`application";" " -"asset";"Assets";" ";"Actif";" " -"at.least.one";"At least one";" ";"Au moins un";" " -"attach.image";"Attach Image";" ";"Attacher une image";" " -"attribute";"Attribute";"Attribute";"Attribue";" " -"attribute.set";"Attribute Set";"Attribute Set";"Groupe de l`attribue";" " -"available.menu";"Available Menus";" ";"Menus disponibles";" " -"back";"Back";" ";"Retour";" " -"barcode";"Barcode";"Barcode";"Code barre";" " -"barcode.already.exists";"Barcode already exists!";" ";"Code barre d��existant";" " -"black.listed.cheques";"Black Listed Cheques";" ";"Ch�ue sur liste noire";" " -"bpartner.info";"Business Partner Info";" ";"Info sur tiers";" " -"bpartner.trx.details";"Business Partner Trx Details";" ";"D�ails des transactions des tiers";" " -"brand";"Brand";" ";"Marque";" " -"cal.period.curr";"Calculation Period And Curr.";" ";"P�iode de calcul et devise";" " -"card";"Card";" ";"Carte bleue";" " -"card.amount";"Card Amount";" ";"Montant carte bleue";" " -"card.amt.entered";"Card Amount Entered";" ";"Montant carte bleue �d�iter";" " -"card.amt.tendered";"Card amount tendered";" ";"Montant re� par carte bleue";" " -"card.amt.total";"Card Amount Total";" ";"Montant total sur carte bleue";" " -"card.is.empty";"The Cart is Empty !";" ";"Le caddie est vide!";" " -"card.no";"Card No";" ";"Num�o de carte bleue";" " -"card.total";"Card Total";" ";"Montant total sur carte bleue";" " -"cart.addmore";"Add More";" ";"Rajouter";" " -"cart.empty";"Cart is empty!";" ";"Le caddie est vide!";" " -"cart.has";"Cart has";" ";"Le caddie contient:";" " -"cart.items";" items";" ";"items";" " -"cart.remove";"Remove";" ";"Retirer";" " -"cash";"Cash";" ";"Esp�e";" " -"cash.amount";"Cash Amount";" ";"Montant en esp�e";" " -"cash.book";"Cash Book";" ";"Livre de caisse";" " -"cash.book.adjust";"The Cash Book has been adjusted.";" ";"Le livre de caisse a ��ajust�;" " -"cash.book.adjusted";"The Cash Book has been adjusted";" ";"Le livre de caisse a ��ajust�;" " -"cash.book.history";"Cash Book History";" ";"Historique du livre de caisse";" " -"cash.line.detail";"Cash Line Details";" ";"D�ail des lignes d'esp�e";" " -"cash.payment";"Cash Payment";" ";"Paiement en esp�e";" " -"cash.receipt";"Cash Receipt";" ";"Montant re� en esp�e";" " -"cash.refunded";"Cash refunded";" ";"Montant rembours�en esp�e";" " -"cash.tendered";"Cash tendered";" ";"Argent donn�;" " -"cash.to.transfer";"Cash to transfer";" ";"Argent �transf�er";" " -"cash.total";"Cash Total";" ";"Total Esp�e";" " -"cellphone";"Cellphone";" ";"T��hone portable/GSM";" " -"checkout";"Checkout";" ";"Sortir";" " -"cheque";"Cheque";" ";"Ch�ue";" " -"cheque.amount";"Cheque Amount";" ";"Montant ch�ue";" " -"cheque.amt.entered";"Cheque Amount Entered";" ";"Montant donn�en ch�ue";" " -"cheque.amt.tendered";"Cheque amount tendered";" ";"Montant re� par ch�ue";" " -"cheque.amt.total";"Cheque Amount Total";" ";"Montant total en ch�ue";" " -"cheque.no";"Cheque No";" ";"No de ch�ue";" " -"cheque.total";"Cheque Total";" ";"Montant total ch�ue";" " -"choose.attribute";"Choose Attribute";" ";"Choisir les attributs";" " -"choose.your.till";"Please choose your till number";" ";"Choisir le num�o de poste";" " -"clear";"Clear";" ";"Supprimer";" " -"close";"Close";" ";"Fermer";" " -"close.till";"Close Till";" ";"Fermer la caisse";" " -"closed";"Closed";" ";"Ferm�;" " -"closing.balance";"Closing Balance";" ";"Balance de cl�ure";" " -"cogs";"CoGS";" ";"Cots des marchandises vendues";" " -"colour";"Colour";" ";"Couleur";" " -"commission.details";"Commission Details";" ";"D�ails des commissions";" " -"completed";"Completed";" ";"Compl��;" " -"continue";"Continue";" ";"Continuer a v�ifier";" " -"create.bpartner";"Create Business Partner";" ";"Cr�r tiers";" " -"create.garment";"Create Garment";" ";"Cr�r";" " -"create.payment";"Create Payment";" ";"Cr�r un paiement";" " -"credit.check";"Credit Check";" ";"V�ification cr�it";" " -"credit.details";"Credit Details";" ";"D�ails cr�nces";" " -"credit.hold";"Credit Hold";" ";"Cr�it �v�ifier";" " -"credit.memo";"Credit Memo";" ";"Cr�it M�o";" " -"credit.ok";"Credit OK";" ";"Cr�it OK";" " -"credit.order";"Credit Order";" ";"Vente �cr�it";" " -"credit.order.discount";"Credit Order Discount";" ";"Remise sur vente �cr�it";" " -"credit.stop";"Credit Stop";" ";"Cr�it suspendu";" " -"credit.watch";"Credit Watch";" ";"Cr�it sous surveillance";" " -"current.month";"Current Month";" ";"Mois actuel";" " -"current.till.amount";"Current Till Amount";" ";"Montant en caisse";" " -"current.week";"Current Week";" ";"Semaine actuelle";" " -"current.year";"Current Year";" ";"Ann� actuelle";" " -"custom";"Custom";" ";"Personnalis�;" " -"custom.sales.reports";"Custom Sales Report";" ";"Tableaux de bords personnalis�";" " -"customer";"Customer";" ";"Client";" " -"customer.id";"Customer ID";" ";"Identification client";" " -"customer.info";"Customer Info";" ";"Information client";" " -"customer.returned.order";"Customer Returned Order";" ";"Retour client";" " -"customervendor";"Customer/Vendor";" ";"Client/Fournisseur";" " -"date.created";"Date Created";" ";"Date de cr�tion";" " -"date.from";"From";" ";"De";" " -"date.ordered";"Date Ordered";"Date Ordered";"Date de commande";" " -"date.range";"Date Range";" ";"P�iode";" " -"date.to";"to";" ";"�;" " -"deactivate";"De-activate";" ";"D�activer";" " -"deactivate.vendor";"Deactivate Vendor";" ";"D�activer fournisseur";" " -"dealer.name";"Dealer Name";" ";"Nom client";" " -"default";"Default";" ";"Par d�aut";" " -"delete";"Delete";" ";"Supprimer";" " -"delete.selected";"Delete Selected";" ";"Supprimer la s�ection";" " -"design";"Design";" ";"Dessin";" " -"discount.amt";"Discount";" ";"Escompte";" " -"discounted.price";"Discounted Price";" ";"Prix sold�;" " -"display";"Display";" ";"Display";" " -"display.all.records";"Do you want to display all records?";" ";"Voulez vous voir toute les entr�s?";" " -"doc.basis.type";"Doc Basis Type";" ";"Type de document";" " -"download.csv";"Download CSV";" ";"T��harger en CSV";" " -"drafted";"Drafted";" ";"Brouillon";" " -"dunning.letters.printed.successfully";"Dunning letters have been printed successfully";" ";"Les lettres ont ��imprim�s";" " -"edit";"Edit";" ";"Modifier";" " -"edit.attribute";"Edit Attribute";" ";"Modifier les attributs";" " -"edit.black.listed.cheque";"Edit Black Listed Cheque";" ";"Modifier la liste des ch�ues non recevables";" " -"edit.customer";"Edit Customer";" ";"Modifier client";" " -"edit.price";"Edit Price";" ";"Modifier prix";" " -"edit.price.list";"Edit Price List";" ";"Modifier la liste de prix";" " -"edit.product";"Edit Product";" ";"�iter le produit";" " -"edit.related.products";"Edit related products details";" ";"Modifier les d�ails des produits";" " -"edit.role";"Edit Role";" ";"Modifier le r�e";" " -"edit.user";"Edit User";" ";"Modifier utilisateur";" " -"edit.vendor";"Edit Vendor";" ";"�iter le fournisseur";" " -"enable.printing";"Enable printing";" ";"Permettre l`impression";" " -"enter";"ENTER";" ";"Entrer";" " -"excl.vat";"(excl. VAT)";" ";"TVA exclu";" " -"fast.moving.item";"Fast Moving Items Report";" ";"Tableau des produits les PLUS vendus";" " -"fast.moving.item.current.month";"Fast Moving Items Report (Current Month)";" ";"Tableau des produits les PLUS vendus (MOIS courant)";" " -"fast.moving.item.today";"Fast Moving Items Report (Today)";" ";"Tableau des produits les PLUS vendus (aujourd'hui)";" " -"filter.by";"Filter By";" ";"Filtrer par";" " -"filter.type";"Choose the type of filter";" ";"Choisir le type de filtre";" " -"first";"First";" ";"Premier";" " -"fixed";"Fixed";" ";"Fixe";" " -"float.amt.change";"This is the float amount for today. Please Enter float amount for the next day if needs to be changed.";" ";"Ceci est le fond de caisse pour aujourd'hui. Pri�e d'entrer le fond de caisse pour le jour suivant si besoin est.";" " -"footer.copyright";"All Contents ©2006 Tamak ICT";" ";" ";"Tout contenues et copies r�erv�" -"found.none";"Found None";" ";"Aucune information correspond �la recherche";" " -"from";"From";" ";"De";" " -"garment.template";"Garment Template";" ";"Mod�e pour v�ement";" " -"generate.commission";"Generate Commission";" ";"G��er les commissions";" " -"goods.received.note";"Goods Received Note";" ";"Achat produit";" " -"goods.returned.note";"Goods Returned Note";" ";"Retour produit";" " -"hide.details";"Hide Details";" ";"Cacher d�ails";" " -"import.black.listed";"Import Black Listed Cheques";" ";"Importer la liste de ch�ues non recevables";" " -"import.blacklisted.message1";"This utility is to import the a list of Black Listed Cheques from a csv file into the system,
    The csv file should look like the one shown below including the header:";" ";"Cet outil aide �importer une liste de ch�ue non recevables dans l'application a partir d'un fichier CSV.
    le ficher CSV doit �re importe sous le m�e format que celui de l'exemple ci-dessous en incluant l'en-t�e";" " -"import.list";"Import List";" ";"Importer la liste";" " -"import.product.message";"This utility is to import the products & Stock in Hand from a csv file into the system,
    For importing the garment products, the CSV file name should containg the word 'Garment'
    The csv file should look like the one shown below including the header";" ";"Cet outil aide �importer une liste de produit accompagner du stock dans l'application a partir d'un fichier CSV.
    le ficher CSV doit �re importe sous le m�e format que celui de l'exemple ci-dessous en incluant l'en-t�e";" " -"incl.vat";"(incl. VAT)";" ";"( TVA inclue)";" " -"inprogress";"InProgress";" ";"En cours";" " -"invalid";"Invalid";" ";"Non valable";" " -"invoice.no";"Invoice No";" ";"No de facture";" " -"invoke";"Invoke";" ";"Chercher";" " -"invoke.customer.returned.order";"Invoke";" ";"Chercher r��ence pour retour client";" " -"invoke.partial";"Invoke Partial POS Order";" ";"Chercher Ordre de vente partiel";" " -"items";"Items";" ";"Items";" " -"last";"Last";" ";"Suivant";" " -"last.2.months";"Last 2 Months";" ";"Deux derniers mois";" " -"last.2.weeks";"Last 2 Weeks";" ";"Deux derni�es semaines";" " -"last.3.months";"Last 3 Months";" ";"Les 3 derniers mois";" " -"last.3.weeks";"Last 3 Weeks";" ";"Les 3 derni�es semaines";" " -"last.6.month";"Last 6 Months";" ";"Les 6 derniers mois";" " -"license.name";"License Name";"License Name";"Nom de la Licence";" " -"license.valid";"License Valid";"License Valid";"Licence valide";" " -"licensed.distribution";"Licensed Distribution";" ";"Distribution de la licence";" " -"licensed.module";"Licensed Modules";" ";"Module de la Licence";" " -"licensing.info";"Licensing Information";" ";"Information de la licence";" " -"list";"List";" ";"Liste";" " -"login.home.all.contents";"All content";" ";"Tout le contenu";" " -"login.home.loginForgot";"Forgot password?";" ";"Vous avez oubli�votre mot de passe?";" " -"login.home.message1";"Please enter your username and password";" ";"Veuillez entrer votre identifiant et votre mot de passe";" " -"login.home.message2";"Please enter PIN";" ";"Entrer votre code secret";" " -"login.home.password";"Password";" ";"Mot de passe";" " -"login.home.username";"Username";" ";"Nom utilisateur";" " -"login.password.backToLogin";"  Click Here to go back to the Login Screen";" ";" ";" " -"login.password.passwordSent";"Your password has been sent you should receive it in a few minutes";" ";"Votre mot de passe vous a ��envoy� vous devriez le recevoir d'ici quelques minutes";" " -"marked.price";"Marked Price";" ";"Prix affich�;" " -"max.active.users";"Max Active Users";" ";"Max d`utilisateur valide";" " -"max.sold.item";"Max sold Item";" ";"Items";" " -"menus";"Menus";" ";"Menus";" " -"min.item.sold";"Min Item Sold";" ";"Min d'article vendus";" " -"mixed";"Mixed";" ";"mixe";" " -"mobile";"Moblie No";" ";"GSM";" " -"model";"Model";" ";"Mod�e";" " -"month";"Month";" ";"Mois";" " -"net.amt";"Net Amount";" ";"Montant Net";" " -"net.cash.trx";"Net Cash Trx";" ";"Montant Net en esp�e";" " -"net.transaction";"Net Transaction";" ";"Transaction net";" " -"new.attribute.value";"New Attribute Value";" ";"Nouvel valeur pour l'attribue";" " -"new.credit.order";"New Credit Order";" ";"Nouvel vente �cr�it";" " -"new.customer";"New Customer";" ";"Nouveau client";" " -"new.customer.return.order";"New Customer Return Order";" ";"Nouveau retour client";" " -"new.goods.received.note";"New Goods Receive Note";" ";"Nouvel achat produit";" " -"new.goods.returned.note";"New Goods Returned Note";" ";"Nouveau retour produit";" " -"new.order";"New Order";" ";"Nouvel vente";" " -"new.price";"New Price";" ";"Nouveau prix";" " -"no";"No";" ";"No";" " -"no.customer.was.found.for";"No customer was found for";" ";"Aucun client n'a ��trouv�pour votre recherche:";" " -"no.shipment";"No Shipment";" ";"No d`exp�ition";" " -"no.vendor.was.found.for";"No vendor was found for";" ";"Aucun fournisseur n'a ��trouv�pour votre recherche:";" " -"normal.template";"Normal Template";" ";"Mod�e normal";" " -"not.authorised.to.give.discount";"It seems that you are not authorised to give discounts";" ";"Vous n'avez pas le droit de donner des remises";" " -"not.found";"Not Found";" ";"Ne peux pas �re trouv�;" " -"notes";"Notes";"Notes";"Coin";" " -"num.active.users";"No of Active Users";" ";"Nombre d`utilisateur actif";" " -"num.operations";"Number of Operations";" ";"Nombre d`op�ation";" " -"old.attribute.value";"Old Attribute Value";" ";"Ancienne valeur de l'attribue";" " -"open.invoices";"Open Invoices";" ";"Ouvrir factures";" " -"opening.balance";"Opening Balance";" ";"Balance d'ouverture";" " -"order.no";"Order No";" ";"num�o de facture";" " -"order.type";"Order Type";" ";"Type de facture";" " -"organisation.name";"Organisations";" ";"Organisation";" " -"partial.pos.order";"Partial POS Order";" ";"Vente partielle";" " -"partial.pos.order.history";"Partial POS Order History";" ";"Historique des ventes partielles";" " -"payment.allocation";"Payment Allocation";" ";"Allocation de payement";" " -"payment.by";"Payment By";" ";"Paiement par";" " -"payment.details";"Payment Details";" ";"D�ails des paiements";" " -"payment.num";"Payment No";"Payment No";"Num�o du paiement";" " -"payment.status";"Payment Status";"Payment Status";"Statue du paiement";" " -"payment.terms";"Payment Terms";" ";"Terme de paiement";" " -"payment.type";"Payment Type";" ";"Type de paiement";" " -"periodic.cash.details";"Periodic Cash Book Details";" ";"D�ails du livre de caisse par p�iode";" " -"please.enter.pin";"Please enter PIN";" ";"Entrer votre code secret";" " -"pmenu.administration";"Administration";" ";"Administration";" " -"pmenu.cash.sales";"Cash Sales";" ";"Ventes";" " -"pmenu.credit.sales";"Credit Sales";" ";"Ventes �Cr�it";" " -"pmenu.performance.analysis";"Performance Analysis";" ";"Tableaux de bords";" " -"pmenu.purchases";"Purchases";" ";"Achat";" " -"pmenu.stock";"Stock";" ";"Stock";" " -"pos.info";"POS Info";" ";"Information du point de vente";" " -"pos.info.current.month";"POS Info (Current Month)";" ";"Information du point de vente(du mois)";" " -"pos.info.custom";"POS Info (Custom)";" ";"Information du point de vente(Personnalis�";" " -"pos.info.today";"POS Info (Today)";" ";"Information du point de vente(aujourd'hui)";" " -"pos.name";"POS Name";" ";"Nom de point de vente";" " -"pos.order";"POS Order";" ";"Facture";" " -"pos.order.history";"POS Order History";" ";"Historique des factures";" " -"posPassowrd.welcome";"Welcome to Tamak POS";" ";"Bienvenue";" " -"postalAddr";"Postal Address";" ";"Adresse postale";" " -"preference.themes";"Themes";" ";"Th�es";" " -"preferences";"Preferences";" ";"Preferences";" " -"prepared.order";"Prepared Order";" ";"Ventes partielles";" " -"prev";"Prev";" ";"Pr��ent";" " -"print.barcode";"Print Barcode";" ";"Imprimer code barre";" " -"print.dunning.letters";"Print Dunning Letters";" ";"Imprimer lettres de rappels";" " -"print.fidelity.card";"Print Fidelity Card";" ";"Imprimer carte de fid�it�;" " -"print.order";"Print Order";" ";"Imprimer facture";" " -"print.pdf";"Print PDF";" ";"Imprimer PDF";" " -"printer.enabled";"Printer enabled";" ";"Imprimante active";" " -"printer.name";"Printer name";" ";"Nom de l`imprimante";" " -"product.already.exists";"Product name already exists!";" ";"Nom du produit est d��existant";" " -"product.id";"Product ID";" ";"ID Produit";" " -"product.info";"Product Info";" ";"Information Produit";" " -"product.type.item";"Item";" ";"Items";" " -"product.type.services";"Services";" ";"Services";" " -"product.updated";"The Products have been updated";" ";"Les produits ont ��mis �jour";" " -"profit.margin";"Profit Margin";" ";"Marge brute";" " -"purchase.price";"Purchase Price";" ";"Prix d'achat";" " -"qty.received";"Qty Received";" ";"Quantit� re�es";" " -"qty.returned.by.customer";"Qty Returned By Customer";" ";"Quantit�retourn�par le client";" " -"qty.returned.to.supplier";"Qty Returned to Supplier";" ";"Quantit�retourn�au fournisseur";" " -"qty.sold";"Qty Sold";" ";"Quantit�vendues";" " -"reason.message";"Reason";" ";"Raison";" " -"record.found";"Records found";" ";"Donn� trouv�s";" " -"records.per.page";"records per page";" ";"Donn� par page";" " -"remote.printing";"Remote printing";" ";"Imprim��distance";" " -"remove.customer.fidelity.card";"Remove Customer for fidelity card";" ";"Enlever client";" " -"report.filter.settings";"Report Filter Settings";" ";"R�lage du filtre des tableaux";" " -"reprint";"Reprint";" ";"R�mprimer";" " -"returned.order";"Returned Order";" ";"Retour";" " -"revenue";"Revenue";" ";"Chiffre d'affaires";" " -"sales.details";"Sales Details";" ";"D�ail de ventes";" " -"sales.order";"Sales Order";" ";"Ventes";" " -"sales.price";"Sales Price";" ";"Prix de vente";" " -"sales.reports";"Sales Reports";" ";"Tableau de vente";" " -"save";"Save";" ";"Save";" " -"save.as.csv";"Save as CSV";" ";"Sauvegarder en CSV";" " -"search";"Search";" ";"Rechercher";" " -"search.customer";"Search Customer";" ";"Rechercher un client";" " -"search.customer.notfound";"No customers were found for";" ";"Pas de clients trouv�pour";" " -"search.product";"Search Product";" ";"Rechercher un produit";" " -"search.product.notfound";"No products were found for:";" ";"Aucun produit n'a ��trouv�pour votre recherche:";" " -"search.result.displaying";"Displaying";" ";"Affichage";" " -"search.result.of";"of";" ";"De";" " -"search.result.to";"to";" ";"Jusqu'�;" " -"search.results";"Search Results";" ";"Rechercher r�ultats";" " -"select";"Select";" ";"S�ectionner";" " -"select.all";"Select All";" ";"Tout S�ectionner";" " -"select.bpartner.type";"Select partner type";" ";"Choisir type de tiers";" " -"select.range";"Select Range";" ";"S�ectionner une p�iode";" " -"selected.customers";"Selected Customers";" ";"S�ectionner les clients";" " -"settle.payment";"Settle Payment";" ";"Paiement d'une facture";" " -"settle.payment.message";"NOTE:-The Cash Payments would have effect only when the cash book is closed";" ";"NOTE:-The Cash Payments would have effect only when the cash book is closed";" " -"shipment.no";"Shipment No";" ";"Num�o d`exp�ition";" " -"shipment.required";"Shipment Required";" ";"Exp�ition requise";" " -"shipment.status";"Shipment Status";"Shipment Status";"Statue de l`exp�ition";" " -"show.details";"Show Details";" ";"Montrer d�ails";" " -"size";"Size";" ";"Taille";" " -"slow.moving.item";"Slow Moving Items";" ";"Produits lents";" " -"smenu.adjust.cashbook";"Adjust Cash Book";" ";"Ajuster le livre de caisse";" " -"smenu.adjust.inventory.id";"Adjust Inventory";" ";"Ajuster l'inventaire";" " -"smenu.adjust.stock.id";"Stock Adjustment";" ";"Ajuster le stock";" " -"smenu.bpartner.sales.details";"Business Partner Sales Details";" ";"Info sur tiers";" " -"smenu.bpartners";"Business Partners";" ";"Tiers";" " -"smenu.cash.sales";"Cash Sales";" ";"Ventes";" " -"smenu.cash.sales.customer.complusory";"Cash Sales (Customer Compulsory)";" ";"Ventes (Client obligatoire)";" " -"smenu.cash.sales.history";"Cash Sales History";" ";"Historique des ventes";" " -"smenu.cash.sales.multiple.payments";"Cash Sales (Discount/Multiple Payments)";" ";"Ventes (Remises/Paiements multiples)";" " -"smenu.cashbook.history";"Cash Book History";" ";"Historique du livre de caisse";" " -"smenu.cashbook.report";"Cash Book Report";" ";"Tableaux de bords du livre de caisse";" " -"smenu.check.repair.database.integrity";"Check/Repair Database Integrity";" ";"V�ifier/R�arer l'int�rit�de la base de donn�s";" " -"smenu.close.till";"Close Till";" ";"Fermer la caisse";" " -"smenu.complete.prepared.order";"Complete Prepared Order";" ";"Compl��une vente partielle";" " -"smenu.create.unallocated.payment.id";"Create General Payments";" ";"Cr�r un paiement g��al";" " -"smenu.credit.memo.history.id";"Credit Memo History";" ";"Credit Memo History";" " -"smenu.credit.sales";"Credit Sales";" ";"Ventes �cr�it";" " -"smenu.credit.sales.history";"Credit Sales History";" ";"Historique des ventes �cr�it";" " -"smenu.creditmemo.from.creditorder.id";"Invoke Credit Memo";" ";"Chercher r��ence pour vente �cr�it";" " -"smenu.current.money.in.terminal";"Current Money in Terminal";" ";"Montant du terminal";" " -"smenu.customer.return.history.id";"Customer Return History";" ";"Customer Return History";" " -"smenu.customer.returned.order";"Customer Returned Order";" ";"Retour client";" " -"smenu.customers";"Customers";" ";"Clients";" " -"smenu.document.history";"Document History";" ";"Historique des documents";" " -"smenu.dunning.letters";"Dunning Letters";" ";"Lettres de rappelles";" " -"smenu.edit.product.attribute.value";"Edit Product Attribute Value";" ";"�iter valeur de l'attribut du produit";" " -"smenu.fast.moving.items";"Fast Moving Items";" ";"Tableaux des produits les plus vendus";" " -"smenu.generate.commission";"Generate Commission";" ";"G��er les commissions";" " -"smenu.goods.received.note";"Goods Received Note";" ";"Achat produit";" " -"smenu.goods.received.note.history";"Goods Received Note History";" ";"Historique des achats produit";" " -"smenu.goods.returned.note";"Goods Returned Note";" ";"Retour produit";" " -"smenu.goods.returned.note.history";"Goods Returned Note History";" ";"Historique des retours produit";" " -"smenu.inventory.history.id";"Inventory History";" ";"Historique des inventaires";" " -"smenu.invoke.customer.returned.order";"Invoke Customer Returned Order";" ";"Rechercher retour client";" " -"smenu.logout";"Logout";" ";"Quitter";" " -"smenu.open.cashdrawer";"Open Cash Drawer";" ";"Ouvrir la caisse";" " -"smenu.order.history";"Order History";" ";"Historique des ventes";" " -"smenu.payment.allocation.history";"Payment Allocations History";" ";"Historique des allocations de paiement";" " -"smenu.payment.term";"Payment Term";" ";"Allocation de payement";" " -"smenu.performance.analysis.report";"Performance Analysis Report";" ";"Tableaux de bords";" " -"smenu.preferences";"Preferences";" ";"Pr��ences";" " -"smenu.prepare.order";"Prepare Order";" ";"Ventes partielles";" " -"smenu.prepared.order.history";"Prepared Order History";" ";"Historique des ventes partielles";" " -"smenu.products";"Products";" ";"Produits";" " -"smenu.quick.cash.sales";"Quick Cash Sales";" ";"Ventes rapide";" " -"smenu.role";"Role";" ";"R�e";" " -"smenu.sales.report.per.terminal";"Sales Report per Terminal";" ";"Tableaux de bords par terminal";" " -"smenu.settle.payment.credit.sales";"Settle Payment on a Credit Sales";" ";"Paiement pour ventes �cr�it";" " -"smenu.slow.moving.items";"Slow Moving Items";" ";"Tableaux des produits les moins vendus";" " -"smenu.stock";"Stock";" ";"Stock";" " -"smenu.stock.movement";"Stock Movement";" ";"Mouvement du stock";" " -"smenu.tax";"Tax";" ";"Taxe";" " -"smenu.users";"Users";" ";"Utilisateur";" " -"smenu.vendors";"Vendors";" ";"Fournisseurs";" " -"smenu.view.last.generated.commission";"Last Generated Commission";" ";"Visualiser les derni�es commissions g���s";" " -"smenu.view.licensing";"Licensing";" ";"Visualiser licence";" " -"status";"Status";"Status";"Statues";" " -"stock.in.hand";"Stock in Hand";" ";"Stock disponible";" " -"stock.inquiry";"Stock Inquiry";" ";"Interrogation du stock";" " -"stock.movement";"Stock Movement";" ";"Mouvement du stock";" " -"stock.movement.report";"Stock Movement Report";" ";"�ats sur les mouvements de stock";" " -"submit";"Submit";" ";"Soumettre";" " -"summary.by.periods";"Summary By Period";" ";"R�um�par p�iode";" " -"switch.to.paging";"Switch to Paging";" ";"Changer la pagination";" " -"tamak.pos";"TAMAK ICT WARMS";" ";"Tamak ICT ARMS";" " -"tax.credit";"Tax Credit";" ";"Cr�it de TVA";" " -"tax.due";"Tax Due";" ";"TVA d";" " -"texttile.products.only";"Textile Products Only";" ";"Produits textiles uniquement";" " -"the.cart.has";"The Cart has";" ";"Le caddie contient:";" " -"till.balance.entered";"Till Balance Entered";" ";"Balance de la caisse entr�par vendeur";" " -"till.management";"Till Mgt";" ";"G�er la caisse";" " -"till.no";"Till No";" ";"No de caisse";" " -"time.hour";"h";" ";"H";" " -"time.minute";"m";" ";"Min";" " -"to";"To";" ";"Jusqu'�;" " -"today";"Today";" ";"Aujourd'hui";" " -"total";"Total";" ";"Total";" " -"total.price";"Total Price";" ";"Prix total";" " -"trade.revenue";"Trade Revenue";" ";"Chiffre d'affaires";" " -"unallocated.payments";"Unallocated Payments";" ";"Paiements non assign�;" " -"update.details";"Update Details";" ";"Mise �jour";" " -"user";"User";" ";"Utilisateur";" " -"user.details";"User's Details";" ";"D�ails utilisateur";" " -"user.info";"Information";" ";"Information";" " -"vat";"VAT";" ";"TVA";" " -"vendor.details";"Vendor Details";" ";"D�ails fournisseurs";" " -"vendor.ref";"Vendor Ref";" ";"R��ence fournisseur";" " -"vendors";"Vendors";" ";"Fournisseurs";" " -"view";"View";" ";"Visualiser";" " -"view.attributes";"View Attributes";"View Attributes";"Visualiser attribues";" " -"view.by";"View By";" ";"Visualiser par";" " -"view.info";"View Info";" ";"Visualiser Info";" " -"view.product.cart";"View Product Cart";" ";"Visualiser caddie";" " -"view.report";"View Report";" ";"Visualiser tableaux de bords";" " -"view.role";"View Role";" ";"Visualiser R�e";" " -"view.vendor";"View Vendor";" ";"Visualiser fournisseur";" " -"year";"Year";" ";"Ann�";" " -"yes";"Yes";" ";"Oui";" " -"price.x";"Price(excl. VAT)";"Prix(excl. TVA)";" " -"price.i";"Price(incl. VAT)";"Prix(incl. TVA)";" " -"LogOut";"Log Out";"Sortir";" " -"smenu.price.check";"Price Check";"Verifier Prix";" " -"next";"Next";"Suivant";" " -"grouped.by";"Group by";"Grouper par";" " -"view.product";"View Product";"Produit de vue";" " -"activate.product";"Activate Ptoduct";"Activez le produit";" " -"deactivate.product";"Deactivate Produit";"Desactiver le produit";" " diff --git a/posterita/posterita/web/WEB-INF/c.tld b/posterita/posterita/web/WEB-INF/c.tld deleted file mode 100644 index ce80e8dd55..0000000000 --- a/posterita/posterita/web/WEB-INF/c.tld +++ /dev/null @@ -1,416 +0,0 @@ - - - - 1.0 - 1.2 - c - http://java.sun.com/jstl/core - JSTL core - JSTL 1.0 core library - - - - org.apache.taglibs.standard.tlv.JstlCoreTLV - - - expressionAttributes - - out:value - out:default - out:escapeXml - if:test - import:url - import:context - import:charEncoding - forEach:items - forEach:begin - forEach:end - forEach:step - forTokens:items - forTokens:begin - forTokens:end - forTokens:step - param:encode - param:name - param:value - redirect:context - redirect:url - set:property - set:target - set:value - url:context - url:value - when:test - - - Whitespace-separated list of colon-separated token pairs - describing tag:attribute combinations that accept expressions. - The validator uses this information to determine which - attributes need their syntax validated. - - - - - - catch - org.apache.taglibs.standard.tag.common.core.CatchTag - JSP - - Catches any Throwable that occurs in its body and optionally - exposes it. - - - var - false - false - - - - - choose - org.apache.taglibs.standard.tag.common.core.ChooseTag - JSP - - Simple conditional tag that establishes a context for - mutually exclusive conditional operations, marked by - <when> and <otherwise> - - - - - out - org.apache.taglibs.standard.tag.el.core.OutTag - JSP - - Like <%= ... >, but for expressions. - - - value - true - false - - - default - false - false - - - escapeXml - false - false - - - - - if - org.apache.taglibs.standard.tag.el.core.IfTag - JSP - - Simple conditional tag, which evalutes its body if the - supplied condition is true and optionally exposes a Boolean - scripting variable representing the evaluation of this condition - - - test - true - false - - - var - false - false - - - scope - false - false - - - - - import - org.apache.taglibs.standard.tag.el.core.ImportTag - org.apache.taglibs.standard.tei.ImportTEI - JSP - - Retrieves an absolute or relative URL and exposes its contents - to either the page, a String in 'var', or a Reader in 'varReader'. - - - url - true - false - - - var - false - false - - - scope - false - false - - - varReader - false - false - - - context - false - false - - - charEncoding - false - false - - - - - forEach - org.apache.taglibs.standard.tag.el.core.ForEachTag - org.apache.taglibs.standard.tei.ForEachTEI - JSP - - The basic iteration tag, accepting many different - collection types and supporting subsetting and other - functionality - - - items - false - false - - - begin - false - false - - - end - false - false - - - step - false - false - - - var - false - false - - - varStatus - false - false - - - - - forTokens - org.apache.taglibs.standard.tag.el.core.ForTokensTag - JSP - - Iterates over tokens, separated by the supplied delimeters - - - items - true - false - - - delims - true - false - - - begin - false - false - - - end - false - false - - - step - false - false - - - var - false - false - - - varStatus - false - false - - - - - otherwise - org.apache.taglibs.standard.tag.common.core.OtherwiseTag - JSP - - Subtag of <choose> that follows <when> tags - and runs only if all of the prior conditions evaluated to - 'false' - - - - - param - org.apache.taglibs.standard.tag.el.core.ParamTag - JSP - - Adds a parameter to a containing 'import' tag's URL. - - - name - true - false - - - value - false - false - - - - - redirect - org.apache.taglibs.standard.tag.el.core.RedirectTag - JSP - - Redirects to a new URL. - - - var - false - false - - - scope - false - false - - - url - true - false - - - context - false - false - - - - - remove - org.apache.taglibs.standard.tag.common.core.RemoveTag - empty - - Removes a scoped variable (from a particular scope, if specified). - - - var - true - false - - - scope - false - false - - - - - set - org.apache.taglibs.standard.tag.el.core.SetTag - JSP - - Sets the result of an expression evaluation in a 'scope' - - - var - false - false - - - value - false - false - - - target - false - false - - - property - false - false - - - scope - false - false - - - - - url - org.apache.taglibs.standard.tag.el.core.UrlTag - JSP - - Prints or exposes a URL with optional query parameters - (via the c:param tag). - - - var - false - false - - - scope - false - false - - - value - true - false - - - context - false - false - - - - - when - org.apache.taglibs.standard.tag.el.core.WhenTag - JSP - - Subtag of <choose> that includes its body if its - condition evalutes to 'true' - - - test - true - false - - - - diff --git a/posterita/posterita/web/WEB-INF/dcs.tld b/posterita/posterita/web/WEB-INF/dcs.tld deleted file mode 100644 index f24e99d210..0000000000 --- a/posterita/posterita/web/WEB-INF/dcs.tld +++ /dev/null @@ -1,201 +0,0 @@ - - - -1.0 -1.1 -dcs - - - - -orderStatus -org.posterita.taglib.OrderStatus -JSP - -name -true -true - - -property -true -true - - -scope -false -true - - - - -attributeValues -com.posterita.taglib.AttributeValues -JSP - -name -true -true - - -property -true -true - - -scope -false -true - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/WEB-INF/fmt.tld b/posterita/posterita/web/WEB-INF/fmt.tld deleted file mode 100644 index 20523ee619..0000000000 --- a/posterita/posterita/web/WEB-INF/fmt.tld +++ /dev/null @@ -1,442 +0,0 @@ - - - - 1.0 - 1.2 - fmt - http://java.sun.com/jstl/fmt - JSTL fmt - JSTL 1.0 i18n-capable formatting library - - - - org.apache.taglibs.standard.tlv.JstlFmtTLV - - - expressionAttributes - - requestEncoding:value - setLocale:value - setLocale:variant - timeZone:value - setTimeZone:value - bundle:basename - bundle:prefix - setBundle:basename - message:key - message:bundle - param:value - formatNumber:value - formatNumber:pattern - formatNumber:currencyCode - formatNumber:currencySymbol - formatNumber:groupingUsed - formatNumber:maxIntegerDigits - formatNumber:minIntegerDigits - formatNumber:maxFractionDigits - formatNumber:minFractionDigits - parseNumber:value - parseNumber:pattern - parseNumber:parseLocale - parseNumber:integerOnly - formatDate:value - formatDate:pattern - formatDate:timeZone - parseDate:value - parseDate:pattern - parseDate:timeZone - parseDate:parseLocale - - - Whitespace-separated list of colon-separated token pairs - describing tag:attribute combinations that accept expressions. - The validator uses this information to determine which - attributes need their syntax validated. - - - - - - requestEncoding - org.apache.taglibs.standard.tag.el.fmt.RequestEncodingTag - empty - - Sets the request character encoding - - - value - false - false - - - - - setLocale - org.apache.taglibs.standard.tag.el.fmt.SetLocaleTag - empty - - Stores the given locale in the locale configuration variable - - - value - true - false - - - variant - false - false - - - scope - false - false - - - - - timeZone - org.apache.taglibs.standard.tag.el.fmt.TimeZoneTag - JSP - - Specifies the time zone for any time formatting or parsing actions - nested in its body - - - value - true - false - - - - - setTimeZone - org.apache.taglibs.standard.tag.el.fmt.SetTimeZoneTag - empty - - Stores the given time zone in the time zone configuration variable - - - value - true - false - - - var - false - false - - - scope - false - false - - - - - bundle - org.apache.taglibs.standard.tag.el.fmt.BundleTag - JSP - - Loads a resource bundle to be used by its tag body - - - basename - true - false - - - prefix - false - false - - - - - setBundle - org.apache.taglibs.standard.tag.el.fmt.SetBundleTag - empty - - Loads a resource bundle and stores it in the named scoped variable or - the bundle configuration variable - - - basename - true - false - - - var - false - false - - - scope - false - false - - - - - message - org.apache.taglibs.standard.tag.el.fmt.MessageTag - JSP - - Maps key to localized message and performs parametric replacement - - - key - false - false - - - bundle - false - false - - - var - false - false - - - scope - false - false - - - - - param - org.apache.taglibs.standard.tag.el.fmt.ParamTag - JSP - - Supplies an argument for parametric replacement to a containing - <message> tag - - - value - false - false - - - - - formatNumber - org.apache.taglibs.standard.tag.el.fmt.FormatNumberTag - JSP - - Formats a numeric value as a number, currency, or percentage - - - value - false - false - - - type - false - false - - - pattern - false - false - - - currencyCode - false - false - - - currencySymbol - false - false - - - groupingUsed - false - false - - - maxIntegerDigits - false - false - - - minIntegerDigits - false - false - - - maxFractionDigits - false - false - - - minFractionDigits - false - false - - - var - false - false - - - scope - false - false - - - - - parseNumber - org.apache.taglibs.standard.tag.el.fmt.ParseNumberTag - JSP - - Parses the string representation of a number, currency, or percentage - - - value - false - false - - - type - false - false - - - pattern - false - false - - - parseLocale - false - false - - - integerOnly - false - false - - - var - false - false - - - scope - false - false - - - - - formatDate - org.apache.taglibs.standard.tag.el.fmt.FormatDateTag - empty - - Formats a date and/or time using the supplied styles and pattern - - - value - true - false - - - type - false - false - - - dateStyle - false - false - - - timeStyle - false - false - - - pattern - false - false - - - timeZone - false - false - - - var - false - false - - - scope - false - false - - - - - parseDate - org.apache.taglibs.standard.tag.el.fmt.ParseDateTag - JSP - - Parses the string representation of a date and/or time - - - value - false - false - - - type - false - false - - - dateStyle - false - false - - - timeStyle - false - false - - - pattern - false - false - - - timeZone - false - false - - - parseLocale - false - false - - - var - false - false - - - scope - false - false - - - - diff --git a/posterita/posterita/web/WEB-INF/pos.tld b/posterita/posterita/web/WEB-INF/pos.tld deleted file mode 100644 index b194ced21f..0000000000 --- a/posterita/posterita/web/WEB-INF/pos.tld +++ /dev/null @@ -1,76 +0,0 @@ - - - - 1.0 - 1.2 - pos - pos.tld - POSterita - $Id: pos.tld,v 1.2 2006/11/29 05:23:55 alok Exp $ - - - - message - org.posterita.pos.taglib.MessageTag - JSP - Display element - - key - true - true - - - printing - false - false - - - textOnly - false - false - - - - bpartner - org.posterita.pos.taglib.BPartnerSearchTag - JSP - Ajax search for BPartner - - name - true - true - - - property - true - true - - - disabled - false - true - - - isCustomer - false - false - - - isVendor - false - false - - - isEmployee - false - false - - - size - false - false - - - \ No newline at end of file diff --git a/posterita/posterita/web/WEB-INF/posterita.tld b/posterita/posterita/web/WEB-INF/posterita.tld deleted file mode 100644 index 11315c500f..0000000000 --- a/posterita/posterita/web/WEB-INF/posterita.tld +++ /dev/null @@ -1,146 +0,0 @@ - - - -1.0 -1.1 -dms - - - - -regionName -com.dms.taglib.Region -JSP - -name -true -true - - -property -false -true - - -scope -true -true - - - - -warehouseName -com.dms.taglib.Warehouse -JSP - -name -true -true - - -property -false -true - - -scope -true -true - - - - - -productName -com.dms.taglib.ProductName -JSP - -name -true -true - - -property -false -true - - -scope -true -true - - - - - bankName - com.dms.taglib.BankName - JSP - - name - true - true - - - property - false - true - - - scope - true - true - - - - - -menuClose -com.dms.taglib.MenuClose -JSP - -name -true -true - - -property -false -true - - -scope -true -true - - - - - -sco -com.dms.taglib.SCONaming -JSP - -name -false -true - - -property -false -true - - -abbreviated -false -true - - -scope -false -true - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/WEB-INF/struts-bean.tld b/posterita/posterita/web/WEB-INF/struts-bean.tld deleted file mode 100644 index 5fe94bd359..0000000000 --- a/posterita/posterita/web/WEB-INF/struts-bean.tld +++ /dev/null @@ -1,382 +0,0 @@ - - - - - - - - - - -1.2 -1.1 -bean -http://struts.apache.org/tags-bean - -cookie -org.apache.struts.taglib.bean.CookieTag -org.apache.struts.taglib.bean.CookieTei -empty - -id -true -false - - -multiple -false -true - - -name -true -true - - -value -false -true - - - -define -org.apache.struts.taglib.bean.DefineTag -org.apache.struts.taglib.bean.DefineTei -JSP - -id -true -false - - -name -false -true - - -property -false -true - - -scope -false -true - - -toScope -false -true - - -type -false -true - - -value -false -true - - - -header -org.apache.struts.taglib.bean.HeaderTag -org.apache.struts.taglib.bean.HeaderTei -empty - -id -true -false - - -multiple -false -true - - -name -true -true - - -value -false -true - - - -include -org.apache.struts.taglib.bean.IncludeTag -org.apache.struts.taglib.bean.IncludeTei -empty - -anchor -false -true - - -forward -false -true - - -href -false -true - - -id -true -false - - -name -false -true - - -page -false -true - - -transaction -false -true - - - -message -org.apache.struts.taglib.bean.MessageTag -empty - -arg0 -false -true - - -arg1 -false -true - - -arg2 -false -true - - -arg3 -false -true - - -arg4 -false -true - - -bundle -false -true - - -key -false -true - - -locale -false -true - - -name -false -true - - -property -false -true - - -scope -false -true - - - -page -org.apache.struts.taglib.bean.PageTag -org.apache.struts.taglib.bean.PageTei -empty - -id -true -false - - -property -true -true - - - -parameter -org.apache.struts.taglib.bean.ParameterTag -org.apache.struts.taglib.bean.ParameterTei -empty - -id -true -false - - -multiple -false -true - - -name -true -true - - -value -false -true - - - -resource -org.apache.struts.taglib.bean.ResourceTag -org.apache.struts.taglib.bean.ResourceTei -empty - -id -true -false - - -input -false -true - - -name -true -true - - - -size -org.apache.struts.taglib.bean.SizeTag -org.apache.struts.taglib.bean.SizeTei -empty - -collection -false -true - - -id -true -false - - -name -false -true - - -property -false -true - - -scope -false -true - - - -struts -org.apache.struts.taglib.bean.StrutsTag -org.apache.struts.taglib.bean.StrutsTei -empty - -id -true -false - - -formBean -false -true - - -forward -false -true - - -mapping -false -true - - - -write -org.apache.struts.taglib.bean.WriteTag -empty - -bundle -false -true - - -filter -false -true - - -format -false -true - - -formatKey -false -true - - -ignore -false -true - - -locale -false -true - - -name -true -true - - -property -false -true - - -scope -false -true - - - - - - diff --git a/posterita/posterita/web/WEB-INF/struts-config.xml b/posterita/posterita/web/WEB-INF/struts-config.xml deleted file mode 100644 index e33082530b..0000000000 --- a/posterita/posterita/web/WEB-INF/struts-config.xml +++ /dev/null @@ -1,6673 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/posterita/web/WEB-INF/struts-config_1_2.dtd b/posterita/posterita/web/WEB-INF/struts-config_1_2.dtd deleted file mode 100644 index fa479f76b5..0000000000 --- a/posterita/posterita/web/WEB-INF/struts-config_1_2.dtd +++ /dev/null @@ -1,686 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/posterita/web/WEB-INF/struts-html.tld b/posterita/posterita/web/WEB-INF/struts-html.tld deleted file mode 100644 index a53db16f66..0000000000 --- a/posterita/posterita/web/WEB-INF/struts-html.tld +++ /dev/null @@ -1,3032 +0,0 @@ - - - - - - - - - - -1.2 -1.1 -html -http://struts.apache.org/tags-html - -base -org.apache.struts.taglib.html.BaseTag -empty - -target -false -true - - -server -false -true - - - -button -org.apache.struts.taglib.html.ButtonTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -cancel -org.apache.struts.taglib.html.CancelTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -checkbox -org.apache.struts.taglib.html.CheckboxTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -errors -org.apache.struts.taglib.html.ErrorsTag -empty - -bundle -false -true - - -locale -false -true - - -name -false -true - - -property -false -true - - - -file -org.apache.struts.taglib.html.FileTag - -accesskey -false -true - - -accept -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -maxlength -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -size -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -form -org.apache.struts.taglib.html.FormTag -JSP - -action -true -true - - -acceptCharset -false -true - - -enctype -false -true - - -focus -false -true - - -focusIndex -false -true - - -method -false -true - - -onreset -false -true - - -onsubmit -false -true - - -scriptLanguage -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -target -false -true - - - -frame -org.apache.struts.taglib.html.FrameTag - -action -false -true - - -module -false -true - - -anchor -false -true - - -forward -false -true - - -frameborder -false -true - - -frameName -false -true - - -href -false -true - - -longdesc -false -true - - -marginheight -false -true - - -marginwidth -false -true - - -name -false -true - - -noresize -false -true - - -page -false -true - - -paramId -false -true - - -paramName -false -true - - -paramProperty -false -true - - -paramScope -false -true - - -property -false -true - - -scope -false -true - - -scrolling -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -title -false -true - - -titleKey -false -true - - -transaction -false -true - - - -hidden -org.apache.struts.taglib.html.HiddenTag -empty - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - -write -false -true - - - -html -org.apache.struts.taglib.html.HtmlTag -JSP - -lang -false -true - - -locale -false -true - - -xhtml -false -true - - - -image -org.apache.struts.taglib.html.ImageTag - -accesskey -false -true - - -align -false -true - - -alt -false -true - - -altKey -false -true - - -border -false -true - - -bundle -false -true - - -disabled -false -true - - -indexed -false -true - - -locale -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -page -false -true - - -pageKey -false -true - - -property -false -true - - -src -false -true - - -srcKey -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -img -org.apache.struts.taglib.html.ImgTag -empty - -align -false -true - - -alt -false -true - - -altKey -false -true - - -border -false -true - - -bundle -false -true - - -contextRelative -false -true - - -height -false -true - - -hspace -false -true - - -imageName -false -true - - -ismap -false -true - - -locale -false -true - - -lowsrc -false -true - - -name -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -paramId -false -true - - -page -false -true - - -pageKey -false -true - - -action -false -true - - -module -false -true - - -paramName -false -true - - -paramProperty -false -true - - -paramScope -false -true - - -property -false -true - - -scope -false -true - - -src -false -true - - -srcKey -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -title -false -true - - -titleKey -false -true - - -useLocalEncoding -false -true - - -usemap -false -true - - -vspace -false -true - - -width -false -true - - - -javascript -org.apache.struts.taglib.html.JavascriptValidatorTag -empty - -cdata -false -true - - -dynamicJavascript -false -false - - -formName -false -true - - -method -false -true - - -page -false -true - - -scriptLanguage -false -true - - -src -false -true - - -staticJavascript -false -false - - -htmlComment -false -true - - - -link -org.apache.struts.taglib.html.LinkTag - -accesskey -false -true - - -action -false -true - - -module -false -true - - -anchor -false -true - - -forward -false -true - - -href -false -true - - -indexed -false -true - - -indexId -false -true - - -linkName -false -true - - -name -false -true - - -onblur -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -page -false -true - - -paramId -false -true - - -paramName -false -true - - -paramProperty -false -true - - -paramScope -false -true - - -property -false -true - - -scope -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -target -false -true - - -title -false -true - - -titleKey -false -true - - -transaction -false -true - - -useLocalEncoding -false -true - - - -messages -org.apache.struts.taglib.html.MessagesTag -org.apache.struts.taglib.html.MessagesTei -JSP - -id -true -false - - -bundle -false -true - - -locale -false -true - - -name -false -true - - -property -false -true - - -header -false -true - - -footer -false -true - - -message -false -true - - - -multibox -org.apache.struts.taglib.html.MultiboxTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -option -org.apache.struts.taglib.html.OptionTag - -bundle -false -true - - -disabled -false -true - - -key -false -true - - -locale -false -true - - -style -false -true - - -styleId -false -true - - -styleClass -false -true - - -value -true -true - - - -options -org.apache.struts.taglib.html.OptionsTag -empty - -collection -false -true - - -filter -false -true - - -labelName -false -true - - -labelProperty -false -true - - -name -false -true - - -property -false -true - - -style -false -true - - -styleClass -false -true - - - -optionsCollection -org.apache.struts.taglib.html.OptionsCollectionTag -empty - -filter -false -true - - -label -false -true - - -name -false -true - - -property -false -true - - -style -false -true - - -styleClass -false -true - - -value -false -true - - - -password -org.apache.struts.taglib.html.PasswordTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -maxlength -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -readonly -false -true - - -redisplay -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -size -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -radio -org.apache.struts.taglib.html.RadioTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -property -true -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -true -true - - -idName -false -true - - - -reset -org.apache.struts.taglib.html.ResetTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -rewrite -org.apache.struts.taglib.html.RewriteTag -empty - -action -false -true - - -module -false -true - - -anchor -false -true - - -forward -false -true - - -href -false -true - - -name -false -true - - -page -false -true - - -paramId -false -true - - -paramName -false -true - - -paramProperty -false -true - - -paramScope -false -true - - -property -false -true - - -scope -false -true - - -transaction -false -true - - -useLocalEncoding -false -true - - - -select -org.apache.struts.taglib.html.SelectTag -JSP - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -multiple -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -size -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -submit -org.apache.struts.taglib.html.SubmitTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -text -org.apache.struts.taglib.html.TextTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -maxlength -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -readonly -false -true - - -size -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -textarea -org.apache.struts.taglib.html.TextareaTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -cols -false -true - - -disabled -false -true - - -indexed -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -readonly -false -true - - -rows -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -xhtml -org.apache.struts.taglib.html.XhtmlTag -empty - - - diff --git a/posterita/posterita/web/WEB-INF/struts-logic.tld b/posterita/posterita/web/WEB-INF/struts-logic.tld deleted file mode 100644 index f920868073..0000000000 --- a/posterita/posterita/web/WEB-INF/struts-logic.tld +++ /dev/null @@ -1,652 +0,0 @@ - - - - - - - - - -1.2 -1.1 -logic -http://struts.apache.org/tags-logic - -empty -org.apache.struts.taglib.logic.EmptyTag -JSP - -name -false -true - - -property -false -true - - -scope -false -true - - - -equal -org.apache.struts.taglib.logic.EqualTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -forward -org.apache.struts.taglib.logic.ForwardTag -empty - -name -true -true - - - -greaterEqual -org.apache.struts.taglib.logic.GreaterEqualTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -greaterThan -org.apache.struts.taglib.logic.GreaterThanTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -iterate -org.apache.struts.taglib.logic.IterateTag -org.apache.struts.taglib.logic.IterateTei -JSP - -collection -false -true - - -id -true -false - - -indexId -false -false - - -length -false -true - - -name -false -true - - -offset -false -true - - -property -false -true - - -scope -false -true - - -type -false -true - - - -lessEqual -org.apache.struts.taglib.logic.LessEqualTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -lessThan -org.apache.struts.taglib.logic.LessThanTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -match -org.apache.struts.taglib.logic.MatchTag -JSP - -cookie -false -true - - -header -false -true - - -location -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -messagesNotPresent -org.apache.struts.taglib.logic.MessagesNotPresentTag -JSP - -name -false -true - - -property -false -true - - -message -false -true - - - -messagesPresent -org.apache.struts.taglib.logic.MessagesPresentTag -JSP - -name -false -true - - -property -false -true - - -message -false -true - - - -notEmpty -org.apache.struts.taglib.logic.NotEmptyTag -JSP - -name -false -true - - -property -false -true - - -scope -false -true - - - -notEqual -org.apache.struts.taglib.logic.NotEqualTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -notMatch -org.apache.struts.taglib.logic.NotMatchTag -JSP - -cookie -false -true - - -header -false -true - - -location -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -notPresent -org.apache.struts.taglib.logic.NotPresentTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -role -false -true - - -scope -false -true - - -user -false -true - - - -present -org.apache.struts.taglib.logic.PresentTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -role -false -true - - -scope -false -true - - -user -false -true - - - -redirect -org.apache.struts.taglib.logic.RedirectTag - -action -false -true - - -anchor -false -true - - -forward -false -true - - -href -false -true - - -name -false -true - - -page -false -true - - -paramId -false -true - - -paramName -false -true - - -paramProperty -false -true - - -paramScope -false -true - - -property -false -true - - -scope -false -true - - -transaction -false -true - - -useLocalEncoding -false -true - - - - - - diff --git a/posterita/posterita/web/WEB-INF/struts-nested.tld b/posterita/posterita/web/WEB-INF/struts-nested.tld deleted file mode 100644 index f4a10d0f52..0000000000 --- a/posterita/posterita/web/WEB-INF/struts-nested.tld +++ /dev/null @@ -1,2886 +0,0 @@ - - - - - - - - - -1.2 -1.1 -nested -http://struts.apache.org/tags-nested - -nest -org.apache.struts.taglib.nested.NestedPropertyTag -JSP - -property -false -true - - - -writeNesting -org.apache.struts.taglib.nested.NestedWriteNestingTag -org.apache.struts.taglib.nested.NestedWriteNestingTei -JSP - -property -false -true - - -id -false -true - - -filter -false -true - - - -root -org.apache.struts.taglib.nested.NestedRootTag -JSP - -name -false -true - - - -define -org.apache.struts.taglib.nested.bean.NestedDefineTag -org.apache.struts.taglib.nested.bean.NestedDefineTei -empty - -id -true -true - - -name -false -true - - -property -false -true - - -scope -false -true - - -toScope -false -true - - -type -false -true - - -value -false -true - - - -message -org.apache.struts.taglib.nested.bean.NestedMessageTag -empty - -arg0 -false -true - - -arg1 -false -true - - -arg2 -false -true - - -arg3 -false -true - - -arg4 -false -true - - -bundle -false -true - - -key -false -true - - -locale -false -true - - -name -false -true - - -property -false -true - - -scope -false -true - - - -size -org.apache.struts.taglib.nested.bean.NestedSizeTag -org.apache.struts.taglib.bean.SizeTei -empty - -collection -false -true - - -id -true -true - - -name -false -true - - -property -false -true - - -scope -false -true - - - -write -org.apache.struts.taglib.nested.bean.NestedWriteTag -empty - -bundle -false -true - - -filter -false -true - - -format -false -true - - -formatKey -false -true - - -ignore -false -true - - -locale -false -true - - -name -false -true - - -property -false -true - - -scope -false -true - - - -checkbox -org.apache.struts.taglib.nested.html.NestedCheckboxTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -errors -org.apache.struts.taglib.nested.html.NestedErrorsTag -empty - -bundle -false -true - - -locale -false -true - - -name -false -true - - -property -false -true - - - -file -org.apache.struts.taglib.nested.html.NestedFileTag - -accesskey -false -true - - -accept -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -maxlength -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -size -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -form -org.apache.struts.taglib.nested.html.NestedFormTag -JSP - -action -true -true - - -enctype -false -true - - -focus -false -true - - -method -false -true - - -onreset -false -true - - -onsubmit -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -target -false -true - - - -hidden -org.apache.struts.taglib.nested.html.NestedHiddenTag - -alt -false -true - - -altKey -false -true - - -indexed -false -true - - -name -false -true - - -property -true -true - - -title -false -true - - -titleKey -false -true - - -styleClass -false -true - - -styleId -false -true - - -value -false -true - - -write -false -true - - - -image -org.apache.struts.taglib.nested.html.NestedImageTag - -accesskey -false -true - - -align -false -true - - -alt -false -true - - -altKey -false -true - - -border -false -true - - -bundle -false -true - - -disabled -false -true - - -indexed -false -true - - -locale -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -page -false -true - - -pageKey -false -true - - -property -false -true - - -src -false -true - - -srcKey -false -true - - -style -false -true - - -styleClass -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -img -org.apache.struts.taglib.nested.html.NestedImgTag -empty - -accesskey -false -true - - -align -false -true - - -alt -false -true - - -altKey -false -true - - -border -false -true - - -bundle -false -true - - -height -false -true - - -hspace -false -true - - -imageName -false -true - - -ismap -false -true - - -locale -false -true - - -lowsrc -false -true - - -name -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -paramId -false -true - - -page -false -true - - -pageKey -false -true - - -paramName -false -true - - -paramProperty -false -true - - -paramScope -false -true - - -property -false -true - - -scope -false -true - - -src -false -true - - -srcKey -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -title -false -true - - -titleKey -false -true - - -usemap -false -true - - -vspace -false -true - - -width -false -true - - - -link -org.apache.struts.taglib.nested.html.NestedLinkTag - -accesskey -false -true - - -action -false -true - - -anchor -false -true - - -forward -false -true - - -href -false -true - - -indexed -false -true - - -indexId -false -true - - -linkName -false -true - - -name -false -true - - -onblur -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -page -false -true - - -paramId -false -true - - -paramName -false -true - - -paramProperty -false -true - - -paramScope -false -true - - -property -false -true - - -scope -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -target -false -true - - -title -false -true - - -titleKey -false -true - - -transaction -false -true - - - -messages -org.apache.struts.taglib.nested.html.NestedMessagesTag -org.apache.struts.taglib.html.MessagesTei -JSP - -id -true -true - - -bundle -false -true - - -locale -false -true - - -name -false -true - - -property -false -true - - -header -false -true - - -footer -false -true - - -message -false -true - - - -multibox -org.apache.struts.taglib.nested.html.NestedMultiboxTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -options -org.apache.struts.taglib.nested.html.NestedOptionsTag -empty - -collection -false -true - - -filter -false -true - - -labelName -false -true - - -labelProperty -false -true - - -name -false -true - - -property -false -true - - -style -false -true - - -styleClass -false -true - - - -optionsCollection -org.apache.struts.taglib.nested.html.NestedOptionsCollectionTag -empty - -filter -false -true - - -label -false -true - - -name -false -true - - -property -true -true - - -style -false -true - - -styleClass -false -true - - -value -false -true - - - -password -org.apache.struts.taglib.nested.html.NestedPasswordTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -maxlength -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -readonly -false -true - - -redisplay -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -size -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -radio -org.apache.struts.taglib.nested.html.NestedRadioTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -property -true -true - - -onmousedown -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -true -true - - - -select -org.apache.struts.taglib.nested.html.NestedSelectTag -JSP - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -multiple -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -size -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -submit -org.apache.struts.taglib.nested.html.NestedSubmitTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -text -org.apache.struts.taglib.nested.html.NestedTextTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -disabled -false -true - - -indexed -false -true - - -maxlength -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -readonly -false -true - - -size -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -textarea -org.apache.struts.taglib.nested.html.NestedTextareaTag - -accesskey -false -true - - -alt -false -true - - -altKey -false -true - - -cols -false -true - - -disabled -false -true - - -indexed -false -true - - -name -false -true - - -onblur -false -true - - -onchange -false -true - - -onclick -false -true - - -ondblclick -false -true - - -onfocus -false -true - - -onkeydown -false -true - - -onkeypress -false -true - - -onkeyup -false -true - - -onmousedown -false -true - - -onmousemove -false -true - - -onmouseout -false -true - - -onmouseover -false -true - - -onmouseup -false -true - - -property -true -true - - -readonly -false -true - - -rows -false -true - - -style -false -true - - -styleClass -false -true - - -styleId -false -true - - -tabindex -false -true - - -title -false -true - - -titleKey -false -true - - -value -false -true - - - -empty -org.apache.struts.taglib.nested.logic.NestedEmptyTag -JSP - -name -false -true - - -property -false -true - - -scope -false -true - - - -equal -org.apache.struts.taglib.nested.logic.NestedEqualTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -greaterEqual -org.apache.struts.taglib.nested.logic.NestedGreaterEqualTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -greaterThan -org.apache.struts.taglib.nested.logic.NestedGreaterThanTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -iterate -org.apache.struts.taglib.nested.logic.NestedIterateTag -org.apache.struts.taglib.nested.logic.NestedIterateTei -JSP - -collection -false -true - - -id -false -true - - -indexId -false -true - - -length -false -true - - -name -false -true - - -offset -false -true - - -property -false -true - - -scope -false -true - - -type -false -true - - - -lessEqual -org.apache.struts.taglib.nested.logic.NestedLessEqualTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -lessThan -org.apache.struts.taglib.nested.logic.NestedLessThanTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -match -org.apache.struts.taglib.nested.logic.NestedMatchTag -JSP - -cookie -false -true - - -header -false -true - - -location -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -messagesNotPresent -org.apache.struts.taglib.nested.logic.NestedMessagesNotPresentTag -JSP - -name -false -true - - -property -false -true - - -message -false -true - - - -messagesPresent -org.apache.struts.taglib.nested.logic.NestedMessagesPresentTag -JSP - -name -false -true - - -property -false -true - - -message -false -true - - - -notEmpty -org.apache.struts.taglib.nested.logic.NestedNotEmptyTag -JSP - -name -false -true - - -property -false -true - - -scope -false -true - - - -notEqual -org.apache.struts.taglib.nested.logic.NestedNotEqualTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -notMatch -org.apache.struts.taglib.nested.logic.NestedNotMatchTag -JSP - -cookie -false -true - - -header -false -true - - -location -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -scope -false -true - - -value -true -true - - - -notPresent -org.apache.struts.taglib.nested.logic.NestedNotPresentTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -role -false -true - - -scope -false -true - - -user -false -true - - - -present -org.apache.struts.taglib.nested.logic.NestedPresentTag -JSP - -cookie -false -true - - -header -false -true - - -name -false -true - - -parameter -false -true - - -property -false -true - - -role -false -true - - -scope -false -true - - -user -false -true - - - - - - diff --git a/posterita/posterita/web/WEB-INF/struts-tiles.tld b/posterita/posterita/web/WEB-INF/struts-tiles.tld deleted file mode 100644 index 657334ea94..0000000000 --- a/posterita/posterita/web/WEB-INF/struts-tiles.tld +++ /dev/null @@ -1,344 +0,0 @@ - - - - - - - - - - -1.2 -1.1 -tiles -http://struts.apache.org/tags-tiles - -insert -org.apache.struts.taglib.tiles.InsertTag -JSP - -template -false -true - - -component -false -true - - -page -false -true - - -definition -false -true - - -attribute -false -false - - -name -false -true - - -beanName -false -true - - -beanProperty -false -true - - -beanScope -false -false - - -flush -false -false - - -ignore -false -true - - -role -false -true - - -controllerUrl -false -true - - -controllerClass -false -true - - - -definition -org.apache.struts.taglib.tiles.DefinitionTag -JSP - -id -true -false - - -scope -false -false - - -template -false -true - - -page -false -true - - -role -false -true - - -extends -false -true - - - -put -org.apache.struts.taglib.tiles.PutTag -JSP - -name -false -false - - -value -false -true - - -content -false -true - - -direct -false -false - - -type -false -false - - -beanName -false -true - - -beanProperty -false -true - - -beanScope -false -false - - -role -false -true - - - -putList -org.apache.struts.taglib.tiles.PutListTag -JSP - -name -true -false - - - -add -org.apache.struts.taglib.tiles.AddTag -JSP - -value -false -false - - -content -false -true - - -direct -false -false - - -type -false -false - - -beanName -false -true - - -beanProperty -false -true - - -beanScope -false -false - - -role -false -true - - - -get -org.apache.struts.taglib.tiles.GetTag -empty - -name -true -true - - -ignore -false -true - - -flush -false -false - - -role -false -true - - - -getAsString -org.apache.struts.taglib.tiles.GetAttributeTag -empty - -name -true -true - - -ignore -false -true - - -role -false -true - - - -useAttribute -org.apache.struts.taglib.tiles.UseAttributeTag -org.apache.struts.taglib.tiles.UseAttributeTei -empty - -id -false -false - - -classname -false -false - - -scope -false -false - - -name -true -true - - -ignore -false -true - - - -importAttribute -org.apache.struts.taglib.tiles.ImportAttributeTag -empty - -name -false -true - - -scope -false -false - - -ignore -false -true - - - -initComponentDefinitions -org.apache.struts.taglib.tiles.InitDefinitionsTag -empty - -file -true -false - - -classname -false -false - - - - - - diff --git a/posterita/posterita/web/WEB-INF/tiles-config_1_1.dtd b/posterita/posterita/web/WEB-INF/tiles-config_1_1.dtd deleted file mode 100644 index 7568b78082..0000000000 --- a/posterita/posterita/web/WEB-INF/tiles-config_1_1.dtd +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/posterita/web/WEB-INF/tiles-defs.xml b/posterita/posterita/web/WEB-INF/tiles-defs.xml deleted file mode 100644 index 8b8f66691a..0000000000 --- a/posterita/posterita/web/WEB-INF/tiles-defs.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/posterita/posterita/web/WEB-INF/validator-rules.xml b/posterita/posterita/web/WEB-INF/validator-rules.xml deleted file mode 100644 index 6c502f73dd..0000000000 --- a/posterita/posterita/web/WEB-INF/validator-rules.xml +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/posterita/web/WEB-INF/web-app_2_2.dtd b/posterita/posterita/web/WEB-INF/web-app_2_2.dtd deleted file mode 100644 index 172dafa712..0000000000 --- a/posterita/posterita/web/WEB-INF/web-app_2_2.dtd +++ /dev/null @@ -1,565 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/posterita/web/WEB-INF/web-app_2_3.dtd b/posterita/posterita/web/WEB-INF/web-app_2_3.dtd deleted file mode 100644 index 56bfb11dc2..0000000000 --- a/posterita/posterita/web/WEB-INF/web-app_2_3.dtd +++ /dev/null @@ -1,1059 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/posterita/web/WEB-INF/web.xml b/posterita/posterita/web/WEB-INF/web.xml deleted file mode 100644 index c6aed084aa..0000000000 --- a/posterita/posterita/web/WEB-INF/web.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - /C32.gif - - - Posterita Ltd Enterprise Software Platform - - - - - #AD_Client_ID - 11 - - - #AD_Language - en_US - - - #AD_Org_ID - 11 - - - #AD_User_ID - 100 - - - #C_BankAccount_ID - 100 - - - #SalesRep_ID - 100 - - - #AD_Role_ID - 103 - - - #W_Store_ID - 11 - - - #POS_ID - 100 - - - REPORT_DIRECTORY - /config/reports/ - - - - - - action - org.apache.struts.action.ActionServlet - - config - /WEB-INF/struts-config.xml - - - debug - 2 - - - detail - 2 - - 2 - - - - DisplayChart - org.jfree.chart.servlet.DisplayChart - - - - DisplayReportServlet - org.posterita.core.utils.DisplayReportServlet - - - - action - *.do - - - - - - DisplayChart - /servlet/DisplayChart - - - - DisplayReportServlet - /servlet/DisplayReportServlet/* - - - - - - - 60 - - - - - - - - - index.jsp - - - - ResponseOverrideFilter - org.displaytag.filter.ResponseOverrideFilter - - - - ResponseOverrideFilter - *.do - - - ResponseOverrideFilter - *.jsp - - - diff --git a/posterita/posterita/web/WEB-INF/webStore.tld b/posterita/posterita/web/WEB-INF/webStore.tld deleted file mode 100644 index 6ba28aa42e..0000000000 --- a/posterita/posterita/web/WEB-INF/webStore.tld +++ /dev/null @@ -1,213 +0,0 @@ - - - - 1.0 - 1.2 - cws - webStore.tld - Compiere WebStore - $Id: webStore.tld,v 1.1 2005/06/23 08:33:30 vishee Exp $ - - - - requestType - org.compiere.wstore.RequestTypeTag - empty - Request Type Selection - - - - loginLink - org.compiere.wstore.LoginLinkTag - empty - Login Links - - - - checkOutLink - org.compiere.wstore.CheckOutLinkTag - empty - CheckOut Links - - oneLine - false - false - - - - - infoLink - org.compiere.wstore.InfoLinkTag - empty - Info Links - - oneLine - false - false - - - - - priceList - org.compiere.wstore.PriceListTag - empty - Initializes + loads Price List - - priceList_ID - false - false - - - - - productCategoryList - org.compiere.wstore.ProductCategoryListTag - empty - Login Links - - - - workflow - org.compiere.wstore.WorkflowTag - empty - Workflow Choices - - activityID - true - false - - - - - location - org.compiere.wstore.LocationTag - empty - Location table rows - - countryID - true - false - - - regionID - false - false - - - regionName - false - false - - - postal - false - false - - - city - true - false - - - - - message - org.compiere.wstore.MessageTag - empty - Translate Messages - - txt - true - false - - - - - tableBorder - com.tamak.webstore.util.TableBorder - JSP - - scope - false - true - - - lcTopImg - false - true - - - bgTopImg - false - true - - - rcTopImg - false - true - - - topBorderHeight - false - true - - - bgLeftImg - false - true - - - sideBorderHeight - false - true - - - borderBgColor - false - true - - - contentBgColor - false - true - - - classStyleSheet - false - true - - - bgRightImg - false - true - - - lcBtmImg - false - true - - - bgBtmImg - false - true - - - rcBtmImg - false - true - - - btmBorderHeight - false - true - - - borderWidth - false - true - - - - diff --git a/posterita/posterita/web/css/alternative.css b/posterita/posterita/web/css/alternative.css deleted file mode 100644 index c44429bdec..0000000000 --- a/posterita/posterita/web/css/alternative.css +++ /dev/null @@ -1,85 +0,0 @@ -/* alternative styles */ -table.its thead tr { - background-color: #69c; -} - -table.its tr.even { - background-color: #def; -} - -table.mars thead tr { - background-color: #9c9; -} - -table.mars tr.even { - background-color: #ccb; -} - -table.mars tr.odd { - background-color: #eec; -} - -table.simple thead tr th { - background-color: #eee; -} - -table.simple tr.even { - background-color: #fff; -} - -table.simple { - border: 1px solid #ccc; - border-collapse: collapse; -} - -table.simple td,table.simple th { - border: 1px solid #ccc; -} - -table.nocol tbody td,table.nocol tbody th { - border-left: none; - border-right: none; -} - -table.report td,table.report th { - font: menu; -} - -table.report th { - background: buttonface; - border-width: 1px; - border-style: solid; - border-color: threedhighlight threedshadow threedshadow threedhighlight; - cursor: hand; -} - -table.report idcol { - background: buttonface; -} - -table.report tr.even { - background-color: #399; -} - -table.report tbody { - height: 100px; - overflow: auto; -} - -table.report { - height: 120px; - overflow: auto; -} - -table.report tbody tr { - height: 10px; -} - -table.mark td.tableCellError { - background-color: #d00; - color: #fff; -} - -table.simple td.textRed { - color: #b11; -} \ No newline at end of file diff --git a/posterita/posterita/web/css/common.jsp b/posterita/posterita/web/css/common.jsp deleted file mode 100644 index 6c120a1586..0000000000 --- a/posterita/posterita/web/css/common.jsp +++ /dev/null @@ -1,1688 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author tamak - */ - - -<% -response.setContentType("text/css"); -String path = request.getContextPath() + "/"; -%> - -div.main -{ - width:100%; - text-align: center; - overflow: inherit; -} - - -#header { - background: #fff; - position:relative; - vertical-align:top; - height:30px; - width: 100%; - overflow:hidden; - text-overflow:ellipsis - - -} - -#headerTitle -{ - float:left; - margin-left:200px; - font-weight: bold; -} - -#logo{ -height:30px; -float:left; -} - -#context{ -float:right; -margin-right:50px; -height:30px; -white-space:nowrap; -overflow:hidden; -text-align:right; -text-overflow:ellipsis - -} - -#timer{ -position:relative; -vertical-align:top; -float:right; -border: 0px #E83530 solid; -background-color: #ffffff; -color: #666666; -font-size: 13px; -font-weight: bold; -} - -#actionlink -{ -position:relative; -vertical-align:top; -float:right; - -} - -#menu -{ - position:relative; - background-color: #D8D8D8; -} - -#menulink -{ - background-color: #D8D8D8; - position:relative; - width:100%; - float:right; - text-align: right; - height:20px; - overflow:hidden; - text-overflow: ellipsis; -} - - - -#content { - text-align:left; - background-color: #F4F4F4; - width: 100%; - min-height: 500px; - padding:0px; -} - -#cart td{ - text-align: left; -} - -div.container -{ - -} - -div.leftContainer -{ - width:50%; - float:left; - text-align:left; -} - -div.rightContainer -{ - width:50%; - float:right; - text-align:right; -} - - -/*#footer { - background: #D8D8D8; - clear: both; - width: 100%; -} -*/ - -/*body -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - color: #000000; -}*/ - -#content div, #main div -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - color: #000000; -} - -mandatory -{ - font-weight: bold; - text-align:right; - font-size:12px; - color: blue; -} - -p.loginHeader -{ - color: #666666; - font-size: 36px; - font-weight: bold; - font-family: arial,sans-serif; -} - - - -div.copyright -{ - background-color: #666666; - text-align: center; - color: #FFFFFF; - font-family: arial,sans-serif; - font-weight: bold; - font-size: 10pt; - letter-spacing: 1px; - padding: 2; -} - -/*label -{ - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - color: #000000; - padding-right: 4px; -}*/ - -label.red -{ - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - color: #E83530; -} - - - - -label.green -{ - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - color: #0A9409; -} - -td.green -{ - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - background-color: #80FFC9; -} - -td.green input -{ - visibility:hidden; -} - -td.red -{ - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - background-color: #FF9980; -} -td.blue -{ - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - background-color: #80C9FF; -} -td.yellow -{ - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - background-color: #FFE680; -} - -#messagebox div, .errormsg -{ - background-image: url("<%= path + "images/newUI/icon-err.gif" %>"); - background-repeat: no-repeat; - background-position: left center; - font-family: arial,sans-serif; - font-weight: bold; - font-size: 10pt; - letter-spacing: 1px; - padding-left: 30px; - color: #E83530; -} - -.successmsg -{ - background-image: url("<%= path + "images/pos/success.gif" %>"); - background-repeat: no-repeat; - background-position: left top; - font-family: arial,sans-serif; - font-weight: bold; - font-size: 12pt; - letter-spacing: 1px; - padding-left: 30px; - color: #008000; -} - -legend -{ - font-family: arial,sans-serif; - font-size: 10pt; - font-weight: bold; - letter-spacing: 1px; - color:#0A9409; -} - - -input.text -{ - border: solid 1px #666666; - /*font-family: arial,sans-serif;*/ - font-size: 10pt; -} - -textarea.text -{ - border: solid 1px #666666; - /*font-family: arial,sans-serif;*/ - font-size: 10pt; -} - -select.text -{ - border: solid 1px #666666; - /*font-family: arial,sans-serif;*/ - font-size: 10pt; - color: #51585F; -} - - -input.medium -{ - width:100px; -} - -input:focus -{ - background-color: #CDD4E9; - border: solid 1px #333333; -} - - -.greencolor -{ - color:#0A9409; -} - -.completecolor -{ - color:#E83530; -} - -font.pagetitle -{ - font-size: 14pt; - color: #990000; -} - -font.reporttitle -{ - font-size: 14pt; -} - -font.reportsubtitle -{ - font-size: 12pt; -} - -font -{ - font-family: arial,sans-serif; - font-size: 10pt; - font-weight: bold; - letter-spacing: 1px; - color: #555555; -} - -li.submenu -{ - list-style-image: url("<%= path + "images/pos/buttons/bullet_red.gif" %>"); - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - color: #000000; -} - -img.topmenu -{ - border-style: none; - -} - -img.button -{ - cursor:pointer; -} - -/* anchor sytles */ -/*a:hover -{ - color:#0A9409; -} -*/ -a.topmenu -{ - text-decoration: none; - border-width: 0px; - border-style: none; -} - -a.submenu -{ - text-decoration: none; - color:#666666; - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; -} - -a -{ - text-decoration: none; - font-family:tahoma,san-serif; - font-size: 10pt; - letter-spacing: 0px; -} - -a.forgotpassword -{ - color:#0A9409; - font-family: arial,sans-serif; - font-size: 12pt; - letter-spacing: 1px; - font-weight: bold; -} - -/* end of anchor styles */ - -/* Auto complete style */ -div.autocomplete { - position:absolute; - width:250px; - height:300px; - background-color:white; - border:1px solid #888; - margin:0px; - padding:0px; - overflow: scroll; -} - -div.autocomplete ul { - list-style-type:none; - margin:0px; - padding:0px; -} -div.autocomplete ul li.selected { background-color: #ffb;} -div.autocomplete ul li { - list-style-type:none; - display:block; - margin:0; - padding:2px; - cursor:pointer; - letter-spacing: 1px; - font-size: 10pt; - font-family:arial,sans-serif; -} -div.notfound { - background-color: #ffb; -} - -div.autocomplete2 { - position:absolute; - width:250px; - background-color:white; - border:1px solid #888; - margin:0px; - padding:0px; - overflow: auto; -} - -div.autocomplete2 ul { - list-style-type:none; - margin:0px; - padding:0px; -} -div.autocomplete2 ul li.selected { background-color: #9ACF30;} -div.autocomplete2 ul li { - list-style-type:none; - display:block; - margin:0; - padding:2px; - cursor:pointer; - letter-spacing: 1px; - font-size: 10pt; - font-family:arial,sans-serif; - text-align:left; -} - -/* tables styles */ -table.view -{ - border-collapse: collapse; - /*border: solid 1px black;*/ -} - -table.view td -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - color: #000000; - padding: 5px 0px 5px 0px; -} - -table.layout -{ - padding-left: 10; - padding-right: 10; - padding-top: 0; - padding-bottom: 5; - - /* border:solid 1px #000000; */ -} - -table.main -{ - width: 100%; - /*border: solid 1px black;*/ - border-collapse: collapse; -} - -table.main td -{ - padding: 5px 0px 5px 0px; -} - -table.topmenu -{ - padding-left: 0; - padding-right: 0; - - /* border:solid 1px #000000; */ -} - -td.buttoncell -{ - padding-right: 0px; -} - -table.login -{ - width: 800px; - /*height: 600px;*/ - border: solid black 1px; - border-spacing: 0; -} - -table.content -{ - width: 100%; - /* border: solid 1px black; */ - border-collapse: collapse; -} - -table.content th -{ - font-family: arial,sans-serif; - font-size: 10pt; - font-weight: bold; - letter-spacing: 1px; - color: #FFFFFF; - background-color: #909090; -} - -table.content td.total -{ - font-family: arial,sans-serif; - font-size: 10pt; - font-weight: bold; - letter-spacing: 1px; - color: #FFFFFF; - background-color: #BBBBBB; -} - -table.content td -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; - color: #000000; - padding: 5px 0px 5px 0px; - -} - -table.cart -{ - width: 100%; - /*border: solid 1px black;*/ - border-collapse: collapse; - border-spacing: 0px; - border: 0px; -} - -table.cart td -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; - color: #000000; - padding: 5px 5px 5px 5px; -} - -table.cart th -{ - font-family: arial,sans-serif; - font-size: 10pt; - font-weight: bold; - letter-spacing: 1px; - color: #FFFFFF; - background-color: #909090; - padding: 5px 5px 5px 5px; -} - -table.cart td.total -{ - color: #FFFFFF; - background-color: #909090; -} - -table.cart td.label -{ - color: #000000; - background-color: #D8D8D8; -} - -table.cart td.contentname -{ - color: #000000; - background-color: #C9C9C9; -} - -table.content td.label -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; - color: #000000; - background-color: #D8D8D8; -} - -table.content td.contentname -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; - color: #ffffff; - background-color: #C9C9C9; -} - -table.orderheader td -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - padding: 5px 0px 5px 0px; - color: #000000; -} - -/* -td.copyright -{ - height: 60px; - vertical-align: top; - padding: 0; -} -*/ - -table.display td a -{ - text-decoration: none; - color:blue; - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; -} - -table.display -{ - width: 100%; - border-color: #000000; - border-collapse: collapse; -} - -table.display td.label -{ - /* - font-family: arial,sans-serif; - letter-spacing: 1px; - color: #000000; - */ - font-size: 8pt; - background-color: #D8D8D8; -} - -table.display td.contentname -{ - /* - font-family: arial,sans-serif; - letter-spacing: 1px; - color: #000000; - */ - font-size: 8pt; - background-color: #C9C9C9; -} - -table.display td -{ - font-family: arial,sans-serif; - font-size: 9pt; - letter-spacing: 1px; - color: #000000; - padding: 5px 5px 5px 5px; - border-color: #000000; - border-collapse: collapse; -} - -table.display th -{ - font-family: arial,sans-serif; - font-size: 9pt; - font-weight: bold; - letter-spacing: 1px; - color: #FFFFFF; - background-color: #909090; - padding: 5px 5px 5px 5px; - border-color: #000000; - border-collapse: collapse; -} - -table.displaytag -{ - border-width: 1px; - width: 100%; - border-color: #000000; - border-collapse: collapse; - border-style: solid; -} - -table.displaytag th -{ - font-family: arial,sans-serif; - font-size: 9pt; - font-weight: bold; - letter-spacing: 1px; - color: #FFFFFF; - background-color: #909090; - border-color: #000000; - padding: 5px 5px 5px 5px; - border-width: 1px; - border-style: solid; -} - -table.displaytag th a -{ - color: #FFFFFF; -} - -table.displaytag td -{ - font-family: arial,sans-serif; - font-size: 9pt; - letter-spacing: 1px; - color: #000000; - padding: 5px 5px 5px 5px; - border-color: #000000; - border-collapse: collapse; - border-width: 1px; - border-style: solid; -} - -table.displaytag td.amount -{ - font-family: arial,sans-serif; - font-size: 9pt; - letter-spacing: 1px; - color: #000000; - padding: 5px 5px 5px 5px; - border-color: #000000; - border-collapse: collapse; - border-width: 1px; - border-style: solid; - text-align: right; -} - -table.displaytag td.numeric -{ - font-family: arial,sans-serif; - font-size: 9pt; - letter-spacing: 1px; - color: #000000; - padding: 5px 5px 5px 5px; - border-color: #000000; - border-collapse: collapse; - border-width: 1px; - border-style: solid; - text-align: right; - font-weight: bold; -} - -table.displaytag td.negativenumeric -{ - font-family: arial,sans-serif; - font-size: 9pt; - letter-spacing: 1px; - padding: 5px 5px 5px 5px; - border-color: #000000; - border-collapse: collapse; - border-width: 1px; - border-style: solid; - text-align: right; - color: #FF0000; - font-weight: bold; -} - - -table.displaytag td a -{ - text-decoration: none; - color:blue; - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; -} - -table.displaytag tr.odd -{ - border-width: 1px; - border-style: solid; - text-align: left; - background-color: #D8D8D8; -} - -table.displaytag tr.even -{ - border-width: 1px; - border-style: solid; - background-color: #C9C9C9; - text-align: left; -} - -div.exportlinks -{ - text-align: right; -} - -caption -{ - font-family: arial,sans-serif; - font-size: 12pt; - font-weight: bold; - letter-spacing: 1px; - padding: 5px 5px 5px 5px; -} -/* end of table styles */ - -/* buttons styles */ -.advanced -{ - background-image: url("<%= path + "images/pos/buttons/button_advanced.gif" %>"); -} - -.continue -{ - background-image: url("<%= path + "images/pos/buttons/button_continue.gif" %>"); -} - -.create -{ - background-image: url("<%= path + "images/pos/buttons/button_create.gif" %>"); -} - -.complete -{ - background-image: url("<%= path + "images/pos/buttons/button_complete.gif" %>"); -} - -.addtocart -{ - background-image: url("<%= path + "images/pos/buttons/button_addtocart.gif" %>"); -} - -.newcustomer -{ - background-image: url("<%= path + "images/pos/buttons/button_newcustomer.gif" %>"); -} - -.checkout -{ - background-image: url("<%= path + "images/pos/buttons/button_checkout.gif" %>"); -} - -.delete -{ - background-image: url("<%= path + "images/pos/buttons/button_delete.gif" %>"); -} - -.neworder -{ - background-image: url("<%= path + "images/pos/buttons/button_neworder.gif" %>"); -} -.newnote -{ - background-image: url("<%= path + "images/pos/buttons/button_newnote.gif" %>"); -} - -.cash -{ - background-image: url("<%= path + "images/pos/buttons/button_cash.gif" %>"); -} - -.card -{ - background-image: url("<%= path + "images/pos/buttons/button_card.gif" %>"); -} - -.cheque -{ - background-image: url("<%= path + "images/pos/buttons/button_cheque.gif" %>"); -} - -.mixed -{ - background-image: url("<%= path + "images/pos/buttons/button_mixed.gif" %>"); -} - -.save -{ - background-image: url("<%= path + "images/pos/buttons/button_save.gif" %>"); -} - -.search -{ - background-image: url("<%= path + "images/pos/buttons/button_search.gif" %>"); -} - -.edit -{ - background-image: url("<%= path + "images/pos/buttons/button_edit.gif" %>"); -} - -.tangoSearch -{ - background-image: url("<%= path + "images/tango/system-search.png" %>"); - margin-top: -3px; -} - -.selectall -{ - background-image: url("<%= path + "images/pos/buttons/button_selectall.gif" %>"); -} - -.submit -{ - background-image: url("<%= path + "images/pos/buttons/button_submit.gif" %>"); -} - -.refresh -{ - background-image: url("<%= path + "images/pos/buttons/button_refresh.gif" %>"); -} - -.piechart -{ - background-image: url("<%= path + "images/pos/buttons/button_piechart.gif" %>"); -} - -.barchart -{ - background-image: url("<%= path + "images/pos/buttons/button_barchart.gif" %>"); -} - -.timeseries -{ - background-image: url("<%= path + "images/pos/buttons/button_timeseries.gif" %>"); -} - -.tabular -{ - background-image: url("<%= path + "images/pos/buttons/button_tabular.gif" %>"); -} - -.saveascsv -{ - background-image: url("<%= path + "images/pos/buttons/button_saveascsv.gif" %>"); -} - -.saveaspdf -{ - background-image: url("<%= path + "images/pos/buttons/button_saveaspdf.gif" %>"); -} - -.blank -{ - background-image: url("<%= path + "images/pos/buttons/button_blank.gif" %>"); -} - -.bigbutton -{ - background-repeat: no-repeat; - cursor: pointer; - border: 0px; - width: 127px; - height: 42px; - font-family: arial,sans-serif; - font-size: 12pt; - letter-spacing: 1px; - font-weight: bolder; - color: #666666; - padding: 0px; -} - -.smallbutton -{ - background-repeat: no-repeat; - cursor: pointer; - border: 0px; - width: 87px; - height: 42px; - font-family: arial,sans-serif; - font-size: 12pt; - letter-spacing: 1px; - font-weight: bolder; - color: #666666; - padding: 0px; -} - -.tangoButton -{ - background-repeat: no-repeat; - cursor: pointer; - border: 0px; - width: 32px; - height: 32px; - font-family: arial,sans-serif; - letter-spacing: 1px; - font-weight: bolder; - v-align:middle; - background-color:transparent; -} - -/* end of buttons styles */ - -div.space -{ - height:10px; - /* - border: solid 1px black; - background-color: #0000FF; - */ -} - -span.link -{ - cursor:pointer; - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - color: #0A9409; -} - -span.shortcutkey -{ - padding:0px 4px; - /*float:left;*/ -} - -span.shortcutkey label -{ - font-size: 10pt; - padding-right: 0px; -} - -span.shortcutkey label.red -{ - padding-left: 0px; -} - -/* Shopping Cart */ -div#shoppingCart -{ -/* - height:200; - overflow:auto; - border: solid 1px #555555; -*/ -} - -table.scroll -{ - border-color: #000000; - border-collapse: collapse; -} - -table.scroll td.label -{ - background-color: #D8D8D8; -} - -table.scroll td.contentname -{ - background-color: #C9C9C9; -} - -table.scroll td -{ - font-family: arial,sans-serif; - font-size: 9pt; - letter-spacing: 1px; - color: #000000; - padding: 5px 5px 5px 5px; - border-color: #000000; - border-collapse: collapse; -} - -table.scroll th -{ - font-family: arial,sans-serif; - font-size: 9pt; - font-weight: bold; - letter-spacing: 1px; - color: #FFFFFF; - background-color: #909090; - padding: 5px 5px 5px 5px; - border-color: #000000; - border-collapse: collapse; -} - -table.scroll a -{ - font-family: arial,sans-serif; - font-size: 9pt; -} - -table.popup -{ - background-color: #FFFFFF; - border: solid 1px #000000; -} - -table.popup td -{ - font-family: arial,sans-serif; - font-size: 9pt; - letter-spacing: 1px; - color: #000000; - padding: 5px 5px 5px 5px; - border-color: #000000; - border-collapse: collapse; -} - -div.popup -{ - font-family: arial,sans-serif; - font-size: 9pt; - letter-spacing: 1px; - position:absolute; - display:none; - background-color:#FFFFFF; -} - - -table.cart td.label div.popupDiv:hover -{ - background-color:#CDD4E9;; -} - -table.cart td.contentname div.popupDiv:hover -{ - background-color:#CDD4E9; -} - -/* -table.cart tr.popup:hover td.label,td.contentname -{ - background-color:#CDD4E9; -} -*/ - -table.report -{ - border-color: #000000; - border-collapse: collapse; - font-family: arial,sans-serif; - font-size: 9pt; - letter-spacing: 1px; -} - -table.cart tbody -{ -/* - style="height:200px; - overflow:auto"; -*/ -} - -.border -{ - border:solid 1px #000000; -} - -.error -{ - background-color:#E83530; - border:solid 1px #000000; -} - -div.scrollpane -{ - overflow:auto; - /*height:500px;*/ -} - - -table.numericpad td -{ - text-align:center; - v-align:middle; -} - -div.key -{ - width:50px; - height:50px; - border:solid 1px #000000; - cursor:pointer; - text-align:center; - vertical-align: middle; - font-family: arial,sans-serif; - font-size: 14pt; - font-weight:bold; -} - -a.button -{ - text-decoration: none; - cursor: pointer; - border: 0px; - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bolder; - color: #606760; - padding: 2px 4px 2px 4px; - border:solid 1px #000000; - text-align:center; - background-color: #F2F2F2; -} - -a.button:hover -{ - background-color: #D8D8D8; -} - -div#PINPanel -{ - border:solid 2px #000000; - z-index:1000; - height:120px; - width:200px; - background-color: #F2F2F2; - padding: 4px; - display:none; -} - -div#divBack -{ - background-image: url("<%= path + "images/pos/maskBG.png" %>"); - filter: alpha(opacity=40); -} - -span.draftedcolor -{ - color:red; -} - -div.draftedcolor -{ - color:red; -} - -div.completecolor -{ - color:green; -} - -div.inprogresscolor -{ - color:yellow; -} - -div.closed -{ - color:blue; -} - -div.negativecolor -{ - color:red; -} -div.nomalcolor -{ - color:black; -} - -div#keyboard{ - position:absolute; - background-color: #FFFFFF; - border:solid 1px #000000; - z-index:3000; - display:none; -} - -div#uppercase{ - display:none; -} - -div#lowercase{ - display:block; -} - -div.keyboardHandler{ - background-color:#777777; - height:20px; - cursor:move; -} - -table.keyboard{ - background-color: #FFFFFF; -} - -table.keyboard td{ - vertical-align:middle; - text-align:center; - width:50px; - height:50px; - border:solid 1px #444444; - background-color: #FFFFFF; - cursor:pointer; - background-color:#F4F4F4; - font-family: arial,sans-serif; - font-size: 13pt; - letter-spacing: 1px; - font-weight: bolder; - color: #000000; -} - -table.keyboard td:hover{ - background-color:#FFFFFF; -} - -img#keyboardicon{ - display:none; - cursor: pointer; -} - -div.tooltip{ - width:200px; - z-index:1000; - background-color:#FDFDDB; - position:absolute; - border: solid 1px #000000; - padding:4px; - font-color:#333333; - font-size:10pt; -} - -div.pager{ - //border: dashed 1px #000000; - padding:4px; - font-color:#333333; - font-size:10pt; - text-align:center; -} - -.pager label{ - color: #51585F; - font-weight: normal; - font-family: Verdana,Arial,Helvetica,san-serif; -} - -div.button { - float:left; - border:solid 1px #333333; - margin-right: 4px; - margin-top: 4px; - margin-bottom: 4px; - padding:6px; - font-size:14px; - font-weight: bold; - font-family: Verdana, Arial, Helvetica, sans-serif; - color:#FFFFFF; - background-color:#333333; - cursor:pointer; -} - -div.pager a{ - font-color:#333333; - font-size:10pt; - text-decoration:none; -} - -span.menu{ - text-decoration: none; - color:#000000; - padding:1px; - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; -} - -a.nodecoration:active,a.nodecoration:visited{ - text-decoration:none; -} - -fieldset.submenu{ - height:165px; -} - -.newbutton{ - background-repeat: repeat-x; - cursor: pointer; - font-family: verdana,arial,sans-serif; - font-size: 11pt; - font-weight:bold; - letter-spacing: 1px; - font-weight: bolder; - color: #666666; - height: 42px; - /*min-width:87px;*/ - background-image: url("<%= path + "images/pos/buttons/button_middle.gif" %>"); - border-left: solid 1px #9b9b9b; - border-right: solid 1px #9b9b9b; - border-top-width: 0px; - border-bottom-width: 0px; - padding-left:4px; - padding-right:4px; -} - -fieldset#createcustomer{ - height:150px; -} - -/* -.searchBox{ - background-image:url("<%= path + "images/pos/magnifying-glass.gif" %>"); - background-repeat:no-repeat; - padding-left:20px; -} -*/ - -span.drafted -{ - color:red; -} - -span.completed -{ - color:green; -} - -span.inprogress -{ - color:yellow; -} - -span.closed -{ - color:blue; -} - -div#errorbox -{ - background-color:CC1515; - border: solid 1px #D41616; - padding: 4px; -} - -div#msgbox -{ - background-color:#E6F3D8; - border: solid 1px #75D416; - padding: 4px; -} - -/***************************************************************************/ -div.popupwindow{ - display:inline; - position:absolute; - z-index:1000; - border: solid 1px #636363; - padding:0px; - visibility:hidden; -} - -div.popupwindow div{ - padding:4px; -} - -div.popupwindow div.title{ - color:#FFFFFF; - background:#ACACAC; - font-weight:bold; - /*font-size:13pt;*/ -} - -div.popupwindow div.footer{ - background:#EDEDED; - text-align:right; - background:#ACACAC; -} - -div.popupwindow div.messagebody{ - background:#EDEDED; -} - -div.popupwindow div.footer a{ - font-size:10pt; -} - -div#tenderPanel{ - /*height:170px;*/ - width:300px; -} - -div#customerInfoPanel{ - width:400px; -} - -div.disableMask -{ - background-image: url("<%= path + "images/pos/maskBG.png" %>"); - filter: alpha(opacity=40); -} - -div.ajaxindicator -{ - width:150px; - padding:10px; - border:solid 1px #000000; - background-color:#FFFFFF; - /*background-image: url("<%= path + "images/ajax-indicators/indicator.gif" %>");*/ - background-repeat:no-repeat; - background-position:left center; - padding-left:20px; - -} - -.redcolor -{ - color:#E83530; -} - -td.loginHeader -{ - height: 210px; - width: 800px; - background-image: url("<%= path + "images/pos/logo.jpg" %>"); - background-position:center center; - background-repeat:no-repeat; -} - -td.headerLogo -{ - background-image: url("<%= path + "images/pos/logo.gif" %>"); - background-position:top left; - background-repeat:no-repeat; - height: 40px; - width: 320px; -} - -td.headerDetails -{ - vertical-align: top; - background-color:#EEEEEE; -} - -a.sortheader -{ - color:#000; -} - -input.calendar-icon -{ - width: 28px; - height: 22px; - background-image: url("<%= path + "images/pos/calendar.gif" %>"); -} - -.floatleft -{ - float: left; - display: block; - padding: 0px 2px; -} - -#footerContainer{ - position: relative; -} - -.footer{ -background: #9A9A9A url("../images/newUI/footerbg.gif") repeat-x; -padding: 8px; -margin: 0; -height: 41px; -color: #FFFFFF; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: bold; -border-top: #FFFFFF solid 1px; -position: relative; -} - -.roleButton{ - background: url("../images/newUI/pricedetbg.gif") repeat; - border: 1px solid #FFF; - line-height: 15px; - float: left; - height: 15px; - width: 90px; - font-family: tahoma, san-serif; - font-weight: normal; - color: #FFF; - padding-top: 0px; - padding-bottom: 0px; - vertical-align: middle; - text-align: center; - cursor: pointer; - margin-left: 15px; - margin-top: 1px; -} - -.buttonLabel{ - font-family: tahoma, san-serif; - font-weight: normal; - color: #FFF; -} - -.button span{ - color: #FFFFFF; -} - -#remainingDetailsBtn, #remainingDetailsBtn1, #switchBack, #switchBack1{ - - float: right; -} - -#previousFirst div { - float:left; -} - -#previousFirst span{ - float: right; -} - -#nextLast div{ - float: right; -} - -#nextLast span{ - float:left; -} - -#nextLast{ - margin-top: -17px; -} - -.pagerContainer{ - border-top: solid 1px #FFFFFF; - font-family:tahoma,san-serif; - background: #9A9A9A -} - -.pagerContainer a{ - color: #669ACF; -} diff --git a/posterita/posterita/web/css/displaytag.css b/posterita/posterita/web/css/displaytag.css deleted file mode 100644 index a77fc712df..0000000000 --- a/posterita/posterita/web/css/displaytag.css +++ /dev/null @@ -1,147 +0,0 @@ - -table { - border: 0px solid #666; - width: 100%; - margin: 20px 0 20px 0 !important; -} - - -th,td { - padding: 2px 4px 2px 4px !important; - text-align: left; - vertical-align: top; -} - -thead tr { - background-color: #fc0; -} - -th.sorted { - background-color: orange; -} - -th a,th a:visited { - color: black; -} - -th a:hover { - text-decoration: underline; - color: black; -} - -th.sorted a,th.sortable a { - background-position: right; - display: block; - width: 100%; -} - -th.sortable a { - background: transparent url(../images/pos/arrow_off.png) no-repeat right; - -} - -th.order1 a { - background: transparent url(../images/pos/arrow_down.png) no-repeat right; - -} - -th.order2 a { - background: transparent url(../images/pos/arrow_up.png) no-repeat right; - -} - -tr.odd { - background-color: #fff -} - -tr.tableRowEven,tr.even { - background-color: #fea -} - -div.exportlinks { - background-color: #eee; - border: 1px dotted #999; - padding: 2px 4px 2px 4px; - margin: 2px 0 10px 0; - width: 100%; -} - -span.export { - padding: 0 4px 1px 20px; - display: inline; - display: inline-block; - cursor: pointer; -} - -span.excel { - background: transparent url(../images/pos/ico_file_excel.png) no-repeat; -} - -span.csv { - background: transparent url(../images/pos/ico_file_csv.png) no-repeat; -} - -span.xml { - background: transparent url(../images/pos/ico_file_xml.png) no-repeat; -} - -span.pdf { - background: transparent url(../images/pos/ico_file_pdf.png) no-repeat; -} - -span.rtf { - background: transparent url(../images/pos/ico_file_rtf.png) no-repeat; -} - -span.pagebanner { - background-color: #eee; - border: 1px dotted #999; - padding: 2px 4px 2px 4px; - width: 100%; - margin-top: 10px; - display: block; - border-bottom: none; -} - -span.pagelinks { - background-color: #eee; - border: 1px dotted #999; - padding: 2px 4px 2px 4px; - width: 100%; - display: block; - border-top: none; - margin-bottom: -5px; -} - - -.group-1 { - font-weight:bold; - padding-bottom:10px; - border-top:1px solid black; -} -.group-2 { - font-style:italic; - border-top: 1px solid black; - -} -.subtotal-sum, .grandtotal-sum { - font-weight:bold; - text-align:right; -} -.subtotal-header { - padding-bottom: 0px; - border-top: 1px solid white; -} -.subtotal-label, .grandtotal-label { - border-top: 1px solid white; - font-weight: bold; -} -.grouped-table tr.even { - background-color: #fff; -} -.grouped-table tr.odd { - background-color: #fff; -} -.grandtotal-row { - border-top: 2px solid black; -} diff --git a/posterita/posterita/web/css/frame.css b/posterita/posterita/web/css/frame.css deleted file mode 100644 index 6af85573d8..0000000000 --- a/posterita/posterita/web/css/frame.css +++ /dev/null @@ -1,30 +0,0 @@ -/* Send link -============================== */ - -MB_content fieldset input { - float: left; - margin: 0.5em 0; - font: 100%/1.2 Arial, Helvetica, Geneva, sans-serif; -} -#MB_content fieldset textarea { - width: 98%; - margin: 0 0 0.5em; - color: #666; - font: 100%/1.2 Arial, Helvetica, Geneva, sans-serif; -} -#MB_content fieldset label { - float: left; - padding-bottom: .25em; - margin: 0.5em 0; - width: 100px; -} -#MB_content fieldset label.long { width: 100%; } -#MB_content br { clear: both } - -#MB_content .error-msg { - padding: .5em; - color: #FFF; - font-weight: bold; - background-color: #C30; - border: 1px solid #930; -} \ No newline at end of file diff --git a/posterita/posterita/web/css/global.css b/posterita/posterita/web/css/global.css deleted file mode 100644 index 9f66e3253a..0000000000 --- a/posterita/posterita/web/css/global.css +++ /dev/null @@ -1,390 +0,0 @@ -body { - padding:0; - margin:0; - font:12px Arial, Helvetica, sans-serif; - line-height:130%; - color:#333; - text-align:center; - background:#FFF; - font-size:x-small; - voice-family: "\"}\""; - voice-family: inherit; - font-size:small; -} - - -/* General definitions */ -a { color:#06C; } -a:visited { color:#A9D; } -a:hover { color:#C63 } -a img { border:0px solid } - -h2 { - margin:1.5em 0 .5em; - font-size:135%; - font-weight:normal; - color:#000; -} -h3 { - font-size:115%; - color:#666; -} - -p { - margin:.75em 0; - line-height:1.5; -} - -ol li, ul li { margin:.5em 0; } -ul li { list-style:square; } - -code { - padding: .15em; - font: 100% "Monaco", "Courier New", Courier, monospace; - border-bottom: 1px dotted #FFCC66; - background-color: #FFFFCC; -} - -pre { - margin: .5em 0; - padding: .5em; - font: 100% "Monaco", "Courier New", Courier, monospace; - border: 1px solid #D3DAE4; - background-color: #F4F6F8; - width: 97%; - overflow: auto; -} - -/* General Layout */ -#page { - position:relative; - margin:0 auto; - text-align:left; - width:700px; -} - -#container { - position:relative; - background:#FFF; - z-index:1; -} -#container:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} -/* Hides from IE-mac \*/ -* html #container { height: 1%; } -/* End hide from IE-mac */ - - -.xtop, .xbottom {display:block; background:transparent; font-size:1px; } -.xb1, .xb2, .xb3, .xb4 {display:block; overflow:hidden;} -.xb1, .xb2, .xb3 {height:1px;} -.xb2, .xb3, .xb4 {background:#F4F6F8; border-left:1px solid #D3DAE4; border-right:1px solid #D3DAE4;} -.xbottom .xb2, .xbottom .xb3, .xbottom .xb4 {background:#FFF;} -.xb1 {margin:0 5px; background:#D3DAE4;} -.xb2 {margin:0 3px; border-width:0 2px;} -.xb3 {margin:0 2px;} -.xb4 {height:2px; margin:0 1px; } - -.xboxcontent { - background:#FFF; - border:1px solid #D3DAE4; - border-top:0 solid; - border-bottom:1px solid #FFF; -} -.block-content { - border:0px solid; - background:none; -} - -/* Badge */ -#badge { - position: absolute; - top: 0; - right: 0; - width: 111px; - height: 114px; - background: url(../images/newversion-badge.gif) 0 0 no-repeat; -} - #badge * { display: none; } - -/* Header section */ -#header { - position:relative; - margin:30px 10px; - text-align:center; - overflow: hidden; - //height: 1%; -} - -/* Wildbit Logotype */ -#wildbit { - float: left; - margin:0 18px 0 0; - padding:0 18px 0 18px; - width:96px; - height:57px; - border-right: 1px solid #CCC; - overflow:hidden; -} - #wildbit a { - position:relative; - display:block; - width:96px; - height:57px; - } - #wildbit a span { - position:absolute; - left:0; top:0; - display:block; - width:96px; - height:57px; - background:url(../images/wildbit-logo.gif) left top no-repeat; - } - - -/* Columns wrappers */ -.twocolwrapper { clear:both; margin:0; width:100%; overflow:hidden; } -html>body .twocolwrapper { width:auto; border-top:1px solid #FFF; } - -.twocolwrapper .firstcol { - float:left; - width:59%; -} -.twocolwrapper .secondcol { - margin:0 0 0 60%; - padding:0; - width:100%; - voice-family: "\"}\""; - voice-family: inherit; - width:39%; -} -html>body .twocolwrapper .secondcol { width:40%; overflow:visible; } - - -/* Content Area */ -#content { - margin: 0 28px; - padding-bottom: 2em; -} - -.new { - padding:.15em .35em; - font-size:85%; - font-style:italic; - background-color:#CBE564; -} -.note { - font-style:italic; -} - -/* Demo buttons */ -.demo-hint { - padding-left: .5em; - line-height: 2.5em; - color: #999; -} - -a.demo-btn { - display: block; - float: left; - font-weight: bold; - text-decoration: none; - text-shadow: #FFF 2px 2px 0; - color: #000!important; - background: url('../images/btn-demo-l.gif') 0 0 no-repeat; -} -a.demo-btn:hover { text-decoration: underline; } - a.demo-btn span { - display: block; - padding: 8px 15px 12px 34px; - background: url('../images/btn-demo-r.gif') 100% 0 no-repeat; - } - -ul#features { - padding:0; - margin:1em 0; -} - #features li { - margin:1em 0; - padding-left:18px; - font-size: 90%; - list-style:none; - background:url(../images/bul-feature.gif) 0 0 no-repeat; - } - -/* Download block */ -.download { - position: relative; - padding: 1em 1em 1em 28px; - background: #F4F6F8; - //height: 1%; -} - .download .download-lnk { - margin-right: 270px; - - } - .download .download-lnk h2 { - position: relative; - margin: 0; - padding: 1em 0 .75em; - font-weight: bold; - } - .download .download-lnk h2 a { - display: block; - position: absolute; - left: -52px; top: 0; - margin: 0; - padding: 1em 0 .75em 52px; - background: url(../images/download.gif) 0 0 no-repeat; - } - - /* Donate form section */ - .form-donate { - margin: 0; - padding: 0; - margin-left: -14px; - } - .form-donate .xtop, .form-donate .xbottom {display:block; background:transparent; font-size:1px; } - .form-donate .xb1, .form-donate .xb2, .form-donate .xb3, .form-donate .xb4 {display:block; overflow:hidden;} - .form-donate .xb1, .form-donate .xb2, .form-donate .xb3 {height:1px;} - .form-donate .xb2, .form-donate .xb3, .form-donate .xb4 {background:#FCFCFF; border-left:1px solid #FCFCFF; border-right:1px solid #FCFCFF;} - .form-donate .xbottom .xb2, .form-donate .xbottom .xb3, .form-donate .xbottom .xb4 {background:#FCFCFF;} - .form-donate .xb1 {margin:0 5px; background:#FCFCFF;} - .form-donate .xb2 {margin:0 3px; border-width:0 2px;} - .form-donate .xb3 {margin:0 2px;} - .form-donate .xb4 {height:2px; margin:0 1px; } - - .form-donate .xboxcontent { - padding: .25em 1em; - margin: 0; - color: #000; - border: 1px solid #FCFCFF; - border-width: 0px 1px 0 1px; - background-color: #FCFCFF; - } - .form-donate p { - margin: 0; - padding: 0; - } - .form-donate .secondcol input { margin-left: 6px; } - /* Huge demo button */ - .download .demo-btn { - position: absolute; - float: none; - left: 416px; top: 20px; - width: 182px; - height: 67px; - background: url(../images/button-demo.gif) 0 0 no-repeat; - } - .download .demo-btn span { - display: block; - text-indent: -2000px; - background-image: none; - } - -/* Demos */ -.warning { - padding: .5em .5em 1em 28px; - font-weight: bold; - background: url('../images/warn.gif') 0 15px no-repeat; -} - -/* Google Code Block */ -#gcode { - padding-left: 110px; - background: url('../images/google-logo.png') 0 0 no-repeat; - -} - -/* Annouce balloon block */ -.balloon { - position: relative; - margin: -20px 0 20px; -} - - .balloon .xtop, .balloon .xbottom {display:block; background:transparent; font-size:1px; } - .balloon .xb1, .balloon .xb2, .balloon .xb3, .balloon .xb4 {display:block; overflow:hidden;} - .balloon .xb1, .balloon .xb2, .balloon .xb3 {height:1px;} - .balloon .xb2, .balloon .xb3, .balloon .xb4 {background:#FFFFEC; border-left:1px solid #EEC; border-right:1px solid #EEC;} - .balloon .xbottom .xb2, .balloon .xbottom .xb3, .balloon .xbottom .xb4 {background:#FFFFEC;} - .balloon .xb1 {margin:0 5px; background:#EEC;} - .balloon .xb2 {margin:0 3px; border-width:0 2px;} - .balloon .xb3 {margin:0 2px;} - .balloon .xb4 {height:2px; margin:0 1px; } - - .balloon .xarrow { - position: relative; - top: 1px; left: 70px; - width: 15px; - height: 16px; - } - .balloon .xarrow b { - display: block; - background:#FFFFEC; - border-left:1px solid #EEC; - border-right:1px solid #EEC; - font-size:1px; - height: 2px; - } - .balloon .xarrow .a1 { margin: 0 7px; background-color: #EEC; border: 0 solid; width: 1px; } - .balloon .xarrow .a2 { width: 1px; margin: 0 6px;} - .balloon .xarrow .a3 { width: 3px; margin: 0 5px;} - .balloon .xarrow .a4 { width: 5px; margin: 0 4px;} - .balloon .xarrow .a5 { width: 7px; margin: 0 3px;} - .balloon .xarrow .a6 { width: 9px; margin: 0 2px;} - .balloon .xarrow .a7 { width: 11px; margin: 0 1px;} - .balloon .xarrow .a8 { width: 13px; margin: 0;} - - .balloon .xboxcontent { - padding: .25em 27px; - margin: 0; - color: #000; - font-size: 135%; - border: 1px solid #EEC; - border-width: 0px 1px 0 1px; - background-color: #FFFFEC; - } - .balloon .xboxcontent a:link, - .balloon .xboxcontent a:visited { - display: block; - padding: .5em 0; - color: #000; - text-decoration: none; - } - .balloon .xboxcontent a:hover { - color: #C63; - text-decoration: underline; - } - - - -/* Footer Section */ -#footer { - margin-top:10px; - font-size:85%; - color:#99C; - text-align:center; -} - -/* Clear */ -.clear { - clear: both; - margin: 0; - padding: 0; - font-size: 1px; -} - -/* Hire us badge */ -.label-hire { - position: absolute; - margin: 0; - padding: 0; - top: 0; - left: 0; - z-index: 1010; -} \ No newline at end of file diff --git a/posterita/posterita/web/css/inventory.css b/posterita/posterita/web/css/inventory.css deleted file mode 100644 index 2853b2e4eb..0000000000 --- a/posterita/posterita/web/css/inventory.css +++ /dev/null @@ -1,118 +0,0 @@ -div#status{ - font-size: 12px; - font-weight: bold; -} -div#uploadCsv{ - height: 150px; - font-size: 14px; - font-weight: bold; - border-top: solid 1px #000; - border-bottom: solid 1px #000; -} - -div#priceLists{ - font-size: 10px; - font-weight: bold; - border-top: solid 1px #000; - border-left: solid 1px #000; - border-right: solid 1px #000; - border-bottom: solid 1px #000; - background-color: #dddddd; -} - -select#priceList{ - font-size: 10px; - font-weight: bold; - border-top: solid 1px #000; - border-left: solid 1px #000; - border-right: solid 1px #000; - border-bottom: solid 1px #000; - background-color: #ffffff -} - - - -.descButton { - float:left; - border:solid 1px #333333; - margin-right: 4px; - margin-top: 4px; - margin-bottom: 4px; - padding:6px; - font-size:8px; - font-weight: bold; - font-family: Verdana, Arial, Helvetica, sans-serif; - color:#FFFFFF; - background-color:#333333; - cursor:pointer; -} - -.upbutton { - float:left; - border:solid 1px #333333; - margin-right: 4px; - margin-top: 4px; - margin-bottom: 4px; - padding:6px; - font-size:10px; - font-weight: bold; - font-family: Verdana, Arial, Helvetica, sans-serif; - color:#FFFFFF; - background-color:#333333; - cursor:pointer; -} - -div#detailsInfo label{ - width : 190px; - display:block; - /*border: solid 1px #000;*/ - float:left; -} - -div#invDescription label{ - width : 100px; - display:block; - font-size: 12px; - float:left; -} - -/* Sortable tables */ -table.sortable thead { - background-color:#eee; - color:#666666; - font-weight: bold; - cursor: default; -} - -.highlighted { background: yellow; } - -.box .filter { display: none; } - - -div.popup { - max-width: 600px; - border: 1px solid red; - padding: 5px; - background-color: white; - /* The following properties should not be changed */ - position: absolute; -} -.popup_overlay { - background-color: #000000; - /* The following properties should not be changed */ - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 500px; - z-index:9999; -} - -span.popup_link, a.popup_link { - cursor: pointer; - border-bottom: 1px dotted; -} - -.popup_draghandle { - cursor: move; -} diff --git a/posterita/posterita/web/css/js-calendar/calendar-win2k-1.css b/posterita/posterita/web/css/js-calendar/calendar-win2k-1.css deleted file mode 100644 index e7c888c6aa..0000000000 --- a/posterita/posterita/web/css/js-calendar/calendar-win2k-1.css +++ /dev/null @@ -1,296 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author tamak - */ - - -/* The main calendar widget. DIV containing a table. */ - -.calendar { - position: relative; - display: none; - border-top: 2px solid #fff; - border-right: 2px solid #000; - border-bottom: 2px solid #000; - border-left: 2px solid #fff; - font-size: 11px; - color: #000; - cursor: default; - background: #d4d0c8; - font-family: tahoma,verdana,sans-serif; -} - -.calendar table { - border-top: 1px solid #000; - border-right: 1px solid #fff; - border-bottom: 1px solid #fff; - border-left: 1px solid #000; - font-size: 11px; - color: #000; - cursor: default; - background: #d4d0c8; - font-family: tahoma,verdana,sans-serif; -} - -/* Header part -- contains navigation buttons and day names. */ - -.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ - text-align: center; - padding: 1px; - border-top: 1px solid #fff; - border-right: 1px solid #000; - border-bottom: 1px solid #000; - border-left: 1px solid #fff; -} - -.calendar .nav { - background: transparent url(menuarrow.gif) no-repeat 100% 100%; -} - -.calendar thead .title { /* This holds the current "month, year" */ - font-weight: bold; - padding: 1px; - border: 1px solid #000; - background: #848078; - color: #fff; - text-align: center; -} - -.calendar thead .headrow { /* Row containing navigation buttons */ -} - -.calendar thead .daynames { /* Row containing the day names */ -} - -.calendar thead .name { /* Cells containing the day names */ - border-bottom: 1px solid #000; - padding: 2px; - text-align: center; - background: #f4f0e8; -} - -.calendar thead .weekend { /* How a weekend day name shows in header */ - color: #f00; -} - -.calendar thead .hilite { /* How do the buttons in header appear when hover */ - border-top: 2px solid #fff; - border-right: 2px solid #000; - border-bottom: 2px solid #000; - border-left: 2px solid #fff; - padding: 0px; - background-color: #e4e0d8; -} - -.calendar thead .active { /* Active (pressed) buttons in header */ - padding: 2px 0px 0px 2px; - border-top: 1px solid #000; - border-right: 1px solid #fff; - border-bottom: 1px solid #fff; - border-left: 1px solid #000; - background-color: #c4c0b8; -} - -/* The body part -- contains all the days in month. */ - -.calendar tbody .day { /* Cells containing month days dates */ - width: 2em; - text-align: right; - padding: 2px 4px 2px 2px; -} -.calendar tbody .day.othermonth { - font-size: 80%; - color: #aaa; -} -.calendar tbody .day.othermonth.oweekend { - color: #faa; -} - -.calendar table .wn { - padding: 2px 3px 2px 2px; - border-right: 1px solid #000; - background: #f4f0e8; -} - -.calendar tbody .rowhilite td { - background: #e4e0d8; -} - -.calendar tbody .rowhilite td.wn { - background: #d4d0c8; -} - -.calendar tbody td.hilite { /* Hovered cells */ - padding: 1px 3px 1px 1px; - border-top: 1px solid #fff; - border-right: 1px solid #000; - border-bottom: 1px solid #000; - border-left: 1px solid #fff; -} - -.calendar tbody td.active { /* Active (pressed) cells */ - padding: 2px 2px 0px 2px; - border-top: 1px solid #000; - border-right: 1px solid #fff; - border-bottom: 1px solid #fff; - border-left: 1px solid #000; -} - -.calendar tbody td.selected { /* Cell showing selected date */ - font-weight: bold; - border-top: 1px solid #000; - border-right: 1px solid #fff; - border-bottom: 1px solid #fff; - border-left: 1px solid #000; - padding: 2px 2px 0px 2px; - background: #e4e0d8; -} - -.calendar tbody td.weekend { /* Cells showing weekend days */ - color: #f00; -} - -.calendar tbody td.today { /* Cell showing today date */ - font-weight: bold; - color: #00f; -} - -.calendar tbody .disabled { color: #999; } - -.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ - visibility: hidden; -} - -.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ - display: none; -} - -/* The footer part -- status bar and "Close" button */ - -.calendar tfoot .footrow { /* The in footer (only one right now) */ -} - -.calendar tfoot .ttip { /* Tooltip (status bar) cell */ - background: #f4f0e8; - padding: 1px; - border: 1px solid #000; - background: #848078; - color: #fff; - text-align: center; -} - -.calendar tfoot .hilite { /* Hover style for buttons in footer */ - border-top: 1px solid #fff; - border-right: 1px solid #000; - border-bottom: 1px solid #000; - border-left: 1px solid #fff; - padding: 1px; - background: #e4e0d8; -} - -.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ - padding: 2px 0px 0px 2px; - border-top: 1px solid #000; - border-right: 1px solid #fff; - border-bottom: 1px solid #fff; - border-left: 1px solid #000; -} - -/* Combo boxes (menus that display months/years for direct selection) */ - -.calendar .combo { - position: absolute; - display: none; - width: 4em; - top: 0px; - left: 0px; - cursor: default; - border-top: 1px solid #fff; - border-right: 1px solid #000; - border-bottom: 1px solid #000; - border-left: 1px solid #fff; - background: #e4e0d8; - font-size: 90%; - padding: 1px; - z-index: 100; -} - -.calendar .combo .label, -.calendar .combo .label-IEfix { - text-align: center; - padding: 1px; -} - -.calendar .combo .label-IEfix { - width: 4em; -} - -.calendar .combo .active { - background: #c4c0b8; - padding: 0px; - border-top: 1px solid #000; - border-right: 1px solid #fff; - border-bottom: 1px solid #fff; - border-left: 1px solid #000; -} - -.calendar .combo .hilite { - background: #048; - color: #fea; -} - -.calendar td.time { - border-top: 1px solid #000; - padding: 1px 0px; - text-align: center; - background-color: #f4f0e8; -} - -.calendar td.time .hour, -.calendar td.time .minute, -.calendar td.time .ampm { - padding: 0px 3px 0px 4px; - border: 1px solid #889; - font-weight: bold; - background-color: #fff; -} - -.calendar td.time .ampm { - text-align: center; -} - -.calendar td.time .colon { - padding: 0px 2px 0px 3px; - font-weight: bold; -} - -.calendar td.time span.hilite { - border-color: #000; - background-color: #766; - color: #fff; -} - -.calendar td.time span.active { - border-color: #f00; - background-color: #000; - color: #0f0; -} diff --git a/posterita/posterita/web/css/logo.css b/posterita/posterita/web/css/logo.css deleted file mode 100644 index d13a1e6359..0000000000 --- a/posterita/posterita/web/css/logo.css +++ /dev/null @@ -1,23 +0,0 @@ -/* Logotype */ -#logo { - float: left; - margin:0; - padding:0; - width:265px; - height:57px; - overflow:hidden; -} - #logo a { - position:relative; - display:block; - width:265px; - height:57px; - } - #logo a span { - position:absolute; - left:0; top:0; - display:block; - width:265px; - height:57px; - background:url(../images/logo.gif) left top no-repeat; - } \ No newline at end of file diff --git a/posterita/posterita/web/css/mainMenu.css b/posterita/posterita/web/css/mainMenu.css deleted file mode 100644 index 6cb65890b0..0000000000 --- a/posterita/posterita/web/css/mainMenu.css +++ /dev/null @@ -1,841 +0,0 @@ -/*MAIN POS MENU CSS*/ - -#posHeader{ -background: #9A9A9A url("../images/newUI/topmenubg.gif") repeat-x; -position: relative; -float: left; -width: 100%;} - - -#backButn{ -position: relative; -float: left; -width: 28px; -cursor: pointer; -} - -#logo{ -position: relative; -width: 133px; -float: left; -} - -#mainTitle{ -position: relative; -color: #FFFFFF; -font-family: tahoma, san-serif; -font-size: 13px; -font-weight: bold; -text-transform: uppercase; -margin: 10px 0 0 10px; -float: left; - -} -#acDetailsContainer{ -margin: 5px 10px 0 10px;} - -#acDetailsL{ -position: relative; -margin: 0; -float: right; -color: #fff; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: normal; -padding-right: 10px; - -} - -#acDetailsR{ -position: relative; -margin: 0; -float: right; -color: #fff; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: normal; -} - -#systemMenuContainer{ -background: #9A9A9A url("../images/newUI/pricedetbg.gif") no-repeat; -height: 41px; -} - -#systemMenuBg{ -background: url("../images/newUI/pricedetbgtile.gif") repeat-x; -height: 41px; -position: relative; -margin: 0 0 0 5px; -} - -#choosePOS{ - color: #FFFFFF; - text-align: center; - font-size: 11pt; -} - -#systemMenu{ -padding-top: 3px; -padding-left: 13px;} - - -img.center{ -padding-right: 10px; -float: left; -} - -.posSubNavContainer, .category h1{ -font-size: 11px; -font-family: tahoma; -color: #fff; -text-transform: uppercase; -padding: 6px 0 10px 0; -margin-top: -40px; -margin-left: 0px; -text-indent: 30px; - -} - -#categoryImg -{ - height: 19px; - width: 18px; - margin-right: 13px; - margin-top: 5px; - margin-left: -30px; -} - -#posNavContainer { - margin: 0; - padding: 0; - } - -#posNavContainer ul{ - margin: 0; - padding: 0; - list-style-type: none; - line-height: 30px; -} - -#posNavContainer li { - margin: 0; - padding: 0; - } - -#posNavContainer a{ - display: table-row; - color: #777; - padding: 2px 0px 2px 20px; - text-decoration: none; - font-size: 11px; - font-weight: bold; - text-transform: normal; - font-family: tahoma, verdana, san-serif; - width: 1em; - margin: 0px; - text-indent: 20px; - } - -#posNavContainer a:hover{ - color: #333; - } - -#posSubNavContainer .posNews h1{ - font-size: 11px; - font-family: tahoma; - color: #fff; - text-transform: uppercase; - padding: 6px 0 10px 0; - margin-top: -30px; - margin-left: 0px; - text-indent: 30px; - background: url(../images/newUI/hicon-news.gif) 0 0 no-repeat; -} - -#posSubNavContainer .posHelp h1{ - font-size: 11px; - font-family: tahoma; - color: #fff; - text-transform: uppercase; - padding: 6px 0 10px 0; - margin-top: -30px; - margin-left: 0px; - text-indent: 30px; - background: url(../images/newUI/hicon-help.gif) 0 0 no-repeat; -} - - -#posSubNavContainer .posDonate h1{ - font-size: 11px; - font-family: tahoma; - color: #fff; - text-transform: uppercase; - padding: 6px 0 10px 0; - margin-top: -30px; - margin-left: 0px; - text-indent: 30px; - background: url(../images/newUI/hicon-donate.gif) 0 0 no-repeat; -} - -.currentpage { - background: url(../images/newUI/navbg.gif) left; - background-repeat: no-repeat; - width: 100%; - margin-left: 1px; -} - -.currentpage span{ - color: #3B6DAA; -} - -/*END*/ - - -/*POS SUB CONTENT MENU CSS*/ - -#posSubNavContainer { - margin-right: 0px; - margin-left: 0px; - - } - -#posSubNavContainer ul{ - margin: 0px 0 0 0 ; - padding: 0; - list-style-type: none; - line-height: 12px; - } - -#posSubNavContainer li { - margin: 0 0 0 0px; - } - -#posSubNavContainer a{ - width: 98%; - text-align: left; - color: #777; - display: block; - padding: 5px 0 5px 0px; - text-decoration: none; - font-size: 11px; - font-weight: bold; - text-transform: normal; - font-family: tahoma, verdana, san-serif; - text-indent: 0px; - - border-top: 1px solid #ddd} - -#posSubNavContainer a:hover{ - color: #3B6DAA; - } - - -/*END*/ - - -#rightContainer{ -margin: 0; -padding: 0; -min-height: 525px; -} - -.rightContainer{ -background:#EBEFF7 url(../images/newUI/palebluebg.gif) repeat-y 0 0; -} - - -#mainHeaderTitleContainer{ -text-align: left; -margin-top: 0px; -padding-left: 20px; -border-bottom: 1px solid #fff; -height: 30px;} - - -#mainHeaderTitleContainer h1{ -font-size: 14px; -font-family: tahoma; -color: #669ACF; -text-transform: uppercase; -padding: 5px 0 0 0; -margin: 0; - -} - -.liquid-round { -padding-right: 5px; -float: left; -width:32%; -/* set to 49% for 2 column layout. can also set exact px width if you dont want to auto resize width */ -margin-top: 5px; -margin-right: auto; -margin-bottom: 5px; -margin-left: auto; -background:#fff url(../images/newUI/leftside.gif) repeat-y left top; -position: relative; - -} - -.top { -width:100%; -height:40px; -background:url(../images/newUI/top.gif) no-repeat left top; -} - -.top span { -display:block; -position:relative; -height:40px; -background:url(../images/newUI/top-right.gif) no-repeat right top; -} - -.center-content { -position:relative; -background:url(../images/newUI/rightside.gif) repeat-y right top; -padding:1px 20px 1px 25px; -margin:-1px 0 -50px 0; -} - -.bottom{ -width:100%; -height:60px; -background:url(../images/newUI/bottom.gif) no-repeat left bottom; -} - -.bottom span { -display:block; -/*remove because of ie position:relative;*/ -height:60px; -background:url(../images/newUI/bottom-right.gif) no-repeat right top; -} - - .mainContainer{ -background: #fff; -padding: 5px; -} - -#mainFields{ -padding: 0px; -margin: 0; -background: #FFF; -} - -#mainFields td, #mainFields table, #mainFields tr{ -background: #DFDFDF; -color: #51585F; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: bold; -text-transform: uppercase; -padding: 0px 0 0 0; -margin: 0; -} - -.footer{ -background: #9A9A9A url("../images/newUI/footerbg.gif") repeat-x; -padding: 8px; -margin: 0; -height: 41px; -color: #FFFFFF; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: bold; -border-top: #FFFFFF solid 1px; -position: relative; -} - -.floatRight{ - float: right; -} - -.floatLeft{ - float: left; -} - -#newHeader, #footer, #body, .form{ - padding: 0px; - margin: 0px; -} - -#content{ - padding: 0px; - min-height: 525px; - margin: 0px; -} - -#search{ - display:none; - border:solid 1px #FFF; - background-color: #EBEFF7; - padding: 10px; - width : 280px; - height: 100px; - position: absolute; - z-index: 8000; - color: #333; - font-family: tahoma, san-serif; - font-size: 12px; - text-align: center; - left: 40%; - top: 40%; -} - -#bulletList { - margin-right: 0px; - margin-left: 0px; -} - -#bulletList ul{ - margin: 0px 0 0 0 ; - padding: 0; - list-style-type: none; - line-height: 12px; -} - -#bulletList li { - margin: 0 0 0 0px; -} - -#bulletList a{ - width: 98%; - text-align: left; - color: #777; - display: block; - padding: 8px 0 3px 0px; - text-decoration: none; - font-size: 11px; - font-weight: bold; - text-transform: normal; - font-family: tahoma, verdana, san-serif; - text-indent: 18px; - background: url(../images/newUI/icon-newwindow.gif) no-repeat 0 8px; - border-top: none -} - -#bulletList a:hover{ - color: #3B6DAA; -} - -#bulletList2 { - margin-right: 0px; - margin-left: 20px; -} - -#bulletList2 ul{ - margin: 0px 0 0 0 ; - padding: 0; - list-style-type: none; - line-height: 12px; -} - -#bulletList2 li { - margin: 0 0 0 0px; -} - -#bulletList2 a{ - width: 98%; - text-align: left; - color: #777; - display: block; - padding: 8px 0 3px 0px; - text-decoration: none; - font-size: 11px; - font-weight: bold; - text-transform: normal; - font-family: tahoma, verdana, san-serif; - text-indent: 18px; - background: url(../images/newUI/bullet-arrow.gif) no-repeat 0 8px; - border-top: none -} - -#bulletList2 a:hover{ - color: #3B6DAA; - } - -#rightContainer{ - margin: 0; - padding: 0; -} - -.rightContainer{ - background:#EBEFF7 url(../images/newUI/palebluebg.gif) repeat-y 0 0; -} - -#rightHeaderTitleContainer a{ - text-decoration: none; - font-size: 11px; - color: #777; - text-align: left; -} - -#rightHeaderTitleContainer a:hover{ - text-decoration: none; - font-size: 11px; - color: #3B6DAA; -} - - -#rightHeaderTitleContainer{ - text-align: center; - margin-top: 3px; - padding-left: 20px; - border-bottom: 1px solid #fff; - height: 27px; -} - -#mainHeaderTitleContainer{ - text-align: center; - margin-top: 0px; - padding-left: 20px; - border-bottom: 1px solid #fff; - height: 30px; -} - - -#mainHeaderTitleContainer h1{ - font-size: 14px; - font-family: tahoma; - color: #669ACF; - text-transform: uppercase; - padding: 5px 0 0 0; - margin: 0; -} - -#liquid-roundFull { - padding-right: 0px; - float: left; - width:99%; - /* set to 49% for 2 column layout. can also set exact px width if you dont want to auto resize width */ - margin:5px auto; - background:#fff url(../images/newUI/leftside.gif) repeat-y left top; -} - -#liquid-roundHalf { - padding-right: 7px; - float: left; - width:49%; - /* set to 49% for 2 column layout. can also set exact px width if you dont want to auto resize width */ - margin:0px auto; - background:#fff url(../images/newUI/leftside.gif) repeat-y left top; -} - -.browse{ - background: url(../images/newUI/butn-browse.gif) no-repeat 0 1px; - width: 89px; - height: 22px; - margin: 0px 0 0px 5px; - padding: 0; - cursor: pointer; /* hand-shaped cursor */ - cursor: hand; /* for IE 5.x */ - border: 0; - font-size: 10px; - text-transform: uppercase; -} - -.radioBox{ - padding: 0; - margin: 0; -} - -#generalSystemActions{ - position: relative; - margin: 0; - float: right; - color: #fff; - font-family: tahoma, san-serif; - font-size: 11px; - font-weight: normal; - padding: 3px 8px 0 10px; -} - -#generalSystemActions img{ - margin-right:2px; -} - -#acDetailsR{ - position: relative; - margin: 0; - float: right; - color: #fff; - font-family: tahoma, san-serif; - font-size: 11px; - font-weight: normal; -} - -.strong{ - font-weight: bold; -} - -#systemMenu{ - padding-top: 3px; - padding-left: 13px; - color: #fff; - font-size: 11px; - text-align: center; -} - -#systemActionContainer{ - text-align: center; - padding: 5px 0 0 0; -} -#systemActionContainer img{ - margin: 0px 2px 0 0; - cursor: pointer; -} - -#loginContainer{ - background: #fff ; - position: relative; - clear: both; - height: 100%; - font-size: 12px; -} - -#loginContainer td{ - font-size: 12px; - font-weight: bold; - color: #666; -} -#loginContainer a{ - color: #3B6DAA; -} - -#loginContainer a:hover{ - color: #3B6DAA; - text-decoration: none; -} - -#pinLoginContainer, .paleBlueBg{ - background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; - margin: 0 0 0 0px; - clear: both; - height: 100%; -} - -#loginPinContent td{ - font-size: 12px; - font-weight: bold; - text-transform: uppercase; - color: #666; -} - -.input{ - width: 200px; - height: 30px; - font-size: 12px; - font-weight: normal; -} - -.butnLogin{ - background: url(../images/newUI/butn-login.gif) no-repeat center top; - width: 81px; - height: 25px; - margin: 0px 0 0px 0px; - padding: 0; - cursor: pointer; /* hand-shaped cursor */ - cursor: hand; /* for IE 5.x */ - border: 0; - text-indent: -1000em; -} - -.systemMsg{ - padding-top: 8px; - text-transform: none; -} - -input.usernameMissing, input.passwordMissing, input.pinnumberMissing{ - border: 1px solid #CC0000; -} - -#pinLoginContainer input{ - width: 162px; - height: 30px; - font-size: 20px; - margin: 5px 0; -} - -#loginPinContent input{ - height: 30px; - font-size: 12px; - font-weight: normal; -} - -.divsystemerror{ - width: 250px; - color: #CC0000; - margin-bottom: 0px; -} -.systemerror{ - //background: url(../images/newUI/icon-err.gif) no-repeat 0 top; - width: 30px; - height: 35px; - float: left; - margin-right: 10px; -} - -#loginContent{ - padding: 55px 0 30% 0; -} - -#loginPinContent{ - padding: 15% 0 15% 0; -} - -.systemKey{ - background: url(../images/newUI/singlekey.gif) no-repeat 0 top; - width: 51px; - height: 51px; - float: left; - margin: 0 5px 5px 0; - cursor: pointer; -} - -.systemKey div{ - color : #333; - display: block; - width: 51px; - height: 36px; - text-decoration: none; - text-align: center; - font-weight: bold; - padding-top: 15px; -} - -.numPad{ - width: 168px; -} - -.dateTag{ - font-size: 11px; - color: #666; - width: 20px; - border-right: 1px solid #999; - padding-right: 12px; - text-align: center; - clear: both; -} - -.date{ - font-size: 13px; -} - -.month, .upperCase{ - text-transform: uppercase; - font-weight: bold; -} - -.newsContent{ - font-size: 11px; - color: #666; - clear: left; - margin-left: 40px; - margin-top: -28px; -} - -.newsContainer{ -width: 100%; -clear: both; -margin-bottom: 15px; - -} - -.infoContainer{ - font-size: 11px; - color: #666; -} - -.reg10UC{ - font-weight: normal; - font-size: 10px; - text-transform: uppercase; -} - -.reg10{ - font-weight: normal; - font-size: 10px; -} - -.bold11{ - font-weight: bold; - font-size: 11px; -} - -.bold13{ - font-weight: bold; - font-size: 13px; - text-transform: uppercase; -} - -#headerContainerRight{ - background: #9A9A9A url("../images/newUI/pricedetbg.gif") no-repeat; - height: 41px; -} - -#headerRight{ - background: url("../images/newUI/pricedetbgtile.gif") repeat-x; - height: 41px; - position: relative; - margin: 0 0 0 5px; -} - -#donate a{ - text-align: center; -} - -#rightBtnContainer{ - background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; - position: relative; - margin: 0 0 0 0px; - border-top: 1px solid #fff; - clear: both; - height: 100%; -} - -#rightBtn{ - padding: 6px; - color: #669ACF; - font-family: tahoma, san-serif; - font-size: 12px; - font-weight: bold; - text-align: center; - clear: both; -} - -#messagebox div, .errormsg{ - background: url(../images/newUI/icon-err.gif) no-repeat left center; - min-height: 35px; - line-height: 35px; -} - -.errormsgs { - background-color: #CC1515; - color:#FFFFFF; - z-index: 9000; - background: url(../images/newUI/icon-err.gif) no-repeat left center; - background-repeat: no-repeat; - background-position: 5px 5px; - padding-left: 40px; - padding-top: 5px; - min-height: 35px; - line-height: 35px; -} - -#errorsbox -{ - vertical-align: middle; - background-color:CC1515; - border: solid 1px #D41616; - padding: 4px; -} - -.errorRight{ - height: 99%; - text-align: center; - text-transform: uppercase; - color: #CC1515; - vertical-align: middle; - font-family: tahoma, san-serif; - font-size: 16px; - font-weight: bold; - border-bottom: 1px solid #FFF; -} \ No newline at end of file diff --git a/posterita/posterita/web/css/modalbox.css b/posterita/posterita/web/css/modalbox.css deleted file mode 100644 index 4685eb5a24..0000000000 --- a/posterita/posterita/web/css/modalbox.css +++ /dev/null @@ -1,101 +0,0 @@ -#MB_overlay { - position: absolute; - margin: auto; - top: 0; left: 0; - width: 100%; height: 100%; - z-index: 9999; - background-color: #000!important; -} -#MB_overlay[id] { position: fixed; } - -#MB_window { - position: absolute; - top: 0; - border: 0 solid; - text-align: left; - z-index: 10000; -} -#MB_window[id] { position: fixed!important; } - -#MB_frame { - position: relative; - background-color: #EFEFEF; - height: 100%; -} - -#MB_header { - margin: 0; - padding: 0; -} - -#MB_content { - padding: 6px .75em; - overflow: auto; -} - -#MB_caption { - font: bold 100% "Lucida Grande", Arial, sans-serif; - text-shadow: #FFF 0 1px 0; - padding: .5em 2em .5em .75em; - margin: 0; - text-align: left; -} - -#MB_close { - display: block; - position: absolute; - right: 5px; top: 4px; - padding: 2px 3px; - font-weight: bold; - text-decoration: none; - font-size: 13px; -} -#MB_close:hover { - background: transparent; -} - -#MB_loading { - padding: 1.5em; - text-indent: -10000px; - background: transparent url(/posterita/images/spinner.gif) 50% 0 no-repeat; -} - -/* Color scheme */ -#MB_frame { - padding-bottom: 7px; - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px; -} -#MB_window { - background-color: #EFEFEF; - color: #000; - -webkit-box-shadow: 0 8px 64px #000; - -moz-box-shadow: 0 0 64px #000; - box-shadow: 0 0 64px #000; - - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px; -} -#MB_content { border-top: 1px solid #F9F9F9; } -#MB_header { - background-color: #DDD; - border-bottom: 1px solid #CCC; -} -#MB_caption { color: #000 } -#MB_close { color: #777 } -#MB_close:hover { color: #000 } - - -/* Alert message */ -.MB_alert { - margin: 10px 0; - text-align: center; -} - -.popup{ - text-decoration:none; - color:#FFFFFF; - background-color:#333333; -} \ No newline at end of file diff --git a/posterita/posterita/web/css/newPOS.css b/posterita/posterita/web/css/newPOS.css deleted file mode 100644 index 1758d4d473..0000000000 --- a/posterita/posterita/web/css/newPOS.css +++ /dev/null @@ -1,723 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author tamak - */ - - -body -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - color: #000000; - -} - -mandatory -{ - font-weight: bold; - text-align:right; - font-size:18px; - color: blue; -} - -p.loginHeader -{ - color: #666666; - font-size: 36px; - font-weight: bold; - font-family: arial,sans-serif; -} - - - -div.copyright -{ - background-color: #666666; - text-align: center; - color: #FFFFFF; - font-family: arial,sans-serif; - font-weight: bold; - font-size: 10pt; - letter-spacing: 1px; - padding: 2; -} - -label -{ - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - color: #000000; - padding-right: 4px; -} - -label.red -{ - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - color: #E83530; -} - -label.green -{ - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - color: #0A9409; -} - -li.errormsg -{ - list-style-image: url("../images/pos/error.jpg"); - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - color: #000000; -} - -legend -{ - font-family: arial,sans-serif; - font-size: 10pt; - font-weight: bold; - letter-spacing: 1px; - color:#0A9409; -} - - -input.text -{ - border: solid 1px #666666; - /*font-family: arial,sans-serif;*/ - font-size: 10pt; -} - -textarea.text -{ - border: solid 1px #666666; - /*font-family: arial,sans-serif;*/ - font-size: 10pt; -} - -select.text -{ - border: solid 1px #666666; - /*font-family: arial,sans-serif;*/ - font-size: 10pt; -} - - -input.medium -{ - width:100px; -} - -input:focus -{ - background-color: #CDD4E9; - border: solid 1px #333333; -} - - -font.greencolor -{ - color:#0A9409; -} - -font.redcolor -{ - color:#E83530; -} - -font.title -{ - font-size: 16pt; -} - -div.main -{ - width:800px; - border:solid 1px #000000; - text-align: center; - overflow: inherit; - /* height: 600px; */ -} - -div.header -{ - width:800px; - /* height: 110px; */ -} - -div.menu -{ - width:800px; - background-color: #D8D8D8; -} - -div.content -{ - width:800px; - min-height: 300px; - background-color: #F4F4F4; -} - -font -{ - font-family: arial,sans-serif; - font-size: 10pt; - font-weight: bold; - letter-spacing: 1px; - color: #555555; -} - -li.submenu -{ - list-style-image: url("../images/pos/buttons/bullet_red.gif"); - font-family: arial,sans-serif; - font-size: 10pt; - /*font-weight: bold;*/ - letter-spacing: 1px; - color: #000000; -} - -img.topmenu -{ - border-style: none; - -} - -img.button -{ - cursor:pointer; -} - -/* anchor sytles */ -a:hover -{ - color:#0A9409; -} - -a.topmenu -{ - text-decoration: none; - border-width: 0px; - border-style: none; -} - -a.submenu -{ - text-decoration: none; - color:#666666; - font-family: arial,sans-serif; - font-size: 11pt; - letter-spacing: 1px; - font-weight: bold; -} - -td.submenu -{ - text-decoration: none; - color:#666666; - font-family: arial,sans-serif; - font-size: 11pt; - letter-spacing: 1px; - font-weight: bold; -} - -a -{ - text-decoration: none; - font-family: arial,sans-serif; - font-size: 11pt; - letter-spacing: 1px; -} - -a.forgotpassword -{ - color:#0A9409; - font-family: arial,sans-serif; - font-size: 12pt; - letter-spacing: 1px; - font-weight: bold; -} - -/* end of anchor styles */ - -/* Auto complete style */ -div.autocomplete { - position:absolute; - width:250px; - background-color:white; - border:1px solid #888; - margin:0px; - padding:0px; - overflow: auto; -} - -div.autocomplete ul { - list-style-type:none; - margin:0px; - padding:0px; -} -div.autocomplete ul li.selected { background-color: #ffb;} -div.autocomplete ul li { - list-style-type:none; - display:block; - margin:0; - padding:2px; - cursor:pointer; - letter-spacing: 1px; - font-size: 10pt; - font-family:arial,sans-serif; -} -div.notfound { - background-color: #ffb; -} - -/* tables styles */ -table.view -{ - border-collapse: collapse; - /*border: solid 1px black;*/ -} - -table.view td -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - color: #000000; - padding: 5px 0px 5px 0px; -} - -table.layout -{ - padding-left: 10; - padding-right: 10; - padding-top: 10; - padding-bottom: 10; - - /* border:solid 1px #000000; */ -} - -table.main -{ - width: 100%; - /*border: solid 1px black;*/ - border-collapse: collapse; -} - -table.main td -{ - padding: 5px 0px 5px 0px; -} - -table.topmenu -{ - padding-left: 10; - padding-right: 10; - - /* border:solid 1px #000000; */ -} - -td.buttoncell -{ - padding-right: 0px; -} - -table.login -{ - width: 800px; - /*height: 600px;*/ - border: solid black 1px; - border-spacing: 0; -} - -td.loginHeader -{ - height: 210px; - background-image: url("../images/pos/POS-LOGIN_01.gif"); - background-repeat: no-repeat; -} - -table.content -{ - width: 100%; - /* border: solid 1px black; */ - border-collapse: collapse; -} - -table.content th -{ - font-family: arial,sans-serif; - font-size: 10pt; - font-weight: bold; - letter-spacing: 1px; - color: #FFFFFF; - background-color: #909090; -} - -table.content td.total -{ - font-family: arial,sans-serif; - font-size: 10pt; - font-weight: bold; - letter-spacing: 1px; - color: #FFFFFF; - background-color: #BBBBBB; -} - -table.content td -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; - color: #000000; - padding: 5px 0px 5px 0px; - -} - -table.cart -{ - width: 100%; - /*border: solid 1px black;*/ - border-collapse: collapse; - border-spacing: 0px; - border: 0px; -} - -table.cart td -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; - color: #000000; - padding: 5px 5px 5px 5px; -} - -table.cart th -{ - font-family: arial,sans-serif; - font-size: 10pt; - font-weight: bold; - letter-spacing: 1px; - color: #FFFFFF; - background-color: #909090; - padding: 5px 5px 5px 5px; -} - -table.cart td.total -{ - font-family: arial,sans-serif; - font-size: 10pt; - font-weight: bold; - letter-spacing: 1px; - color: #FFFFFF; - background-color: #BBBBBB; -} - -table.cart td.label -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; - color: #000000; - background-color: #D8D8D8; -} - -table.cart td.contentname -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; - color: #000000; - background-color: #C9C9C9; -} - -table.content td.label -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; - color: #000000; - background-color: #D8D8D8; -} - -table.content td.contentname -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - font-weight: bold; - color: #000000; - background-color: #C9C9C9; -} - -table.orderheader td -{ - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - padding: 5px 0px 5px 0px; - color: #000000; -} - -/* -td.copyright -{ - height: 60px; - vertical-align: top; - padding: 0; -} -*/ - -table.display td a -{ - text-decoration: none; - color:blue; - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; -} - -table.display -{ - width: 100%; - border: solid 1px black; - border-collapse: collapse; -} - -table.display td.label -{ - /* - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - color: #000000; - */ - background-color: #D8D8D8; -} - -table.display td.contentname -{ - /* - font-family: arial,sans-serif; - font-size: 10pt; - letter-spacing: 1px; - color: #000000; - */ - background-color: #C9C9C9; -} - -table.display td -{ - font-family: arial,sans-serif; - font-size: 9pt; - letter-spacing: 1px; - color: #000000; - padding: 5px 5px 5px 5px; -} - -table.display th -{ - font-family: arial,sans-serif; - font-size: 9pt; - font-weight: bold; - letter-spacing: 1px; - color: #FFFFFF; - background-color: #909090; - padding: 5px 5px 5px 5px; -} - -caption -{ - font-family: arial,sans-serif; - font-size: 12pt; - font-weight: bold; - letter-spacing: 1px; - padding: 5px 5px 5px 5px; -} -/* end of table styles */ - -/* buttons styles */ -.advanced -{ - background-image: url("../images/pos/buttons/button_advanced.gif"); -} - -.continue -{ - background-image: url("../images/pos/buttons/button_continue.gif"); -} - -.complete -{ - background-image: url("../images/pos/buttons/button_continue.gif"); -} - -.addtocart -{ - background-image: url("../images/pos/buttons/button_addtocart.gif"); -} - -.newcustomer -{ - background-image: url("../images/pos/buttons/button_newcustomer.gif"); -} - -.checkout -{ - background-image: url("../images/pos/buttons/button_checkout.gif"); -} - -.delete -{ - background-image: url("../images/pos/buttons/button_delete.gif"); -} - -.neworder -{ - background-image: url("../images/pos/buttons/button_neworder.gif"); -} - -.cash -{ - background-image: url("../images/pos/buttons/button_cash.gif"); -} - -.card -{ - background-image: url("../images/pos/buttons/button_card.gif"); -} - -.cheque -{ - background-image: url("../images/pos/buttons/button_cheque.gif"); -} - -.mixed -{ - background-image: url("../images/pos/buttons/button_mixed.gif"); -} - -.save -{ - background-image: url("../images/pos/buttons/button_submit.gif"); -} - -.submit -{ - background-image: url("../images/pos/buttons/button_submit.gif"); -} - -.refresh -{ - background-image: url("../images/pos/buttons/button_refresh.gif"); -} - -.piechart -{ - background-image: url("../images/pos/buttons/button_piechart.gif"); -} - -.barchart -{ - background-image: url("../images/pos/buttons/button_barchart.gif"); -} - -.timeseries -{ - background-image: url("../images/pos/buttons/button_timeseries.gif"); -} - -.tabular -{ - background-image: url("../images/pos/buttons/button_tabular.gif"); -} - -.bigbutton -{ - background-repeat: no-repeat; - cursor: pointer; - border: 0px; - width: 127px; - height: 42px; - font-family: arial,sans-serif; - font-size: 12pt; - letter-spacing: 1px; - font-weight: bolder; - color: #666666; - padding: 0px; -} - -.smallbutton -{ - background-repeat: no-repeat; - cursor: pointer; - border: 0px; - width: 87px; - height: 42px; - font-family: arial,sans-serif; - font-size: 12pt; - letter-spacing: 1px; - font-weight: bolder; - color: #666666; - padding: 0px; -} - -.tangobutton -{ - background-repeat: no-repeat; - cursor: pointer; - border: 0px; - width: 87px; - height: 42px; - font-family: arial,sans-serif; - font-size: 12pt; - letter-spacing: 1px; - font-weight: bolder; - color: #666666; - padding: 0px; -} - -/* end of buttons styles */ - -div.space -{ - height:10px; - /* - border: solid 1px black; - background-color: #0000FF; - */ -} diff --git a/posterita/posterita/web/css/orderScreen.css b/posterita/posterita/web/css/orderScreen.css deleted file mode 100644 index f15c9b34ee..0000000000 --- a/posterita/posterita/web/css/orderScreen.css +++ /dev/null @@ -1,828 +0,0 @@ -#controls, div#centerShortcuts{ -background: #9A9A9A url("../images/newUI/footerbg.gif") repeat-x; -padding: 8px; -margin: 0; -height: 41px; -color: #FFFFFF; -font-family: tahoma, san-serif; -font-size: 11px; -text-align: center; -} - -body{ -padding: 0; -margin: 0; -background: #DFDFDF; -} - -.divider{ -color: #AEAEB0; -padding: 0 2px 0 2px; -} - -#posHeader{ -background: #9A9A9A url("../images/newUI/topmenubg.gif") repeat-x; -position: relative; -float: left; -width: 100%;} - - -.backButn{ -position: relative; -float: left; -width: 28px; -cursor: pointer; -} - -#logo{ -position: relative; -width: 133px; -float: left; -} - -#mainTitle{ -position: relative; -color: #FFFFFF; -font-family: tahoma, san-serif; -font-size: 13px; -font-weight: bold; -text-transform: uppercase; -margin: 10px 0 0 10px; -float: left; - -} -#acDetailsContainer{ -margin: 5px 10px 0 10px;} - -#acDetailsL{ -position: relative; -margin: 0; -float: right; -color: #fff; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: normal; -padding-right: 10px; - -} - -#acDetailsR{ -position: relative; -margin: 0; -float: right; -color: #fff; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: normal; -} - -.strong{ -font-weight: bold; -} - -#priceContainer{ -background: #9A9A9A url("../images/newUI/pricedetbg.gif") no-repeat; -height: 41px; -} - -#priceContainerBg{ -background: url("../images/newUI/pricedetbgtile.gif") repeat-x; -height: 41px; -position: relative; -margin: 0 0 0 5px; -} - -#priceValue{ -color: #FFFFFF; -font-family: tahoma, san-serif; -font-size: 16px; -font-weight: bold; -text-align: center; -padding: 10px 0 0 0; -} - -#priceListDetailsContainer{ -background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; -position: relative; -margin: 0 0 0 0px; -clear: both; -} - -#priceListDetails{ -padding: 10px; -color: #669ACF; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: bold; -text-align: center; -clear: both; -} - -.productValue, .discountDetails{ -color: #333; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: bold; -margin-left: 5px; -} - -#pgTitle{ -color: #fff; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: bold; -text-transform: uppercase; -position: relative; -margin-left: 170px; -padding-top: 25px; -} - -#productFieldsContainer{ -background: #DFDFDF; -padding: 0px; -margin: 0px; -} - -#productFields{ -padding: 1px; -margin: 0; -background: #DFDFDF; -} - -#productFields td, #productFields table, #productFields tr{ -background: #DFDFDF; -color: #51585F; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: bold; -text-transform: uppercase; -padding: 0px 0 0 0; -margin: 0; -} - -#productFields form{ -padding: 0; -margin:0; - -} - -input, textarea{ -background-color: #fff; -border: 1px solid #9A9A9A; -height: 18px; -padding: 0px; -margin: 0; -color: #51585F; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: normal; - -} - - input:focus, textarea:focus{ - border:1px solid #9ACF30; - background:#E3F3C3; -} - - -#productDetailsContainer, div#discountDetailsContainer{ -background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; -position: relative; -margin: 0 0 0 0px; -clear: both; -border-top: 1px solid #fff; -height: 100%; -line-height: 16px; -} - -#productDetails, div#discountDetails{ -padding: 10px; -color: #9A9A9A; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: normal; -text-align: left; -} - -div#productImage{ -background: #EBEFF7; -width: 90px; -height: 90px; -float: right; -} - -#editProductContainer, .rightColSubContainer{ -position: relative; -margin: 0; -border-top: 1px solid #fff; -} - -#editProductDetails{ -position: relative; -padding: 10px; -color: #9A9A9A; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: bold; -text-align: center; -} - -#editProductDetails input{ -margin-bottom: 10px; -margin-right: 5px; -} - -#customerContainer, #changePricelistContainer, #choosePrintDetailsContainer, .inventoryDetails{ -position: relative; -margin: 0; -border-top: 1px solid #fff; -} - -#choosePrintDetailsContainer span{ - font-family: tahoma, san-serif; - font-size: 12px; - font-weight: bold; - color: #333; - text-align: left; -} - -#choosePrintDetailsContainer table, input{ - margin-top: 8px; -} - -.inventoryDetails table{ - margin-top: 5px; - margin-bottom: 5px; -} - -#changePricelist{ - margin-top: 10px; - text-transform: uppercase; - color: #333; - font-weight: bold; -} - -#customerDetails{ -position: relative; -padding: 10px; -color: #9A9A9A; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: bold; -text-align: left; -} - -#paymentContainer{ -position: relative; -margin: 0; -border-top: 1px solid #fff; -} - -#paymentDetails{ -padding: 10px; -color: #9A9A9A; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: bold; -text-align: center; -} - -#quickDiscountDetails{ -position: relative; -border-top: 1px solid #fff; -padding: 10px; -color: #9A9A9A; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: bold; -text-align: left; -width: 300px; -display:block; -float:left; -} - -#docStatus{ -position: relative; -border-top: 1px solid #fff; -padding: 10px; -color: #9A9A9A; -font-family: tahoma, san-serif; -font-size: 10px; -font-weight: bold; -text-align: left; -width: 300px; -display:block; -float:left; -} - -#paymentDetails h1{ -padding-bottom: 5px; -margin: 0; -color: #9A9A9A; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: bold; -text-align: center; -} - -#contentContainer{ -position: relative; -margin: 0 0 0 0px; -clear: both; -border-top: 1px solid #fff; -height: 100%; -} - -#content{ -padding: 0px; -color: #333333; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: bold; -text-align: center; -} - -#contentContainer div{ - background: #DFDFDF; -} - - -#systemButnContainer{ -position: relative; -margin: 0 0 0 0px; -clear: both; -border-top: 1px solid #fff; -height: 100%; -} - -#systemButn{ -padding: 6px; -color: #669ACF; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: bold; -text-align: left; -} - -#checkoutContainer{ -background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; -position: relative; -margin: 0 0 0 0px; -border-top: 1px solid #fff; -clear: both; -height: 100%; -} - -#checkout{ -padding: 6px; -color: #669ACF; -font-family: tahoma, san-serif; -font-size: 12px; -font-weight: bold; -text-align: center; -clear: both; -} - -.itemTitleList{ -background: #929292; -color: #fff; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: bold; -} - -.itemTitleList th{ -padding: 4px; -border: none; -text-align: left; -} - - -.highlight { -background-color: #9ACF30; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: normal; -color: #fff; -text-align: left; -} - -.highlight td{ -padding: 4px; -border: none; -} - -.totalItem{ -text-align: right; -} - -.totalSales{ -text-align: right; -} - -.oddRow{ -background: #F7F7F7; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: normal; -text-align: left; -} - -.oddRow td{ -padding: 4px; -border: none; -} - -.evenRow{ -background: #FFF; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: normal; -text-align: left; -} - -.evenRow td{ -padding: 4px; -border: none; -} - -.itemsTotal{ -background: #fff; -color: #333; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: bold; -} - -.itemsTotal td{ -background: #fff; -padding: 4px; -border-top: 2px solid #656565; -border-bottom: 2px solid #656565; -border-left: none; -border-right: none; -text-align: left; -} - -/* Auto complete style */ -div.autocomplete { - position: absolute; - /*width:250px;*/ - height:200px; - display:none; - background-color:white; - border:1px solid #888; - margin:0px; - padding:0px; - overflow: auto; - font-size: 11px; - font-family: tahoma, san-serif; - z-index: 9000; -} - -div.autocomplete ul { - list-style-type:none; - margin:0px; - padding:0px; -} - -div.autocomplete ul li.selected { - background-color: #9ACF30; - } - -div.autocomplete ul li { - list-style-type:none; - display:block; - margin:0; - padding:2px; - cursor:pointer; - letter-spacing: 1px; - font-size: 11px; - font-family: tahoma, san-serif; -} -div.notfound { - background-color: #ffb; -} - -div.errormsg { - padding: 10px; - border: solid 2px #BA0B0B; - background-color: #CC1515; - color:#FFFFFF; - position:absolute; - float:left; - z-index: 9000; - width:300px; - min-height: 60px; - padding-left: 60px; - background-image: url(../images/pos/icon-error.gif); - background-repeat: no-repeat; - background-position: 5px 5px; -} - -div.mask { - position:absolute; - float:left; - z-index: 8500; - background-image: url(../images/pos/maskBG.png); - top:0px; - left: 0px; -} - -div#indicator { - top:0px; - border: solid 2px #CC1515; - padding: 5px 5px 5px 5px; - display: none; - background-color: #FFFFFF; - z-index:10000; - right: 0px; - position: absolute; -} - -div#cashPanel, div#cardPanel, div#chequePanel, div#debitPanel, div#mixPanel, div#PINPanel { - display:none; - border:solid 10px #FFF; - background-color: #EBEFF7; - padding: 20px; - width : 400px; - position: absolute; - - margin: 0px; - z-index: 8000; - color: #333; - font-family: tahoma, san-serif; - font-weight: bold; - font-size: 14px; -} - -div#cash, div#card, div#cheque, div#mix, div#debit{ - overflow: auto; -} - -div#PINPanel { - width : 200px; - height : 100px; - position: absolute; - z-index: 8000; -} - -div#reciept { - text-align: center; -} - -div#reciept h1, div#reciept h2, div#reciept h3 { - text-align: center; -} - -div.floatDown { - position:absolute; - top: 560px; -} - -div#shoppingCart, div#cart { - height: 450px; - overflow: auto; -} - -.pointer{ - cursor:pointer; -} - -.selected{ - border:solid 1px #9ACF30; - cursor:pointer; -} - -.alignDetails td{ - border: 0px; - vertical-align: top; - text-align: left; - font-family: tahoma, san-serif; - font-size: 11px; - font-weight: normal; -} - -br.clear{ - clear:both; -} - -tr#customerName, tr#customerCode , tr#creditAvailable, tr#creditLimit, tr#openBalance{ - display: none; -} - -#receipt{ - overflow: auto; - background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; - border-top: 1px solid #fff; - line-height: 16px; - height: 450px; -} - -#receiptDetails{ - margin-left: 10px; -} - -.buttonLeft, .buttonRight{ - background: url("../images/newUI/pricedetbg.gif") repeat; - border: 1px solid #FFF; - line-height: 23px; - float: left; - height: 21px; - width: 95px; - font-family: tahoma, san-serif; - font-size: 11px; - font-weight: bold; - color: #FFF; - margin-right: 5px; - padding-top: 0px; - padding-bottom: 0px; - vertical-align: middle; - text-align: center; - margin-top:5px; - margin-bottom: 5px; - cursor: pointer; -} - -.buttonRight{ - position: absolute; - margin-left: 110px; -} - -div#leftBtnContainer, div#rightBtnContainer{ - position: relative; - margin: 0 0 0 0px; - padding-top: 3px; - padding-bottom: 0px; - border-top: 1px solid #fff; - height: 38px; - padding-left: 7px; -} - -div#rightBtnContainer, .paleBlueBg{ - background: #EBEFF7 url("../images/newUI/palebluebg.gif") repeat-y; - padding-left: 0px; -} - -div#discountDetails{ - height: 430px; - position: relative; -} - -div#centerShortcuts{ - line-height: 41px; -} - -#discount td{ - text-align: left; - padding-left: 5px; - background-color: #FFFFFF; -} - -div#frameHandle{ - text-align: right; - border-bottom: solid 1px #CCC; - padding: 2px; - background-color: #333; -} - -div#frameHandle a{ - text-decoration: none; - color: #FFF; - font-weight: bold; -} - -.error { - font-size: 11px; - color: white; - text-decoration: blink; - background-color: #FF0000; -} - -#pop_overlay - { - display: none; - position: fixed; - width: 100%; - height: 100%; - top: 0px; - left: 0px; - background: #000000; - filter: alpha(opacity=60); - -moz-opacity: 0.6; - opacity: 0.6; - } - - #pop_container - { - display: none; - position: fixed; - width: 100%; - height: 100%; - top: 0px; - left: 0px; - background: transparent; - } - - #pop_inner - { - display: block; - width: 320px; - height: 320px; - margin: 120px auto 0 auto; - background: #FFFFFF - border: 1px solid #999999 - text-align: center; - } - -#productCount{ - font-size: 14px; - font-weight: bold; - vertical-align: middle; - color: #CC0000; - text-transform: uppercase; - line-height: 450px; - margin-left: 30%; -} - -.noProduct{ - color: #CC0000; - font-size: 12px; - font-weight: bold; -} - -.salesFiguresHeader{ -background: #929292; -color: #fff; -font-family: tahoma, san-serif; -font-size: 11px; -font-weight: bold; -} - -.salesFiguresHeader th{ -padding: 2px; -border: none; -text-align: left; -} - -.salesFiguresRow{ - background: #DFDFDF; -} - -.captionStyle{ - padding: 10px; - color: #669ACF; - font-family: tahoma, san-serif; - font-size: 12px; - font-weight: bold; - letter-spacing: 0px; -} - -#productImage img{ - padding-top: 10px; -} - -#productEditFieldsContainer -{ -background: #fff; -padding: 0px; -margin: 0px; -height: 100%; -color: #666; -} - -#productEditFieldsContainer .prodFields{ -width: 270px;} - -#productEditFieldsContainer .prodTaxFields{ -width: 100%;} - -#productEditFieldsContainer .prodDescription -{ -font-size: 11px; -width: 270px; -padding: 0; -margin: 0;} - -#productEditFieldsContainer select -{ -border: 1px solid #777; -font-size: 11px; -} - -#productEditFieldsContainer td -{ -font-size: 11px; -} - -#productDetails td{ - font-size: 11px; -} - -#productEditFieldsContainer .checkbox, #productEditFieldsContainer .radioBox{ - vertical-align: middle; -} - -#productDetails .checkbox{ - vertical-align: middle; -} \ No newline at end of file diff --git a/posterita/posterita/web/css/popup.css b/posterita/posterita/web/css/popup.css deleted file mode 100644 index e74efdc479..0000000000 --- a/posterita/posterita/web/css/popup.css +++ /dev/null @@ -1,30 +0,0 @@ -/* - popup.js -*/ -div.popup { - max-width: 600px; - border: 1px solid grey; - padding: 5px; - background-color: white; - /* The following properties should not be changed */ - position: absolute; -} - -#popup_overlay { - background-color: #000000; - /* The following properties should not be changed */ - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 500px; -} - -span.popup_link, a.popup_link { - cursor: pointer; - border-bottom: 1px dotted; -} - -.popup_draghandle { - cursor: move; -} diff --git a/posterita/posterita/web/css/print.css b/posterita/posterita/web/css/print.css deleted file mode 100644 index 56bf0f385d..0000000000 --- a/posterita/posterita/web/css/print.css +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author tamak - */ - - -body, td, th, input { /* redundant rules for bad browsers */ - font-family: verdana, sans-serif; - font-size: 12px; - voice-family: "\"}\""; - voice-family: inherit; -} - -body{ - margin:40px; -} - -table.header{ - background-color:#FFFFFF; -} - -table.content { - border: 1px solid black; - border-collapse: collapse; - background-color: white; -} - -table.footer{ - background-color:#CCCCCC; -} - -th { - color: #333333; - font-weight:bold; - background-color: #CCCCCC; - text-align: left; -} - -td.contentname { - background-color: #F2F2F2; - font-family: Arial, Helvetica, sans-serif; - text-align: left; -} - -td.label { - background-color: #FAFAFA; - font-family: Arial, Helvetica, sans-serif; - text-align: left; -} - -.nodisplay{ - display:none; -} - -.big{ - height:50px; -} \ No newline at end of file diff --git a/posterita/posterita/web/css/screen.css b/posterita/posterita/web/css/screen.css deleted file mode 100644 index 4c69f4b028..0000000000 --- a/posterita/posterita/web/css/screen.css +++ /dev/null @@ -1,118 +0,0 @@ -@import url("displaytag.css"); - -@import url("alternative.css"); - -@import url("teststyles.css"); - -body,input,select,td,textarea { - font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -h4,h5,h6,p,strong,div,form,acronym,label,table,td,th,span,a,hr,code,pre,hr - { - margin: 0; - padding: 0; - font-size: 1em; - background-repeat: no-repeat; - list-style-type: none; -} - -a,a:visited,a:hover { - color: #666; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -img { - border: none; -} - -table hr { - height: 1px; - clear: both; - margin: none; - width: 100%; -} - -textarea { - width: 80%; - height: 200px; -} - -dt { - font-weight: bold; -} - -acronym { - border-bottom: 1px dashed #000; - cursor: help; -} - -ul#stylelist { - margin: 0 0 20px 0; - height: 20px; - padding: 0; -} - -ul#stylelist li { - list-style-type: none; - float: left; - width: 100px; - border: 1px solid #ccc; - background-color: #eee; - padding: 2px;; - float: left; - width: 100px; - border: 1px solid #ccc; - background-color: #eee; - padding: 2px; - margin: 0 2px 0 0; -} - -ul#showsource { - float: right; - padding: 0; - margin: 15px 20px 0 0; - width: 100px; - height: 33px; - list-style-type: none; - background-image: url("../img/viewsource.png"); - background-repeat: no-repeat; - margin-bottom: -30px; - text-align: center; - line-height: 30px; - font-weight: bold; -} - -ul#showsource a,ul#showsource a:visited { - font-size: 11px; - font-family: verdana; - color: #fff; -} - -table.sublist { - margin: 0 0 0 0; - width: 100%; -} - -table.sublist td,table.sublist th { - width: 50%; -} - -code { - background-color: #eee; - padding: 0 2px 0 2px; -} - -hr { - height: 1px; - color: #fff; - border: none; - border-top: 1px dotted #ccc; - margin: 20px 0 20px 0; - width: 50%; -} \ No newline at end of file diff --git a/posterita/posterita/web/css/style.css b/posterita/posterita/web/css/style.css deleted file mode 100644 index 1c52557fad..0000000000 --- a/posterita/posterita/web/css/style.css +++ /dev/null @@ -1,566 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author tamak - */ - - -body { - margin: 10px; - font-family: Arial, Helvetica, sans-serif; - color: #000000; - font-size: 12px; - background-color: #C3C1A9; -} -a { - color: #be0027; - text-decoration: none; - font-size:11px; - font-weight:500; -} -a:hover { - color: #666666; - text-decoration: underline; - font-weight:500; - font-size:10px; -} -a:visited { - color: #be0027; - text-decoration: underline; - font-size:11px; - font-weight:500; -} -a.left, a:hover.left, a:active.left, a:visited.left{ - color: #be0027; - text-decoration: none; - font-size:10px; - font-weight:500; -} - -a.message { - color: #be0027; - font-size:11px; - text-decoration: none; - font-weight:500; -} -a:hover.message { - color: #666666; - font-size:11px; - text-decoration: none; - font-weight:500; -} -a:visited.message { - color: #CC0000; - text-decoration: none; - font-weight:500; -} - - -a:hover.submenu, a:link.submenu, a:visited.submenu, a:active.submenu { - color: #be0027; - text-decoration: none; - font-size:11px; -font-weight:500; -} - -/* -a:submenu.left { - color: #666666; - text-decoration: none; - font-size:11px; - font-weight:500; -} -a:submenu.left { - color: #CC0000; - text-decoration: none; - font-size:11px; - font-weight:500; -} -*/ - -h2 { - color: #be0027; - font-size: 20px; - text-align: center; -} -h3 { - color: #be0027; - font-size: 18px; -} - -h1 { - color: #be0027; - font-size: 16px; -} - -.titleleft { - background-image: url(../images/titleleft.png); - background-repeat: no-repeat; - width: 202px; -} -.titlemiddle { - background-image: url(../images/titlemiddle.png); - background-repeat: repeat-x; -} -.titleright { - background-image: url(../images/titleright.png); - background-repeat: no-repeat; - width: 21px; -} -.menutop { - background-image: url(../images/menutop.png); - background-repeat: no-repeat; - width: 168px; - height: 15px; -} -.menumiddle { - background-image: url(../images/menumiddle.png); - background-repeat: repeat-y; - width: 168px; - padding: 10px; -} -.menubottom { - background-image: url(../images/menubottom.png); - background-repeat: no-repeat; - width: 168px; - height: 15px; -} -.contenttopleft { - background-image: url(../images/contenttopleft.png); - background-repeat: no-repeat; - width: 15px; -} -.contenttop { - background-image: url(../images/contenttop.png); - background-repeat: repeat-x; - text-align:right; -} -.contenttopright { - background-image: url(../images/contenttopright.png); - background-repeat: no-repeat; - width: 17px; -} -.contentleft { - background-image: url(../images/contentleft.png); - background-repeat: repeat-y; - width: 15px; -} -.contentright { - background-image: url(../images/contentright.png); - background-repeat: repeat-y; - width: 17px; -} -.contentbottomleft { - background-image: url(../images/contentbottomleft.png); - background-repeat: no-repeat; - width: 15px; -} -.contentbottom { - background-image: url(../images/contentbottom.png); - background-repeat: repeat-x; -} -.contentbottomright { - background-image: url(../images/contentbottomright.png); - background-repeat: no-repeat; - width: 17px; - -} -.copy { - font-size:10px; - color: #666666; - text-align: center; -} - -tr.noborder -{ - border: hidden; - -} - -.borderBottom -{ - - color: #be0027; - border-bottom: 1px solid #be0027; -} - -.createcustomer -{ - border-bottom: 1px solid #be0027; - border-top: 1px solid #be0027; - border-left: 1px solid #be0027; - border-right: 1px solid #be0027; -} - - -table.content { - background-color: #CCCCCC; -} -td.contentname { - background-color: #F2F2F2; - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - text-align: left; -} - -tr.contentname { - background-color: #F2F2F2; - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - text-align: left; -} - -td.label { - background-color: #FAFAFA; - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - text-align: left; -} - -td.rightLabel { - background-color: #FAFAFA; - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - text-align: right; -} - -td.greyBgTextBold { - background-color: #F2F2F2; - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - font-weight: bold; -} - -td.contentnameCenter { - background-color: #F2F2F2; - text-align: center; -} -td.contentred { - background-color: #F2F2F2; - color: #CC0000; - font-weight: bold; -} -td.contenthead { - font-weight: bold; -} -tr.white { - background-color: #FFFFFF; -} -th { - color: #333333; - font-weight:bold; - background-color: #CCCCCC; - text-align: left; - font-size:12px; - -} -.nb { - color: #be0027; - font-weight: bold; -} -.loginbox { - border: 1px solid #999999; -} -.buttonwide{ - background-color: #cccccc; - border: 1px #999999 solid; - font-family: verdana; - font-weight: bold; - color: #333333; - font-size: 10px; - text-transform: uppercase; - text-align: center; - width: 130px; - height: 18px; - } -.button{ - background-color: #cccccc; - border: 1px #999999 solid; - font-family: verdana; - font-weight: bold; - color: #333333; - font-size: 10px; - text-transform: uppercase; - text-align:center; - width: 100px; - height: 18px; -} - -.button1{ - background-color: #cccccc; - border: 1px #999999 solid; - font-family: verdana; - font-weight: bold; - color: #333333; - font-size: 10px; - text-transform: uppercase; - text-align: center; - width: 120px; - height: 18px; -} - -.button2{ - background-color: #cccccc; - border: 1px #999999 solid; - font-family: verdana; - font-weight: bold; - color: #333333; - font-size: 10px; - text-transform: uppercase; - text-align: center; - width: 160px; - height: 18px; -} - -.pagetitle -{ -background-image: url(../images/tab.jpg); - background-repeat: repeat; - color: #be0027; - font-size: 18px; - font-family: verdana; - text-align:center; - padding-top: 9px; - height: 29px; -} -.pagetitlefont -{ -color: #be0027; - font-size: 18px; - font-family: verdana; - text-align:center; - padding-top: 9px; - height: 29px; -} -.buttonClass -{ -background: #FF6F0E; -color: white; -border: 0; -font-weight: bold; -font-size: 12 px; -} -.buttonClassHeight -{ -background: #FFFFFF; -color:#FF6F0E ; -border: 0; -font-family:Times New Roman; -font-weight: bold; -font-size: 36px; -} -.border0 -{ -border: 0; -} - -table.officeTable { - border: 1px solid black; - border-collapse: collapse; - background-color: white; -} -table.officeTable th { - border: 1px solid black; - background-color: white; -} -table.officeTable td -{ - border: 1px solid black; -} - - -table.content { - border: 1px solid black; - border-collapse: collapse; - background-color: white; -} - -.label -{ - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - text-align: left; -} - -.label12pxbold -{ - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - font-weight: bold; -} - - -td.borderBottom -{ - border-bottom: 1px solid #000000;; -} - -td.contentbold { - font-weight: bold; -} - -.orderTitle -{ - font-size: 14px; - font-family: Helvetica, Helvetica, sans-serif; - font-weight: bold; -} - -.ZZMessage -{ - font-size: 14px; - font-family: Helvetica, Helvetica, sans-serif; - font-weight: normal; - color:#CC0000; -} - -tr.noBorder -{ - border-collapse: collapse; - border-top: 0px solid #FFFFFF; - border-bottom: 0px solid #FFFFFF; - border-left: 0px solid #FFFFFF; - border-right: 0px solid #FFFFFF; -} - -.border -{ - border-top: 1px solid #000000; - border-bottom: 1px solid #000000; - border-left: 1px solid #000000; - font-family:Verdana, Arial, Helvetica; - font-size:12px; -} - - -.borderRight -{ - border-top: 1px solid #000000; - border-bottom: 1px solid #000000; - border-left: 1px solid #000000; - border-right: 1px solid #000000; - font-family:Verdana, Arial, Helvetica; - font-size:12px; -} - -.daySelectBox -{ - font-family:Verdana,Arial,Helvetica; - font-size:10px; - width:70px; - color:#000000; - border-width:0.2px; - border-color:#ededed; -} - -.monthSelectBox -{ - font-family:Verdana,Arial,Helvetica; - font-size:10px; - width:70px; - color:#000000; -} - -.yearSelectBox -{ - font-family:Verdana,Arial,Helvetica; - font-size:10px; - width:70px; - color:#000000; -} - -.customerDetails -{ - font-size: 12px; - font-family: Helvetica, Helvetica, sans-serif; - font-weight: bold; -} - -.header -{ - border-style:solid; - border-width:4px; - border-color: #CCCCCC; - font-size: 20px; -} - -select -{ - font-family: Arial, Helvetica, sans-serif; - font-size: 10px; -} -.boldgraysmall -{ -font-family: verdana; -font-size :11px; -color: #999999; -font-weight: 700; -} -.bolddarkgraysmall -{ -font-family: verdana; -font-size: 11px; -color: #333333; -font-weight: 700; -} - -a.breadcr -{ -font-family: verdana; -font-size: 12px; -color: #999999; -text-decoration: none; -font-weight: 500; -} - -a.viewcert -{ -font-family: verdana; -font-size: 10px; -color: #be0027; -font-weight: 500; -} -.breadcr -{ -font-family: verdana; -font-size: 12px; -color: #999999; -text-decoration: none; -font-weight: 500; -} -.darkgray -{ -font-family: verdana; -font-size: 12px; -color: #333333; -font-weight: 500; -} -.bolddarkgray -{ -font-family: verdana; -font-size: 12px; -color: #333333; -font-weight: 600; -} - - - - diff --git a/posterita/posterita/web/css/teststyles.css b/posterita/posterita/web/css/teststyles.css deleted file mode 100644 index 796871382f..0000000000 --- a/posterita/posterita/web/css/teststyles.css +++ /dev/null @@ -1,50 +0,0 @@ -tr.good td { - color: red; - font-weight: bold; -} - -tr.bad td { - color: blue; -} - -td.money { - text-align: right; - padding-right: 2px; -} - -tr.bad td.money { - font-weight: bold; - background-color: blue; - color: #fff; -} - -td.r,th.r { - text-align: right; - padding-right: 10px; -} - -tr.total td,tr.subtotal td { - background-color: #eee; - font-weight: bold; -} - - -.DR -{ - color:red; -} - -.CO -{ - color:green; -} - -.PR -{ - color:yellow; -} - -.CL -{ - color:blue; -} diff --git a/posterita/posterita/web/images/back-menu.gif b/posterita/posterita/web/images/back-menu.gif deleted file mode 100644 index dc02cd77a1..0000000000 Binary files a/posterita/posterita/web/images/back-menu.gif and /dev/null differ diff --git a/posterita/posterita/web/images/bar.gif b/posterita/posterita/web/images/bar.gif deleted file mode 100644 index abc513f888..0000000000 Binary files a/posterita/posterita/web/images/bar.gif and /dev/null differ diff --git a/posterita/posterita/web/images/barcode.jpg b/posterita/posterita/web/images/barcode.jpg deleted file mode 100644 index e3f0042f33..0000000000 Binary files a/posterita/posterita/web/images/barcode.jpg and /dev/null differ diff --git a/posterita/posterita/web/images/bg_header.jpg b/posterita/posterita/web/images/bg_header.jpg deleted file mode 100644 index 10dbd74e8a..0000000000 Binary files a/posterita/posterita/web/images/bg_header.jpg and /dev/null differ diff --git a/posterita/posterita/web/images/bg_td.gif b/posterita/posterita/web/images/bg_td.gif deleted file mode 100644 index dc5fb47476..0000000000 Binary files a/posterita/posterita/web/images/bg_td.gif and /dev/null differ diff --git a/posterita/posterita/web/images/bullet1.gif b/posterita/posterita/web/images/bullet1.gif deleted file mode 100644 index ae352c2b69..0000000000 Binary files a/posterita/posterita/web/images/bullet1.gif and /dev/null differ diff --git a/posterita/posterita/web/images/bullet2.gif b/posterita/posterita/web/images/bullet2.gif deleted file mode 100644 index 04b293d4b7..0000000000 Binary files a/posterita/posterita/web/images/bullet2.gif and /dev/null differ diff --git a/posterita/posterita/web/images/calendar_icon.png b/posterita/posterita/web/images/calendar_icon.png deleted file mode 100644 index 92cb163d12..0000000000 Binary files a/posterita/posterita/web/images/calendar_icon.png and /dev/null differ diff --git a/posterita/posterita/web/images/ico_printer.gif b/posterita/posterita/web/images/ico_printer.gif deleted file mode 100644 index de27b46458..0000000000 Binary files a/posterita/posterita/web/images/ico_printer.gif and /dev/null differ diff --git a/posterita/posterita/web/images/iconCSV.jpg b/posterita/posterita/web/images/iconCSV.jpg deleted file mode 100644 index 231da309aa..0000000000 Binary files a/posterita/posterita/web/images/iconCSV.jpg and /dev/null differ diff --git a/posterita/posterita/web/images/loader.gif b/posterita/posterita/web/images/loader.gif deleted file mode 100644 index 240d4e17dc..0000000000 Binary files a/posterita/posterita/web/images/loader.gif and /dev/null differ diff --git a/posterita/posterita/web/images/logo.gif b/posterita/posterita/web/images/logo.gif deleted file mode 100644 index d990762f63..0000000000 Binary files a/posterita/posterita/web/images/logo.gif and /dev/null differ diff --git a/posterita/posterita/web/images/logo.jpg b/posterita/posterita/web/images/logo.jpg deleted file mode 100644 index 77c8b5142c..0000000000 Binary files a/posterita/posterita/web/images/logo.jpg and /dev/null differ diff --git a/posterita/posterita/web/images/logo1.jpg b/posterita/posterita/web/images/logo1.jpg deleted file mode 100644 index 7b543ace26..0000000000 Binary files a/posterita/posterita/web/images/logo1.jpg and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/back-menu.gif b/posterita/posterita/web/images/newUI/back-menu.gif deleted file mode 100644 index dc02cd77a1..0000000000 Binary files a/posterita/posterita/web/images/newUI/back-menu.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/blankimage.png b/posterita/posterita/web/images/newUI/blankimage.png deleted file mode 100644 index b87bb24850..0000000000 Binary files a/posterita/posterita/web/images/newUI/blankimage.png and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/bottom-right.gif b/posterita/posterita/web/images/newUI/bottom-right.gif deleted file mode 100644 index 9b13d8c551..0000000000 Binary files a/posterita/posterita/web/images/newUI/bottom-right.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/bottom.gif b/posterita/posterita/web/images/newUI/bottom.gif deleted file mode 100644 index 5d8c4bbdd7..0000000000 Binary files a/posterita/posterita/web/images/newUI/bottom.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/btn_changepin.gif b/posterita/posterita/web/images/newUI/btn_changepin.gif deleted file mode 100644 index 104b1c7497..0000000000 Binary files a/posterita/posterita/web/images/newUI/btn_changepin.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/btn_quickdiscount.gif b/posterita/posterita/web/images/newUI/btn_quickdiscount.gif deleted file mode 100644 index 1fc42b3a69..0000000000 Binary files a/posterita/posterita/web/images/newUI/btn_quickdiscount.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/btn_resetuser.gif b/posterita/posterita/web/images/newUI/btn_resetuser.gif deleted file mode 100644 index aa942b4c88..0000000000 Binary files a/posterita/posterita/web/images/newUI/btn_resetuser.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/btun_complete.gif b/posterita/posterita/web/images/newUI/btun_complete.gif deleted file mode 100644 index 0856eb919c..0000000000 Binary files a/posterita/posterita/web/images/newUI/btun_complete.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/btun_generic.gif b/posterita/posterita/web/images/newUI/btun_generic.gif deleted file mode 100644 index e8f508c112..0000000000 Binary files a/posterita/posterita/web/images/newUI/btun_generic.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/btun_save.gif b/posterita/posterita/web/images/newUI/btun_save.gif deleted file mode 100644 index f728bf2da9..0000000000 Binary files a/posterita/posterita/web/images/newUI/btun_save.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/bullet-arrow.gif b/posterita/posterita/web/images/newUI/bullet-arrow.gif deleted file mode 100644 index 838613f26c..0000000000 Binary files a/posterita/posterita/web/images/newUI/bullet-arrow.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-add.gif b/posterita/posterita/web/images/newUI/butn-add.gif deleted file mode 100644 index 35bdefd42b..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-add.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-addnew.gif b/posterita/posterita/web/images/newUI/butn-addnew.gif deleted file mode 100644 index 8baad87b55..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-addnew.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-browse.gif b/posterita/posterita/web/images/newUI/butn-browse.gif deleted file mode 100644 index a8583d97bd..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-browse.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-card.gif b/posterita/posterita/web/images/newUI/butn-card.gif deleted file mode 100644 index 8eec29d7d7..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-card.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-cash.gif b/posterita/posterita/web/images/newUI/butn-cash.gif deleted file mode 100644 index 9a3e64b6ea..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-cash.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-checkout.gif b/posterita/posterita/web/images/newUI/butn-checkout.gif deleted file mode 100644 index 466dad3c2d..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-checkout.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-cheque.gif b/posterita/posterita/web/images/newUI/butn-cheque.gif deleted file mode 100644 index 3e0e4a5ada..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-cheque.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-clearall.gif b/posterita/posterita/web/images/newUI/butn-clearall.gif deleted file mode 100644 index 16b4e1d570..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-clearall.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-copy.gif b/posterita/posterita/web/images/newUI/butn-copy.gif deleted file mode 100644 index ba1908bff8..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-copy.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-createpos.gif b/posterita/posterita/web/images/newUI/butn-createpos.gif deleted file mode 100644 index 3081b76eb0..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-createpos.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-credit.gif b/posterita/posterita/web/images/newUI/butn-credit.gif deleted file mode 100644 index c547c536a6..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-credit.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-delete.gif b/posterita/posterita/web/images/newUI/butn-delete.gif deleted file mode 100644 index 1052bc5d9c..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-delete.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-delprod.gif b/posterita/posterita/web/images/newUI/butn-delprod.gif deleted file mode 100644 index 59538f2415..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-delprod.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-discount.gif b/posterita/posterita/web/images/newUI/butn-discount.gif deleted file mode 100644 index 9255a33ee7..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-discount.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-donate.gif b/posterita/posterita/web/images/newUI/butn-donate.gif deleted file mode 100644 index 68c8385e65..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-donate.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-edit-off.gif b/posterita/posterita/web/images/newUI/butn-edit-off.gif deleted file mode 100644 index b378bad364..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-edit-off.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-edit.gif b/posterita/posterita/web/images/newUI/butn-edit.gif deleted file mode 100644 index 7fa4759e1a..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-edit.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-exit.gif b/posterita/posterita/web/images/newUI/butn-exit.gif deleted file mode 100644 index f79382042f..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-exit.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-import.gif b/posterita/posterita/web/images/newUI/butn-import.gif deleted file mode 100644 index 1932c4377a..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-import.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-login.gif b/posterita/posterita/web/images/newUI/butn-login.gif deleted file mode 100644 index 97ec014e2c..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-login.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-mix.gif b/posterita/posterita/web/images/newUI/butn-mix.gif deleted file mode 100644 index cb20ad935f..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-mix.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-new.gif b/posterita/posterita/web/images/newUI/butn-new.gif deleted file mode 100644 index 840ddf1a91..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-new.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-next.gif b/posterita/posterita/web/images/newUI/butn-next.gif deleted file mode 100644 index ef7500e89f..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-next.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-opendrawer.gif b/posterita/posterita/web/images/newUI/butn-opendrawer.gif deleted file mode 100644 index 2e59a54032..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-opendrawer.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-prev.gif b/posterita/posterita/web/images/newUI/butn-prev.gif deleted file mode 100644 index 64c165c643..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-prev.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-save.gif b/posterita/posterita/web/images/newUI/butn-save.gif deleted file mode 100644 index d2f24c6f32..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-save.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-subtract.gif b/posterita/posterita/web/images/newUI/butn-subtract.gif deleted file mode 100644 index 4d07a54c12..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-subtract.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-system.gif b/posterita/posterita/web/images/newUI/butn-system.gif deleted file mode 100644 index 92d41f4563..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-system.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/butn-touchscreen.gif b/posterita/posterita/web/images/newUI/butn-touchscreen.gif deleted file mode 100644 index 64a6b8c432..0000000000 Binary files a/posterita/posterita/web/images/newUI/butn-touchscreen.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/donate.gif b/posterita/posterita/web/images/newUI/donate.gif deleted file mode 100644 index 68c8385e65..0000000000 Binary files a/posterita/posterita/web/images/newUI/donate.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/footerbg.gif b/posterita/posterita/web/images/newUI/footerbg.gif deleted file mode 100644 index 41c0aab47e..0000000000 Binary files a/posterita/posterita/web/images/newUI/footerbg.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/headblc.gif b/posterita/posterita/web/images/newUI/headblc.gif deleted file mode 100644 index 12e9bc7f6a..0000000000 Binary files a/posterita/posterita/web/images/newUI/headblc.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/headbody.gif b/posterita/posterita/web/images/newUI/headbody.gif deleted file mode 100644 index 9eabd859e4..0000000000 Binary files a/posterita/posterita/web/images/newUI/headbody.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/headbrc.gif b/posterita/posterita/web/images/newUI/headbrc.gif deleted file mode 100644 index bb51f2879c..0000000000 Binary files a/posterita/posterita/web/images/newUI/headbrc.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/headtlc.gif b/posterita/posterita/web/images/newUI/headtlc.gif deleted file mode 100644 index 916b90b76e..0000000000 Binary files a/posterita/posterita/web/images/newUI/headtlc.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/headtrc.gif b/posterita/posterita/web/images/newUI/headtrc.gif deleted file mode 100644 index 5b24715cd7..0000000000 Binary files a/posterita/posterita/web/images/newUI/headtrc.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/hicon-cashbook.gif b/posterita/posterita/web/images/newUI/hicon-cashbook.gif deleted file mode 100644 index 59dbabab72..0000000000 Binary files a/posterita/posterita/web/images/newUI/hicon-cashbook.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/hicon-donate.gif b/posterita/posterita/web/images/newUI/hicon-donate.gif deleted file mode 100644 index c0188f44d8..0000000000 Binary files a/posterita/posterita/web/images/newUI/hicon-donate.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/hicon-help.gif b/posterita/posterita/web/images/newUI/hicon-help.gif deleted file mode 100644 index 97c669da65..0000000000 Binary files a/posterita/posterita/web/images/newUI/hicon-help.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/hicon-news.gif b/posterita/posterita/web/images/newUI/hicon-news.gif deleted file mode 100644 index dcd84be349..0000000000 Binary files a/posterita/posterita/web/images/newUI/hicon-news.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/hicon-salesorder.gif b/posterita/posterita/web/images/newUI/hicon-salesorder.gif deleted file mode 100644 index 229eca3f3b..0000000000 Binary files a/posterita/posterita/web/images/newUI/hicon-salesorder.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/hicon-tillmgt.gif b/posterita/posterita/web/images/newUI/hicon-tillmgt.gif deleted file mode 100644 index 4771367e5e..0000000000 Binary files a/posterita/posterita/web/images/newUI/hicon-tillmgt.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/icon-err.gif b/posterita/posterita/web/images/newUI/icon-err.gif deleted file mode 100644 index dd9f54fa24..0000000000 Binary files a/posterita/posterita/web/images/newUI/icon-err.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/icon-help.gif b/posterita/posterita/web/images/newUI/icon-help.gif deleted file mode 100644 index fce1a0409e..0000000000 Binary files a/posterita/posterita/web/images/newUI/icon-help.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/icon-newwindow.gif b/posterita/posterita/web/images/newUI/icon-newwindow.gif deleted file mode 100644 index e09df2291c..0000000000 Binary files a/posterita/posterita/web/images/newUI/icon-newwindow.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/left.gif b/posterita/posterita/web/images/newUI/left.gif deleted file mode 100644 index 421bee6b1e..0000000000 Binary files a/posterita/posterita/web/images/newUI/left.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/leftside.gif b/posterita/posterita/web/images/newUI/leftside.gif deleted file mode 100644 index 370463fe63..0000000000 Binary files a/posterita/posterita/web/images/newUI/leftside.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/logo.gif b/posterita/posterita/web/images/newUI/logo.gif deleted file mode 100644 index 7d7366242b..0000000000 Binary files a/posterita/posterita/web/images/newUI/logo.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/navbg.gif b/posterita/posterita/web/images/newUI/navbg.gif deleted file mode 100644 index 7c24e5bd73..0000000000 Binary files a/posterita/posterita/web/images/newUI/navbg.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/palebluebg.gif b/posterita/posterita/web/images/newUI/palebluebg.gif deleted file mode 100644 index 25d2fbefeb..0000000000 Binary files a/posterita/posterita/web/images/newUI/palebluebg.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/pricedetbg.gif b/posterita/posterita/web/images/newUI/pricedetbg.gif deleted file mode 100644 index 7dfc094b13..0000000000 Binary files a/posterita/posterita/web/images/newUI/pricedetbg.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/pricedetbgtile.gif b/posterita/posterita/web/images/newUI/pricedetbgtile.gif deleted file mode 100644 index b8954d01fc..0000000000 Binary files a/posterita/posterita/web/images/newUI/pricedetbgtile.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/productpreview.gif b/posterita/posterita/web/images/newUI/productpreview.gif deleted file mode 100644 index cf20c558fc..0000000000 Binary files a/posterita/posterita/web/images/newUI/productpreview.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/rightside.gif b/posterita/posterita/web/images/newUI/rightside.gif deleted file mode 100644 index a0e4253901..0000000000 Binary files a/posterita/posterita/web/images/newUI/rightside.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/singlekey.gif b/posterita/posterita/web/images/newUI/singlekey.gif deleted file mode 100644 index d822f9e795..0000000000 Binary files a/posterita/posterita/web/images/newUI/singlekey.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/spacer.gif b/posterita/posterita/web/images/newUI/spacer.gif deleted file mode 100644 index 35d42e808f..0000000000 Binary files a/posterita/posterita/web/images/newUI/spacer.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/top-right.gif b/posterita/posterita/web/images/newUI/top-right.gif deleted file mode 100644 index 6ced494d44..0000000000 Binary files a/posterita/posterita/web/images/newUI/top-right.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/top.gif b/posterita/posterita/web/images/newUI/top.gif deleted file mode 100644 index b948640c05..0000000000 Binary files a/posterita/posterita/web/images/newUI/top.gif and /dev/null differ diff --git a/posterita/posterita/web/images/newUI/topmenubg.gif b/posterita/posterita/web/images/newUI/topmenubg.gif deleted file mode 100644 index d03b3abff9..0000000000 Binary files a/posterita/posterita/web/images/newUI/topmenubg.gif and /dev/null differ diff --git a/posterita/posterita/web/images/nok.gif b/posterita/posterita/web/images/nok.gif deleted file mode 100644 index 7e9e3cff9e..0000000000 Binary files a/posterita/posterita/web/images/nok.gif and /dev/null differ diff --git a/posterita/posterita/web/images/ok.gif b/posterita/posterita/web/images/ok.gif deleted file mode 100644 index 34da177364..0000000000 Binary files a/posterita/posterita/web/images/ok.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pdfIcon.jpg b/posterita/posterita/web/images/pdfIcon.jpg deleted file mode 100644 index bbf0b6dd7b..0000000000 Binary files a/posterita/posterita/web/images/pdfIcon.jpg and /dev/null differ diff --git a/posterita/posterita/web/images/pdf_icon_small.gif b/posterita/posterita/web/images/pdf_icon_small.gif deleted file mode 100644 index 502fb77ed6..0000000000 Binary files a/posterita/posterita/web/images/pdf_icon_small.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/-----.gif b/posterita/posterita/web/images/pos/-----.gif deleted file mode 100644 index 2030a5f450..0000000000 Binary files a/posterita/posterita/web/images/pos/-----.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/ADMINISTRATION.gif b/posterita/posterita/web/images/pos/ADMINISTRATION.gif deleted file mode 100644 index 62bf4be6a9..0000000000 Binary files a/posterita/posterita/web/images/pos/ADMINISTRATION.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/BULLET_reddd.gif b/posterita/posterita/web/images/pos/BULLET_reddd.gif deleted file mode 100644 index 88c72711b7..0000000000 Binary files a/posterita/posterita/web/images/pos/BULLET_reddd.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/Contacts 1.gif b/posterita/posterita/web/images/pos/Contacts 1.gif deleted file mode 100644 index e31cfab365..0000000000 Binary files a/posterita/posterita/web/images/pos/Contacts 1.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/Contacts 2.gif b/posterita/posterita/web/images/pos/Contacts 2.gif deleted file mode 100644 index b750e7063f..0000000000 Binary files a/posterita/posterita/web/images/pos/Contacts 2.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/ImageBack.jpg b/posterita/posterita/web/images/pos/ImageBack.jpg deleted file mode 100644 index 394390b137..0000000000 Binary files a/posterita/posterita/web/images/pos/ImageBack.jpg and /dev/null differ diff --git a/posterita/posterita/web/images/pos/LOGOUT.gif b/posterita/posterita/web/images/pos/LOGOUT.gif deleted file mode 100644 index 72a91a124c..0000000000 Binary files a/posterita/posterita/web/images/pos/LOGOUT.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/ORDER.gif b/posterita/posterita/web/images/pos/ORDER.gif deleted file mode 100644 index 8fe689cd80..0000000000 Binary files a/posterita/posterita/web/images/pos/ORDER.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/REPORTS.gif b/posterita/posterita/web/images/pos/REPORTS.gif deleted file mode 100644 index add87aa820..0000000000 Binary files a/posterita/posterita/web/images/pos/REPORTS.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/arrow_down.png b/posterita/posterita/web/images/pos/arrow_down.png deleted file mode 100644 index 107b59f444..0000000000 Binary files a/posterita/posterita/web/images/pos/arrow_down.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/arrow_off.png b/posterita/posterita/web/images/pos/arrow_off.png deleted file mode 100644 index c507cb5679..0000000000 Binary files a/posterita/posterita/web/images/pos/arrow_off.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/arrow_up.png b/posterita/posterita/web/images/pos/arrow_up.png deleted file mode 100644 index b4e9bbb3c9..0000000000 Binary files a/posterita/posterita/web/images/pos/arrow_up.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/blankimage.png b/posterita/posterita/web/images/pos/blankimage.png deleted file mode 100644 index b87bb24850..0000000000 Binary files a/posterita/posterita/web/images/pos/blankimage.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/button-login.gif b/posterita/posterita/web/images/pos/button-login.gif deleted file mode 100644 index ac11f25cda..0000000000 Binary files a/posterita/posterita/web/images/pos/button-login.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/button_add to cart.gif b/posterita/posterita/web/images/pos/button_add to cart.gif deleted file mode 100644 index 0638845afe..0000000000 Binary files a/posterita/posterita/web/images/pos/button_add to cart.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/button_advanced.gif b/posterita/posterita/web/images/pos/button_advanced.gif deleted file mode 100644 index 3537dcf733..0000000000 Binary files a/posterita/posterita/web/images/pos/button_advanced.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/button_card.gif b/posterita/posterita/web/images/pos/button_card.gif deleted file mode 100644 index 7413c289b2..0000000000 Binary files a/posterita/posterita/web/images/pos/button_card.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/button_cash.gif b/posterita/posterita/web/images/pos/button_cash.gif deleted file mode 100644 index 720026d03d..0000000000 Binary files a/posterita/posterita/web/images/pos/button_cash.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/button_checkout.gif b/posterita/posterita/web/images/pos/button_checkout.gif deleted file mode 100644 index f5e023e5f6..0000000000 Binary files a/posterita/posterita/web/images/pos/button_checkout.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/button_cheque.gif b/posterita/posterita/web/images/pos/button_cheque.gif deleted file mode 100644 index 6c286714bb..0000000000 Binary files a/posterita/posterita/web/images/pos/button_cheque.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/button_newcustomer.gif b/posterita/posterita/web/images/pos/button_newcustomer.gif deleted file mode 100644 index 3a20ccd4cc..0000000000 Binary files a/posterita/posterita/web/images/pos/button_newcustomer.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/browser.gif b/posterita/posterita/web/images/pos/buttons/browser.gif deleted file mode 100644 index 561173d83a..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/browser.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/bullet_red.gif b/posterita/posterita/web/images/pos/buttons/bullet_red.gif deleted file mode 100644 index 88c72711b7..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/bullet_red.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_addtocart.gif b/posterita/posterita/web/images/pos/buttons/button_addtocart.gif deleted file mode 100644 index 0638845afe..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_addtocart.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_administration.gif b/posterita/posterita/web/images/pos/buttons/button_administration.gif deleted file mode 100644 index 62bf4be6a9..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_administration.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_advanced.gif b/posterita/posterita/web/images/pos/buttons/button_advanced.gif deleted file mode 100644 index 3537dcf733..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_advanced.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_background.gif b/posterita/posterita/web/images/pos/buttons/button_background.gif deleted file mode 100644 index c6beb23d71..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_background.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_barchart.gif b/posterita/posterita/web/images/pos/buttons/button_barchart.gif deleted file mode 100644 index 2171c739fa..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_barchart.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_blank.gif b/posterita/posterita/web/images/pos/buttons/button_blank.gif deleted file mode 100644 index 26707e2aed..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_blank.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_card.gif b/posterita/posterita/web/images/pos/buttons/button_card.gif deleted file mode 100644 index 7413c289b2..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_card.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_cart.jpeg b/posterita/posterita/web/images/pos/buttons/button_cart.jpeg deleted file mode 100644 index d88f4c78c2..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_cart.jpeg and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_cash.gif b/posterita/posterita/web/images/pos/buttons/button_cash.gif deleted file mode 100644 index 720026d03d..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_cash.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_checkout.gif b/posterita/posterita/web/images/pos/buttons/button_checkout.gif deleted file mode 100644 index f5e023e5f6..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_checkout.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_cheque.gif b/posterita/posterita/web/images/pos/buttons/button_cheque.gif deleted file mode 100644 index 6c286714bb..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_cheque.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_complete.gif b/posterita/posterita/web/images/pos/buttons/button_complete.gif deleted file mode 100644 index 9980c9268b..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_complete.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_continue.gif b/posterita/posterita/web/images/pos/buttons/button_continue.gif deleted file mode 100644 index 8a00291315..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_continue.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_delete.gif b/posterita/posterita/web/images/pos/buttons/button_delete.gif deleted file mode 100644 index 8de32e1fcb..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_delete.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_edit.gif b/posterita/posterita/web/images/pos/buttons/button_edit.gif deleted file mode 100644 index e5df0f5a91..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_edit.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_import.gif b/posterita/posterita/web/images/pos/buttons/button_import.gif deleted file mode 100644 index b73a6b7ef3..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_import.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_login.gif b/posterita/posterita/web/images/pos/buttons/button_login.gif deleted file mode 100644 index ac11f25cda..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_login.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_logout.gif b/posterita/posterita/web/images/pos/buttons/button_logout.gif deleted file mode 100644 index 72a91a124c..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_logout.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_middle.gif b/posterita/posterita/web/images/pos/buttons/button_middle.gif deleted file mode 100644 index be4927b44e..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_middle.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_minus.gif b/posterita/posterita/web/images/pos/buttons/button_minus.gif deleted file mode 100644 index 2030a5f450..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_minus.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_mixed.gif b/posterita/posterita/web/images/pos/buttons/button_mixed.gif deleted file mode 100644 index e5146729cb..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_mixed.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_newcustomer.gif b/posterita/posterita/web/images/pos/buttons/button_newcustomer.gif deleted file mode 100644 index 3a20ccd4cc..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_newcustomer.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_newnote.gif b/posterita/posterita/web/images/pos/buttons/button_newnote.gif deleted file mode 100644 index ea2c0cb576..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_newnote.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_neworder.gif b/posterita/posterita/web/images/pos/buttons/button_neworder.gif deleted file mode 100644 index c1a9d54039..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_neworder.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_order.gif b/posterita/posterita/web/images/pos/buttons/button_order.gif deleted file mode 100644 index 8fe689cd80..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_order.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_piechart.gif b/posterita/posterita/web/images/pos/buttons/button_piechart.gif deleted file mode 100644 index bdeb6b06fe..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_piechart.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_plus.gif b/posterita/posterita/web/images/pos/buttons/button_plus.gif deleted file mode 100644 index f14e73fe83..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_plus.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_refresh.gif b/posterita/posterita/web/images/pos/buttons/button_refresh.gif deleted file mode 100644 index 554c9e7a7f..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_refresh.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_reports.gif b/posterita/posterita/web/images/pos/buttons/button_reports.gif deleted file mode 100644 index add87aa820..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_reports.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_save.gif b/posterita/posterita/web/images/pos/buttons/button_save.gif deleted file mode 100644 index 6c18606669..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_save.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_saveascsv.gif b/posterita/posterita/web/images/pos/buttons/button_saveascsv.gif deleted file mode 100644 index 9f099f2905..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_saveascsv.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_saveaspdf.gif b/posterita/posterita/web/images/pos/buttons/button_saveaspdf.gif deleted file mode 100644 index bff11a3d4c..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_saveaspdf.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_search.gif b/posterita/posterita/web/images/pos/buttons/button_search.gif deleted file mode 100644 index bcebc9db78..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_search.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_selectall.gif b/posterita/posterita/web/images/pos/buttons/button_selectall.gif deleted file mode 100644 index 03bb547870..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_selectall.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_submit.gif b/posterita/posterita/web/images/pos/buttons/button_submit.gif deleted file mode 100644 index d9b2fcf53c..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_submit.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_tabular.gif b/posterita/posterita/web/images/pos/buttons/button_tabular.gif deleted file mode 100644 index dc93499596..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_tabular.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/buttons/button_timeseries.gif b/posterita/posterita/web/images/pos/buttons/button_timeseries.gif deleted file mode 100644 index 1943bc0f2e..0000000000 Binary files a/posterita/posterita/web/images/pos/buttons/button_timeseries.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/calendar.gif b/posterita/posterita/web/images/pos/calendar.gif deleted file mode 100644 index 18801096ac..0000000000 Binary files a/posterita/posterita/web/images/pos/calendar.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/charts/barchart_icon.gif b/posterita/posterita/web/images/pos/charts/barchart_icon.gif deleted file mode 100644 index 417a1ae334..0000000000 Binary files a/posterita/posterita/web/images/pos/charts/barchart_icon.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/charts/piechart_icon.gif b/posterita/posterita/web/images/pos/charts/piechart_icon.gif deleted file mode 100644 index 4a8b0bb799..0000000000 Binary files a/posterita/posterita/web/images/pos/charts/piechart_icon.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/charts/tabular_icon.gif b/posterita/posterita/web/images/pos/charts/tabular_icon.gif deleted file mode 100644 index e90b927886..0000000000 Binary files a/posterita/posterita/web/images/pos/charts/tabular_icon.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/charts/timeseries_icon.gif b/posterita/posterita/web/images/pos/charts/timeseries_icon.gif deleted file mode 100644 index c7409ab9bf..0000000000 Binary files a/posterita/posterita/web/images/pos/charts/timeseries_icon.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/cross.gif b/posterita/posterita/web/images/pos/cross.gif deleted file mode 100644 index 84ef48f084..0000000000 Binary files a/posterita/posterita/web/images/pos/cross.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/delprod.gif b/posterita/posterita/web/images/pos/delprod.gif deleted file mode 100644 index e03a79165b..0000000000 Binary files a/posterita/posterita/web/images/pos/delprod.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/error.gif b/posterita/posterita/web/images/pos/error.gif deleted file mode 100644 index 8533edbb08..0000000000 Binary files a/posterita/posterita/web/images/pos/error.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/error.jpg b/posterita/posterita/web/images/pos/error.jpg deleted file mode 100644 index 78ec8a06ff..0000000000 Binary files a/posterita/posterita/web/images/pos/error.jpg and /dev/null differ diff --git a/posterita/posterita/web/images/pos/error.png b/posterita/posterita/web/images/pos/error.png deleted file mode 100644 index 242be63fa4..0000000000 Binary files a/posterita/posterita/web/images/pos/error.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/helpIcon.gif b/posterita/posterita/web/images/pos/helpIcon.gif deleted file mode 100644 index e04ad56f15..0000000000 Binary files a/posterita/posterita/web/images/pos/helpIcon.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/helpIcon2.gif b/posterita/posterita/web/images/pos/helpIcon2.gif deleted file mode 100644 index 01389860c4..0000000000 Binary files a/posterita/posterita/web/images/pos/helpIcon2.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/ico_file_csv.png b/posterita/posterita/web/images/pos/ico_file_csv.png deleted file mode 100644 index 1192a9a715..0000000000 Binary files a/posterita/posterita/web/images/pos/ico_file_csv.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/ico_file_excel.png b/posterita/posterita/web/images/pos/ico_file_excel.png deleted file mode 100644 index 378ae0b739..0000000000 Binary files a/posterita/posterita/web/images/pos/ico_file_excel.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/ico_file_pdf.png b/posterita/posterita/web/images/pos/ico_file_pdf.png deleted file mode 100644 index 468e082811..0000000000 Binary files a/posterita/posterita/web/images/pos/ico_file_pdf.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/ico_file_rtf.png b/posterita/posterita/web/images/pos/ico_file_rtf.png deleted file mode 100644 index e1e8255795..0000000000 Binary files a/posterita/posterita/web/images/pos/ico_file_rtf.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/ico_file_xml.png b/posterita/posterita/web/images/pos/ico_file_xml.png deleted file mode 100644 index dd0fb16db5..0000000000 Binary files a/posterita/posterita/web/images/pos/ico_file_xml.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/icon-error.gif b/posterita/posterita/web/images/pos/icon-error.gif deleted file mode 100644 index 397b655ab8..0000000000 Binary files a/posterita/posterita/web/images/pos/icon-error.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/icon-info.gif b/posterita/posterita/web/images/pos/icon-info.gif deleted file mode 100644 index 58281c3067..0000000000 Binary files a/posterita/posterita/web/images/pos/icon-info.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/icon-question.gif b/posterita/posterita/web/images/pos/icon-question.gif deleted file mode 100644 index 08abd82ae8..0000000000 Binary files a/posterita/posterita/web/images/pos/icon-question.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/icon-warning.gif b/posterita/posterita/web/images/pos/icon-warning.gif deleted file mode 100644 index 27ff98b4f7..0000000000 Binary files a/posterita/posterita/web/images/pos/icon-warning.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/indicator.gif b/posterita/posterita/web/images/pos/indicator.gif deleted file mode 100644 index 6bdefde949..0000000000 Binary files a/posterita/posterita/web/images/pos/indicator.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/kbicon.gif b/posterita/posterita/web/images/pos/kbicon.gif deleted file mode 100644 index 0c5d53e5bc..0000000000 Binary files a/posterita/posterita/web/images/pos/kbicon.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/logo.jpg b/posterita/posterita/web/images/pos/logo.jpg deleted file mode 100644 index c6ab5ebb2a..0000000000 Binary files a/posterita/posterita/web/images/pos/logo.jpg and /dev/null differ diff --git a/posterita/posterita/web/images/pos/magnifying-glass.gif b/posterita/posterita/web/images/pos/magnifying-glass.gif deleted file mode 100644 index 18e046b144..0000000000 Binary files a/posterita/posterita/web/images/pos/magnifying-glass.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/maskBG.png b/posterita/posterita/web/images/pos/maskBG.png deleted file mode 100644 index b89babc2f1..0000000000 Binary files a/posterita/posterita/web/images/pos/maskBG.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/paginazione.png b/posterita/posterita/web/images/pos/paginazione.png deleted file mode 100644 index afe9a4b6e7..0000000000 Binary files a/posterita/posterita/web/images/pos/paginazione.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/paginazione_ahead.png b/posterita/posterita/web/images/pos/paginazione_ahead.png deleted file mode 100644 index 430ef3556a..0000000000 Binary files a/posterita/posterita/web/images/pos/paginazione_ahead.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/paginazione_back.png b/posterita/posterita/web/images/pos/paginazione_back.png deleted file mode 100644 index 598151550d..0000000000 Binary files a/posterita/posterita/web/images/pos/paginazione_back.png and /dev/null differ diff --git a/posterita/posterita/web/images/pos/plus.gif b/posterita/posterita/web/images/pos/plus.gif deleted file mode 100644 index f14e73fe83..0000000000 Binary files a/posterita/posterita/web/images/pos/plus.gif and /dev/null differ diff --git a/posterita/posterita/web/images/pos/success.gif b/posterita/posterita/web/images/pos/success.gif deleted file mode 100644 index 59e2108ca1..0000000000 Binary files a/posterita/posterita/web/images/pos/success.gif and /dev/null differ diff --git a/posterita/posterita/web/images/posterita.jpg b/posterita/posterita/web/images/posterita.jpg deleted file mode 100644 index cab0493e71..0000000000 Binary files a/posterita/posterita/web/images/posterita.jpg and /dev/null differ diff --git a/posterita/posterita/web/images/progress.gif b/posterita/posterita/web/images/progress.gif deleted file mode 100644 index 2988647327..0000000000 Binary files a/posterita/posterita/web/images/progress.gif and /dev/null differ diff --git a/posterita/posterita/web/images/spacer.gif b/posterita/posterita/web/images/spacer.gif deleted file mode 100644 index 35d42e808f..0000000000 Binary files a/posterita/posterita/web/images/spacer.gif and /dev/null differ diff --git a/posterita/posterita/web/images/spinner.gif b/posterita/posterita/web/images/spinner.gif deleted file mode 100644 index 39615c8925..0000000000 Binary files a/posterita/posterita/web/images/spinner.gif and /dev/null differ diff --git a/posterita/posterita/web/images/tango/accessories-calculator.png b/posterita/posterita/web/images/tango/accessories-calculator.png deleted file mode 100644 index 7de1c447d1..0000000000 Binary files a/posterita/posterita/web/images/tango/accessories-calculator.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/accessories-character-map.png b/posterita/posterita/web/images/tango/accessories-character-map.png deleted file mode 100644 index a86c23ee25..0000000000 Binary files a/posterita/posterita/web/images/tango/accessories-character-map.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/accessories-text-editor.png b/posterita/posterita/web/images/tango/accessories-text-editor.png deleted file mode 100644 index c6b6285144..0000000000 Binary files a/posterita/posterita/web/images/tango/accessories-text-editor.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/address-book-new.png b/posterita/posterita/web/images/tango/address-book-new.png deleted file mode 100644 index 420139d307..0000000000 Binary files a/posterita/posterita/web/images/tango/address-book-new.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/applications-system.png b/posterita/posterita/web/images/tango/applications-system.png deleted file mode 100644 index 565f406dd1..0000000000 Binary files a/posterita/posterita/web/images/tango/applications-system.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/appointment-new.png b/posterita/posterita/web/images/tango/appointment-new.png deleted file mode 100644 index 85daef3b0b..0000000000 Binary files a/posterita/posterita/web/images/tango/appointment-new.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/bookmark-new.png b/posterita/posterita/web/images/tango/bookmark-new.png deleted file mode 100644 index 621312a89b..0000000000 Binary files a/posterita/posterita/web/images/tango/bookmark-new.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/contact-new.png b/posterita/posterita/web/images/tango/contact-new.png deleted file mode 100644 index 8b10c1e9a2..0000000000 Binary files a/posterita/posterita/web/images/tango/contact-new.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/document-new.png b/posterita/posterita/web/images/tango/document-new.png deleted file mode 100644 index e6d64bb90b..0000000000 Binary files a/posterita/posterita/web/images/tango/document-new.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/document-open.png b/posterita/posterita/web/images/tango/document-open.png deleted file mode 100644 index 2b135a17f3..0000000000 Binary files a/posterita/posterita/web/images/tango/document-open.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/document-print-preview.png b/posterita/posterita/web/images/tango/document-print-preview.png deleted file mode 100644 index 772efe5a8a..0000000000 Binary files a/posterita/posterita/web/images/tango/document-print-preview.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/document-print.png b/posterita/posterita/web/images/tango/document-print.png deleted file mode 100644 index 3ef393029e..0000000000 Binary files a/posterita/posterita/web/images/tango/document-print.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/document-properties.png b/posterita/posterita/web/images/tango/document-properties.png deleted file mode 100644 index fa697db405..0000000000 Binary files a/posterita/posterita/web/images/tango/document-properties.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/document-save-as.png b/posterita/posterita/web/images/tango/document-save-as.png deleted file mode 100644 index 5c9f6b343b..0000000000 Binary files a/posterita/posterita/web/images/tango/document-save-as.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/document-save.png b/posterita/posterita/web/images/tango/document-save.png deleted file mode 100644 index db5c52b769..0000000000 Binary files a/posterita/posterita/web/images/tango/document-save.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/edit-clear.png b/posterita/posterita/web/images/tango/edit-clear.png deleted file mode 100644 index 5542948bca..0000000000 Binary files a/posterita/posterita/web/images/tango/edit-clear.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/edit-copy.png b/posterita/posterita/web/images/tango/edit-copy.png deleted file mode 100644 index 3348ee08fd..0000000000 Binary files a/posterita/posterita/web/images/tango/edit-copy.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/edit-cut.png b/posterita/posterita/web/images/tango/edit-cut.png deleted file mode 100644 index 217663b19c..0000000000 Binary files a/posterita/posterita/web/images/tango/edit-cut.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/edit-delete.png b/posterita/posterita/web/images/tango/edit-delete.png deleted file mode 100644 index 9becb3e2f3..0000000000 Binary files a/posterita/posterita/web/images/tango/edit-delete.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/edit-find-replace.png b/posterita/posterita/web/images/tango/edit-find-replace.png deleted file mode 100644 index 0f1b117ff7..0000000000 Binary files a/posterita/posterita/web/images/tango/edit-find-replace.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/edit-find.png b/posterita/posterita/web/images/tango/edit-find.png deleted file mode 100644 index 5594785d10..0000000000 Binary files a/posterita/posterita/web/images/tango/edit-find.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/edit-paste.png b/posterita/posterita/web/images/tango/edit-paste.png deleted file mode 100644 index dd429ced62..0000000000 Binary files a/posterita/posterita/web/images/tango/edit-paste.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/edit-redo.png b/posterita/posterita/web/images/tango/edit-redo.png deleted file mode 100644 index 3eb7b05c84..0000000000 Binary files a/posterita/posterita/web/images/tango/edit-redo.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/edit-select-all.png b/posterita/posterita/web/images/tango/edit-select-all.png deleted file mode 100644 index 107fc60741..0000000000 Binary files a/posterita/posterita/web/images/tango/edit-select-all.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/edit-undo.png b/posterita/posterita/web/images/tango/edit-undo.png deleted file mode 100644 index 61b2ce9a53..0000000000 Binary files a/posterita/posterita/web/images/tango/edit-undo.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/folder-new.png b/posterita/posterita/web/images/tango/folder-new.png deleted file mode 100644 index fcd15c0184..0000000000 Binary files a/posterita/posterita/web/images/tango/folder-new.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/format-indent-less.png b/posterita/posterita/web/images/tango/format-indent-less.png deleted file mode 100644 index 7ced16f725..0000000000 Binary files a/posterita/posterita/web/images/tango/format-indent-less.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/format-indent-more.png b/posterita/posterita/web/images/tango/format-indent-more.png deleted file mode 100644 index 6a18867ca7..0000000000 Binary files a/posterita/posterita/web/images/tango/format-indent-more.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/format-justify-center.png b/posterita/posterita/web/images/tango/format-justify-center.png deleted file mode 100644 index a0db2bb30a..0000000000 Binary files a/posterita/posterita/web/images/tango/format-justify-center.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/format-justify-fill.png b/posterita/posterita/web/images/tango/format-justify-fill.png deleted file mode 100644 index 2a34a8fd6c..0000000000 Binary files a/posterita/posterita/web/images/tango/format-justify-fill.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/format-justify-left.png b/posterita/posterita/web/images/tango/format-justify-left.png deleted file mode 100644 index ba0e914a00..0000000000 Binary files a/posterita/posterita/web/images/tango/format-justify-left.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/format-justify-right.png b/posterita/posterita/web/images/tango/format-justify-right.png deleted file mode 100644 index 2144cb915e..0000000000 Binary files a/posterita/posterita/web/images/tango/format-justify-right.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/format-text-bold.png b/posterita/posterita/web/images/tango/format-text-bold.png deleted file mode 100644 index 99ed19c580..0000000000 Binary files a/posterita/posterita/web/images/tango/format-text-bold.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/format-text-italic.png b/posterita/posterita/web/images/tango/format-text-italic.png deleted file mode 100644 index 87ed6f9f6e..0000000000 Binary files a/posterita/posterita/web/images/tango/format-text-italic.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/format-text-strikethrough.png b/posterita/posterita/web/images/tango/format-text-strikethrough.png deleted file mode 100644 index b9b55ab250..0000000000 Binary files a/posterita/posterita/web/images/tango/format-text-strikethrough.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/format-text-underline.png b/posterita/posterita/web/images/tango/format-text-underline.png deleted file mode 100644 index 0de6b1cfd3..0000000000 Binary files a/posterita/posterita/web/images/tango/format-text-underline.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/go-bottom.png b/posterita/posterita/web/images/tango/go-bottom.png deleted file mode 100644 index bf973fedc2..0000000000 Binary files a/posterita/posterita/web/images/tango/go-bottom.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/go-down.png b/posterita/posterita/web/images/tango/go-down.png deleted file mode 100644 index dce3f15ef5..0000000000 Binary files a/posterita/posterita/web/images/tango/go-down.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/go-first.png b/posterita/posterita/web/images/tango/go-first.png deleted file mode 100644 index 5e2a6b1ea8..0000000000 Binary files a/posterita/posterita/web/images/tango/go-first.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/go-home.png b/posterita/posterita/web/images/tango/go-home.png deleted file mode 100644 index a3ca103e35..0000000000 Binary files a/posterita/posterita/web/images/tango/go-home.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/go-jump.png b/posterita/posterita/web/images/tango/go-jump.png deleted file mode 100644 index 34dc4c04e2..0000000000 Binary files a/posterita/posterita/web/images/tango/go-jump.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/go-last.png b/posterita/posterita/web/images/tango/go-last.png deleted file mode 100644 index 48fe95bd3b..0000000000 Binary files a/posterita/posterita/web/images/tango/go-last.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/go-next.png b/posterita/posterita/web/images/tango/go-next.png deleted file mode 100644 index a68e2db775..0000000000 Binary files a/posterita/posterita/web/images/tango/go-next.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/go-previous.png b/posterita/posterita/web/images/tango/go-previous.png deleted file mode 100644 index c37bc0414c..0000000000 Binary files a/posterita/posterita/web/images/tango/go-previous.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/go-top.png b/posterita/posterita/web/images/tango/go-top.png deleted file mode 100644 index d99552b694..0000000000 Binary files a/posterita/posterita/web/images/tango/go-top.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/go-up.png b/posterita/posterita/web/images/tango/go-up.png deleted file mode 100644 index afb307b18c..0000000000 Binary files a/posterita/posterita/web/images/tango/go-up.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/help-browser.png b/posterita/posterita/web/images/tango/help-browser.png deleted file mode 100644 index d60425f7ec..0000000000 Binary files a/posterita/posterita/web/images/tango/help-browser.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/input-keyboard.png b/posterita/posterita/web/images/tango/input-keyboard.png deleted file mode 100644 index 5bb1298cd3..0000000000 Binary files a/posterita/posterita/web/images/tango/input-keyboard.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/internet-group-chat.png b/posterita/posterita/web/images/tango/internet-group-chat.png deleted file mode 100644 index 9cb1d3be11..0000000000 Binary files a/posterita/posterita/web/images/tango/internet-group-chat.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/internet-mail.png b/posterita/posterita/web/images/tango/internet-mail.png deleted file mode 100644 index dc3b9dd3a6..0000000000 Binary files a/posterita/posterita/web/images/tango/internet-mail.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/internet-news-reader.png b/posterita/posterita/web/images/tango/internet-news-reader.png deleted file mode 100644 index ebc528fed8..0000000000 Binary files a/posterita/posterita/web/images/tango/internet-news-reader.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/internet-web-browser.png b/posterita/posterita/web/images/tango/internet-web-browser.png deleted file mode 100644 index 10d2ed4f47..0000000000 Binary files a/posterita/posterita/web/images/tango/internet-web-browser.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/list-add.png b/posterita/posterita/web/images/tango/list-add.png deleted file mode 100644 index 2acdd8f514..0000000000 Binary files a/posterita/posterita/web/images/tango/list-add.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/list-remove.png b/posterita/posterita/web/images/tango/list-remove.png deleted file mode 100644 index c5524f7284..0000000000 Binary files a/posterita/posterita/web/images/tango/list-remove.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/mail-forward.png b/posterita/posterita/web/images/tango/mail-forward.png deleted file mode 100644 index bea94ab0c8..0000000000 Binary files a/posterita/posterita/web/images/tango/mail-forward.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/mail-mark-junk.png b/posterita/posterita/web/images/tango/mail-mark-junk.png deleted file mode 100644 index 0af3006673..0000000000 Binary files a/posterita/posterita/web/images/tango/mail-mark-junk.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/mail-mark-not-junk.png b/posterita/posterita/web/images/tango/mail-mark-not-junk.png deleted file mode 100644 index 296e92ad13..0000000000 Binary files a/posterita/posterita/web/images/tango/mail-mark-not-junk.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/mail-message-new.png b/posterita/posterita/web/images/tango/mail-message-new.png deleted file mode 100644 index 9f51246f1e..0000000000 Binary files a/posterita/posterita/web/images/tango/mail-message-new.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/mail-reply-all.png b/posterita/posterita/web/images/tango/mail-reply-all.png deleted file mode 100644 index 0216e390b6..0000000000 Binary files a/posterita/posterita/web/images/tango/mail-reply-all.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/mail-reply-sender.png b/posterita/posterita/web/images/tango/mail-reply-sender.png deleted file mode 100644 index 3f248dc3a2..0000000000 Binary files a/posterita/posterita/web/images/tango/mail-reply-sender.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/mail-send-receive.png b/posterita/posterita/web/images/tango/mail-send-receive.png deleted file mode 100644 index 99349b9aac..0000000000 Binary files a/posterita/posterita/web/images/tango/mail-send-receive.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/media-eject.png b/posterita/posterita/web/images/tango/media-eject.png deleted file mode 100644 index b218e7ae98..0000000000 Binary files a/posterita/posterita/web/images/tango/media-eject.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/media-playback-pause.png b/posterita/posterita/web/images/tango/media-playback-pause.png deleted file mode 100644 index 1e9f4d5357..0000000000 Binary files a/posterita/posterita/web/images/tango/media-playback-pause.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/media-playback-start.png b/posterita/posterita/web/images/tango/media-playback-start.png deleted file mode 100644 index 66f32d89b5..0000000000 Binary files a/posterita/posterita/web/images/tango/media-playback-start.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/media-playback-stop.png b/posterita/posterita/web/images/tango/media-playback-stop.png deleted file mode 100644 index a0947879ee..0000000000 Binary files a/posterita/posterita/web/images/tango/media-playback-stop.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/media-record.png b/posterita/posterita/web/images/tango/media-record.png deleted file mode 100644 index 43f034b59a..0000000000 Binary files a/posterita/posterita/web/images/tango/media-record.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/media-seek-backward.png b/posterita/posterita/web/images/tango/media-seek-backward.png deleted file mode 100644 index 535c536157..0000000000 Binary files a/posterita/posterita/web/images/tango/media-seek-backward.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/media-seek-forward.png b/posterita/posterita/web/images/tango/media-seek-forward.png deleted file mode 100644 index 96ebe01c5f..0000000000 Binary files a/posterita/posterita/web/images/tango/media-seek-forward.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/media-skip-backward.png b/posterita/posterita/web/images/tango/media-skip-backward.png deleted file mode 100644 index aa082513b9..0000000000 Binary files a/posterita/posterita/web/images/tango/media-skip-backward.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/media-skip-forward.png b/posterita/posterita/web/images/tango/media-skip-forward.png deleted file mode 100644 index 52be9420da..0000000000 Binary files a/posterita/posterita/web/images/tango/media-skip-forward.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/office-calendar.png b/posterita/posterita/web/images/tango/office-calendar.png deleted file mode 100644 index 7817c12b4f..0000000000 Binary files a/posterita/posterita/web/images/tango/office-calendar.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-desktop-accessibility.png b/posterita/posterita/web/images/tango/preferences-desktop-accessibility.png deleted file mode 100644 index adfe247e29..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-desktop-accessibility.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-desktop-assistive-technology.png b/posterita/posterita/web/images/tango/preferences-desktop-assistive-technology.png deleted file mode 100644 index 70adb92b52..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-desktop-assistive-technology.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-desktop-font.png b/posterita/posterita/web/images/tango/preferences-desktop-font.png deleted file mode 100644 index b4ec434ca1..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-desktop-font.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-desktop-keyboard-shortcuts.png b/posterita/posterita/web/images/tango/preferences-desktop-keyboard-shortcuts.png deleted file mode 100644 index 178dd294c3..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-desktop-keyboard-shortcuts.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-desktop-locale.png b/posterita/posterita/web/images/tango/preferences-desktop-locale.png deleted file mode 100644 index 608a0b1e95..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-desktop-locale.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-desktop-remote-desktop.png b/posterita/posterita/web/images/tango/preferences-desktop-remote-desktop.png deleted file mode 100644 index 6da67c65f7..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-desktop-remote-desktop.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-desktop-screensaver.png b/posterita/posterita/web/images/tango/preferences-desktop-screensaver.png deleted file mode 100644 index dba245586f..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-desktop-screensaver.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-desktop-sound.png b/posterita/posterita/web/images/tango/preferences-desktop-sound.png deleted file mode 100644 index 56a5662eee..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-desktop-sound.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-desktop-theme.png b/posterita/posterita/web/images/tango/preferences-desktop-theme.png deleted file mode 100644 index 7af777d6e7..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-desktop-theme.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-desktop-wallpaper.png b/posterita/posterita/web/images/tango/preferences-desktop-wallpaper.png deleted file mode 100644 index 4eb744ca14..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-desktop-wallpaper.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-system-network-proxy.png b/posterita/posterita/web/images/tango/preferences-system-network-proxy.png deleted file mode 100644 index e75f6f769c..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-system-network-proxy.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-system-session.png b/posterita/posterita/web/images/tango/preferences-system-session.png deleted file mode 100644 index f8c2d112c9..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-system-session.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-system-windows.png b/posterita/posterita/web/images/tango/preferences-system-windows.png deleted file mode 100644 index 517e48ae08..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-system-windows.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/preferences-system.png b/posterita/posterita/web/images/tango/preferences-system.png deleted file mode 100644 index 6e52db7cfd..0000000000 Binary files a/posterita/posterita/web/images/tango/preferences-system.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/process-stop.png b/posterita/posterita/web/images/tango/process-stop.png deleted file mode 100644 index e7a8d1722f..0000000000 Binary files a/posterita/posterita/web/images/tango/process-stop.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/system-file-manager.png b/posterita/posterita/web/images/tango/system-file-manager.png deleted file mode 100644 index 1d6ce31510..0000000000 Binary files a/posterita/posterita/web/images/tango/system-file-manager.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/system-installer.png b/posterita/posterita/web/images/tango/system-installer.png deleted file mode 100644 index c26576ee8f..0000000000 Binary files a/posterita/posterita/web/images/tango/system-installer.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/system-lock-screen.png b/posterita/posterita/web/images/tango/system-lock-screen.png deleted file mode 100644 index 2c220fcb62..0000000000 Binary files a/posterita/posterita/web/images/tango/system-lock-screen.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/system-log-out.png b/posterita/posterita/web/images/tango/system-log-out.png deleted file mode 100644 index 780411d3ea..0000000000 Binary files a/posterita/posterita/web/images/tango/system-log-out.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/system-password.png b/posterita/posterita/web/images/tango/system-password.png deleted file mode 100644 index b0109750ac..0000000000 Binary files a/posterita/posterita/web/images/tango/system-password.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/system-search.png b/posterita/posterita/web/images/tango/system-search.png deleted file mode 100644 index 950d792af5..0000000000 Binary files a/posterita/posterita/web/images/tango/system-search.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/system-shutdown.png b/posterita/posterita/web/images/tango/system-shutdown.png deleted file mode 100644 index 36acd46bd3..0000000000 Binary files a/posterita/posterita/web/images/tango/system-shutdown.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/system-software-update.png b/posterita/posterita/web/images/tango/system-software-update.png deleted file mode 100644 index 470b5d46f4..0000000000 Binary files a/posterita/posterita/web/images/tango/system-software-update.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/system-users.png b/posterita/posterita/web/images/tango/system-users.png deleted file mode 100644 index 749c825e07..0000000000 Binary files a/posterita/posterita/web/images/tango/system-users.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/tab-new.png b/posterita/posterita/web/images/tango/tab-new.png deleted file mode 100644 index 294d150697..0000000000 Binary files a/posterita/posterita/web/images/tango/tab-new.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/user-trash.png b/posterita/posterita/web/images/tango/user-trash.png deleted file mode 100644 index 9b7a462d7d..0000000000 Binary files a/posterita/posterita/web/images/tango/user-trash.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/utilities-system-monitor.png b/posterita/posterita/web/images/tango/utilities-system-monitor.png deleted file mode 100644 index b62959e4f3..0000000000 Binary files a/posterita/posterita/web/images/tango/utilities-system-monitor.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/utilities-terminal.png b/posterita/posterita/web/images/tango/utilities-terminal.png deleted file mode 100644 index f86c784002..0000000000 Binary files a/posterita/posterita/web/images/tango/utilities-terminal.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/view-fullscreen.png b/posterita/posterita/web/images/tango/view-fullscreen.png deleted file mode 100644 index 00e6b83cc0..0000000000 Binary files a/posterita/posterita/web/images/tango/view-fullscreen.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/view-refresh.png b/posterita/posterita/web/images/tango/view-refresh.png deleted file mode 100644 index 606ea9eba4..0000000000 Binary files a/posterita/posterita/web/images/tango/view-refresh.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/window-new.png b/posterita/posterita/web/images/tango/window-new.png deleted file mode 100644 index e091702e33..0000000000 Binary files a/posterita/posterita/web/images/tango/window-new.png and /dev/null differ diff --git a/posterita/posterita/web/images/tango/x-office-calendar.png b/posterita/posterita/web/images/tango/x-office-calendar.png deleted file mode 100644 index 0c224e9f01..0000000000 Binary files a/posterita/posterita/web/images/tango/x-office-calendar.png and /dev/null differ diff --git a/posterita/posterita/web/images/tick.png b/posterita/posterita/web/images/tick.png deleted file mode 100644 index 1d7ef37770..0000000000 Binary files a/posterita/posterita/web/images/tick.png and /dev/null differ diff --git a/posterita/posterita/web/images/trash.png b/posterita/posterita/web/images/trash.png deleted file mode 100644 index 17d5dbcdc9..0000000000 Binary files a/posterita/posterita/web/images/trash.png and /dev/null differ diff --git a/posterita/posterita/web/images/wrong.png b/posterita/posterita/web/images/wrong.png deleted file mode 100644 index 9fcdd470e2..0000000000 Binary files a/posterita/posterita/web/images/wrong.png and /dev/null differ diff --git a/posterita/posterita/web/import/importGarmentTemplate.csv b/posterita/posterita/web/import/importGarmentTemplate.csv deleted file mode 100644 index 8b085861e0..0000000000 --- a/posterita/posterita/web/import/importGarmentTemplate.csv +++ /dev/null @@ -1 +0,0 @@ -"Barcode","Brand","Design","Model","Colour","Size","Revenue Recognition","Purchase Price","Marked Price","Discounted Price","Limit Price","VAT %","Stock in Hand" diff --git a/posterita/posterita/web/import/importTemplate.csv b/posterita/posterita/web/import/importTemplate.csv deleted file mode 100644 index 2c8e62915b..0000000000 --- a/posterita/posterita/web/import/importTemplate.csv +++ /dev/null @@ -1 +0,0 @@ -"Revenue Recognition",Barcode,Name,Description,UOM,"Purchase Price","Marked Price","Discounted Price","Limit Price","VAT %","Stock in Hand" diff --git a/posterita/posterita/web/index.jsp b/posterita/posterita/web/index.jsp deleted file mode 100644 index fb62a96c53..0000000000 --- a/posterita/posterita/web/index.jsp +++ /dev/null @@ -1,21 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ---%> - - diff --git a/posterita/posterita/web/javascripts/actb.js b/posterita/posterita/web/javascripts/actb.js deleted file mode 100644 index c6800f2f14..0000000000 --- a/posterita/posterita/web/javascripts/actb.js +++ /dev/null @@ -1,645 +0,0 @@ -function addEvent(obj,event_name,func_name){ - if (obj.attachEvent){ - obj.attachEvent("on"+event_name, func_name); - }else if(obj.addEventListener){ - obj.addEventListener(event_name,func_name,true); - }else{ - obj["on"+event_name] = func_name; - } -} -function removeEvent(obj,event_name,func_name){ - if (obj.detachEvent){ - obj.detachEvent("on"+event_name,func_name); - }else if(obj.removeEventListener){ - obj.removeEventListener(event_name,func_name,true); - }else{ - obj["on"+event_name] = null; - } -} -function stopEvent(evt){ - evt || window.event; - if (evt.stopPropagation){ - evt.stopPropagation(); - evt.preventDefault(); - }else if(typeof evt.cancelBubble != "undefined"){ - evt.cancelBubble = true; - evt.returnValue = false; - } - return false; -} -function getElement(evt){ - if (window.event){ - return window.event.srcElement; - }else{ - return evt.currentTarget; - } -} -function getTargetElement(evt){ - if (window.event){ - return window.event.srcElement; - }else{ - return evt.target; - } -} -function stopSelect(obj){ - if (typeof obj.onselectstart != 'undefined'){ - addEvent(obj,"selectstart",function(){ return false;}); - } -} -function getCaretEnd(obj){ - if(typeof obj.selectionEnd != "undefined"){ - return obj.selectionEnd; - }else if(document.selection&&document.selection.createRange){ - var M=document.selection.createRange(); - try{ - var Lp = M.duplicate(); - Lp.moveToElementText(obj); - }catch(e){ - var Lp=obj.createTextRange(); - } - Lp.setEndPoint("EndToEnd",M); - var rb=Lp.text.length; - if(rb>obj.value.length){ - return -1; - } - return rb; - } -} -function getCaretStart(obj){ - if(typeof obj.selectionStart != "undefined"){ - return obj.selectionStart; - }else if(document.selection&&document.selection.createRange){ - var M=document.selection.createRange(); - try{ - var Lp = M.duplicate(); - Lp.moveToElementText(obj); - }catch(e){ - var Lp=obj.createTextRange(); - } - Lp.setEndPoint("EndToStart",M); - var rb=Lp.text.length; - if(rb>obj.value.length){ - return -1; - } - return rb; - } -} -function setCaret(obj,l){ - obj.focus(); - if (obj.setSelectionRange){ - obj.setSelectionRange(l,l); - }else if(obj.createTextRange){ - m = obj.createTextRange(); - m.moveStart('character',l); - m.collapse(); - m.select(); - } -} -function setSelection(obj,s,e){ - obj.focus(); - if (obj.setSelectionRange){ - obj.setSelectionRange(s,e); - }else if(obj.createTextRange){ - m = obj.createTextRange(); - m.moveStart('character',s); - m.moveEnd('character',e); - m.select(); - } -} -String.prototype.addslashes = function(){ - return this.replace(/(["\\\.\|\[\]\^\*\+\?\$\(\)])/g, '\\$1'); -} -String.prototype.trim = function () { - return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"); -}; -function curTop(obj){ - toreturn = 0; - while(obj){ - toreturn += obj.offsetTop; - obj = obj.offsetParent; - } - return toreturn; -} -function curLeft(obj){ - toreturn = 0; - while(obj){ - toreturn += obj.offsetLeft; - obj = obj.offsetParent; - } - return toreturn; -} -function isNumber(a) { - return typeof a == 'number' && isFinite(a); -} -function replaceHTML(obj,text){ - while(el = obj.childNodes[0]){ - obj.removeChild(el); - }; - obj.appendChild(document.createTextNode(text)); -} - -function actb(obj,ca){ - /* ---- Public Variables ---- */ - this.actb_timeOut = -1; // Autocomplete Timeout in ms (-1: autocomplete never time out) - this.actb_lim = 4; // Number of elements autocomplete can show (-1: no limit) - this.actb_firstText = false; // should the auto complete be limited to the beginning of keyword? - this.actb_mouse = true; // Enable Mouse Support - this.actb_delimiter = new Array(';',','); // Delimiter for multiple autocomplete. Set it to empty array for single autocomplete - this.actb_startcheck = 1; // Show widget only after this number of characters is typed in. - /* ---- Public Variables ---- */ - - /* --- Styles --- */ - this.actb_bgColor = '#888888'; - this.actb_textColor = '#FFFFFF'; - this.actb_hColor = '#000000'; - this.actb_fFamily = 'Verdana'; - this.actb_fSize = '11px'; - this.actb_hStyle = 'text-decoration:underline;font-weight="bold"'; - /* --- Styles --- */ - - /* ---- Private Variables ---- */ - var actb_delimwords = new Array(); - var actb_cdelimword = 0; - var actb_delimchar = new Array(); - var actb_display = false; - var actb_pos = 0; - var actb_total = 0; - var actb_curr = null; - var actb_rangeu = 0; - var actb_ranged = 0; - var actb_bool = new Array(); - var actb_pre = 0; - var actb_toid; - var actb_tomake = false; - var actb_getpre = ""; - var actb_mouse_on_list = 1; - var actb_kwcount = 0; - var actb_caretmove = false; - this.actb_keywords = new Array(); - /* ---- Private Variables---- */ - - this.actb_keywords = ca; - var actb_self = this; - - actb_curr = obj; - - addEvent(actb_curr,"focus",actb_setup); - function actb_setup(){ - addEvent(document,"keydown",actb_checkkey); - addEvent(actb_curr,"blur",actb_clear); - addEvent(document,"keypress",actb_keypress); - } - - function actb_clear(evt){ - if (!evt) evt = event; - removeEvent(document,"keydown",actb_checkkey); - removeEvent(actb_curr,"blur",actb_clear); - removeEvent(document,"keypress",actb_keypress); - actb_removedisp(); - } - function actb_parse(n){ - if (actb_self.actb_delimiter.length > 0){ - var t = actb_delimwords[actb_cdelimword].trim().addslashes(); - var plen = actb_delimwords[actb_cdelimword].trim().length; - }else{ - var t = actb_curr.value.addslashes(); - var plen = actb_curr.value.length; - } - var tobuild = ''; - var i; - - if (actb_self.actb_firstText){ - var re = new RegExp("^" + t, "i"); - }else{ - var re = new RegExp(t, "i"); - } - var p = n.search(re); - - for (i=0;i" - for (i=p;i 1){ - r = a.insertRow(-1); - r.style.backgroundColor = actb_self.actb_bgColor; - c = r.insertCell(-1); - c.style.color = actb_self.actb_textColor; - c.style.fontFamily = 'arial narrow'; - c.style.fontSize = actb_self.actb_fSize; - c.align='center'; - replaceHTML(c,'/\\'); - if (actb_self.actb_mouse){ - c.style.cursor = 'pointer'; - c.onclick = actb_mouse_up; - } - } - for (i=0;i= actb_rangeu && j <= actb_ranged){ - r = a.insertRow(-1); - r.style.backgroundColor = actb_self.actb_bgColor; - r.id = 'tat_tr'+(j); - c = r.insertCell(-1); - c.style.color = actb_self.actb_textColor; - c.style.fontFamily = actb_self.actb_fFamily; - c.style.fontSize = actb_self.actb_fSize; - c.innerHTML = actb_parse(actb_self.actb_keywords[i]); - c.id = 'tat_td'+(j); - c.setAttribute('pos',j); - if (actb_self.actb_mouse){ - c.style.cursor = 'pointer'; - c.onclick=actb_mouseclick; - c.onmouseover = actb_table_highlight; - } - j++; - }else{ - j++; - } - } - if (j > actb_ranged) break; - } - if (j-1 < actb_total){ - r = a.insertRow(-1); - r.style.backgroundColor = actb_self.actb_bgColor; - c = r.insertCell(-1); - c.style.color = actb_self.actb_textColor; - c.style.fontFamily = 'arial narrow'; - c.style.fontSize = actb_self.actb_fSize; - c.align='center'; - replaceHTML(c,'\\/'); - if (actb_self.actb_mouse){ - c.style.cursor = 'pointer'; - c.onclick = actb_mouse_down; - } - } - } - function actb_goup(){ - if (!actb_display) return; - if (actb_pos == 1) return; - document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor; - actb_pos--; - if (actb_pos < actb_rangeu) actb_moveup(); - document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor; - if (actb_toid) clearTimeout(actb_toid); - if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut); - } - function actb_godown(){ - if (!actb_display) return; - if (actb_pos == actb_total) return; - document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor; - actb_pos++; - if (actb_pos > actb_ranged) actb_movedown(); - document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor; - if (actb_toid) clearTimeout(actb_toid); - if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut); - } - function actb_movedown(){ - actb_rangeu++; - actb_ranged++; - actb_remake(); - } - function actb_moveup(){ - actb_rangeu--; - actb_ranged--; - actb_remake(); - } - - /* Mouse */ - function actb_mouse_down(){ - document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor; - actb_pos++; - actb_movedown(); - document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor; - actb_curr.focus(); - actb_mouse_on_list = 0; - if (actb_toid) clearTimeout(actb_toid); - if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut); - } - function actb_mouse_up(evt){ - if (!evt) evt = event; - if (evt.stopPropagation){ - evt.stopPropagation(); - }else{ - evt.cancelBubble = true; - } - document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor; - actb_pos--; - actb_moveup(); - document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor; - actb_curr.focus(); - actb_mouse_on_list = 0; - if (actb_toid) clearTimeout(actb_toid); - if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list=0;actb_removedisp();},actb_self.actb_timeOut); - } - function actb_mouseclick(evt){ - if (!evt) evt = event; - if (!actb_display) return; - actb_mouse_on_list = 0; - actb_pos = this.getAttribute('pos'); - actb_penter(); - } - function actb_table_focus(){ - actb_mouse_on_list = 1; - } - function actb_table_unfocus(){ - actb_mouse_on_list = 0; - if (actb_toid) clearTimeout(actb_toid); - if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list = 0;actb_removedisp();},actb_self.actb_timeOut); - } - function actb_table_highlight(){ - actb_mouse_on_list = 1; - document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_bgColor; - actb_pos = this.getAttribute('pos'); - while (actb_pos < actb_rangeu) actb_moveup(); - while (actb_pos > actb_ranged) actb_movedown(); - document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_self.actb_hColor; - if (actb_toid) clearTimeout(actb_toid); - if (actb_self.actb_timeOut > 0) actb_toid = setTimeout(function(){actb_mouse_on_list = 0;actb_removedisp();},actb_self.actb_timeOut); - } - /* ---- */ - - function actb_insertword(a){ - if (actb_self.actb_delimiter.length > 0){ - str = ''; - l=0; - for (i=0;i=0;--j){ - if (actb_delimwords[i].charAt(j) != ' ') break; - postspace += ' '; - } - str += prespace; - str += a; - l = str.length; - if (gotbreak) str += postspace; - }else{ - str += actb_delimwords[i]; - } - if (i != actb_delimwords.length - 1){ - str += actb_delimchar[i]; - } - } - actb_curr.value = str; - setCaret(actb_curr,l); - }else{ - actb_curr.value = a; - } - actb_mouse_on_list = 0; - actb_removedisp(); - } - function actb_penter(){ - if (!actb_display) return; - actb_display = false; - var word = ''; - var c = 0; - for (var i=0;i<=actb_self.actb_keywords.length;i++){ - if (actb_bool[i]) c++; - if (c == actb_pos){ - word = actb_self.actb_keywords[i]; - break; - } - } - actb_insertword(word); - l = getCaretStart(actb_curr); - } - function actb_removedisp(){ - if (actb_mouse_on_list==0){ - actb_display = 0; - if (document.getElementById('tat_table')){ document.body.removeChild(document.getElementById('tat_table')); } - if (actb_toid) clearTimeout(actb_toid); - } - } - function actb_keypress(e){ - if (actb_caretmove) stopEvent(e); - return !actb_caretmove; - } - function actb_checkkey(evt){ - if (!evt) evt = event; - a = evt.keyCode; - caret_pos_start = getCaretStart(actb_curr); - actb_caretmove = 0; - switch (a){ - case 38: - actb_goup(); - actb_caretmove = 1; - return false; - break; - case 40: - actb_godown(); - actb_caretmove = 1; - return false; - break; - case 13: case 9: - if (actb_display){ - actb_caretmove = 1; - actb_penter(); - return false; - }else{ - return true; - } - break; - default: - setTimeout(function(){actb_tocomplete(a)},50); - break; - } - } - - function actb_tocomplete(kc){ - if (kc == 38 || kc == 40 || kc == 13) return; - var i; - if (actb_display){ - var word = 0; - var c = 0; - for (var i=0;i<=actb_self.actb_keywords.length;i++){ - if (actb_bool[i]) c++; - if (c == actb_pos){ - word = i; - break; - } - } - actb_pre = word; - }else{ actb_pre = -1}; - - if (actb_curr.value == ''){ - actb_mouse_on_list = 0; - actb_removedisp(); - return; - } - if (actb_self.actb_delimiter.length > 0){ - caret_pos_start = getCaretStart(actb_curr); - caret_pos_end = getCaretEnd(actb_curr); - - delim_split = ''; - for (i=0;i= l && caret_pos_end <= l + actb_delimwords[i].length){ - actb_cdelimword = i; - } - l+=actb_delimwords[i].length + 1; - } - var ot = actb_delimwords[actb_cdelimword].trim(); - var t = actb_delimwords[actb_cdelimword].addslashes().trim(); - }else{ - var ot = actb_curr.value; - var t = actb_curr.value.addslashes(); - } - if (ot.length == 0){ - actb_mouse_on_list = 0; - actb_removedisp(); - } - if (ot.length < actb_self.actb_startcheck) return this; - if (actb_self.actb_firstText){ - var re = new RegExp("^" + t, "i"); - }else{ - var re = new RegExp(t, "i"); - } - - actb_total = 0; - actb_tomake = false; - actb_kwcount = 0; - for (i=0;i 0) actb_toid = setTimeout(function(){actb_mouse_on_list = 0;actb_removedisp();},actb_self.actb_timeOut); - actb_generate(); - } - return this; -} \ No newline at end of file diff --git a/posterita/posterita/web/javascripts/builder.js b/posterita/posterita/web/javascripts/builder.js deleted file mode 100644 index 8301999444..0000000000 --- a/posterita/posterita/web/javascripts/builder.js +++ /dev/null @@ -1,136 +0,0 @@ -// script.aculo.us builder.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 - -// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -var Builder = { - NODEMAP: { - AREA: 'map', - CAPTION: 'table', - COL: 'table', - COLGROUP: 'table', - LEGEND: 'fieldset', - OPTGROUP: 'select', - OPTION: 'select', - PARAM: 'object', - TBODY: 'table', - TD: 'table', - TFOOT: 'table', - TH: 'table', - THEAD: 'table', - TR: 'table' - }, - // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken, - // due to a Firefox bug - node: function(elementName) { - elementName = elementName.toUpperCase(); - - // try innerHTML approach - var parentTag = this.NODEMAP[elementName] || 'div'; - var parentElement = document.createElement(parentTag); - try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 - parentElement.innerHTML = "<" + elementName + ">"; - } catch(e) {} - var element = parentElement.firstChild || null; - - // see if browser added wrapping tags - if(element && (element.tagName.toUpperCase() != elementName)) - element = element.getElementsByTagName(elementName)[0]; - - // fallback to createElement approach - if(!element) element = document.createElement(elementName); - - // abort if nothing could be created - if(!element) return; - - // attributes (or text) - if(arguments[1]) - if(this._isStringOrNumber(arguments[1]) || - (arguments[1] instanceof Array) || - arguments[1].tagName) { - this._children(element, arguments[1]); - } else { - var attrs = this._attributes(arguments[1]); - if(attrs.length) { - try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 - parentElement.innerHTML = "<" +elementName + " " + - attrs + ">"; - } catch(e) {} - element = parentElement.firstChild || null; - // workaround firefox 1.0.X bug - if(!element) { - element = document.createElement(elementName); - for(attr in arguments[1]) - element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; - } - if(element.tagName.toUpperCase() != elementName) - element = parentElement.getElementsByTagName(elementName)[0]; - } - } - - // text, or array of children - if(arguments[2]) - this._children(element, arguments[2]); - - return element; - }, - _text: function(text) { - return document.createTextNode(text); - }, - - ATTR_MAP: { - 'className': 'class', - 'htmlFor': 'for' - }, - - _attributes: function(attributes) { - var attrs = []; - for(attribute in attributes) - attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) + - '="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"'); - return attrs.join(" "); - }, - _children: function(element, children) { - if(children.tagName) { - element.appendChild(children); - return; - } - if(typeof children=='object') { // array can hold nodes and text - children.flatten().each( function(e) { - if(typeof e=='object') - element.appendChild(e) - else - if(Builder._isStringOrNumber(e)) - element.appendChild(Builder._text(e)); - }); - } else - if(Builder._isStringOrNumber(children)) - element.appendChild(Builder._text(children)); - }, - _isStringOrNumber: function(param) { - return(typeof param=='string' || typeof param=='number'); - }, - build: function(html) { - var element = this.node('div'); - $(element).update(html.strip()); - return element.down(); - }, - dump: function(scope) { - if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope - - var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " + - "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " + - "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+ - "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+ - "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+ - "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); - - tags.each( function(tag){ - scope[tag] = function() { - return Builder.node.apply(Builder, [tag].concat($A(arguments))); - } - }); - } -} diff --git a/posterita/posterita/web/javascripts/controls.js b/posterita/posterita/web/javascripts/controls.js deleted file mode 100644 index fc7968dfe1..0000000000 --- a/posterita/posterita/web/javascripts/controls.js +++ /dev/null @@ -1,965 +0,0 @@ -// script.aculo.us controls.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 - -// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan) -// (c) 2005-2007 Jon Tirsen (http://www.tirsen.com) -// Contributors: -// Richard Livsey -// Rahul Bhargava -// Rob Wills -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -// Autocompleter.Base handles all the autocompletion functionality -// that's independent of the data source for autocompletion. This -// includes drawing the autocompletion menu, observing keyboard -// and mouse events, and similar. -// -// Specific autocompleters need to provide, at the very least, -// a getUpdatedChoices function that will be invoked every time -// the text inside the monitored textbox changes. This method -// should get the text for which to provide autocompletion by -// invoking this.getToken(), NOT by directly accessing -// this.element.value. This is to allow incremental tokenized -// autocompletion. Specific auto-completion logic (AJAX, etc) -// belongs in getUpdatedChoices. -// -// Tokenized incremental autocompletion is enabled automatically -// when an autocompleter is instantiated with the 'tokens' option -// in the options parameter, e.g.: -// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' }); -// will incrementally autocomplete with a comma as the token. -// Additionally, ',' in the above example can be replaced with -// a token array, e.g. { tokens: [',', '\n'] } which -// enables autocompletion on multiple tokens. This is most -// useful when one of the tokens is \n (a newline), as it -// allows smart autocompletion after linebreaks. - -if(typeof Effect == 'undefined') - throw("controls.js requires including script.aculo.us' effects.js library"); - -var Autocompleter = { } -Autocompleter.Base = Class.create({ - baseInitialize: function(element, update, options) { - element = $(element) - this.element = element; - this.update = $(update); - this.hasFocus = false; - this.changed = false; - this.active = false; - this.index = 0; - this.entryCount = 0; - this.oldElementValue = this.element.value; - - if(this.setOptions) - this.setOptions(options); - else - this.options = options || { }; - - this.options.paramName = this.options.paramName || this.element.name; - this.options.tokens = this.options.tokens || []; - this.options.frequency = this.options.frequency || 0.4; - this.options.minChars = this.options.minChars || 1; - this.options.onShow = this.options.onShow || - function(element, update){ - if(!update.style.position || update.style.position=='absolute') { - update.style.position = 'absolute'; - Position.clone(element, update, { - setHeight: false, - offsetTop: element.offsetHeight - }); - } - Effect.Appear(update,{duration:0.15}); - }; - this.options.onHide = this.options.onHide || - function(element, update){ new Effect.Fade(update,{duration:0.15}) }; - - if(typeof(this.options.tokens) == 'string') - this.options.tokens = new Array(this.options.tokens); - // Force carriage returns as token delimiters anyway - if (!this.options.tokens.include('\n')) - this.options.tokens.push('\n'); - - this.observer = null; - - this.element.setAttribute('autocomplete','off'); - - Element.hide(this.update); - - Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this)); - Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this)); - }, - - show: function() { - if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); - if(!this.iefix && - (Prototype.Browser.IE) && - (Element.getStyle(this.update, 'position')=='absolute')) { - new Insertion.After(this.update, - ''); - this.iefix = $(this.update.id+'_iefix'); - } - if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); - }, - - fixIEOverlapping: function() { - Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); - this.iefix.style.zIndex = 1; - this.update.style.zIndex = 2; - Element.show(this.iefix); - }, - - hide: function() { - this.stopIndicator(); - if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); - if(this.iefix) Element.hide(this.iefix); - }, - - startIndicator: function() { - if(this.options.indicator) Element.show(this.options.indicator); - }, - - stopIndicator: function() { - if(this.options.indicator) Element.hide(this.options.indicator); - }, - - onKeyPress: function(event) { - if(this.active) - switch(event.keyCode) { - case Event.KEY_TAB: - case Event.KEY_RETURN: - this.selectEntry(); - Event.stop(event); - case Event.KEY_ESC: - this.hide(); - this.active = false; - Event.stop(event); - return; - case Event.KEY_LEFT: - case Event.KEY_RIGHT: - return; - case Event.KEY_UP: - this.markPrevious(); - this.render(); - Event.stop(event); - return; - case Event.KEY_DOWN: - this.markNext(); - this.render(); - Event.stop(event); - return; - } - else - if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || - (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; - - this.changed = true; - this.hasFocus = true; - - if(this.observer) clearTimeout(this.observer); - this.observer = - setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); - }, - - activate: function() { - this.changed = false; - this.hasFocus = true; - this.getUpdatedChoices(); - }, - - onHover: function(event) { - var element = Event.findElement(event, 'LI'); - if(this.index != element.autocompleteIndex) - { - this.index = element.autocompleteIndex; - this.render(); - } - Event.stop(event); - }, - - onClick: function(event) { - var element = Event.findElement(event, 'LI'); - this.index = element.autocompleteIndex; - this.selectEntry(); - this.hide(); - }, - - onBlur: function(event) { - // needed to make click events working - setTimeout(this.hide.bind(this), 250); - this.hasFocus = false; - this.active = false; - }, - - render: function() { - if(this.entryCount > 0) { - for (var i = 0; i < this.entryCount; i++) - this.index==i ? - Element.addClassName(this.getEntry(i),"selected") : - Element.removeClassName(this.getEntry(i),"selected"); - if(this.hasFocus) { - this.show(); - this.active = true; - } - } else { - this.active = false; - this.hide(); - } - }, - - markPrevious: function() { - if(this.index > 0) this.index-- - else this.index = this.entryCount-1; - this.getEntry(this.index).scrollIntoView(true); - }, - - markNext: function() { - if(this.index < this.entryCount-1) this.index++ - else this.index = 0; - this.getEntry(this.index).scrollIntoView(false); - }, - - getEntry: function(index) { - return this.update.firstChild.childNodes[index]; - }, - - getCurrentEntry: function() { - return this.getEntry(this.index); - }, - - selectEntry: function() { - this.active = false; - this.updateElement(this.getCurrentEntry()); - }, - - updateElement: function(selectedElement) { - if (this.options.updateElement) { - this.options.updateElement(selectedElement); - return; - } - var value = ''; - if (this.options.select) { - var nodes = $(selectedElement).select('.' + this.options.select) || []; - if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); - } else - value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); - - var bounds = this.getTokenBounds(); - if (bounds[0] != -1) { - var newValue = this.element.value.substr(0, bounds[0]); - var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); - if (whitespace) - newValue += whitespace[0]; - this.element.value = newValue + value + this.element.value.substr(bounds[1]); - } else { - this.element.value = value; - } - this.oldElementValue = this.element.value; - this.element.focus(); - - if (this.options.afterUpdateElement) - this.options.afterUpdateElement(this.element, selectedElement); - }, - - updateChoices: function(choices) { - if(!this.changed && this.hasFocus) { - this.update.innerHTML = choices; - Element.cleanWhitespace(this.update); - Element.cleanWhitespace(this.update.down()); - - if(this.update.firstChild && this.update.down().childNodes) { - this.entryCount = - this.update.down().childNodes.length; - for (var i = 0; i < this.entryCount; i++) { - var entry = this.getEntry(i); - entry.autocompleteIndex = i; - this.addObservers(entry); - } - } else { - this.entryCount = 0; - } - - this.stopIndicator(); - this.index = 0; - - if(this.entryCount==1 && this.options.autoSelect) { - this.selectEntry(); - this.hide(); - } else { - this.render(); - } - } - }, - - addObservers: function(element) { - Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); - Event.observe(element, "click", this.onClick.bindAsEventListener(this)); - }, - - onObserverEvent: function() { - this.changed = false; - this.tokenBounds = null; - if(this.getToken().length>=this.options.minChars) { - this.getUpdatedChoices(); - } else { - this.active = false; - this.hide(); - } - this.oldElementValue = this.element.value; - }, - - getToken: function() { - var bounds = this.getTokenBounds(); - return this.element.value.substring(bounds[0], bounds[1]).strip(); - }, - - getTokenBounds: function() { - if (null != this.tokenBounds) return this.tokenBounds; - var value = this.element.value; - if (value.strip().empty()) return [-1, 0]; - var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); - var offset = (diff == this.oldElementValue.length ? 1 : 0); - var prevTokenPos = -1, nextTokenPos = value.length; - var tp; - for (var index = 0, l = this.options.tokens.length; index < l; ++index) { - tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); - if (tp > prevTokenPos) prevTokenPos = tp; - tp = value.indexOf(this.options.tokens[index], diff + offset); - if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; - } - return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); - } -}); - -Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { - var boundary = Math.min(newS.length, oldS.length); - for (var index = 0; index < boundary; ++index) - if (newS[index] != oldS[index]) - return index; - return boundary; -}; - -Ajax.Autocompleter = Class.create(Autocompleter.Base, { - initialize: function(element, update, url, options) { - this.baseInitialize(element, update, options); - this.options.asynchronous = true; - this.options.onComplete = this.onComplete.bind(this); - this.options.defaultParams = this.options.parameters || null; - this.url = url; - }, - - getUpdatedChoices: function() { - this.startIndicator(); - - var entry = encodeURIComponent(this.options.paramName) + '=' + - encodeURIComponent(this.getToken()); - - this.options.parameters = this.options.callback ? - this.options.callback(this.element, entry) : entry; - - if(this.options.defaultParams) - this.options.parameters += '&' + this.options.defaultParams; - - new Ajax.Request(this.url, this.options); - }, - - onComplete: function(request) { - this.updateChoices(request.responseText); - } -}); - -// The local array autocompleter. Used when you'd prefer to -// inject an array of autocompletion options into the page, rather -// than sending out Ajax queries, which can be quite slow sometimes. -// -// The constructor takes four parameters. The first two are, as usual, -// the id of the monitored textbox, and id of the autocompletion menu. -// The third is the array you want to autocomplete from, and the fourth -// is the options block. -// -// Extra local autocompletion options: -// - choices - How many autocompletion choices to offer -// -// - partialSearch - If false, the autocompleter will match entered -// text only at the beginning of strings in the -// autocomplete array. Defaults to true, which will -// match text at the beginning of any *word* in the -// strings in the autocomplete array. If you want to -// search anywhere in the string, additionally set -// the option fullSearch to true (default: off). -// -// - fullSsearch - Search anywhere in autocomplete array strings. -// -// - partialChars - How many characters to enter before triggering -// a partial match (unlike minChars, which defines -// how many characters are required to do any match -// at all). Defaults to 2. -// -// - ignoreCase - Whether to ignore case when autocompleting. -// Defaults to true. -// -// It's possible to pass in a custom function as the 'selector' -// option, if you prefer to write your own autocompletion logic. -// In that case, the other options above will not apply unless -// you support them. - -Autocompleter.Local = Class.create(Autocompleter.Base, { - initialize: function(element, update, array, options) { - this.baseInitialize(element, update, options); - this.options.array = array; - }, - - getUpdatedChoices: function() { - this.updateChoices(this.options.selector(this)); - }, - - setOptions: function(options) { - this.options = Object.extend({ - choices: 10, - partialSearch: true, - partialChars: 2, - ignoreCase: true, - fullSearch: false, - selector: function(instance) { - var ret = []; // Beginning matches - var partial = []; // Inside matches - var entry = instance.getToken(); - var count = 0; - - for (var i = 0; i < instance.options.array.length && - ret.length < instance.options.choices ; i++) { - - var elem = instance.options.array[i]; - var foundPos = instance.options.ignoreCase ? - elem.toLowerCase().indexOf(entry.toLowerCase()) : - elem.indexOf(entry); - - while (foundPos != -1) { - if (foundPos == 0 && elem.length != entry.length) { - ret.push("
  • " + elem.substr(0, entry.length) + "" + - elem.substr(entry.length) + "
  • "); - break; - } else if (entry.length >= instance.options.partialChars && - instance.options.partialSearch && foundPos != -1) { - if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { - partial.push("
  • " + elem.substr(0, foundPos) + "" + - elem.substr(foundPos, entry.length) + "" + elem.substr( - foundPos + entry.length) + "
  • "); - break; - } - } - - foundPos = instance.options.ignoreCase ? - elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : - elem.indexOf(entry, foundPos + 1); - - } - } - if (partial.length) - ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) - return "
      " + ret.join('') + "
    "; - } - }, options || { }); - } -}); - -// AJAX in-place editor and collection editor -// Full rewrite by Christophe Porteneuve (April 2007). - -// Use this if you notice weird scrolling problems on some browsers, -// the DOM might be a bit confused when this gets called so do this -// waits 1 ms (with setTimeout) until it does the activation -Field.scrollFreeActivate = function(field) { - setTimeout(function() { - Field.activate(field); - }, 1); -} - -Ajax.InPlaceEditor = Class.create({ - initialize: function(element, url, options) { - this.url = url; - this.element = element = $(element); - this.prepareOptions(); - this._controls = { }; - arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! - Object.extend(this.options, options || { }); - if (!this.options.formId && this.element.id) { - this.options.formId = this.element.id + '-inplaceeditor'; - if ($(this.options.formId)) - this.options.formId = ''; - } - if (this.options.externalControl) - this.options.externalControl = $(this.options.externalControl); - if (!this.options.externalControl) - this.options.externalControlOnly = false; - this._originalBackground = this.element.getStyle('background-color') || 'transparent'; - this.element.title = this.options.clickToEditText; - this._boundCancelHandler = this.handleFormCancellation.bind(this); - this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); - this._boundFailureHandler = this.handleAJAXFailure.bind(this); - this._boundSubmitHandler = this.handleFormSubmission.bind(this); - this._boundWrapperHandler = this.wrapUp.bind(this); - this.registerListeners(); - }, - checkForEscapeOrReturn: function(e) { - if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; - if (Event.KEY_ESC == e.keyCode) - this.handleFormCancellation(e); - else if (Event.KEY_RETURN == e.keyCode) - this.handleFormSubmission(e); - }, - createControl: function(mode, handler, extraClasses) { - var control = this.options[mode + 'Control']; - var text = this.options[mode + 'Text']; - if ('button' == control) { - var btn = document.createElement('input'); - btn.type = 'submit'; - btn.value = text; - btn.className = 'editor_' + mode + '_button'; - if ('cancel' == mode) - btn.onclick = this._boundCancelHandler; - this._form.appendChild(btn); - this._controls[mode] = btn; - } else if ('link' == control) { - var link = document.createElement('a'); - link.href = '#'; - link.appendChild(document.createTextNode(text)); - link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; - link.className = 'editor_' + mode + '_link'; - if (extraClasses) - link.className += ' ' + extraClasses; - this._form.appendChild(link); - this._controls[mode] = link; - } - }, - createEditField: function() { - var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); - var fld; - if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { - fld = document.createElement('input'); - fld.type = 'text'; - var size = this.options.size || this.options.cols || 0; - if (0 < size) fld.size = size; - } else { - fld = document.createElement('textarea'); - fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); - fld.cols = this.options.cols || 40; - } - fld.name = this.options.paramName; - fld.value = text; // No HTML breaks conversion anymore - fld.className = 'editor_field'; - if (this.options.submitOnBlur) - fld.onblur = this._boundSubmitHandler; - this._controls.editor = fld; - if (this.options.loadTextURL) - this.loadExternalText(); - this._form.appendChild(this._controls.editor); - }, - createForm: function() { - var ipe = this; - function addText(mode, condition) { - var text = ipe.options['text' + mode + 'Controls']; - if (!text || condition === false) return; - ipe._form.appendChild(document.createTextNode(text)); - }; - this._form = $(document.createElement('form')); - this._form.id = this.options.formId; - this._form.addClassName(this.options.formClassName); - this._form.onsubmit = this._boundSubmitHandler; - this.createEditField(); - if ('textarea' == this._controls.editor.tagName.toLowerCase()) - this._form.appendChild(document.createElement('br')); - if (this.options.onFormCustomization) - this.options.onFormCustomization(this, this._form); - addText('Before', this.options.okControl || this.options.cancelControl); - this.createControl('ok', this._boundSubmitHandler); - addText('Between', this.options.okControl && this.options.cancelControl); - this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); - addText('After', this.options.okControl || this.options.cancelControl); - }, - destroy: function() { - if (this._oldInnerHTML) - this.element.innerHTML = this._oldInnerHTML; - this.leaveEditMode(); - this.unregisterListeners(); - }, - enterEditMode: function(e) { - if (this._saving || this._editing) return; - this._editing = true; - this.triggerCallback('onEnterEditMode'); - if (this.options.externalControl) - this.options.externalControl.hide(); - this.element.hide(); - this.createForm(); - this.element.parentNode.insertBefore(this._form, this.element); - if (!this.options.loadTextURL) - this.postProcessEditField(); - if (e) Event.stop(e); - }, - enterHover: function(e) { - if (this.options.hoverClassName) - this.element.addClassName(this.options.hoverClassName); - if (this._saving) return; - this.triggerCallback('onEnterHover'); - }, - getText: function() { - return this.element.innerHTML; - }, - handleAJAXFailure: function(transport) { - this.triggerCallback('onFailure', transport); - if (this._oldInnerHTML) { - this.element.innerHTML = this._oldInnerHTML; - this._oldInnerHTML = null; - } - }, - handleFormCancellation: function(e) { - this.wrapUp(); - if (e) Event.stop(e); - }, - handleFormSubmission: function(e) { - var form = this._form; - var value = $F(this._controls.editor); - this.prepareSubmission(); - var params = this.options.callback(form, value) || ''; - if (Object.isString(params)) - params = params.toQueryParams(); - params.editorId = this.element.id; - if (this.options.htmlResponse) { - var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); - Object.extend(options, { - parameters: params, - onComplete: this._boundWrapperHandler, - onFailure: this._boundFailureHandler - }); - new Ajax.Updater({ success: this.element }, this.url, options); - } else { - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: params, - onComplete: this._boundWrapperHandler, - onFailure: this._boundFailureHandler - }); - new Ajax.Request(this.url, options); - } - if (e) Event.stop(e); - }, - leaveEditMode: function() { - this.element.removeClassName(this.options.savingClassName); - this.removeForm(); - this.leaveHover(); - this.element.style.backgroundColor = this._originalBackground; - this.element.show(); - if (this.options.externalControl) - this.options.externalControl.show(); - this._saving = false; - this._editing = false; - this._oldInnerHTML = null; - this.triggerCallback('onLeaveEditMode'); - }, - leaveHover: function(e) { - if (this.options.hoverClassName) - this.element.removeClassName(this.options.hoverClassName); - if (this._saving) return; - this.triggerCallback('onLeaveHover'); - }, - loadExternalText: function() { - this._form.addClassName(this.options.loadingClassName); - this._controls.editor.disabled = true; - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: 'editorId=' + encodeURIComponent(this.element.id), - onComplete: Prototype.emptyFunction, - onSuccess: function(transport) { - this._form.removeClassName(this.options.loadingClassName); - var text = transport.responseText; - if (this.options.stripLoadedTextTags) - text = text.stripTags(); - this._controls.editor.value = text; - this._controls.editor.disabled = false; - this.postProcessEditField(); - }.bind(this), - onFailure: this._boundFailureHandler - }); - new Ajax.Request(this.options.loadTextURL, options); - }, - postProcessEditField: function() { - var fpc = this.options.fieldPostCreation; - if (fpc) - $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); - }, - prepareOptions: function() { - this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); - Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); - [this._extraDefaultOptions].flatten().compact().each(function(defs) { - Object.extend(this.options, defs); - }.bind(this)); - }, - prepareSubmission: function() { - this._saving = true; - this.removeForm(); - this.leaveHover(); - this.showSaving(); - }, - registerListeners: function() { - this._listeners = { }; - var listener; - $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { - listener = this[pair.value].bind(this); - this._listeners[pair.key] = listener; - if (!this.options.externalControlOnly) - this.element.observe(pair.key, listener); - if (this.options.externalControl) - this.options.externalControl.observe(pair.key, listener); - }.bind(this)); - }, - removeForm: function() { - if (!this._form) return; - this._form.remove(); - this._form = null; - this._controls = { }; - }, - showSaving: function() { - this._oldInnerHTML = this.element.innerHTML; - this.element.innerHTML = this.options.savingText; - this.element.addClassName(this.options.savingClassName); - this.element.style.backgroundColor = this._originalBackground; - this.element.show(); - }, - triggerCallback: function(cbName, arg) { - if ('function' == typeof this.options[cbName]) { - this.options[cbName](this, arg); - } - }, - unregisterListeners: function() { - $H(this._listeners).each(function(pair) { - if (!this.options.externalControlOnly) - this.element.stopObserving(pair.key, pair.value); - if (this.options.externalControl) - this.options.externalControl.stopObserving(pair.key, pair.value); - }.bind(this)); - }, - wrapUp: function(transport) { - this.leaveEditMode(); - // Can't use triggerCallback due to backward compatibility: requires - // binding + direct element - this._boundComplete(transport, this.element); - } -}); - -Object.extend(Ajax.InPlaceEditor.prototype, { - dispose: Ajax.InPlaceEditor.prototype.destroy -}); - -Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { - initialize: function($super, element, url, options) { - this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; - $super(element, url, options); - }, - - createEditField: function() { - var list = document.createElement('select'); - list.name = this.options.paramName; - list.size = 1; - this._controls.editor = list; - this._collection = this.options.collection || []; - if (this.options.loadCollectionURL) - this.loadCollection(); - else - this.checkForExternalText(); - this._form.appendChild(this._controls.editor); - }, - - loadCollection: function() { - this._form.addClassName(this.options.loadingClassName); - this.showLoadingText(this.options.loadingCollectionText); - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: 'editorId=' + encodeURIComponent(this.element.id), - onComplete: Prototype.emptyFunction, - onSuccess: function(transport) { - var js = transport.responseText.strip(); - if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check - throw 'Server returned an invalid collection representation.'; - this._collection = eval(js); - this.checkForExternalText(); - }.bind(this), - onFailure: this.onFailure - }); - new Ajax.Request(this.options.loadCollectionURL, options); - }, - - showLoadingText: function(text) { - this._controls.editor.disabled = true; - var tempOption = this._controls.editor.firstChild; - if (!tempOption) { - tempOption = document.createElement('option'); - tempOption.value = ''; - this._controls.editor.appendChild(tempOption); - tempOption.selected = true; - } - tempOption.update((text || '').stripScripts().stripTags()); - }, - - checkForExternalText: function() { - this._text = this.getText(); - if (this.options.loadTextURL) - this.loadExternalText(); - else - this.buildOptionList(); - }, - - loadExternalText: function() { - this.showLoadingText(this.options.loadingText); - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: 'editorId=' + encodeURIComponent(this.element.id), - onComplete: Prototype.emptyFunction, - onSuccess: function(transport) { - this._text = transport.responseText.strip(); - this.buildOptionList(); - }.bind(this), - onFailure: this.onFailure - }); - new Ajax.Request(this.options.loadTextURL, options); - }, - - buildOptionList: function() { - this._form.removeClassName(this.options.loadingClassName); - this._collection = this._collection.map(function(entry) { - return 2 === entry.length ? entry : [entry, entry].flatten(); - }); - var marker = ('value' in this.options) ? this.options.value : this._text; - var textFound = this._collection.any(function(entry) { - return entry[0] == marker; - }.bind(this)); - this._controls.editor.update(''); - var option; - this._collection.each(function(entry, index) { - option = document.createElement('option'); - option.value = entry[0]; - option.selected = textFound ? entry[0] == marker : 0 == index; - option.appendChild(document.createTextNode(entry[1])); - this._controls.editor.appendChild(option); - }.bind(this)); - this._controls.editor.disabled = false; - Field.scrollFreeActivate(this._controls.editor); - } -}); - -//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** -//**** This only exists for a while, in order to let **** -//**** users adapt to the new API. Read up on the new **** -//**** API and convert your code to it ASAP! **** - -Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { - if (!options) return; - function fallback(name, expr) { - if (name in options || expr === undefined) return; - options[name] = expr; - }; - fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : - options.cancelLink == options.cancelButton == false ? false : undefined))); - fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : - options.okLink == options.okButton == false ? false : undefined))); - fallback('highlightColor', options.highlightcolor); - fallback('highlightEndColor', options.highlightendcolor); -}; - -Object.extend(Ajax.InPlaceEditor, { - DefaultOptions: { - ajaxOptions: { }, - autoRows: 3, // Use when multi-line w/ rows == 1 - cancelControl: 'link', // 'link'|'button'|false - cancelText: 'cancel', - clickToEditText: 'Click to edit', - externalControl: null, // id|elt - externalControlOnly: false, - fieldPostCreation: 'activate', // 'activate'|'focus'|false - formClassName: 'inplaceeditor-form', - formId: null, // id|elt - highlightColor: '#ffff99', - highlightEndColor: '#ffffff', - hoverClassName: '', - htmlResponse: true, - loadingClassName: 'inplaceeditor-loading', - loadingText: 'Loading...', - okControl: 'button', // 'link'|'button'|false - okText: 'ok', - paramName: 'value', - rows: 1, // If 1 and multi-line, uses autoRows - savingClassName: 'inplaceeditor-saving', - savingText: 'Saving...', - size: 0, - stripLoadedTextTags: false, - submitOnBlur: false, - textAfterControls: '', - textBeforeControls: '', - textBetweenControls: '' - }, - DefaultCallbacks: { - callback: function(form) { - return Form.serialize(form); - }, - onComplete: function(transport, element) { - // For backward compatibility, this one is bound to the IPE, and passes - // the element directly. It was too often customized, so we don't break it. - new Effect.Highlight(element, { - startcolor: this.options.highlightColor, keepBackgroundImage: true }); - }, - onEnterEditMode: null, - onEnterHover: function(ipe) { - ipe.element.style.backgroundColor = ipe.options.highlightColor; - if (ipe._effect) - ipe._effect.cancel(); - }, - onFailure: function(transport, ipe) { - alert('Error communication with the server: ' + transport.responseText.stripTags()); - }, - onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. - onLeaveEditMode: null, - onLeaveHover: function(ipe) { - ipe._effect = new Effect.Highlight(ipe.element, { - startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, - restorecolor: ipe._originalBackground, keepBackgroundImage: true - }); - } - }, - Listeners: { - click: 'enterEditMode', - keydown: 'checkForEscapeOrReturn', - mouseover: 'enterHover', - mouseout: 'leaveHover' - } -}); - -Ajax.InPlaceCollectionEditor.DefaultOptions = { - loadingCollectionText: 'Loading options...' -}; - -// Delayed observer, like Form.Element.Observer, -// but waits for delay after last key input -// Ideal for live-search fields - -Form.Element.DelayedObserver = Class.create({ - initialize: function(element, delay, callback) { - this.delay = delay || 0.5; - this.element = $(element); - this.callback = callback; - this.timer = null; - this.lastValue = $F(this.element); - Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); - }, - delayedListener: function(event) { - if(this.lastValue == $F(this.element)) return; - if(this.timer) clearTimeout(this.timer); - this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); - this.lastValue = $F(this.element); - }, - onTimerEvent: function() { - this.timer = null; - this.callback(this.element, $F(this.element)); - } -}); diff --git a/posterita/posterita/web/javascripts/dialogbox.js b/posterita/posterita/web/javascripts/dialogbox.js deleted file mode 100644 index 472a962e19..0000000000 --- a/posterita/posterita/web/javascripts/dialogbox.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright sprsquish -All rights reserved. - -http://snippets.dzone.com/user/sprsquish -*/ - -var Dialog = {}; -Dialog.Box = Class.create(); -Object.extend(Dialog.Box.prototype, { - initialize: function(id) { - this.createOverlay(); - - this.dialog_box = $(id); - this.dialog_box.show = this.show.bind(this); - this.dialog_box.hide = this.hide.bind(this); - - this.parent_element = this.dialog_box.parentNode; - - this.dialog_box.style.position = "absolute"; - var e_dims = Element.getDimensions(this.dialog_box); - var b_dims = Element.getDimensions(this.overlay); - this.dialog_box.style.left = ((b_dims.width/2) - (e_dims.width/2)) + 'px'; - this.dialog_box.style.top = '12px'; - this.dialog_box.style.zIndex = this.overlay.style.zIndex + 1; - - }, - - createOverlay: function() { - if($('dialog_overlay')) { - this.overlay = $('dialog_overlay'); - } else { - this.overlay = document.createElement('div'); - this.overlay.id = 'dialog_overlay'; - Object.extend(this.overlay.style, { - position: 'absolute', - top: 0, - left: 0, - zIndex: 90, - width: '100%', - backgroundColor: '#000', - display: 'none' - }); - document.body.insertBefore(this.overlay, document.body.childNodes[0]); - } - }, - - moveDialogBox: function(where) { - Element.remove(this.dialog_box); - if(where == 'back') - this.dialog_box = this.parent_element.appendChild(this.dialog_box); - else - this.dialog_box = this.overlay.parentNode.insertBefore(this.dialog_box, this.overlay); - }, - - show: function() { - this.overlay.style.height = document.body.getHeight()+'px'; - this.moveDialogBox('out'); - this.overlay.onclick = this.hide.bind(this); - this.selectBoxes('hide'); - new Effect.Appear(this.overlay, {duration: 0.1, from: 0.0, to: 0.3}); - this.dialog_box.style.display = ''; - }, - - hide: function() { - this.selectBoxes('show'); - new Effect.Fade(this.overlay, {duration: 0.1}); - this.dialog_box.style.display = 'none'; - this.moveDialogBox('back'); - $A(this.dialog_box.getElementsByTagName('input')).each(function(e){if(e.type!='submit')e.value=''}); - }, - - selectBoxes: function(what) { - $A(document.getElementsByTagName('select')).each(function(select) { - Element[what](select); - }); - - if(what == 'hide') - $A(this.dialog_box.getElementsByTagName('select')).each(function(select){Element.show(select)}) - } -}); \ No newline at end of file diff --git a/posterita/posterita/web/javascripts/dragdrop.js b/posterita/posterita/web/javascripts/dragdrop.js deleted file mode 100644 index bf429c2616..0000000000 --- a/posterita/posterita/web/javascripts/dragdrop.js +++ /dev/null @@ -1,974 +0,0 @@ -// script.aculo.us dragdrop.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 - -// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -if(Object.isUndefined(Effect)) - throw("dragdrop.js requires including script.aculo.us' effects.js library"); - -var Droppables = { - drops: [], - - remove: function(element) { - this.drops = this.drops.reject(function(d) { return d.element==$(element) }); - }, - - add: function(element) { - element = $(element); - var options = Object.extend({ - greedy: true, - hoverclass: null, - tree: false - }, arguments[1] || { }); - - // cache containers - if(options.containment) { - options._containers = []; - var containment = options.containment; - if(Object.isArray(containment)) { - containment.each( function(c) { options._containers.push($(c)) }); - } else { - options._containers.push($(containment)); - } - } - - if(options.accept) options.accept = [options.accept].flatten(); - - Element.makePositioned(element); // fix IE - options.element = element; - - this.drops.push(options); - }, - - findDeepestChild: function(drops) { - deepest = drops[0]; - - for (i = 1; i < drops.length; ++i) - if (Element.isParent(drops[i].element, deepest.element)) - deepest = drops[i]; - - return deepest; - }, - - isContained: function(element, drop) { - var containmentNode; - if(drop.tree) { - containmentNode = element.treeNode; - } else { - containmentNode = element.parentNode; - } - return drop._containers.detect(function(c) { return containmentNode == c }); - }, - - isAffected: function(point, element, drop) { - return ( - (drop.element!=element) && - ((!drop._containers) || - this.isContained(element, drop)) && - ((!drop.accept) || - (Element.classNames(element).detect( - function(v) { return drop.accept.include(v) } ) )) && - Position.within(drop.element, point[0], point[1]) ); - }, - - deactivate: function(drop) { - if(drop.hoverclass) - Element.removeClassName(drop.element, drop.hoverclass); - this.last_active = null; - }, - - activate: function(drop) { - if(drop.hoverclass) - Element.addClassName(drop.element, drop.hoverclass); - this.last_active = drop; - }, - - show: function(point, element) { - if(!this.drops.length) return; - var drop, affected = []; - - this.drops.each( function(drop) { - if(Droppables.isAffected(point, element, drop)) - affected.push(drop); - }); - - if(affected.length>0) - drop = Droppables.findDeepestChild(affected); - - if(this.last_active && this.last_active != drop) this.deactivate(this.last_active); - if (drop) { - Position.within(drop.element, point[0], point[1]); - if(drop.onHover) - drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); - - if (drop != this.last_active) Droppables.activate(drop); - } - }, - - fire: function(event, element) { - if(!this.last_active) return; - Position.prepare(); - - if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) - if (this.last_active.onDrop) { - this.last_active.onDrop(element, this.last_active.element, event); - return true; - } - }, - - reset: function() { - if(this.last_active) - this.deactivate(this.last_active); - } -} - -var Draggables = { - drags: [], - observers: [], - - register: function(draggable) { - if(this.drags.length == 0) { - this.eventMouseUp = this.endDrag.bindAsEventListener(this); - this.eventMouseMove = this.updateDrag.bindAsEventListener(this); - this.eventKeypress = this.keyPress.bindAsEventListener(this); - - Event.observe(document, "mouseup", this.eventMouseUp); - Event.observe(document, "mousemove", this.eventMouseMove); - Event.observe(document, "keypress", this.eventKeypress); - } - this.drags.push(draggable); - }, - - unregister: function(draggable) { - this.drags = this.drags.reject(function(d) { return d==draggable }); - if(this.drags.length == 0) { - Event.stopObserving(document, "mouseup", this.eventMouseUp); - Event.stopObserving(document, "mousemove", this.eventMouseMove); - Event.stopObserving(document, "keypress", this.eventKeypress); - } - }, - - activate: function(draggable) { - if(draggable.options.delay) { - this._timeout = setTimeout(function() { - Draggables._timeout = null; - window.focus(); - Draggables.activeDraggable = draggable; - }.bind(this), draggable.options.delay); - } else { - window.focus(); // allows keypress events if window isn't currently focused, fails for Safari - this.activeDraggable = draggable; - } - }, - - deactivate: function() { - this.activeDraggable = null; - }, - - updateDrag: function(event) { - if(!this.activeDraggable) return; - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - // Mozilla-based browsers fire successive mousemove events with - // the same coordinates, prevent needless redrawing (moz bug?) - if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; - this._lastPointer = pointer; - - this.activeDraggable.updateDrag(event, pointer); - }, - - endDrag: function(event) { - if(this._timeout) { - clearTimeout(this._timeout); - this._timeout = null; - } - if(!this.activeDraggable) return; - this._lastPointer = null; - this.activeDraggable.endDrag(event); - this.activeDraggable = null; - }, - - keyPress: function(event) { - if(this.activeDraggable) - this.activeDraggable.keyPress(event); - }, - - addObserver: function(observer) { - this.observers.push(observer); - this._cacheObserverCallbacks(); - }, - - removeObserver: function(element) { // element instead of observer fixes mem leaks - this.observers = this.observers.reject( function(o) { return o.element==element }); - this._cacheObserverCallbacks(); - }, - - notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' - if(this[eventName+'Count'] > 0) - this.observers.each( function(o) { - if(o[eventName]) o[eventName](eventName, draggable, event); - }); - if(draggable.options[eventName]) draggable.options[eventName](draggable, event); - }, - - _cacheObserverCallbacks: function() { - ['onStart','onEnd','onDrag'].each( function(eventName) { - Draggables[eventName+'Count'] = Draggables.observers.select( - function(o) { return o[eventName]; } - ).length; - }); - } -} - -/*--------------------------------------------------------------------------*/ - -var Draggable = Class.create({ - initialize: function(element) { - var defaults = { - handle: false, - reverteffect: function(element, top_offset, left_offset) { - var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; - new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, - queue: {scope:'_draggable', position:'end'} - }); - }, - endeffect: function(element) { - var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0; - new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, - queue: {scope:'_draggable', position:'end'}, - afterFinish: function(){ - Draggable._dragging[element] = false - } - }); - }, - zindex: 1000, - revert: false, - quiet: false, - scroll: false, - scrollSensitivity: 20, - scrollSpeed: 15, - snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } - delay: 0 - }; - - if(!arguments[1] || Object.isUndefined(arguments[1].endeffect)) - Object.extend(defaults, { - starteffect: function(element) { - element._opacity = Element.getOpacity(element); - Draggable._dragging[element] = true; - new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); - } - }); - - var options = Object.extend(defaults, arguments[1] || { }); - - this.element = $(element); - - if(options.handle && Object.isString(options.handle)) - this.handle = this.element.down('.'+options.handle, 0); - - if(!this.handle) this.handle = $(options.handle); - if(!this.handle) this.handle = this.element; - - if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { - options.scroll = $(options.scroll); - this._isScrollChild = Element.childOf(this.element, options.scroll); - } - - Element.makePositioned(this.element); // fix IE - - this.options = options; - this.dragging = false; - - this.eventMouseDown = this.initDrag.bindAsEventListener(this); - Event.observe(this.handle, "mousedown", this.eventMouseDown); - - Draggables.register(this); - }, - - destroy: function() { - Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); - Draggables.unregister(this); - }, - - currentDelta: function() { - return([ - parseInt(Element.getStyle(this.element,'left') || '0'), - parseInt(Element.getStyle(this.element,'top') || '0')]); - }, - - initDrag: function(event) { - if(!Object.isUndefined(Draggable._dragging[this.element]) && - Draggable._dragging[this.element]) return; - if(Event.isLeftClick(event)) { - // abort on form elements, fixes a Firefox issue - var src = Event.element(event); - if((tag_name = src.tagName.toUpperCase()) && ( - tag_name=='INPUT' || - tag_name=='SELECT' || - tag_name=='OPTION' || - tag_name=='BUTTON' || - tag_name=='TEXTAREA')) return; - - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - var pos = Position.cumulativeOffset(this.element); - this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); - - Draggables.activate(this); - Event.stop(event); - } - }, - - startDrag: function(event) { - this.dragging = true; - if(!this.delta) - this.delta = this.currentDelta(); - - if(this.options.zindex) { - this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); - this.element.style.zIndex = this.options.zindex; - } - - if(this.options.ghosting) { - this._clone = this.element.cloneNode(true); - this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute'); - if (!this.element._originallyAbsolute) - Position.absolutize(this.element); - this.element.parentNode.insertBefore(this._clone, this.element); - } - - if(this.options.scroll) { - if (this.options.scroll == window) { - var where = this._getWindowScroll(this.options.scroll); - this.originalScrollLeft = where.left; - this.originalScrollTop = where.top; - } else { - this.originalScrollLeft = this.options.scroll.scrollLeft; - this.originalScrollTop = this.options.scroll.scrollTop; - } - } - - Draggables.notify('onStart', this, event); - - if(this.options.starteffect) this.options.starteffect(this.element); - }, - - updateDrag: function(event, pointer) { - if(!this.dragging) this.startDrag(event); - - if(!this.options.quiet){ - Position.prepare(); - Droppables.show(pointer, this.element); - } - - Draggables.notify('onDrag', this, event); - - this.draw(pointer); - if(this.options.change) this.options.change(this); - - if(this.options.scroll) { - this.stopScrolling(); - - var p; - if (this.options.scroll == window) { - with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } - } else { - p = Position.page(this.options.scroll); - p[0] += this.options.scroll.scrollLeft + Position.deltaX; - p[1] += this.options.scroll.scrollTop + Position.deltaY; - p.push(p[0]+this.options.scroll.offsetWidth); - p.push(p[1]+this.options.scroll.offsetHeight); - } - var speed = [0,0]; - if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); - if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); - if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); - if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); - this.startScrolling(speed); - } - - // fix AppleWebKit rendering - if(Prototype.Browser.WebKit) window.scrollBy(0,0); - - Event.stop(event); - }, - - finishDrag: function(event, success) { - this.dragging = false; - - if(this.options.quiet){ - Position.prepare(); - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - Droppables.show(pointer, this.element); - } - - if(this.options.ghosting) { - if (!this.element._originallyAbsolute) - Position.relativize(this.element); - delete this.element._originallyAbsolute; - Element.remove(this._clone); - this._clone = null; - } - - var dropped = false; - if(success) { - dropped = Droppables.fire(event, this.element); - if (!dropped) dropped = false; - } - if(dropped && this.options.onDropped) this.options.onDropped(this.element); - Draggables.notify('onEnd', this, event); - - var revert = this.options.revert; - if(revert && Object.isFunction(revert)) revert = revert(this.element); - - var d = this.currentDelta(); - if(revert && this.options.reverteffect) { - if (dropped == 0 || revert != 'failure') - this.options.reverteffect(this.element, - d[1]-this.delta[1], d[0]-this.delta[0]); - } else { - this.delta = d; - } - - if(this.options.zindex) - this.element.style.zIndex = this.originalZ; - - if(this.options.endeffect) - this.options.endeffect(this.element); - - Draggables.deactivate(this); - Droppables.reset(); - }, - - keyPress: function(event) { - if(event.keyCode!=Event.KEY_ESC) return; - this.finishDrag(event, false); - Event.stop(event); - }, - - endDrag: function(event) { - if(!this.dragging) return; - this.stopScrolling(); - this.finishDrag(event, true); - Event.stop(event); - }, - - draw: function(point) { - var pos = Position.cumulativeOffset(this.element); - if(this.options.ghosting) { - var r = Position.realOffset(this.element); - pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; - } - - var d = this.currentDelta(); - pos[0] -= d[0]; pos[1] -= d[1]; - - if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { - pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; - pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; - } - - var p = [0,1].map(function(i){ - return (point[i]-pos[i]-this.offset[i]) - }.bind(this)); - - if(this.options.snap) { - if(Object.isFunction(this.options.snap)) { - p = this.options.snap(p[0],p[1],this); - } else { - if(Object.isArray(this.options.snap)) { - p = p.map( function(v, i) { - return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this)) - } else { - p = p.map( function(v) { - return (v/this.options.snap).round()*this.options.snap }.bind(this)) - } - }} - - var style = this.element.style; - if((!this.options.constraint) || (this.options.constraint=='horizontal')) - style.left = p[0] + "px"; - if((!this.options.constraint) || (this.options.constraint=='vertical')) - style.top = p[1] + "px"; - - if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering - }, - - stopScrolling: function() { - if(this.scrollInterval) { - clearInterval(this.scrollInterval); - this.scrollInterval = null; - Draggables._lastScrollPointer = null; - } - }, - - startScrolling: function(speed) { - if(!(speed[0] || speed[1])) return; - this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; - this.lastScrolled = new Date(); - this.scrollInterval = setInterval(this.scroll.bind(this), 10); - }, - - scroll: function() { - var current = new Date(); - var delta = current - this.lastScrolled; - this.lastScrolled = current; - if(this.options.scroll == window) { - with (this._getWindowScroll(this.options.scroll)) { - if (this.scrollSpeed[0] || this.scrollSpeed[1]) { - var d = delta / 1000; - this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); - } - } - } else { - this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; - this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; - } - - Position.prepare(); - Droppables.show(Draggables._lastPointer, this.element); - Draggables.notify('onDrag', this); - if (this._isScrollChild) { - Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); - Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; - Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; - if (Draggables._lastScrollPointer[0] < 0) - Draggables._lastScrollPointer[0] = 0; - if (Draggables._lastScrollPointer[1] < 0) - Draggables._lastScrollPointer[1] = 0; - this.draw(Draggables._lastScrollPointer); - } - - if(this.options.change) this.options.change(this); - }, - - _getWindowScroll: function(w) { - var T, L, W, H; - with (w.document) { - if (w.document.documentElement && documentElement.scrollTop) { - T = documentElement.scrollTop; - L = documentElement.scrollLeft; - } else if (w.document.body) { - T = body.scrollTop; - L = body.scrollLeft; - } - if (w.innerWidth) { - W = w.innerWidth; - H = w.innerHeight; - } else if (w.document.documentElement && documentElement.clientWidth) { - W = documentElement.clientWidth; - H = documentElement.clientHeight; - } else { - W = body.offsetWidth; - H = body.offsetHeight - } - } - return { top: T, left: L, width: W, height: H }; - } -}); - -Draggable._dragging = { }; - -/*--------------------------------------------------------------------------*/ - -var SortableObserver = Class.create({ - initialize: function(element, observer) { - this.element = $(element); - this.observer = observer; - this.lastValue = Sortable.serialize(this.element); - }, - - onStart: function() { - this.lastValue = Sortable.serialize(this.element); - }, - - onEnd: function() { - Sortable.unmark(); - if(this.lastValue != Sortable.serialize(this.element)) - this.observer(this.element) - } -}); - -var Sortable = { - SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, - - sortables: { }, - - _findRootElement: function(element) { - while (element.tagName.toUpperCase() != "BODY") { - if(element.id && Sortable.sortables[element.id]) return element; - element = element.parentNode; - } - }, - - options: function(element) { - element = Sortable._findRootElement($(element)); - if(!element) return; - return Sortable.sortables[element.id]; - }, - - destroy: function(element){ - var s = Sortable.options(element); - - if(s) { - Draggables.removeObserver(s.element); - s.droppables.each(function(d){ Droppables.remove(d) }); - s.draggables.invoke('destroy'); - - delete Sortable.sortables[s.element.id]; - } - }, - - create: function(element) { - element = $(element); - var options = Object.extend({ - element: element, - tag: 'li', // assumes li children, override with tag: 'tagname' - dropOnEmpty: false, - tree: false, - treeTag: 'ul', - overlap: 'vertical', // one of 'vertical', 'horizontal' - constraint: 'vertical', // one of 'vertical', 'horizontal', false - containment: element, // also takes array of elements (or id's); or false - handle: false, // or a CSS class - only: false, - delay: 0, - hoverclass: null, - ghosting: false, - quiet: false, - scroll: false, - scrollSensitivity: 20, - scrollSpeed: 15, - format: this.SERIALIZE_RULE, - - // these take arrays of elements or ids and can be - // used for better initialization performance - elements: false, - handles: false, - - onChange: Prototype.emptyFunction, - onUpdate: Prototype.emptyFunction - }, arguments[1] || { }); - - // clear any old sortable with same element - this.destroy(element); - - // build options for the draggables - var options_for_draggable = { - revert: true, - quiet: options.quiet, - scroll: options.scroll, - scrollSpeed: options.scrollSpeed, - scrollSensitivity: options.scrollSensitivity, - delay: options.delay, - ghosting: options.ghosting, - constraint: options.constraint, - handle: options.handle }; - - if(options.starteffect) - options_for_draggable.starteffect = options.starteffect; - - if(options.reverteffect) - options_for_draggable.reverteffect = options.reverteffect; - else - if(options.ghosting) options_for_draggable.reverteffect = function(element) { - element.style.top = 0; - element.style.left = 0; - }; - - if(options.endeffect) - options_for_draggable.endeffect = options.endeffect; - - if(options.zindex) - options_for_draggable.zindex = options.zindex; - - // build options for the droppables - var options_for_droppable = { - overlap: options.overlap, - containment: options.containment, - tree: options.tree, - hoverclass: options.hoverclass, - onHover: Sortable.onHover - } - - var options_for_tree = { - onHover: Sortable.onEmptyHover, - overlap: options.overlap, - containment: options.containment, - hoverclass: options.hoverclass - } - - // fix for gecko engine - Element.cleanWhitespace(element); - - options.draggables = []; - options.droppables = []; - - // drop on empty handling - if(options.dropOnEmpty || options.tree) { - Droppables.add(element, options_for_tree); - options.droppables.push(element); - } - - (options.elements || this.findElements(element, options) || []).each( function(e,i) { - var handle = options.handles ? $(options.handles[i]) : - (options.handle ? $(e).select('.' + options.handle)[0] : e); - options.draggables.push( - new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); - Droppables.add(e, options_for_droppable); - if(options.tree) e.treeNode = element; - options.droppables.push(e); - }); - - if(options.tree) { - (Sortable.findTreeElements(element, options) || []).each( function(e) { - Droppables.add(e, options_for_tree); - e.treeNode = element; - options.droppables.push(e); - }); - } - - // keep reference - this.sortables[element.id] = options; - - // for onupdate - Draggables.addObserver(new SortableObserver(element, options.onUpdate)); - - }, - - // return all suitable-for-sortable elements in a guaranteed order - findElements: function(element, options) { - return Element.findChildren( - element, options.only, options.tree ? true : false, options.tag); - }, - - findTreeElements: function(element, options) { - return Element.findChildren( - element, options.only, options.tree ? true : false, options.treeTag); - }, - - onHover: function(element, dropon, overlap) { - if(Element.isParent(dropon, element)) return; - - if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { - return; - } else if(overlap>0.5) { - Sortable.mark(dropon, 'before'); - if(dropon.previousSibling != element) { - var oldParentNode = element.parentNode; - element.style.visibility = "hidden"; // fix gecko rendering - dropon.parentNode.insertBefore(element, dropon); - if(dropon.parentNode!=oldParentNode) - Sortable.options(oldParentNode).onChange(element); - Sortable.options(dropon.parentNode).onChange(element); - } - } else { - Sortable.mark(dropon, 'after'); - var nextElement = dropon.nextSibling || null; - if(nextElement != element) { - var oldParentNode = element.parentNode; - element.style.visibility = "hidden"; // fix gecko rendering - dropon.parentNode.insertBefore(element, nextElement); - if(dropon.parentNode!=oldParentNode) - Sortable.options(oldParentNode).onChange(element); - Sortable.options(dropon.parentNode).onChange(element); - } - } - }, - - onEmptyHover: function(element, dropon, overlap) { - var oldParentNode = element.parentNode; - var droponOptions = Sortable.options(dropon); - - if(!Element.isParent(dropon, element)) { - var index; - - var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); - var child = null; - - if(children) { - var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); - - for (index = 0; index < children.length; index += 1) { - if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { - offset -= Element.offsetSize (children[index], droponOptions.overlap); - } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { - child = index + 1 < children.length ? children[index + 1] : null; - break; - } else { - child = children[index]; - break; - } - } - } - - dropon.insertBefore(element, child); - - Sortable.options(oldParentNode).onChange(element); - droponOptions.onChange(element); - } - }, - - unmark: function() { - if(Sortable._marker) Sortable._marker.hide(); - }, - - mark: function(dropon, position) { - // mark on ghosting only - var sortable = Sortable.options(dropon.parentNode); - if(sortable && !sortable.ghosting) return; - - if(!Sortable._marker) { - Sortable._marker = - ($('dropmarker') || Element.extend(document.createElement('DIV'))). - hide().addClassName('dropmarker').setStyle({position:'absolute'}); - document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); - } - var offsets = Position.cumulativeOffset(dropon); - Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); - - if(position=='after') - if(sortable.overlap == 'horizontal') - Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); - else - Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); - - Sortable._marker.show(); - }, - - _tree: function(element, options, parent) { - var children = Sortable.findElements(element, options) || []; - - for (var i = 0; i < children.length; ++i) { - var match = children[i].id.match(options.format); - - if (!match) continue; - - var child = { - id: encodeURIComponent(match ? match[1] : null), - element: element, - parent: parent, - children: [], - position: parent.children.length, - container: $(children[i]).down(options.treeTag) - } - - /* Get the element containing the children and recurse over it */ - if (child.container) - this._tree(child.container, options, child) - - parent.children.push (child); - } - - return parent; - }, - - tree: function(element) { - element = $(element); - var sortableOptions = this.options(element); - var options = Object.extend({ - tag: sortableOptions.tag, - treeTag: sortableOptions.treeTag, - only: sortableOptions.only, - name: element.id, - format: sortableOptions.format - }, arguments[1] || { }); - - var root = { - id: null, - parent: null, - children: [], - container: element, - position: 0 - } - - return Sortable._tree(element, options, root); - }, - - /* Construct a [i] index for a particular node */ - _constructIndex: function(node) { - var index = ''; - do { - if (node.id) index = '[' + node.position + ']' + index; - } while ((node = node.parent) != null); - return index; - }, - - sequence: function(element) { - element = $(element); - var options = Object.extend(this.options(element), arguments[1] || { }); - - return $(this.findElements(element, options) || []).map( function(item) { - return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; - }); - }, - - setSequence: function(element, new_sequence) { - element = $(element); - var options = Object.extend(this.options(element), arguments[2] || { }); - - var nodeMap = { }; - this.findElements(element, options).each( function(n) { - if (n.id.match(options.format)) - nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; - n.parentNode.removeChild(n); - }); - - new_sequence.each(function(ident) { - var n = nodeMap[ident]; - if (n) { - n[1].appendChild(n[0]); - delete nodeMap[ident]; - } - }); - }, - - serialize: function(element) { - element = $(element); - var options = Object.extend(Sortable.options(element), arguments[1] || { }); - var name = encodeURIComponent( - (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); - - if (options.tree) { - return Sortable.tree(element, arguments[1]).children.map( function (item) { - return [name + Sortable._constructIndex(item) + "[id]=" + - encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); - }).flatten().join('&'); - } else { - return Sortable.sequence(element, arguments[1]).map( function(item) { - return name + "[]=" + encodeURIComponent(item); - }).join('&'); - } - } -} - -// Returns true if child is contained within element -Element.isParent = function(child, element) { - if (!child.parentNode || child == element) return false; - if (child.parentNode == element) return true; - return Element.isParent(child.parentNode, element); -} - -Element.findChildren = function(element, only, recursive, tagName) { - if(!element.hasChildNodes()) return null; - tagName = tagName.toUpperCase(); - if(only) only = [only].flatten(); - var elements = []; - $A(element.childNodes).each( function(e) { - if(e.tagName && e.tagName.toUpperCase()==tagName && - (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) - elements.push(e); - if(recursive) { - var grandchildren = Element.findChildren(e, only, recursive, tagName); - if(grandchildren) elements.push(grandchildren); - } - }); - - return (elements.length>0 ? elements.flatten() : []); -} - -Element.offsetSize = function (element, type) { - return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; -} diff --git a/posterita/posterita/web/javascripts/effects.js b/posterita/posterita/web/javascripts/effects.js deleted file mode 100644 index b8c0259f55..0000000000 --- a/posterita/posterita/web/javascripts/effects.js +++ /dev/null @@ -1,1122 +0,0 @@ -// script.aculo.us effects.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 - -// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// Contributors: -// Justin Palmer (http://encytemedia.com/) -// Mark Pilgrim (http://diveintomark.org/) -// Martin Bialasinki -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -// converts rgb() and #xxx to #xxxxxx format, -// returns self (or first argument) if not convertable -String.prototype.parseColor = function() { - var color = '#'; - if (this.slice(0,4) == 'rgb(') { - var cols = this.slice(4,this.length-1).split(','); - var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); - } else { - if (this.slice(0,1) == '#') { - if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); - if (this.length==7) color = this.toLowerCase(); - } - } - return (color.length==7 ? color : (arguments[0] || this)); -}; - -/*--------------------------------------------------------------------------*/ - -Element.collectTextNodes = function(element) { - return $A($(element).childNodes).collect( function(node) { - return (node.nodeType==3 ? node.nodeValue : - (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); - }).flatten().join(''); -}; - -Element.collectTextNodesIgnoreClass = function(element, className) { - return $A($(element).childNodes).collect( function(node) { - return (node.nodeType==3 ? node.nodeValue : - ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? - Element.collectTextNodesIgnoreClass(node, className) : '')); - }).flatten().join(''); -}; - -Element.setContentZoom = function(element, percent) { - element = $(element); - element.setStyle({fontSize: (percent/100) + 'em'}); - if (Prototype.Browser.WebKit) window.scrollBy(0,0); - return element; -}; - -Element.getInlineOpacity = function(element){ - return $(element).style.opacity || ''; -}; - -Element.forceRerendering = function(element) { - try { - element = $(element); - var n = document.createTextNode(' '); - element.appendChild(n); - element.removeChild(n); - } catch(e) { } -}; - -/*--------------------------------------------------------------------------*/ - -var Effect = { - _elementDoesNotExistError: { - name: 'ElementDoesNotExistError', - message: 'The specified DOM element does not exist, but is required for this effect to operate' - }, - Transitions: { - linear: Prototype.K, - sinoidal: function(pos) { - return (-Math.cos(pos*Math.PI)/2) + 0.5; - }, - reverse: function(pos) { - return 1-pos; - }, - flicker: function(pos) { - var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; - return pos > 1 ? 1 : pos; - }, - wobble: function(pos) { - return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; - }, - pulse: function(pos, pulses) { - pulses = pulses || 5; - return ( - ((pos % (1/pulses)) * pulses).round() == 0 ? - ((pos * pulses * 2) - (pos * pulses * 2).floor()) : - 1 - ((pos * pulses * 2) - (pos * pulses * 2).floor()) - ); - }, - spring: function(pos) { - return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); - }, - none: function(pos) { - return 0; - }, - full: function(pos) { - return 1; - } - }, - DefaultOptions: { - duration: 1.0, // seconds - fps: 100, // 100= assume 66fps max. - sync: false, // true for combining - from: 0.0, - to: 1.0, - delay: 0.0, - queue: 'parallel' - }, - tagifyText: function(element) { - var tagifyStyle = 'position:relative'; - if (Prototype.Browser.IE) tagifyStyle += ';zoom:1'; - - element = $(element); - $A(element.childNodes).each( function(child) { - if (child.nodeType==3) { - child.nodeValue.toArray().each( function(character) { - element.insertBefore( - new Element('span', {style: tagifyStyle}).update( - character == ' ' ? String.fromCharCode(160) : character), - child); - }); - Element.remove(child); - } - }); - }, - multiple: function(element, effect) { - var elements; - if (((typeof element == 'object') || - Object.isFunction(element)) && - (element.length)) - elements = element; - else - elements = $(element).childNodes; - - var options = Object.extend({ - speed: 0.1, - delay: 0.0 - }, arguments[2] || { }); - var masterDelay = options.delay; - - $A(elements).each( function(element, index) { - new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); - }); - }, - PAIRS: { - 'slide': ['SlideDown','SlideUp'], - 'blind': ['BlindDown','BlindUp'], - 'appear': ['Appear','Fade'] - }, - toggle: function(element, effect) { - element = $(element); - effect = (effect || 'appear').toLowerCase(); - var options = Object.extend({ - queue: { position:'end', scope:(element.id || 'global'), limit: 1 } - }, arguments[2] || { }); - Effect[element.visible() ? - Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); - } -}; - -Effect.DefaultOptions.transition = Effect.Transitions.sinoidal; - -/* ------------- core effects ------------- */ - -Effect.ScopedQueue = Class.create(Enumerable, { - initialize: function() { - this.effects = []; - this.interval = null; - }, - _each: function(iterator) { - this.effects._each(iterator); - }, - add: function(effect) { - var timestamp = new Date().getTime(); - - var position = Object.isString(effect.options.queue) ? - effect.options.queue : effect.options.queue.position; - - switch(position) { - case 'front': - // move unstarted effects after this effect - this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { - e.startOn += effect.finishOn; - e.finishOn += effect.finishOn; - }); - break; - case 'with-last': - timestamp = this.effects.pluck('startOn').max() || timestamp; - break; - case 'end': - // start effect after last queued effect has finished - timestamp = this.effects.pluck('finishOn').max() || timestamp; - break; - } - - effect.startOn += timestamp; - effect.finishOn += timestamp; - - if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) - this.effects.push(effect); - - if (!this.interval) - this.interval = setInterval(this.loop.bind(this), 15); - }, - remove: function(effect) { - this.effects = this.effects.reject(function(e) { return e==effect }); - if (this.effects.length == 0) { - clearInterval(this.interval); - this.interval = null; - } - }, - loop: function() { - var timePos = new Date().getTime(); - for(var i=0, len=this.effects.length;i= this.startOn) { - if (timePos >= this.finishOn) { - this.render(1.0); - this.cancel(); - this.event('beforeFinish'); - if (this.finish) this.finish(); - this.event('afterFinish'); - return; - } - var pos = (timePos - this.startOn) / this.totalTime, - frame = (pos * this.totalFrames).round(); - if (frame > this.currentFrame) { - this.render(pos); - this.currentFrame = frame; - } - } - }, - cancel: function() { - if (!this.options.sync) - Effect.Queues.get(Object.isString(this.options.queue) ? - 'global' : this.options.queue.scope).remove(this); - this.state = 'finished'; - }, - event: function(eventName) { - if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); - if (this.options[eventName]) this.options[eventName](this); - }, - inspect: function() { - var data = $H(); - for(property in this) - if (!Object.isFunction(this[property])) data.set(property, this[property]); - return '#'; - } -}); - -Effect.Parallel = Class.create(Effect.Base, { - initialize: function(effects) { - this.effects = effects || []; - this.start(arguments[1]); - }, - update: function(position) { - this.effects.invoke('render', position); - }, - finish: function(position) { - this.effects.each( function(effect) { - effect.render(1.0); - effect.cancel(); - effect.event('beforeFinish'); - if (effect.finish) effect.finish(position); - effect.event('afterFinish'); - }); - } -}); - -Effect.Tween = Class.create(Effect.Base, { - initialize: function(object, from, to) { - object = Object.isString(object) ? $(object) : object; - var args = $A(arguments), method = args.last(), - options = args.length == 5 ? args[3] : null; - this.method = Object.isFunction(method) ? method.bind(object) : - Object.isFunction(object[method]) ? object[method].bind(object) : - function(value) { object[method] = value }; - this.start(Object.extend({ from: from, to: to }, options || { })); - }, - update: function(position) { - this.method(position); - } -}); - -Effect.Event = Class.create(Effect.Base, { - initialize: function() { - this.start(Object.extend({ duration: 0 }, arguments[0] || { })); - }, - update: Prototype.emptyFunction -}); - -Effect.Opacity = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - // make this work on IE on elements without 'layout' - if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) - this.element.setStyle({zoom: 1}); - var options = Object.extend({ - from: this.element.getOpacity() || 0.0, - to: 1.0 - }, arguments[1] || { }); - this.start(options); - }, - update: function(position) { - this.element.setOpacity(position); - } -}); - -Effect.Move = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - x: 0, - y: 0, - mode: 'relative' - }, arguments[1] || { }); - this.start(options); - }, - setup: function() { - this.element.makePositioned(); - this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); - this.originalTop = parseFloat(this.element.getStyle('top') || '0'); - if (this.options.mode == 'absolute') { - this.options.x = this.options.x - this.originalLeft; - this.options.y = this.options.y - this.originalTop; - } - }, - update: function(position) { - this.element.setStyle({ - left: (this.options.x * position + this.originalLeft).round() + 'px', - top: (this.options.y * position + this.originalTop).round() + 'px' - }); - } -}); - -// for backwards compatibility -Effect.MoveBy = function(element, toTop, toLeft) { - return new Effect.Move(element, - Object.extend({ x: toLeft, y: toTop }, arguments[3] || { })); -}; - -Effect.Scale = Class.create(Effect.Base, { - initialize: function(element, percent) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - scaleX: true, - scaleY: true, - scaleContent: true, - scaleFromCenter: false, - scaleMode: 'box', // 'box' or 'contents' or { } with provided values - scaleFrom: 100.0, - scaleTo: percent - }, arguments[2] || { }); - this.start(options); - }, - setup: function() { - this.restoreAfterFinish = this.options.restoreAfterFinish || false; - this.elementPositioning = this.element.getStyle('position'); - - this.originalStyle = { }; - ['top','left','width','height','fontSize'].each( function(k) { - this.originalStyle[k] = this.element.style[k]; - }.bind(this)); - - this.originalTop = this.element.offsetTop; - this.originalLeft = this.element.offsetLeft; - - var fontSize = this.element.getStyle('font-size') || '100%'; - ['em','px','%','pt'].each( function(fontSizeType) { - if (fontSize.indexOf(fontSizeType)>0) { - this.fontSize = parseFloat(fontSize); - this.fontSizeType = fontSizeType; - } - }.bind(this)); - - this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; - - this.dims = null; - if (this.options.scaleMode=='box') - this.dims = [this.element.offsetHeight, this.element.offsetWidth]; - if (/^content/.test(this.options.scaleMode)) - this.dims = [this.element.scrollHeight, this.element.scrollWidth]; - if (!this.dims) - this.dims = [this.options.scaleMode.originalHeight, - this.options.scaleMode.originalWidth]; - }, - update: function(position) { - var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); - if (this.options.scaleContent && this.fontSize) - this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); - this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); - }, - finish: function(position) { - if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle); - }, - setDimensions: function(height, width) { - var d = { }; - if (this.options.scaleX) d.width = width.round() + 'px'; - if (this.options.scaleY) d.height = height.round() + 'px'; - if (this.options.scaleFromCenter) { - var topd = (height - this.dims[0])/2; - var leftd = (width - this.dims[1])/2; - if (this.elementPositioning == 'absolute') { - if (this.options.scaleY) d.top = this.originalTop-topd + 'px'; - if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; - } else { - if (this.options.scaleY) d.top = -topd + 'px'; - if (this.options.scaleX) d.left = -leftd + 'px'; - } - } - this.element.setStyle(d); - } -}); - -Effect.Highlight = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { }); - this.start(options); - }, - setup: function() { - // Prevent executing on elements not in the layout flow - if (this.element.getStyle('display')=='none') { this.cancel(); return; } - // Disable background image during the effect - this.oldStyle = { }; - if (!this.options.keepBackgroundImage) { - this.oldStyle.backgroundImage = this.element.getStyle('background-image'); - this.element.setStyle({backgroundImage: 'none'}); - } - if (!this.options.endcolor) - this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); - if (!this.options.restorecolor) - this.options.restorecolor = this.element.getStyle('background-color'); - // init color calculations - this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); - this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); - }, - update: function(position) { - this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ - return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) }); - }, - finish: function() { - this.element.setStyle(Object.extend(this.oldStyle, { - backgroundColor: this.options.restorecolor - })); - } -}); - -Effect.ScrollTo = function(element) { - var options = arguments[1] || { }, - scrollOffsets = document.viewport.getScrollOffsets(), - elementOffsets = $(element).cumulativeOffset(), - max = (window.height || document.body.scrollHeight) - document.viewport.getHeight(); - - if (options.offset) elementOffsets[1] += options.offset; - - return new Effect.Tween(null, - scrollOffsets.top, - elementOffsets[1] > max ? max : elementOffsets[1], - options, - function(p){ scrollTo(scrollOffsets.left, p.round()) } - ); -}; - -/* ------------- combination effects ------------- */ - -Effect.Fade = function(element) { - element = $(element); - var oldOpacity = element.getInlineOpacity(); - var options = Object.extend({ - from: element.getOpacity() || 1.0, - to: 0.0, - afterFinishInternal: function(effect) { - if (effect.options.to!=0) return; - effect.element.hide().setStyle({opacity: oldOpacity}); - } - }, arguments[1] || { }); - return new Effect.Opacity(element,options); -}; - -Effect.Appear = function(element) { - element = $(element); - var options = Object.extend({ - from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), - to: 1.0, - // force Safari to render floated elements properly - afterFinishInternal: function(effect) { - effect.element.forceRerendering(); - }, - beforeSetup: function(effect) { - effect.element.setOpacity(effect.options.from).show(); - }}, arguments[1] || { }); - return new Effect.Opacity(element,options); -}; - -Effect.Puff = function(element) { - element = $(element); - var oldStyle = { - opacity: element.getInlineOpacity(), - position: element.getStyle('position'), - top: element.style.top, - left: element.style.left, - width: element.style.width, - height: element.style.height - }; - return new Effect.Parallel( - [ new Effect.Scale(element, 200, - { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), - new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], - Object.extend({ duration: 1.0, - beforeSetupInternal: function(effect) { - Position.absolutize(effect.effects[0].element) - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().setStyle(oldStyle); } - }, arguments[1] || { }) - ); -}; - -Effect.BlindUp = function(element) { - element = $(element); - element.makeClipping(); - return new Effect.Scale(element, 0, - Object.extend({ scaleContent: false, - scaleX: false, - restoreAfterFinish: true, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping(); - } - }, arguments[1] || { }) - ); -}; - -Effect.BlindDown = function(element) { - element = $(element); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, 100, Object.extend({ - scaleContent: false, - scaleX: false, - scaleFrom: 0, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makeClipping().setStyle({height: '0px'}).show(); - }, - afterFinishInternal: function(effect) { - effect.element.undoClipping(); - } - }, arguments[1] || { })); -}; - -Effect.SwitchOff = function(element) { - element = $(element); - var oldOpacity = element.getInlineOpacity(); - return new Effect.Appear(element, Object.extend({ - duration: 0.4, - from: 0, - transition: Effect.Transitions.flicker, - afterFinishInternal: function(effect) { - new Effect.Scale(effect.element, 1, { - duration: 0.3, scaleFromCenter: true, - scaleX: false, scaleContent: false, restoreAfterFinish: true, - beforeSetup: function(effect) { - effect.element.makePositioned().makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); - } - }) - } - }, arguments[1] || { })); -}; - -Effect.DropOut = function(element) { - element = $(element); - var oldStyle = { - top: element.getStyle('top'), - left: element.getStyle('left'), - opacity: element.getInlineOpacity() }; - return new Effect.Parallel( - [ new Effect.Move(element, {x: 0, y: 100, sync: true }), - new Effect.Opacity(element, { sync: true, to: 0.0 }) ], - Object.extend( - { duration: 0.5, - beforeSetup: function(effect) { - effect.effects[0].element.makePositioned(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); - } - }, arguments[1] || { })); -}; - -Effect.Shake = function(element) { - element = $(element); - var options = Object.extend({ - distance: 20, - duration: 0.5 - }, arguments[1] || {}); - var distance = parseFloat(options.distance); - var split = parseFloat(options.duration) / 10.0; - var oldStyle = { - top: element.getStyle('top'), - left: element.getStyle('left') }; - return new Effect.Move(element, - { x: distance, y: 0, duration: split, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) { - effect.element.undoPositioned().setStyle(oldStyle); - }}) }}) }}) }}) }}) }}); -}; - -Effect.SlideDown = function(element) { - element = $(element).cleanWhitespace(); - // SlideDown need to have the content of the element wrapped in a container element with fixed height! - var oldInnerBottom = element.down().getStyle('bottom'); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, 100, Object.extend({ - scaleContent: false, - scaleX: false, - scaleFrom: window.opera ? 0 : 1, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makePositioned(); - effect.element.down().makePositioned(); - if (window.opera) effect.element.setStyle({top: ''}); - effect.element.makeClipping().setStyle({height: '0px'}).show(); - }, - afterUpdateInternal: function(effect) { - effect.element.down().setStyle({bottom: - (effect.dims[0] - effect.element.clientHeight) + 'px' }); - }, - afterFinishInternal: function(effect) { - effect.element.undoClipping().undoPositioned(); - effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } - }, arguments[1] || { }) - ); -}; - -Effect.SlideUp = function(element) { - element = $(element).cleanWhitespace(); - var oldInnerBottom = element.down().getStyle('bottom'); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, window.opera ? 0 : 1, - Object.extend({ scaleContent: false, - scaleX: false, - scaleMode: 'box', - scaleFrom: 100, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makePositioned(); - effect.element.down().makePositioned(); - if (window.opera) effect.element.setStyle({top: ''}); - effect.element.makeClipping().show(); - }, - afterUpdateInternal: function(effect) { - effect.element.down().setStyle({bottom: - (effect.dims[0] - effect.element.clientHeight) + 'px' }); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().undoPositioned(); - effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); - } - }, arguments[1] || { }) - ); -}; - -// Bug in opera makes the TD containing this element expand for a instance after finish -Effect.Squish = function(element) { - return new Effect.Scale(element, window.opera ? 1 : 0, { - restoreAfterFinish: true, - beforeSetup: function(effect) { - effect.element.makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping(); - } - }); -}; - -Effect.Grow = function(element) { - element = $(element); - var options = Object.extend({ - direction: 'center', - moveTransition: Effect.Transitions.sinoidal, - scaleTransition: Effect.Transitions.sinoidal, - opacityTransition: Effect.Transitions.full - }, arguments[1] || { }); - var oldStyle = { - top: element.style.top, - left: element.style.left, - height: element.style.height, - width: element.style.width, - opacity: element.getInlineOpacity() }; - - var dims = element.getDimensions(); - var initialMoveX, initialMoveY; - var moveX, moveY; - - switch (options.direction) { - case 'top-left': - initialMoveX = initialMoveY = moveX = moveY = 0; - break; - case 'top-right': - initialMoveX = dims.width; - initialMoveY = moveY = 0; - moveX = -dims.width; - break; - case 'bottom-left': - initialMoveX = moveX = 0; - initialMoveY = dims.height; - moveY = -dims.height; - break; - case 'bottom-right': - initialMoveX = dims.width; - initialMoveY = dims.height; - moveX = -dims.width; - moveY = -dims.height; - break; - case 'center': - initialMoveX = dims.width / 2; - initialMoveY = dims.height / 2; - moveX = -dims.width / 2; - moveY = -dims.height / 2; - break; - } - - return new Effect.Move(element, { - x: initialMoveX, - y: initialMoveY, - duration: 0.01, - beforeSetup: function(effect) { - effect.element.hide().makeClipping().makePositioned(); - }, - afterFinishInternal: function(effect) { - new Effect.Parallel( - [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), - new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), - new Effect.Scale(effect.element, 100, { - scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, - sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) - ], Object.extend({ - beforeSetup: function(effect) { - effect.effects[0].element.setStyle({height: '0px'}).show(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); - } - }, options) - ) - } - }); -}; - -Effect.Shrink = function(element) { - element = $(element); - var options = Object.extend({ - direction: 'center', - moveTransition: Effect.Transitions.sinoidal, - scaleTransition: Effect.Transitions.sinoidal, - opacityTransition: Effect.Transitions.none - }, arguments[1] || { }); - var oldStyle = { - top: element.style.top, - left: element.style.left, - height: element.style.height, - width: element.style.width, - opacity: element.getInlineOpacity() }; - - var dims = element.getDimensions(); - var moveX, moveY; - - switch (options.direction) { - case 'top-left': - moveX = moveY = 0; - break; - case 'top-right': - moveX = dims.width; - moveY = 0; - break; - case 'bottom-left': - moveX = 0; - moveY = dims.height; - break; - case 'bottom-right': - moveX = dims.width; - moveY = dims.height; - break; - case 'center': - moveX = dims.width / 2; - moveY = dims.height / 2; - break; - } - - return new Effect.Parallel( - [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), - new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), - new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) - ], Object.extend({ - beforeStartInternal: function(effect) { - effect.effects[0].element.makePositioned().makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } - }, options) - ); -}; - -Effect.Pulsate = function(element) { - element = $(element); - var options = arguments[1] || { }; - var oldOpacity = element.getInlineOpacity(); - var transition = options.transition || Effect.Transitions.sinoidal; - var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) }; - reverser.bind(transition); - return new Effect.Opacity(element, - Object.extend(Object.extend({ duration: 2.0, from: 0, - afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } - }, options), {transition: reverser})); -}; - -Effect.Fold = function(element) { - element = $(element); - var oldStyle = { - top: element.style.top, - left: element.style.left, - width: element.style.width, - height: element.style.height }; - element.makeClipping(); - return new Effect.Scale(element, 5, Object.extend({ - scaleContent: false, - scaleX: false, - afterFinishInternal: function(effect) { - new Effect.Scale(element, 1, { - scaleContent: false, - scaleY: false, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().setStyle(oldStyle); - } }); - }}, arguments[1] || { })); -}; - -Effect.Morph = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - style: { } - }, arguments[1] || { }); - - if (!Object.isString(options.style)) this.style = $H(options.style); - else { - if (options.style.include(':')) - this.style = options.style.parseStyle(); - else { - this.element.addClassName(options.style); - this.style = $H(this.element.getStyles()); - this.element.removeClassName(options.style); - var css = this.element.getStyles(); - this.style = this.style.reject(function(style) { - return style.value == css[style.key]; - }); - options.afterFinishInternal = function(effect) { - effect.element.addClassName(effect.options.style); - effect.transforms.each(function(transform) { - effect.element.style[transform.style] = ''; - }); - } - } - } - this.start(options); - }, - - setup: function(){ - function parseColor(color){ - if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; - color = color.parseColor(); - return $R(0,2).map(function(i){ - return parseInt( color.slice(i*2+1,i*2+3), 16 ) - }); - } - this.transforms = this.style.map(function(pair){ - var property = pair[0], value = pair[1], unit = null; - - if (value.parseColor('#zzzzzz') != '#zzzzzz') { - value = value.parseColor(); - unit = 'color'; - } else if (property == 'opacity') { - value = parseFloat(value); - if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) - this.element.setStyle({zoom: 1}); - } else if (Element.CSS_LENGTH.test(value)) { - var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/); - value = parseFloat(components[1]); - unit = (components.length == 3) ? components[2] : null; - } - - var originalValue = this.element.getStyle(property); - return { - style: property.camelize(), - originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), - targetValue: unit=='color' ? parseColor(value) : value, - unit: unit - }; - }.bind(this)).reject(function(transform){ - return ( - (transform.originalValue == transform.targetValue) || - ( - transform.unit != 'color' && - (isNaN(transform.originalValue) || isNaN(transform.targetValue)) - ) - ) - }); - }, - update: function(position) { - var style = { }, transform, i = this.transforms.length; - while(i--) - style[(transform = this.transforms[i]).style] = - transform.unit=='color' ? '#'+ - (Math.round(transform.originalValue[0]+ - (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() + - (Math.round(transform.originalValue[1]+ - (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() + - (Math.round(transform.originalValue[2]+ - (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() : - (transform.originalValue + - (transform.targetValue - transform.originalValue) * position).toFixed(3) + - (transform.unit === null ? '' : transform.unit); - this.element.setStyle(style, true); - } -}); - -Effect.Transform = Class.create({ - initialize: function(tracks){ - this.tracks = []; - this.options = arguments[1] || { }; - this.addTracks(tracks); - }, - addTracks: function(tracks){ - tracks.each(function(track){ - track = $H(track); - var data = track.values().first(); - this.tracks.push($H({ - ids: track.keys().first(), - effect: Effect.Morph, - options: { style: data } - })); - }.bind(this)); - return this; - }, - play: function(){ - return new Effect.Parallel( - this.tracks.map(function(track){ - var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options'); - var elements = [$(ids) || $$(ids)].flatten(); - return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) }); - }).flatten(), - this.options - ); - } -}); - -Element.CSS_PROPERTIES = $w( - 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + - 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + - 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + - 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + - 'fontSize fontWeight height left letterSpacing lineHeight ' + - 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ - 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + - 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + - 'right textIndent top width wordSpacing zIndex'); - -Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; - -String.__parseStyleElement = document.createElement('div'); -String.prototype.parseStyle = function(){ - var style, styleRules = $H(); - if (Prototype.Browser.WebKit) - style = new Element('div',{style:this}).style; - else { - String.__parseStyleElement.innerHTML = '
    '; - style = String.__parseStyleElement.childNodes[0].style; - } - - Element.CSS_PROPERTIES.each(function(property){ - if (style[property]) styleRules.set(property, style[property]); - }); - - if (Prototype.Browser.IE && this.include('opacity')) - styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]); - - return styleRules; -}; - -if (document.defaultView && document.defaultView.getComputedStyle) { - Element.getStyles = function(element) { - var css = document.defaultView.getComputedStyle($(element), null); - return Element.CSS_PROPERTIES.inject({ }, function(styles, property) { - styles[property] = css[property]; - return styles; - }); - }; -} else { - Element.getStyles = function(element) { - element = $(element); - var css = element.currentStyle, styles; - styles = Element.CSS_PROPERTIES.inject({ }, function(results, property) { - results[property] = css[property]; - return results; - }); - if (!styles.opacity) styles.opacity = element.getOpacity(); - return styles; - }; -}; - -Effect.Methods = { - morph: function(element, style) { - element = $(element); - new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { })); - return element; - }, - visualEffect: function(element, effect, options) { - element = $(element) - var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1); - new Effect[klass](element, options); - return element; - }, - highlight: function(element, options) { - element = $(element); - new Effect.Highlight(element, options); - return element; - } -}; - -$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+ - 'pulsate shake puff squish switchOff dropOut').each( - function(effect) { - Effect.Methods[effect] = function(element, options){ - element = $(element); - Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options); - return element; - } - } -); - -$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( - function(f) { Effect.Methods[f] = Element[f]; } -); - -Element.addMethods(Effect.Methods); diff --git a/posterita/posterita/web/javascripts/js-calendar/calendar-en.js b/posterita/posterita/web/javascripts/js-calendar/calendar-en.js deleted file mode 100644 index 0dbde793d8..0000000000 --- a/posterita/posterita/web/javascripts/js-calendar/calendar-en.js +++ /dev/null @@ -1,127 +0,0 @@ -// ** I18N - -// Calendar EN language -// Author: Mihai Bazon, -// Encoding: any -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat", - "Sun"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 0; - -// full month names -Calendar._MN = new Array -("January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December"); - -// short month names -Calendar._SMN = new Array -("Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "About the calendar"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + -"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"Date selection:\n" + -"- Use the \xab, \xbb buttons to select year\n" + -"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" + -"- Hold mouse button on any of the above buttons for faster selection."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Time selection:\n" + -"- Click on any of the time parts to increase it\n" + -"- or Shift-click to decrease it\n" + -"- or click and drag for faster selection."; - -Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)"; -Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)"; -Calendar._TT["GO_TODAY"] = "Go Today"; -Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)"; -Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)"; -Calendar._TT["SEL_DATE"] = "Select date"; -Calendar._TT["DRAG_TO_MOVE"] = "Drag to move"; -Calendar._TT["PART_TODAY"] = " (today)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Display %s first"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Close"; -Calendar._TT["TODAY"] = "Today"; -Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "wk"; -Calendar._TT["TIME"] = "Time:"; diff --git a/posterita/posterita/web/javascripts/js-calendar/calendar-setup.js b/posterita/posterita/web/javascripts/js-calendar/calendar-setup.js deleted file mode 100644 index f2b4854308..0000000000 --- a/posterita/posterita/web/javascripts/js-calendar/calendar-setup.js +++ /dev/null @@ -1,200 +0,0 @@ -/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ - * --------------------------------------------------------------------------- - * - * The DHTML Calendar - * - * Details and latest version at: - * http://dynarch.com/mishoo/calendar.epl - * - * This script is distributed under the GNU Lesser General Public License. - * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html - * - * This file defines helper functions for setting up the calendar. They are - * intended to help non-programmers get a working calendar on their site - * quickly. This script should not be seen as part of the calendar. It just - * shows you what one can do with the calendar, while in the same time - * providing a quick and simple method for setting it up. If you need - * exhaustive customization of the calendar creation process feel free to - * modify this code to suit your needs (this is recommended and much better - * than modifying calendar.js itself). - */ - -// $Id: calendar-setup.js,v 1.25 2005/03/07 09:51:33 mishoo Exp $ - -/** - * This function "patches" an input field (or other element) to use a calendar - * widget for date selection. - * - * The "params" is a single object that can have the following properties: - * - * prop. name | description - * ------------------------------------------------------------------------------------------------- - * inputField | the ID of an input field to store the date - * displayArea | the ID of a DIV or other element to show the date - * button | ID of a button or other element that will trigger the calendar - * eventName | event that will trigger the calendar, without the "on" prefix (default: "click") - * ifFormat | date format that will be stored in the input field - * daFormat | the date format that will be used to display the date in displayArea - * singleClick | (true/false) wether the calendar is in single click mode or not (default: true) - * firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc. - * align | alignment (default: "Br"); if you don't know what's this see the calendar documentation - * range | array with 2 elements. Default: [1900, 2999] -- the range of years available - * weekNumbers | (true/false) if it's true (default) the calendar will display week numbers - * flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID - * flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar) - * disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar - * onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay) - * onClose | function that gets called when the calendar is closed. [default] - * onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar. - * date | the date that the calendar will be initially displayed to - * showsTime | default: false; if true the calendar will include a time selector - * timeFormat | the time format; can be "12" or "24", default is "12" - * electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close - * step | configures the step of the years in drop-down boxes; default: 2 - * position | configures the calendar absolute position; default: null - * cache | if "true" (but default: "false") it will reuse the same calendar object, where possible - * showOthers | if "true" (but default: "false") it will show days from other months too - * - * None of them is required, they all have default values. However, if you - * pass none of "inputField", "displayArea" or "button" you'll get a warning - * saying "nothing to setup". - */ -Calendar.setup = function (params) { - function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; - - param_default("inputField", null); - param_default("displayArea", null); - param_default("button", null); - param_default("eventName", "click"); - param_default("ifFormat", "%Y/%m/%d"); - param_default("daFormat", "%Y/%m/%d"); - param_default("singleClick", true); - param_default("disableFunc", null); - param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined - param_default("dateText", null); - param_default("firstDay", null); - param_default("align", "Br"); - param_default("range", [1900, 2999]); - param_default("weekNumbers", true); - param_default("flat", null); - param_default("flatCallback", null); - param_default("onSelect", null); - param_default("onClose", null); - param_default("onUpdate", null); - param_default("date", null); - param_default("showsTime", false); - param_default("timeFormat", "24"); - param_default("electric", true); - param_default("step", 2); - param_default("position", null); - param_default("cache", false); - param_default("showOthers", false); - param_default("multiple", null); - - var tmp = ["inputField", "displayArea", "button"]; - for (var i in tmp) { - if (typeof params[tmp[i]] == "string") { - params[tmp[i]] = document.getElementById(params[tmp[i]]); - } - } - if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) { - alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); - return false; - } - - function onSelect(cal) { - var p = cal.params; - var update = (cal.dateClicked || p.electric); - if (update && p.inputField) { - p.inputField.value = cal.date.print(p.ifFormat); - if (typeof p.inputField.onchange == "function") - p.inputField.onchange(); - } - if (update && p.displayArea) - p.displayArea.innerHTML = cal.date.print(p.daFormat); - if (update && typeof p.onUpdate == "function") - p.onUpdate(cal); - if (update && p.flat) { - if (typeof p.flatCallback == "function") - p.flatCallback(cal); - } - if (update && p.singleClick && cal.dateClicked) - cal.callCloseHandler(); - }; - - if (params.flat != null) { - if (typeof params.flat == "string") - params.flat = document.getElementById(params.flat); - if (!params.flat) { - alert("Calendar.setup:\n Flat specified but can't find parent."); - return false; - } - var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); - cal.showsOtherMonths = params.showOthers; - cal.showsTime = params.showsTime; - cal.time24 = (params.timeFormat == "24"); - cal.params = params; - cal.weekNumbers = params.weekNumbers; - cal.setRange(params.range[0], params.range[1]); - cal.setDateStatusHandler(params.dateStatusFunc); - cal.getDateText = params.dateText; - if (params.ifFormat) { - cal.setDateFormat(params.ifFormat); - } - if (params.inputField && typeof params.inputField.value == "string") { - cal.parseDate(params.inputField.value); - } - cal.create(params.flat); - cal.show(); - return false; - } - - var triggerEl = params.button || params.displayArea || params.inputField; - triggerEl["on" + params.eventName] = function() { - var dateEl = params.inputField || params.displayArea; - var dateFmt = params.inputField ? params.ifFormat : params.daFormat; - var mustCreate = false; - var cal = window.calendar; - if (dateEl) - params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt); - if (!(cal && params.cache)) { - window.calendar = cal = new Calendar(params.firstDay, - params.date, - params.onSelect || onSelect, - params.onClose || function(cal) { cal.hide(); }); - cal.showsTime = params.showsTime; - cal.time24 = (params.timeFormat == "24"); - cal.weekNumbers = params.weekNumbers; - mustCreate = true; - } else { - if (params.date) - cal.setDate(params.date); - cal.hide(); - } - if (params.multiple) { - cal.multiple = {}; - for (var i = params.multiple.length; --i >= 0;) { - var d = params.multiple[i]; - var ds = d.print("%Y%m%d"); - cal.multiple[ds] = d; - } - } - cal.showsOtherMonths = params.showOthers; - cal.yearStep = params.step; - cal.setRange(params.range[0], params.range[1]); - cal.params = params; - cal.setDateStatusHandler(params.dateStatusFunc); - cal.getDateText = params.dateText; - cal.setDateFormat(dateFmt); - if (mustCreate) - cal.create(); - cal.refresh(); - if (!params.position) - cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); - else - cal.showAt(params.position[0], params.position[1]); - return false; - }; - - return cal; -}; diff --git a/posterita/posterita/web/javascripts/js-calendar/calendar.js b/posterita/posterita/web/javascripts/js-calendar/calendar.js deleted file mode 100644 index 9088e0e897..0000000000 --- a/posterita/posterita/web/javascripts/js-calendar/calendar.js +++ /dev/null @@ -1,1806 +0,0 @@ -/* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo - * ----------------------------------------------------------- - * - * The DHTML Calendar, version 1.0 "It is happening again" - * - * Details and latest version at: - * www.dynarch.com/projects/calendar - * - * This script is developed by Dynarch.com. Visit us at www.dynarch.com. - * - * This script is distributed under the GNU Lesser General Public License. - * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html - */ - -// $Id: calendar.js,v 1.51 2005/03/07 16:44:31 mishoo Exp $ - -/** The Calendar object constructor. */ -Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { - // member variables - this.activeDiv = null; - this.currentDateEl = null; - this.getDateStatus = null; - this.getDateToolTip = null; - this.getDateText = null; - this.timeout = null; - this.onSelected = onSelected || null; - this.onClose = onClose || null; - this.dragging = false; - this.hidden = false; - this.minYear = 1970; - this.maxYear = 2050; - this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"]; - this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; - this.isPopup = true; - this.weekNumbers = true; - this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; // 0 for Sunday, 1 for Monday, etc. - this.showsOtherMonths = false; - this.dateStr = dateStr; - this.ar_days = null; - this.showsTime = false; - this.time24 = true; - this.yearStep = 2; - this.hiliteToday = true; - this.multiple = null; - // HTML elements - this.table = null; - this.element = null; - this.tbody = null; - this.firstdayname = null; - // Combo boxes - this.monthsCombo = null; - this.yearsCombo = null; - this.hilitedMonth = null; - this.activeMonth = null; - this.hilitedYear = null; - this.activeYear = null; - // Information - this.dateClicked = false; - - // one-time initializations - if (typeof Calendar._SDN == "undefined") { - // table of short day names - if (typeof Calendar._SDN_len == "undefined") - Calendar._SDN_len = 3; - var ar = new Array(); - for (var i = 8; i > 0;) { - ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len); - } - Calendar._SDN = ar; - // table of short month names - if (typeof Calendar._SMN_len == "undefined") - Calendar._SMN_len = 3; - ar = new Array(); - for (var i = 12; i > 0;) { - ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len); - } - Calendar._SMN = ar; - } -}; - -// ** constants - -/// "static", needed for event handlers. -Calendar._C = null; - -/// detect a special case of "web browser" -Calendar.is_ie = ( /msie/i.test(navigator.userAgent) && - !/opera/i.test(navigator.userAgent) ); - -Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) ); - -/// detect Opera browser -Calendar.is_opera = /opera/i.test(navigator.userAgent); - -/// detect KHTML-based browsers -Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent); - -// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate -// library, at some point. - -Calendar.getAbsolutePos = function(el) { - var SL = 0, ST = 0; - var is_div = /^div$/i.test(el.tagName); - if (is_div && el.scrollLeft) - SL = el.scrollLeft; - if (is_div && el.scrollTop) - ST = el.scrollTop; - var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST }; - if (el.offsetParent) { - var tmp = this.getAbsolutePos(el.offsetParent); - r.x += tmp.x; - r.y += tmp.y; - } - return r; -}; - -Calendar.isRelated = function (el, evt) { - var related = evt.relatedTarget; - if (!related) { - var type = evt.type; - if (type == "mouseover") { - related = evt.fromElement; - } else if (type == "mouseout") { - related = evt.toElement; - } - } - while (related) { - if (related == el) { - return true; - } - related = related.parentNode; - } - return false; -}; - -Calendar.removeClass = function(el, className) { - if (!(el && el.className)) { - return; - } - var cls = el.className.split(" "); - var ar = new Array(); - for (var i = cls.length; i > 0;) { - if (cls[--i] != className) { - ar[ar.length] = cls[i]; - } - } - el.className = ar.join(" "); -}; - -Calendar.addClass = function(el, className) { - Calendar.removeClass(el, className); - el.className += " " + className; -}; - -// FIXME: the following 2 functions totally suck, are useless and should be replaced immediately. -Calendar.getElement = function(ev) { - var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget; - while (f.nodeType != 1 || /^div$/i.test(f.tagName)) - f = f.parentNode; - return f; -}; - -Calendar.getTargetElement = function(ev) { - var f = Calendar.is_ie ? window.event.srcElement : ev.target; - while (f.nodeType != 1) - f = f.parentNode; - return f; -}; - -Calendar.stopEvent = function(ev) { - ev || (ev = window.event); - if (Calendar.is_ie) { - ev.cancelBubble = true; - ev.returnValue = false; - } else { - ev.preventDefault(); - ev.stopPropagation(); - } - return false; -}; - -Calendar.addEvent = function(el, evname, func) { - if (el.attachEvent) { // IE - el.attachEvent("on" + evname, func); - } else if (el.addEventListener) { // Gecko / W3C - el.addEventListener(evname, func, true); - } else { - el["on" + evname] = func; - } -}; - -Calendar.removeEvent = function(el, evname, func) { - if (el.detachEvent) { // IE - el.detachEvent("on" + evname, func); - } else if (el.removeEventListener) { // Gecko / W3C - el.removeEventListener(evname, func, true); - } else { - el["on" + evname] = null; - } -}; - -Calendar.createElement = function(type, parent) { - var el = null; - if (document.createElementNS) { - // use the XHTML namespace; IE won't normally get here unless - // _they_ "fix" the DOM2 implementation. - el = document.createElementNS("http://www.w3.org/1999/xhtml", type); - } else { - el = document.createElement(type); - } - if (typeof parent != "undefined") { - parent.appendChild(el); - } - return el; -}; - -// END: UTILITY FUNCTIONS - -// BEGIN: CALENDAR STATIC FUNCTIONS - -/** Internal -- adds a set of events to make some element behave like a button. */ -Calendar._add_evs = function(el) { - with (Calendar) { - addEvent(el, "mouseover", dayMouseOver); - addEvent(el, "mousedown", dayMouseDown); - addEvent(el, "mouseout", dayMouseOut); - if (is_ie) { - addEvent(el, "dblclick", dayMouseDblClick); - el.setAttribute("unselectable", true); - } - } -}; - -Calendar.findMonth = function(el) { - if (typeof el.month != "undefined") { - return el; - } else if (typeof el.parentNode.month != "undefined") { - return el.parentNode; - } - return null; -}; - -Calendar.findYear = function(el) { - if (typeof el.year != "undefined") { - return el; - } else if (typeof el.parentNode.year != "undefined") { - return el.parentNode; - } - return null; -}; - -Calendar.showMonthsCombo = function () { - var cal = Calendar._C; - if (!cal) { - return false; - } - var cal = cal; - var cd = cal.activeDiv; - var mc = cal.monthsCombo; - if (cal.hilitedMonth) { - Calendar.removeClass(cal.hilitedMonth, "hilite"); - } - if (cal.activeMonth) { - Calendar.removeClass(cal.activeMonth, "active"); - } - var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()]; - Calendar.addClass(mon, "active"); - cal.activeMonth = mon; - var s = mc.style; - s.display = "block"; - if (cd.navtype < 0) - s.left = cd.offsetLeft + "px"; - else { - var mcw = mc.offsetWidth; - if (typeof mcw == "undefined") - // Konqueror brain-dead techniques - mcw = 50; - s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px"; - } - s.top = (cd.offsetTop + cd.offsetHeight) + "px"; -}; - -Calendar.showYearsCombo = function (fwd) { - var cal = Calendar._C; - if (!cal) { - return false; - } - var cal = cal; - var cd = cal.activeDiv; - var yc = cal.yearsCombo; - if (cal.hilitedYear) { - Calendar.removeClass(cal.hilitedYear, "hilite"); - } - if (cal.activeYear) { - Calendar.removeClass(cal.activeYear, "active"); - } - cal.activeYear = null; - var Y = cal.date.getFullYear() + (fwd ? 1 : -1); - var yr = yc.firstChild; - var show = false; - for (var i = 12; i > 0; --i) { - if (Y >= cal.minYear && Y <= cal.maxYear) { - yr.innerHTML = Y; - yr.year = Y; - yr.style.display = "block"; - show = true; - } else { - yr.style.display = "none"; - } - yr = yr.nextSibling; - Y += fwd ? cal.yearStep : -cal.yearStep; - } - if (show) { - var s = yc.style; - s.display = "block"; - if (cd.navtype < 0) - s.left = cd.offsetLeft + "px"; - else { - var ycw = yc.offsetWidth; - if (typeof ycw == "undefined") - // Konqueror brain-dead techniques - ycw = 50; - s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px"; - } - s.top = (cd.offsetTop + cd.offsetHeight) + "px"; - } -}; - -// event handlers - -Calendar.tableMouseUp = function(ev) { - var cal = Calendar._C; - if (!cal) { - return false; - } - if (cal.timeout) { - clearTimeout(cal.timeout); - } - var el = cal.activeDiv; - if (!el) { - return false; - } - var target = Calendar.getTargetElement(ev); - ev || (ev = window.event); - Calendar.removeClass(el, "active"); - if (target == el || target.parentNode == el) { - Calendar.cellClick(el, ev); - } - var mon = Calendar.findMonth(target); - var date = null; - if (mon) { - date = new Date(cal.date); - if (mon.month != date.getMonth()) { - date.setMonth(mon.month); - cal.setDate(date); - cal.dateClicked = false; - cal.callHandler(); - } - } else { - var year = Calendar.findYear(target); - if (year) { - date = new Date(cal.date); - if (year.year != date.getFullYear()) { - date.setFullYear(year.year); - cal.setDate(date); - cal.dateClicked = false; - cal.callHandler(); - } - } - } - with (Calendar) { - removeEvent(document, "mouseup", tableMouseUp); - removeEvent(document, "mouseover", tableMouseOver); - removeEvent(document, "mousemove", tableMouseOver); - cal._hideCombos(); - _C = null; - return stopEvent(ev); - } -}; - -Calendar.tableMouseOver = function (ev) { - var cal = Calendar._C; - if (!cal) { - return; - } - var el = cal.activeDiv; - var target = Calendar.getTargetElement(ev); - if (target == el || target.parentNode == el) { - Calendar.addClass(el, "hilite active"); - Calendar.addClass(el.parentNode, "rowhilite"); - } else { - if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2))) - Calendar.removeClass(el, "active"); - Calendar.removeClass(el, "hilite"); - Calendar.removeClass(el.parentNode, "rowhilite"); - } - ev || (ev = window.event); - if (el.navtype == 50 && target != el) { - var pos = Calendar.getAbsolutePos(el); - var w = el.offsetWidth; - var x = ev.clientX; - var dx; - var decrease = true; - if (x > pos.x + w) { - dx = x - pos.x - w; - decrease = false; - } else - dx = pos.x - x; - - if (dx < 0) dx = 0; - var range = el._range; - var current = el._current; - var count = Math.floor(dx / 10) % range.length; - for (var i = range.length; --i >= 0;) - if (range[i] == current) - break; - while (count-- > 0) - if (decrease) { - if (--i < 0) - i = range.length - 1; - } else if ( ++i >= range.length ) - i = 0; - var newval = range[i]; - el.innerHTML = newval; - - cal.onUpdateTime(); - } - var mon = Calendar.findMonth(target); - if (mon) { - if (mon.month != cal.date.getMonth()) { - if (cal.hilitedMonth) { - Calendar.removeClass(cal.hilitedMonth, "hilite"); - } - Calendar.addClass(mon, "hilite"); - cal.hilitedMonth = mon; - } else if (cal.hilitedMonth) { - Calendar.removeClass(cal.hilitedMonth, "hilite"); - } - } else { - if (cal.hilitedMonth) { - Calendar.removeClass(cal.hilitedMonth, "hilite"); - } - var year = Calendar.findYear(target); - if (year) { - if (year.year != cal.date.getFullYear()) { - if (cal.hilitedYear) { - Calendar.removeClass(cal.hilitedYear, "hilite"); - } - Calendar.addClass(year, "hilite"); - cal.hilitedYear = year; - } else if (cal.hilitedYear) { - Calendar.removeClass(cal.hilitedYear, "hilite"); - } - } else if (cal.hilitedYear) { - Calendar.removeClass(cal.hilitedYear, "hilite"); - } - } - return Calendar.stopEvent(ev); -}; - -Calendar.tableMouseDown = function (ev) { - if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) { - return Calendar.stopEvent(ev); - } -}; - -Calendar.calDragIt = function (ev) { - var cal = Calendar._C; - if (!(cal && cal.dragging)) { - return false; - } - var posX; - var posY; - if (Calendar.is_ie) { - posY = window.event.clientY + document.body.scrollTop; - posX = window.event.clientX + document.body.scrollLeft; - } else { - posX = ev.pageX; - posY = ev.pageY; - } - cal.hideShowCovered(); - var st = cal.element.style; - st.left = (posX - cal.xOffs) + "px"; - st.top = (posY - cal.yOffs) + "px"; - return Calendar.stopEvent(ev); -}; - -Calendar.calDragEnd = function (ev) { - var cal = Calendar._C; - if (!cal) { - return false; - } - cal.dragging = false; - with (Calendar) { - removeEvent(document, "mousemove", calDragIt); - removeEvent(document, "mouseup", calDragEnd); - tableMouseUp(ev); - } - cal.hideShowCovered(); -}; - -Calendar.dayMouseDown = function(ev) { - var el = Calendar.getElement(ev); - if (el.disabled) { - return false; - } - var cal = el.calendar; - cal.activeDiv = el; - Calendar._C = cal; - if (el.navtype != 300) with (Calendar) { - if (el.navtype == 50) { - el._current = el.innerHTML; - addEvent(document, "mousemove", tableMouseOver); - } else - addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver); - addClass(el, "hilite active"); - addEvent(document, "mouseup", tableMouseUp); - } else if (cal.isPopup) { - cal._dragStart(ev); - } - if (el.navtype == -1 || el.navtype == 1) { - if (cal.timeout) clearTimeout(cal.timeout); - cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250); - } else if (el.navtype == -2 || el.navtype == 2) { - if (cal.timeout) clearTimeout(cal.timeout); - cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250); - } else { - cal.timeout = null; - } - return Calendar.stopEvent(ev); -}; - -Calendar.dayMouseDblClick = function(ev) { - Calendar.cellClick(Calendar.getElement(ev), ev || window.event); - if (Calendar.is_ie) { - document.selection.empty(); - } -}; - -Calendar.dayMouseOver = function(ev) { - var el = Calendar.getElement(ev); - if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) { - return false; - } - if (el.ttip) { - if (el.ttip.substr(0, 1) == "_") { - el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1); - } - el.calendar.tooltips.innerHTML = el.ttip; - } - if (el.navtype != 300) { - Calendar.addClass(el, "hilite"); - if (el.caldate) { - Calendar.addClass(el.parentNode, "rowhilite"); - } - } - return Calendar.stopEvent(ev); -}; - -Calendar.dayMouseOut = function(ev) { - with (Calendar) { - var el = getElement(ev); - if (isRelated(el, ev) || _C || el.disabled) - return false; - removeClass(el, "hilite"); - if (el.caldate) - removeClass(el.parentNode, "rowhilite"); - if (el.calendar) - el.calendar.tooltips.innerHTML = _TT["SEL_DATE"]; - return stopEvent(ev); - } -}; - -/** - * A generic "click" handler :) handles all types of buttons defined in this - * calendar. - */ -Calendar.cellClick = function(el, ev) { - var cal = el.calendar; - var closing = false; - var newdate = false; - var date = null; - if (typeof el.navtype == "undefined") { - if (cal.currentDateEl) { - Calendar.removeClass(cal.currentDateEl, "selected"); - Calendar.addClass(el, "selected"); - closing = (cal.currentDateEl == el); - if (!closing) { - cal.currentDateEl = el; - } - } - cal.date.setDateOnly(el.caldate); - date = cal.date; - var other_month = !(cal.dateClicked = !el.otherMonth); - if (!other_month && !cal.currentDateEl) - cal._toggleMultipleDate(new Date(date)); - else - newdate = !el.disabled; - // a date was clicked - if (other_month) - cal._init(cal.firstDayOfWeek, date); - } else { - if (el.navtype == 200) { - Calendar.removeClass(el, "hilite"); - cal.callCloseHandler(); - return; - } - date = new Date(cal.date); - if (el.navtype == 0) - date.setDateOnly(new Date()); // TODAY - // unless "today" was clicked, we assume no date was clicked so - // the selected handler will know not to close the calenar when - // in single-click mode. - // cal.dateClicked = (el.navtype == 0); - cal.dateClicked = false; - var year = date.getFullYear(); - var mon = date.getMonth(); - function setMonth(m) { - var day = date.getDate(); - var max = date.getMonthDays(m); - if (day > max) { - date.setDate(max); - } - date.setMonth(m); - }; - switch (el.navtype) { - case 400: - Calendar.removeClass(el, "hilite"); - var text = Calendar._TT["ABOUT"]; - if (typeof text != "undefined") { - text += cal.showsTime ? Calendar._TT["ABOUT_TIME"] : ""; - } else { - // FIXME: this should be removed as soon as lang files get updated! - text = "Help and about box text is not translated into this language.\n" + - "If you know this language and you feel generous please update\n" + - "the corresponding file in \"lang\" subdir to match calendar-en.js\n" + - "and send it back to to get it into the distribution ;-)\n\n" + - "Thank you!\n" + - "http://dynarch.com/mishoo/calendar.epl\n"; - } - alert(text); - return; - case -2: - if (year > cal.minYear) { - date.setFullYear(year - 1); - } - break; - case -1: - if (mon > 0) { - setMonth(mon - 1); - } else if (year-- > cal.minYear) { - date.setFullYear(year); - setMonth(11); - } - break; - case 1: - if (mon < 11) { - setMonth(mon + 1); - } else if (year < cal.maxYear) { - date.setFullYear(year + 1); - setMonth(0); - } - break; - case 2: - if (year < cal.maxYear) { - date.setFullYear(year + 1); - } - break; - case 100: - cal.setFirstDayOfWeek(el.fdow); - return; - case 50: - var range = el._range; - var current = el.innerHTML; - for (var i = range.length; --i >= 0;) - if (range[i] == current) - break; - if (ev && ev.shiftKey) { - if (--i < 0) - i = range.length - 1; - } else if ( ++i >= range.length ) - i = 0; - var newval = range[i]; - el.innerHTML = newval; - cal.onUpdateTime(); - return; - case 0: - // TODAY will bring us here - if ((typeof cal.getDateStatus == "function") && - cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) { - return false; - } - break; - } - if (!date.equalsTo(cal.date)) { - cal.setDate(date); - newdate = true; - } else if (el.navtype == 0) - newdate = closing = true; - } - if (newdate) { - ev && cal.callHandler(); - } - if (closing) { - Calendar.removeClass(el, "hilite"); - ev && cal.callCloseHandler(); - } -}; - -// END: CALENDAR STATIC FUNCTIONS - -// BEGIN: CALENDAR OBJECT FUNCTIONS - -/** - * This function creates the calendar inside the given parent. If _par is - * null than it creates a popup calendar inside the BODY element. If _par is - * an element, be it BODY, then it creates a non-popup calendar (still - * hidden). Some properties need to be set before calling this function. - */ -Calendar.prototype.create = function (_par) { - var parent = null; - if (! _par) { - // default parent is the document body, in which case we create - // a popup calendar. - parent = document.getElementsByTagName("body")[0]; - this.isPopup = true; - } else { - parent = _par; - this.isPopup = false; - } - this.date = this.dateStr ? new Date(this.dateStr) : new Date(); - - var table = Calendar.createElement("table"); - this.table = table; - table.cellSpacing = 0; - table.cellPadding = 0; - table.calendar = this; - Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown); - - var div = Calendar.createElement("div"); - this.element = div; - div.className = "calendar"; - if (this.isPopup) { - div.style.position = "absolute"; - div.style.display = "none"; - } - div.appendChild(table); - - var thead = Calendar.createElement("thead", table); - var cell = null; - var row = null; - - var cal = this; - var hh = function (text, cs, navtype) { - cell = Calendar.createElement("td", row); - cell.colSpan = cs; - cell.className = "button"; - if (navtype != 0 && Math.abs(navtype) <= 2) - cell.className += " nav"; - Calendar._add_evs(cell); - cell.calendar = cal; - cell.navtype = navtype; - cell.innerHTML = "
    " + text + "
    "; - return cell; - }; - - row = Calendar.createElement("tr", thead); - var title_length = 6; - (this.isPopup) && --title_length; - (this.weekNumbers) && ++title_length; - - hh("?", 1, 400).ttip = Calendar._TT["INFO"]; - this.title = hh("", title_length, 300); - this.title.className = "title"; - if (this.isPopup) { - this.title.ttip = Calendar._TT["DRAG_TO_MOVE"]; - this.title.style.cursor = "move"; - hh("×", 1, 200).ttip = Calendar._TT["CLOSE"]; - } - - row = Calendar.createElement("tr", thead); - row.className = "headrow"; - - this._nav_py = hh("«", 1, -2); - this._nav_py.ttip = Calendar._TT["PREV_YEAR"]; - - this._nav_pm = hh("‹", 1, -1); - this._nav_pm.ttip = Calendar._TT["PREV_MONTH"]; - - this._nav_now = hh(Calendar._TT["TODAY"], this.weekNumbers ? 4 : 3, 0); - this._nav_now.ttip = Calendar._TT["GO_TODAY"]; - - this._nav_nm = hh("›", 1, 1); - this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"]; - - this._nav_ny = hh("»", 1, 2); - this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"]; - - // day names - row = Calendar.createElement("tr", thead); - row.className = "daynames"; - if (this.weekNumbers) { - cell = Calendar.createElement("td", row); - cell.className = "name wn"; - cell.innerHTML = Calendar._TT["WK"]; - } - for (var i = 7; i > 0; --i) { - cell = Calendar.createElement("td", row); - if (!i) { - cell.navtype = 100; - cell.calendar = this; - Calendar._add_evs(cell); - } - } - this.firstdayname = (this.weekNumbers) ? row.firstChild.nextSibling : row.firstChild; - this._displayWeekdays(); - - var tbody = Calendar.createElement("tbody", table); - this.tbody = tbody; - - for (i = 6; i > 0; --i) { - row = Calendar.createElement("tr", tbody); - if (this.weekNumbers) { - cell = Calendar.createElement("td", row); - } - for (var j = 7; j > 0; --j) { - cell = Calendar.createElement("td", row); - cell.calendar = this; - Calendar._add_evs(cell); - } - } - - if (this.showsTime) { - row = Calendar.createElement("tr", tbody); - row.className = "time"; - - cell = Calendar.createElement("td", row); - cell.className = "time"; - cell.colSpan = 2; - cell.innerHTML = Calendar._TT["TIME"] || " "; - - cell = Calendar.createElement("td", row); - cell.className = "time"; - cell.colSpan = this.weekNumbers ? 4 : 3; - - (function(){ - function makeTimePart(className, init, range_start, range_end) { - var part = Calendar.createElement("span", cell); - part.className = className; - part.innerHTML = init; - part.calendar = cal; - part.ttip = Calendar._TT["TIME_PART"]; - part.navtype = 50; - part._range = []; - if (typeof range_start != "number") - part._range = range_start; - else { - for (var i = range_start; i <= range_end; ++i) { - var txt; - if (i < 10 && range_end >= 10) txt = '0' + i; - else txt = '' + i; - part._range[part._range.length] = txt; - } - } - Calendar._add_evs(part); - return part; - }; - var hrs = cal.date.getHours(); - var mins = cal.date.getMinutes(); - var t12 = !cal.time24; - var pm = (hrs > 12); - if (t12 && pm) hrs -= 12; - var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23); - var span = Calendar.createElement("span", cell); - span.innerHTML = ":"; - span.className = "colon"; - var M = makeTimePart("minute", mins, 0, 59); - var AP = null; - cell = Calendar.createElement("td", row); - cell.className = "time"; - cell.colSpan = 2; - if (t12) - AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]); - else - cell.innerHTML = " "; - - cal.onSetTime = function() { - var pm, hrs = this.date.getHours(), - mins = this.date.getMinutes(); - if (t12) { - pm = (hrs >= 12); - if (pm) hrs -= 12; - if (hrs == 0) hrs = 12; - AP.innerHTML = pm ? "pm" : "am"; - } - H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs; - M.innerHTML = (mins < 10) ? ("0" + mins) : mins; - }; - - cal.onUpdateTime = function() { - var date = this.date; - var h = parseInt(H.innerHTML, 10); - if (t12) { - if (/pm/i.test(AP.innerHTML) && h < 12) - h += 12; - else if (/am/i.test(AP.innerHTML) && h == 12) - h = 0; - } - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - date.setHours(h); - date.setMinutes(parseInt(M.innerHTML, 10)); - date.setFullYear(y); - date.setMonth(m); - date.setDate(d); - this.dateClicked = false; - this.callHandler(); - }; - })(); - } else { - this.onSetTime = this.onUpdateTime = function() {}; - } - - var tfoot = Calendar.createElement("tfoot", table); - - row = Calendar.createElement("tr", tfoot); - row.className = "footrow"; - - cell = hh(Calendar._TT["SEL_DATE"], this.weekNumbers ? 8 : 7, 300); - cell.className = "ttip"; - if (this.isPopup) { - cell.ttip = Calendar._TT["DRAG_TO_MOVE"]; - cell.style.cursor = "move"; - } - this.tooltips = cell; - - div = Calendar.createElement("div", this.element); - this.monthsCombo = div; - div.className = "combo"; - for (i = 0; i < Calendar._MN.length; ++i) { - var mn = Calendar.createElement("div"); - mn.className = Calendar.is_ie ? "label-IEfix" : "label"; - mn.month = i; - mn.innerHTML = Calendar._SMN[i]; - div.appendChild(mn); - } - - div = Calendar.createElement("div", this.element); - this.yearsCombo = div; - div.className = "combo"; - for (i = 12; i > 0; --i) { - var yr = Calendar.createElement("div"); - yr.className = Calendar.is_ie ? "label-IEfix" : "label"; - div.appendChild(yr); - } - - this._init(this.firstDayOfWeek, this.date); - parent.appendChild(this.element); -}; - -/** keyboard navigation, only for popup calendars */ -Calendar._keyEvent = function(ev) { - var cal = window._dynarch_popupCalendar; - if (!cal || cal.multiple) - return false; - (Calendar.is_ie) && (ev = window.event); - var act = (Calendar.is_ie || ev.type == "keypress"), - K = ev.keyCode; - if (ev.ctrlKey) { - switch (K) { - case 37: // KEY left - act && Calendar.cellClick(cal._nav_pm); - break; - case 38: // KEY up - act && Calendar.cellClick(cal._nav_py); - break; - case 39: // KEY right - act && Calendar.cellClick(cal._nav_nm); - break; - case 40: // KEY down - act && Calendar.cellClick(cal._nav_ny); - break; - default: - return false; - } - } else switch (K) { - case 32: // KEY space (now) - Calendar.cellClick(cal._nav_now); - break; - case 27: // KEY esc - act && cal.callCloseHandler(); - break; - case 37: // KEY left - case 38: // KEY up - case 39: // KEY right - case 40: // KEY down - if (act) { - var prev, x, y, ne, el, step; - prev = K == 37 || K == 38; - step = (K == 37 || K == 39) ? 1 : 7; - function setVars() { - el = cal.currentDateEl; - var p = el.pos; - x = p & 15; - y = p >> 4; - ne = cal.ar_days[y][x]; - };setVars(); - function prevMonth() { - var date = new Date(cal.date); - date.setDate(date.getDate() - step); - cal.setDate(date); - }; - function nextMonth() { - var date = new Date(cal.date); - date.setDate(date.getDate() + step); - cal.setDate(date); - }; - while (1) { - switch (K) { - case 37: // KEY left - if (--x >= 0) - ne = cal.ar_days[y][x]; - else { - x = 6; - K = 38; - continue; - } - break; - case 38: // KEY up - if (--y >= 0) - ne = cal.ar_days[y][x]; - else { - prevMonth(); - setVars(); - } - break; - case 39: // KEY right - if (++x < 7) - ne = cal.ar_days[y][x]; - else { - x = 0; - K = 40; - continue; - } - break; - case 40: // KEY down - if (++y < cal.ar_days.length) - ne = cal.ar_days[y][x]; - else { - nextMonth(); - setVars(); - } - break; - } - break; - } - if (ne) { - if (!ne.disabled) - Calendar.cellClick(ne); - else if (prev) - prevMonth(); - else - nextMonth(); - } - } - break; - case 13: // KEY enter - if (act) - Calendar.cellClick(cal.currentDateEl, ev); - break; - default: - return false; - } - return Calendar.stopEvent(ev); -}; - -/** - * (RE)Initializes the calendar to the given date and firstDayOfWeek - */ -Calendar.prototype._init = function (firstDayOfWeek, date) { - var today = new Date(), - TY = today.getFullYear(), - TM = today.getMonth(), - TD = today.getDate(); - this.table.style.visibility = "hidden"; - var year = date.getFullYear(); - if (year < this.minYear) { - year = this.minYear; - date.setFullYear(year); - } else if (year > this.maxYear) { - year = this.maxYear; - date.setFullYear(year); - } - this.firstDayOfWeek = firstDayOfWeek; - this.date = new Date(date); - var month = date.getMonth(); - var mday = date.getDate(); - var no_days = date.getMonthDays(); - - // calendar voodoo for computing the first day that would actually be - // displayed in the calendar, even if it's from the previous month. - // WARNING: this is magic. ;-) - date.setDate(1); - var day1 = (date.getDay() - this.firstDayOfWeek) % 7; - if (day1 < 0) - day1 += 7; - date.setDate(-day1); - date.setDate(date.getDate() + 1); - - var row = this.tbody.firstChild; - var MN = Calendar._SMN[month]; - var ar_days = this.ar_days = new Array(); - var weekend = Calendar._TT["WEEKEND"]; - var dates = this.multiple ? (this.datesCells = {}) : null; - for (var i = 0; i < 6; ++i, row = row.nextSibling) { - var cell = row.firstChild; - if (this.weekNumbers) { - cell.className = "day wn"; - cell.innerHTML = date.getWeekNumber(); - cell = cell.nextSibling; - } - row.className = "daysrow"; - var hasdays = false, iday, dpos = ar_days[i] = []; - for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) { - iday = date.getDate(); - var wday = date.getDay(); - cell.className = "day"; - cell.pos = i << 4 | j; - dpos[j] = cell; - var current_month = (date.getMonth() == month); - if (!current_month) { - if (this.showsOtherMonths) { - cell.className += " othermonth"; - cell.otherMonth = true; - } else { - cell.className = "emptycell"; - cell.innerHTML = " "; - cell.disabled = true; - continue; - } - } else { - cell.otherMonth = false; - hasdays = true; - } - cell.disabled = false; - cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday; - if (dates) - dates[date.print("%Y%m%d")] = cell; - if (this.getDateStatus) { - var status = this.getDateStatus(date, year, month, iday); - if (this.getDateToolTip) { - var toolTip = this.getDateToolTip(date, year, month, iday); - if (toolTip) - cell.title = toolTip; - } - if (status === true) { - cell.className += " disabled"; - cell.disabled = true; - } else { - if (/disabled/i.test(status)) - cell.disabled = true; - cell.className += " " + status; - } - } - if (!cell.disabled) { - cell.caldate = new Date(date); - cell.ttip = "_"; - if (!this.multiple && current_month - && iday == mday && this.hiliteToday) { - cell.className += " selected"; - this.currentDateEl = cell; - } - if (date.getFullYear() == TY && - date.getMonth() == TM && - iday == TD) { - cell.className += " today"; - cell.ttip += Calendar._TT["PART_TODAY"]; - } - if (weekend.indexOf(wday.toString()) != -1) - cell.className += cell.otherMonth ? " oweekend" : " weekend"; - } - } - if (!(hasdays || this.showsOtherMonths)) - row.className = "emptyrow"; - } - this.title.innerHTML = Calendar._MN[month] + ", " + year; - this.onSetTime(); - this.table.style.visibility = "visible"; - this._initMultipleDates(); - // PROFILE - // this.tooltips.innerHTML = "Generated in " + ((new Date()) - today) + " ms"; -}; - -Calendar.prototype._initMultipleDates = function() { - if (this.multiple) { - for (var i in this.multiple) { - var cell = this.datesCells[i]; - var d = this.multiple[i]; - if (!d) - continue; - if (cell) - cell.className += " selected"; - } - } -}; - -Calendar.prototype._toggleMultipleDate = function(date) { - if (this.multiple) { - var ds = date.print("%Y%m%d"); - var cell = this.datesCells[ds]; - if (cell) { - var d = this.multiple[ds]; - if (!d) { - Calendar.addClass(cell, "selected"); - this.multiple[ds] = date; - } else { - Calendar.removeClass(cell, "selected"); - delete this.multiple[ds]; - } - } - } -}; - -Calendar.prototype.setDateToolTipHandler = function (unaryFunction) { - this.getDateToolTip = unaryFunction; -}; - -/** - * Calls _init function above for going to a certain date (but only if the - * date is different than the currently selected one). - */ -Calendar.prototype.setDate = function (date) { - if (!date.equalsTo(this.date)) { - this._init(this.firstDayOfWeek, date); - } -}; - -/** - * Refreshes the calendar. Useful if the "disabledHandler" function is - * dynamic, meaning that the list of disabled date can change at runtime. - * Just * call this function if you think that the list of disabled dates - * should * change. - */ -Calendar.prototype.refresh = function () { - this._init(this.firstDayOfWeek, this.date); -}; - -/** Modifies the "firstDayOfWeek" parameter (pass 0 for Synday, 1 for Monday, etc.). */ -Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) { - this._init(firstDayOfWeek, this.date); - this._displayWeekdays(); -}; - -/** - * Allows customization of what dates are enabled. The "unaryFunction" - * parameter must be a function object that receives the date (as a JS Date - * object) and returns a boolean value. If the returned value is true then - * the passed date will be marked as disabled. - */ -Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) { - this.getDateStatus = unaryFunction; -}; - -/** Customization of allowed year range for the calendar. */ -Calendar.prototype.setRange = function (a, z) { - this.minYear = a; - this.maxYear = z; -}; - -/** Calls the first user handler (selectedHandler). */ -Calendar.prototype.callHandler = function () { - if (this.onSelected) { - this.onSelected(this, this.date.print(this.dateFormat)); - } -}; - -/** Calls the second user handler (closeHandler). */ -Calendar.prototype.callCloseHandler = function () { - if (this.onClose) { - this.onClose(this); - } - this.hideShowCovered(); -}; - -/** Removes the calendar object from the DOM tree and destroys it. */ -Calendar.prototype.destroy = function () { - var el = this.element.parentNode; - el.removeChild(this.element); - Calendar._C = null; - window._dynarch_popupCalendar = null; -}; - -/** - * Moves the calendar element to a different section in the DOM tree (changes - * its parent). - */ -Calendar.prototype.reparent = function (new_parent) { - var el = this.element; - el.parentNode.removeChild(el); - new_parent.appendChild(el); -}; - -// This gets called when the user presses a mouse button anywhere in the -// document, if the calendar is shown. If the click was outside the open -// calendar this function closes it. -Calendar._checkCalendar = function(ev) { - var calendar = window._dynarch_popupCalendar; - if (!calendar) { - return false; - } - var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev); - for (; el != null && el != calendar.element; el = el.parentNode); - if (el == null) { - // calls closeHandler which should hide the calendar. - window._dynarch_popupCalendar.callCloseHandler(); - return Calendar.stopEvent(ev); - } -}; - -/** Shows the calendar. */ -Calendar.prototype.show = function () { - var rows = this.table.getElementsByTagName("tr"); - for (var i = rows.length; i > 0;) { - var row = rows[--i]; - Calendar.removeClass(row, "rowhilite"); - var cells = row.getElementsByTagName("td"); - for (var j = cells.length; j > 0;) { - var cell = cells[--j]; - Calendar.removeClass(cell, "hilite"); - Calendar.removeClass(cell, "active"); - } - } - this.element.style.display = "block"; - this.hidden = false; - if (this.isPopup) { - window._dynarch_popupCalendar = this; - Calendar.addEvent(document, "keydown", Calendar._keyEvent); - Calendar.addEvent(document, "keypress", Calendar._keyEvent); - Calendar.addEvent(document, "mousedown", Calendar._checkCalendar); - } - this.hideShowCovered(); -}; - -/** - * Hides the calendar. Also removes any "hilite" from the class of any TD - * element. - */ -Calendar.prototype.hide = function () { - if (this.isPopup) { - Calendar.removeEvent(document, "keydown", Calendar._keyEvent); - Calendar.removeEvent(document, "keypress", Calendar._keyEvent); - Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar); - } - this.element.style.display = "none"; - this.hidden = true; - this.hideShowCovered(); -}; - -/** - * Shows the calendar at a given absolute position (beware that, depending on - * the calendar element style -- position property -- this might be relative - * to the parent's containing rectangle). - */ -Calendar.prototype.showAt = function (x, y) { - var s = this.element.style; - s.left = x + "px"; - s.top = y + "px"; - this.show(); -}; - -/** Shows the calendar near a given element. */ -Calendar.prototype.showAtElement = function (el, opts) { - var self = this; - var p = Calendar.getAbsolutePos(el); - if (!opts || typeof opts != "string") { - this.showAt(p.x, p.y + el.offsetHeight); - return true; - } - function fixPosition(box) { - if (box.x < 0) - box.x = 0; - if (box.y < 0) - box.y = 0; - var cp = document.createElement("div"); - var s = cp.style; - s.position = "absolute"; - s.right = s.bottom = s.width = s.height = "0px"; - document.body.appendChild(cp); - var br = Calendar.getAbsolutePos(cp); - document.body.removeChild(cp); - if (Calendar.is_ie) { - br.y += document.body.scrollTop; - br.x += document.body.scrollLeft; - } else { - br.y += window.scrollY; - br.x += window.scrollX; - } - var tmp = box.x + box.width - br.x; - if (tmp > 0) box.x -= tmp; - tmp = box.y + box.height - br.y; - if (tmp > 0) box.y -= tmp; - }; - this.element.style.display = "block"; - Calendar.continuation_for_the_fucking_khtml_browser = function() { - var w = self.element.offsetWidth; - var h = self.element.offsetHeight; - self.element.style.display = "none"; - var valign = opts.substr(0, 1); - var halign = "l"; - if (opts.length > 1) { - halign = opts.substr(1, 1); - } - // vertical alignment - switch (valign) { - case "T": p.y -= h; break; - case "B": p.y += el.offsetHeight; break; - case "C": p.y += (el.offsetHeight - h) / 2; break; - case "t": p.y += el.offsetHeight - h; break; - case "b": break; // already there - } - // horizontal alignment - switch (halign) { - case "L": p.x -= w; break; - case "R": p.x += el.offsetWidth; break; - case "C": p.x += (el.offsetWidth - w) / 2; break; - case "l": p.x += el.offsetWidth - w; break; - case "r": break; // already there - } - p.width = w; - p.height = h + 40; - self.monthsCombo.style.display = "none"; - fixPosition(p); - self.showAt(p.x, p.y); - }; - if (Calendar.is_khtml) - setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10); - else - Calendar.continuation_for_the_fucking_khtml_browser(); -}; - -/** Customizes the date format. */ -Calendar.prototype.setDateFormat = function (str) { - this.dateFormat = str; -}; - -/** Customizes the tooltip date format. */ -Calendar.prototype.setTtDateFormat = function (str) { - this.ttDateFormat = str; -}; - -/** - * Tries to identify the date represented in a string. If successful it also - * calls this.setDate which moves the calendar to the given date. - */ -Calendar.prototype.parseDate = function(str, fmt) { - if (!fmt) - fmt = this.dateFormat; - this.setDate(Date.parseDate(str, fmt)); -}; - -Calendar.prototype.hideShowCovered = function () { - if (!Calendar.is_ie && !Calendar.is_opera) - return; - function getVisib(obj){ - var value = obj.style.visibility; - if (!value) { - if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { // Gecko, W3C - if (!Calendar.is_khtml) - value = document.defaultView. - getComputedStyle(obj, "").getPropertyValue("visibility"); - else - value = ''; - } else if (obj.currentStyle) { // IE - value = obj.currentStyle.visibility; - } else - value = ''; - } - return value; - }; - - var tags = new Array("applet", "iframe", "select"); - var el = this.element; - - var p = Calendar.getAbsolutePos(el); - var EX1 = p.x; - var EX2 = el.offsetWidth + EX1; - var EY1 = p.y; - var EY2 = el.offsetHeight + EY1; - - for (var k = tags.length; k > 0; ) { - var ar = document.getElementsByTagName(tags[--k]); - var cc = null; - - for (var i = ar.length; i > 0;) { - cc = ar[--i]; - - p = Calendar.getAbsolutePos(cc); - var CX1 = p.x; - var CX2 = cc.offsetWidth + CX1; - var CY1 = p.y; - var CY2 = cc.offsetHeight + CY1; - - if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { - if (!cc.__msh_save_visibility) { - cc.__msh_save_visibility = getVisib(cc); - } - cc.style.visibility = cc.__msh_save_visibility; - } else { - if (!cc.__msh_save_visibility) { - cc.__msh_save_visibility = getVisib(cc); - } - cc.style.visibility = "hidden"; - } - } - } -}; - -/** Internal function; it displays the bar with the names of the weekday. */ -Calendar.prototype._displayWeekdays = function () { - var fdow = this.firstDayOfWeek; - var cell = this.firstdayname; - var weekend = Calendar._TT["WEEKEND"]; - for (var i = 0; i < 7; ++i) { - cell.className = "day name"; - var realday = (i + fdow) % 7; - if (i) { - cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); - cell.navtype = 100; - cell.calendar = this; - cell.fdow = realday; - Calendar._add_evs(cell); - } - if (weekend.indexOf(realday.toString()) != -1) { - Calendar.addClass(cell, "weekend"); - } - cell.innerHTML = Calendar._SDN[(i + fdow) % 7]; - cell = cell.nextSibling; - } -}; - -/** Internal function. Hides all combo boxes that might be displayed. */ -Calendar.prototype._hideCombos = function () { - this.monthsCombo.style.display = "none"; - this.yearsCombo.style.display = "none"; -}; - -/** Internal function. Starts dragging the element. */ -Calendar.prototype._dragStart = function (ev) { - if (this.dragging) { - return; - } - this.dragging = true; - var posX; - var posY; - if (Calendar.is_ie) { - posY = window.event.clientY + document.body.scrollTop; - posX = window.event.clientX + document.body.scrollLeft; - } else { - posY = ev.clientY + window.scrollY; - posX = ev.clientX + window.scrollX; - } - var st = this.element.style; - this.xOffs = posX - parseInt(st.left); - this.yOffs = posY - parseInt(st.top); - with (Calendar) { - addEvent(document, "mousemove", calDragIt); - addEvent(document, "mouseup", calDragEnd); - } -}; - -// BEGIN: DATE OBJECT PATCHES - -/** Adds the number of days array to the Date object. */ -Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); - -/** Constants used for time computations */ -Date.SECOND = 1000 /* milliseconds */; -Date.MINUTE = 60 * Date.SECOND; -Date.HOUR = 60 * Date.MINUTE; -Date.DAY = 24 * Date.HOUR; -Date.WEEK = 7 * Date.DAY; - -Date.parseDate = function(str, fmt) { - var today = new Date(); - var y = 0; - var m = -1; - var d = 0; - var a = str.split(/\W+/); - var b = fmt.match(/%./g); - var i = 0, j = 0; - var hr = 0; - var min = 0; - for (i = 0; i < a.length; ++i) { - if (!a[i]) - continue; - switch (b[i]) { - case "%d": - case "%e": - d = parseInt(a[i], 10); - break; - - case "%m": - m = parseInt(a[i], 10) - 1; - break; - - case "%Y": - case "%y": - y = parseInt(a[i], 10); - (y < 100) && (y += (y > 29) ? 1900 : 2000); - break; - - case "%b": - case "%B": - for (j = 0; j < 12; ++j) { - if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; } - } - break; - - case "%H": - case "%I": - case "%k": - case "%l": - hr = parseInt(a[i], 10); - break; - - case "%P": - case "%p": - if (/pm/i.test(a[i]) && hr < 12) - hr += 12; - else if (/am/i.test(a[i]) && hr >= 12) - hr -= 12; - break; - - case "%M": - min = parseInt(a[i], 10); - break; - } - } - if (isNaN(y)) y = today.getFullYear(); - if (isNaN(m)) m = today.getMonth(); - if (isNaN(d)) d = today.getDate(); - if (isNaN(hr)) hr = today.getHours(); - if (isNaN(min)) min = today.getMinutes(); - if (y != 0 && m != -1 && d != 0) - return new Date(y, m, d, hr, min, 0); - y = 0; m = -1; d = 0; - for (i = 0; i < a.length; ++i) { - if (a[i].search(/[a-zA-Z]+/) != -1) { - var t = -1; - for (j = 0; j < 12; ++j) { - if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; } - } - if (t != -1) { - if (m != -1) { - d = m+1; - } - m = t; - } - } else if (parseInt(a[i], 10) <= 12 && m == -1) { - m = a[i]-1; - } else if (parseInt(a[i], 10) > 31 && y == 0) { - y = parseInt(a[i], 10); - (y < 100) && (y += (y > 29) ? 1900 : 2000); - } else if (d == 0) { - d = a[i]; - } - } - if (y == 0) - y = today.getFullYear(); - if (m != -1 && d != 0) - return new Date(y, m, d, hr, min, 0); - return today; -}; - -/** Returns the number of days in the current month */ -Date.prototype.getMonthDays = function(month) { - var year = this.getFullYear(); - if (typeof month == "undefined") { - month = this.getMonth(); - } - if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) { - return 29; - } else { - return Date._MD[month]; - } -}; - -/** Returns the number of day in the year. */ -Date.prototype.getDayOfYear = function() { - var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); - var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0); - var time = now - then; - return Math.floor(time / Date.DAY); -}; - -/** Returns the number of the week in year, as defined in ISO 8601. */ -Date.prototype.getWeekNumber = function() { - var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); - var DoW = d.getDay(); - d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu - var ms = d.valueOf(); // GMT - d.setMonth(0); - d.setDate(4); // Thu in Week 1 - return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; -}; - -/** Checks date and time equality */ -Date.prototype.equalsTo = function(date) { - return ((this.getFullYear() == date.getFullYear()) && - (this.getMonth() == date.getMonth()) && - (this.getDate() == date.getDate()) && - (this.getHours() == date.getHours()) && - (this.getMinutes() == date.getMinutes())); -}; - -/** Set only the year, month, date parts (keep existing time) */ -Date.prototype.setDateOnly = function(date) { - var tmp = new Date(date); - this.setDate(1); - this.setFullYear(tmp.getFullYear()); - this.setMonth(tmp.getMonth()); - this.setDate(tmp.getDate()); -}; - -/** Prints the date in a string according to the given format. */ -Date.prototype.print = function (str) { - var m = this.getMonth(); - var d = this.getDate(); - var y = this.getFullYear(); - var wn = this.getWeekNumber(); - var w = this.getDay(); - var s = {}; - var hr = this.getHours(); - var pm = (hr >= 12); - var ir = (pm) ? (hr - 12) : hr; - var dy = this.getDayOfYear(); - if (ir == 0) - ir = 12; - var min = this.getMinutes(); - var sec = this.getSeconds(); - s["%a"] = Calendar._SDN[w]; // abbreviated weekday name [FIXME: I18N] - s["%A"] = Calendar._DN[w]; // full weekday name - s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N] - s["%B"] = Calendar._MN[m]; // full month name - // FIXME: %c : preferred date and time representation for the current locale - s["%C"] = 1 + Math.floor(y / 100); // the century number - s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31) - s["%e"] = d; // the day of the month (range 1 to 31) - // FIXME: %D : american date style: %m/%d/%y - // FIXME: %E, %F, %G, %g, %h (man strftime) - s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format) - s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format) - s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366) - s["%k"] = hr; // hour, range 0 to 23 (24h format) - s["%l"] = ir; // hour, range 1 to 12 (12h format) - s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12 - s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59 - s["%n"] = "\n"; // a newline character - s["%p"] = pm ? "PM" : "AM"; - s["%P"] = pm ? "pm" : "am"; - // FIXME: %r : the time in am/pm notation %I:%M:%S %p - // FIXME: %R : the time in 24-hour notation %H:%M - s["%s"] = Math.floor(this.getTime() / 1000); - s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59 - s["%t"] = "\t"; // a tab character - // FIXME: %T : the time in 24-hour notation (%H:%M:%S) - s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn; - s["%u"] = w + 1; // the day of the week (range 1 to 7, 1 = MON) - s["%w"] = w; // the day of the week (range 0 to 6, 0 = SUN) - // FIXME: %x : preferred date representation for the current locale without the time - // FIXME: %X : preferred time representation for the current locale without the date - s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99) - s["%Y"] = y; // year with the century - s["%%"] = "%"; // a literal '%' character - - var re = /%./g; - if (!Calendar.is_ie5 && !Calendar.is_khtml) - return str.replace(re, function (par) { return s[par] || par; }); - - var a = str.match(re); - for (var i = 0; i < a.length; i++) { - var tmp = s[a[i]]; - if (tmp) { - re = new RegExp(a[i], 'g'); - str = str.replace(re, tmp); - } - } - - return str; -}; - -Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; -Date.prototype.setFullYear = function(y) { - var d = new Date(this); - d.__msh_oldSetFullYear(y); - if (d.getMonth() != this.getMonth()) - this.setDate(28); - this.__msh_oldSetFullYear(y); -}; - -// END: DATE OBJECT PATCHES - - -// global object that remembers the calendar -window._dynarch_popupCalendar = null; diff --git a/posterita/posterita/web/javascripts/modalbox.js b/posterita/posterita/web/javascripts/modalbox.js deleted file mode 100644 index af29091ba4..0000000000 --- a/posterita/posterita/web/javascripts/modalbox.js +++ /dev/null @@ -1,573 +0,0 @@ -/* -ModalBox - The pop-up window thingie with AJAX, based on prototype and script.aculo.us. - -Copyright Andrey Okonetchnikov (andrej.okonetschnikow@gmail.com), 2006-2007 -All rights reserved. - -VERSION 1.6.0 -Last Modified: 12/13/2007 -*/ - -if (!window.Modalbox) - var Modalbox = new Object(); - -Modalbox.Methods = { - overrideAlert: false, // Override standard browser alert message with ModalBox - focusableElements: new Array, - currFocused: 0, - initialized: false, - active: true, - options: { - title: "ModalBox Window", // Title of the ModalBox window - overlayClose: true, // Close modal box by clicking on overlay - width: 500, // Default width in px - height: 90, // Default height in px - overlayOpacity: .65, // Default overlay opacity - overlayDuration: .25, // Default overlay fade in/out duration in seconds - slideDownDuration: .5, // Default Modalbox appear slide down effect in seconds - slideUpDuration: .5, // Default Modalbox hiding slide up effect in seconds - resizeDuration: .25, // Default resize duration seconds - inactiveFade: true, // Fades MB window on inactive state - transitions: true, // Toggles transition effects. Transitions are enabled by default - loadingString: "Please wait. Loading...", // Default loading string message - closeString: "Close window", // Default title attribute for close window link - closeValue: "×", // Default string for close link in the header - params: {}, - method: 'get', // Default Ajax request method - autoFocusing: true, // Toggles auto-focusing for form elements. Disable for long text pages. - aspnet: false // Should be use then using with ASP.NET costrols. Then true Modalbox window will be injected into the first form element. - }, - _options: new Object, - - setOptions: function(options) { - Object.extend(this.options, options || {}); - }, - - _init: function(options) { - // Setting up original options with default options - Object.extend(this._options, this.options); - this.setOptions(options); - - //Create the overlay - this.MBoverlay = new Element("div", { id: "MB_overlay", opacity: "0" }); - - //Create DOm for the window - this.MBwindow = new Element("div", {id: "MB_window", style: "display: none"}).update( - this.MBframe = new Element("div", {id: "MB_frame"}).update( - this.MBheader = new Element("div", {id: "MB_header"}).update( - this.MBcaption = new Element("div", {id: "MB_caption"}) - ) - ) - ); - this.MBclose = new Element("a", {id: "MB_close", title: this.options.closeString, href: "#"}).update("" + this.options.closeValue + ""); - this.MBheader.insert({'bottom':this.MBclose}); - - this.MBcontent = new Element("div", {id: "MB_content"}).update( - this.MBloading = new Element("div", {id: "MB_loading"}).update(this.options.loadingString) - ); - this.MBframe.insert({'bottom':this.MBcontent}); - - // Inserting into DOM. If parameter set and form element have been found will inject into it. Otherwise will inject into body as topmost element. - // Be sure to set padding and marging to null via CSS for both body and (in case of asp.net) form elements. - var injectToEl = this.options.aspnet ? $(document.body).down('form') : $(document.body); - injectToEl.insert({'top':this.MBwindow}); - injectToEl.insert({'top':this.MBoverlay}); - - // Initial scrolling position of the window. To be used for remove scrolling effect during ModalBox appearing - this.initScrollX = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft; - this.initScrollY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop; - - //Adding event observers - this.hideObserver = this._hide.bindAsEventListener(this); - this.kbdObserver = this._kbdHandler.bindAsEventListener(this); - this._initObservers(); - - this.initialized = true; // Mark as initialized - }, - - show: function(content, options) { - if(!this.initialized) this._init(options); // Check for is already initialized - - this.content = content; - this.setOptions(options); - - if(this.options.title) // Updating title of the MB - $(this.MBcaption).update(this.options.title); - else { // If title isn't given, the header will not displayed - $(this.MBheader).hide(); - $(this.MBcaption).hide(); - } - - if(this.MBwindow.style.display == "none") { // First modal box appearing - this._appear(); - this.event("onShow"); // Passing onShow callback - } - else { // If MB already on the screen, update it - this._update(); - this.event("onUpdate"); // Passing onUpdate callback - } - }, - - hide: function(options) { // External hide method to use from external HTML and JS - if(this.initialized) { - // Reading for options/callbacks except if event given as a pararmeter - if(options && typeof options.element != 'function') Object.extend(this.options, options); - // Passing beforeHide callback - this.event("beforeHide"); - if(this.options.transitions) - Effect.SlideUp(this.MBwindow, { duration: this.options.slideUpDuration, transition: Effect.Transitions.sinoidal, afterFinish: this._deinit.bind(this) } ); - else { - $(this.MBwindow).hide(); - this._deinit(); - } - } else throw("Modalbox is not initialized."); - }, - - _hide: function(event) { // Internal hide method to use with overlay and close link - event.stop(); // Stop event propaganation for link elements - /* Then clicked on overlay we'll check the option and in case of overlayClose == false we'll break hiding execution [Fix for #139] */ - if(event.element().id == 'MB_overlay' && !this.options.overlayClose) return false; - this.hide(); - }, - - alert: function(message){ - var html = '

    ' + message + '

    '; - Modalbox.show(html, {title: 'Alert: ' + document.title, width: 300}); - }, - - _appear: function() { // First appearing of MB - if(Prototype.Browser.IE && !navigator.appVersion.match(/\b7.0\b/)) { // Preparing IE 6 for showing modalbox - window.scrollTo(0,0); - this._prepareIE("100%", "hidden"); - } - this._setWidth(); - this._setPosition(); - if(this.options.transitions) { - $(this.MBoverlay).setStyle({opacity: 0}); - new Effect.Fade(this.MBoverlay, { - from: 0, - to: this.options.overlayOpacity, - duration: this.options.overlayDuration, - afterFinish: function() { - new Effect.SlideDown(this.MBwindow, { - duration: this.options.slideDownDuration, - transition: Effect.Transitions.sinoidal, - afterFinish: function(){ - this._setPosition(); - this.loadContent(); - }.bind(this) - }); - }.bind(this) - }); - } else { - $(this.MBoverlay).setStyle({opacity: this.options.overlayOpacity}); - $(this.MBwindow).show(); - this._setPosition(); - this.loadContent(); - } - this._setWidthAndPosition = this._setWidthAndPosition.bindAsEventListener(this); - Event.observe(window, "resize", this._setWidthAndPosition); - }, - - resize: function(byWidth, byHeight, options) { // Change size of MB without loading content - var wHeight = $(this.MBwindow).getHeight(); - var wWidth = $(this.MBwindow).getWidth(); - var hHeight = $(this.MBheader).getHeight(); - var cHeight = $(this.MBcontent).getHeight(); - var newHeight = ((wHeight - hHeight + byHeight) < cHeight) ? (cHeight + hHeight - wHeight) : byHeight; - if(options) this.setOptions(options); // Passing callbacks - if(this.options.transitions) { - new Effect.ScaleBy(this.MBwindow, byWidth, newHeight, { - duration: this.options.resizeDuration, - afterFinish: function() { - this.event("_afterResize"); // Passing internal callback - this.event("afterResize"); // Passing callback - }.bind(this) - }); - } else { - this.MBwindow.setStyle({width: wWidth + byWidth + "px", height: wHeight + newHeight + "px"}); - setTimeout(function() { - this.event("_afterResize"); // Passing internal callback - this.event("afterResize"); // Passing callback - }.bind(this), 1); - - } - - }, - - resizeToContent: function(options){ - - // Resizes the modalbox window to the actual content height. - // This might be useful to resize modalbox after some content modifications which were changed ccontent height. - - var byHeight = this.options.height - this.MBwindow.offsetHeight; - if(byHeight != 0) { - if(options) this.setOptions(options); // Passing callbacks - Modalbox.resize(0, byHeight); - } - }, - - resizeToInclude: function(element, options){ - - // Resizes the modalbox window to the camulative height of element. Calculations are using CSS properties for margins and border. - // This method might be useful to resize modalbox before including or updating content. - - var el = $(element); - var elHeight = el.getHeight() + parseInt(el.getStyle('margin-top')) + parseInt(el.getStyle('margin-bottom')) + parseInt(el.getStyle('border-top-width')) + parseInt(el.getStyle('border-bottom-width')); - if(elHeight > 0) { - if(options) this.setOptions(options); // Passing callbacks - Modalbox.resize(0, elHeight); - } - }, - - _update: function() { // Updating MB in case of wizards - $(this.MBcontent).update(""); - this.MBcontent.appendChild(this.MBloading); - $(this.MBloading).update(this.options.loadingString); - this.currentDims = [this.MBwindow.offsetWidth, this.MBwindow.offsetHeight]; - Modalbox.resize((this.options.width - this.currentDims[0]), (this.options.height - this.currentDims[1]), {_afterResize: this._loadAfterResize.bind(this) }); - }, - - loadContent: function () { - if(this.event("beforeLoad") != false) { // If callback passed false, skip loading of the content - if(typeof this.content == 'string') { - var htmlRegExp = new RegExp(/<\/?[^>]+>/gi); - if(htmlRegExp.test(this.content)) { // Plain HTML given as a parameter - this._insertContent(this.content.stripScripts()); - this._putContent(function(){ - this.content.extractScripts().map(function(script) { - return eval(script.replace("", "")); - }.bind(window)); - }.bind(this)); - } else // URL given as a parameter. We'll request it via Ajax - new Ajax.Request( this.content, { method: this.options.method.toLowerCase(), parameters: this.options.params, - onSuccess: function(transport) { - var response = new String(transport.responseText); - this._insertContent(transport.responseText.stripScripts()); - this._putContent(function(){ - response.extractScripts().map(function(script) { - return eval(script.replace("", "")); - }.bind(window)); - }); - }.bind(this), - onException: function(instance, exception){ - Modalbox.hide(); - throw('Modalbox Loading Error: ' + exception); - } - }); - - } else if (typeof this.content == 'object') {// HTML Object is given - this._insertContent(this.content); - this._putContent(); - } else { - Modalbox.hide(); - throw('Modalbox Parameters Error: Please specify correct URL or HTML element (plain HTML or object)'); - } - } - }, - - _insertContent: function(content){ - $(this.MBcontent).hide().update(""); - if(typeof content == 'string') { - setTimeout(function() { // Hack to disable content flickering in Firefox - this.MBcontent.update(content); - }.bind(this), 1); - } else if (typeof content == 'object') { // HTML Object is given - var _htmlObj = content.cloneNode(true); // If node already a part of DOM we'll clone it - // If clonable element has ID attribute defined, modifying it to prevent duplicates - if(content.id) content.id = "MB_" + content.id; - /* Add prefix for IDs on all elements inside the DOM node */ - $(content).select('*[id]').each(function(el){ el.id = "MB_" + el.id; }); - this.MBcontent.appendChild(_htmlObj); - this.MBcontent.down().show(); // Toggle visibility for hidden nodes - if(Prototype.Browser.IE) // Toggling back visibility for hidden selects in IE - $$("#MB_content select").invoke('setStyle', {'visibility': ''}); - } - }, - - _putContent: function(callback){ - // Prepare and resize modal box for content - if(this.options.height == this._options.height) { - setTimeout(function() { // MSIE sometimes doesn't display content correctly - Modalbox.resize(0, $(this.MBcontent).getHeight() - $(this.MBwindow).getHeight() + $(this.MBheader).getHeight(), { - afterResize: function(){ - this.MBcontent.show().makePositioned(); - this.focusableElements = this._findFocusableElements(); - this._setFocus(); // Setting focus on first 'focusable' element in content (input, select, textarea, link or button) - setTimeout(function(){ // MSIE fix - if(callback != undefined) - callback(); // Executing internal JS from loaded content - this.event("afterLoad"); // Passing callback - }.bind(this),1); - }.bind(this) - }); - }.bind(this), 1); - } else { // Height is defined. Creating a scrollable window - this._setWidth(); - this.MBcontent.setStyle({overflow: 'auto', height: $(this.MBwindow).getHeight() - $(this.MBheader).getHeight() - 13 + 'px'}); - this.MBcontent.show(); - this.focusableElements = this._findFocusableElements(); - this._setFocus(); // Setting focus on first 'focusable' element in content (input, select, textarea, link or button) - setTimeout(function(){ // MSIE fix - if(callback != undefined) - callback(); // Executing internal JS from loaded content - this.event("afterLoad"); // Passing callback - }.bind(this),1); - } - }, - - activate: function(options){ - this.setOptions(options); - this.active = true; - $(this.MBclose).observe("click", this.hideObserver); - if(this.options.overlayClose) - $(this.MBoverlay).observe("click", this.hideObserver); - $(this.MBclose).show(); - if(this.options.transitions && this.options.inactiveFade) - new Effect.Appear(this.MBwindow, {duration: this.options.slideUpDuration}); - }, - - deactivate: function(options) { - this.setOptions(options); - this.active = false; - $(this.MBclose).stopObserving("click", this.hideObserver); - if(this.options.overlayClose) - $(this.MBoverlay).stopObserving("click", this.hideObserver); - $(this.MBclose).hide(); - if(this.options.transitions && this.options.inactiveFade) - new Effect.Fade(this.MBwindow, {duration: this.options.slideUpDuration, to: .75}); - }, - - _initObservers: function(){ - $(this.MBclose).observe("click", this.hideObserver); - if(this.options.overlayClose) - $(this.MBoverlay).observe("click", this.hideObserver); - if(Prototype.Browser.IE) - Event.observe(document, "keydown", this.kbdObserver); - else - Event.observe(document, "keypress", this.kbdObserver); - }, - - _removeObservers: function(){ - $(this.MBclose).stopObserving("click", this.hideObserver); - if(this.options.overlayClose) - $(this.MBoverlay).stopObserving("click", this.hideObserver); - if(Prototype.Browser.IE) - Event.stopObserving(document, "keydown", this.kbdObserver); - else - Event.stopObserving(document, "keypress", this.kbdObserver); - }, - - _loadAfterResize: function() { - this._setWidth(); - this._setPosition(); - this.loadContent(); - }, - - _setFocus: function() { - /* Setting focus to the first 'focusable' element which is one with tabindex = 1 or the first in the form loaded. */ - if(this.focusableElements.length > 0 && this.options.autoFocusing == true) { - var firstEl = this.focusableElements.find(function (el){ - return el.tabIndex == 1; - }) || this.focusableElements.first(); - this.currFocused = this.focusableElements.toArray().indexOf(firstEl); - firstEl.focus(); // Focus on first focusable element except close button - } else if($(this.MBclose).visible()) - $(this.MBclose).focus(); // If no focusable elements exist focus on close button - }, - - _findFocusableElements: function(){ // Collect form elements or links from MB content - this.MBcontent.select('input:not([type~=hidden]), select, textarea, button, a[href]').invoke('addClassName', 'MB_focusable'); - return this.MBcontent.select('.MB_focusable'); - }, - - _kbdHandler: function(event) { - var node = event.element(); - switch(event.keyCode) { - case Event.KEY_TAB: - event.stop(); - - /* Switching currFocused to the element which was focused by mouse instead of TAB-key. Fix for #134 */ - if(node != this.focusableElements[this.currFocused]) - this.currFocused = this.focusableElements.toArray().indexOf(node); - - if(!event.shiftKey) { //Focusing in direct order - if(this.currFocused == this.focusableElements.length - 1) { - this.focusableElements.first().focus(); - this.currFocused = 0; - } else { - this.currFocused++; - this.focusableElements[this.currFocused].focus(); - } - } else { // Shift key is pressed. Focusing in reverse order - if(this.currFocused == 0) { - this.focusableElements.last().focus(); - this.currFocused = this.focusableElements.length - 1; - } else { - this.currFocused--; - this.focusableElements[this.currFocused].focus(); - } - } - break; - case Event.KEY_ESC: - if(this.active) this._hide(event); - break; - case 32: - this._preventScroll(event); - break; - case 0: // For Gecko browsers compatibility - if(event.which == 32) this._preventScroll(event); - break; - case Event.KEY_UP: - case Event.KEY_DOWN: - case Event.KEY_PAGEDOWN: - case Event.KEY_PAGEUP: - case Event.KEY_HOME: - case Event.KEY_END: - // Safari operates in slightly different way. This realization is still buggy in Safari. - if(Prototype.Browser.WebKit && !["textarea", "select"].include(node.tagName.toLowerCase())) - event.stop(); - else if( (node.tagName.toLowerCase() == "input" && ["submit", "button"].include(node.type)) || (node.tagName.toLowerCase() == "a") ) - event.stop(); - break; - } - }, - - _preventScroll: function(event) { // Disabling scrolling by "space" key - if(!["input", "textarea", "select", "button"].include(event.element().tagName.toLowerCase())) - event.stop(); - }, - - _deinit: function() - { - this._removeObservers(); - Event.stopObserving(window, "resize", this._setWidthAndPosition ); - if(this.options.transitions) { - Effect.toggle(this.MBoverlay, 'appear', {duration: this.options.overlayDuration, afterFinish: this._removeElements.bind(this) }); - } else { - this.MBoverlay.hide(); - this._removeElements(); - } - $(this.MBcontent).setStyle({overflow: '', height: ''}); - }, - - _removeElements: function () { - $(this.MBoverlay).remove(); - $(this.MBwindow).remove(); - if(Prototype.Browser.IE && !navigator.appVersion.match(/\b7.0\b/)) { - this._prepareIE("", ""); // If set to auto MSIE will show horizontal scrolling - window.scrollTo(this.initScrollX, this.initScrollY); - } - - /* Replacing prefixes 'MB_' in IDs for the original content */ - if(typeof this.content == 'object') { - if(this.content.id && this.content.id.match(/MB_/)) { - this.content.id = this.content.id.replace(/MB_/, ""); - } - this.content.select('*[id]').each(function(el){ el.id = el.id.replace(/MB_/, ""); }); - } - /* Initialized will be set to false */ - this.initialized = false; - this.event("afterHide"); // Passing afterHide callback - this.setOptions(this._options); //Settings options object into intial state - }, - - _setWidth: function () { //Set size - $(this.MBwindow).setStyle({width: this.options.width + "px", height: this.options.height + "px"}); - }, - - _setPosition: function () { - $(this.MBwindow).setStyle({left: Math.round((Element.getWidth(document.body) - Element.getWidth(this.MBwindow)) / 2 ) + "px"}); - }, - - _setWidthAndPosition: function () { - $(this.MBwindow).setStyle({width: this.options.width + "px"}); - this._setPosition(); - }, - - _getScrollTop: function () { //From: http://www.quirksmode.org/js/doctypes.html - var theTop; - if (document.documentElement && document.documentElement.scrollTop) - theTop = document.documentElement.scrollTop; - else if (document.body) - theTop = document.body.scrollTop; - return theTop; - }, - _prepareIE: function(height, overflow){ - $$('html, body').invoke('setStyle', {width: height, height: height, overflow: overflow}); // IE requires width and height set to 100% and overflow hidden - $$("select").invoke('setStyle', {'visibility': overflow}); // Toggle visibility for all selects in the common document - }, - event: function(eventName) { - if(this.options[eventName]) { - var returnValue = this.options[eventName](); // Executing callback - this.options[eventName] = null; // Removing callback after execution - if(returnValue != undefined) - return returnValue; - else - return true; - } - return true; - } -}; - -Object.extend(Modalbox, Modalbox.Methods); - -if(Modalbox.overrideAlert) window.alert = Modalbox.alert; - -Effect.ScaleBy = Class.create(); -Object.extend(Object.extend(Effect.ScaleBy.prototype, Effect.Base.prototype), { - initialize: function(element, byWidth, byHeight, options) { - this.element = $(element) - var options = Object.extend({ - scaleFromTop: true, - scaleMode: 'box', // 'box' or 'contents' or {} with provided values - scaleByWidth: byWidth, - scaleByHeight: byHeight - }, arguments[3] || {}); - this.start(options); - }, - setup: function() { - this.elementPositioning = this.element.getStyle('position'); - - this.originalTop = this.element.offsetTop; - this.originalLeft = this.element.offsetLeft; - - this.dims = null; - if(this.options.scaleMode=='box') - this.dims = [this.element.offsetHeight, this.element.offsetWidth]; - if(/^content/.test(this.options.scaleMode)) - this.dims = [this.element.scrollHeight, this.element.scrollWidth]; - if(!this.dims) - this.dims = [this.options.scaleMode.originalHeight, - this.options.scaleMode.originalWidth]; - - this.deltaY = this.options.scaleByHeight; - this.deltaX = this.options.scaleByWidth; - }, - update: function(position) { - var currentHeight = this.dims[0] + (this.deltaY * position); - var currentWidth = this.dims[1] + (this.deltaX * position); - - currentHeight = (currentHeight > 0) ? currentHeight : 0; - currentWidth = (currentWidth > 0) ? currentWidth : 0; - - this.setDimensions(currentHeight, currentWidth); - }, - - setDimensions: function(height, width) { - var d = {}; - d.width = width + 'px'; - d.height = height + 'px'; - - var topd = Math.round((height - this.dims[0])/2); - var leftd = Math.round((width - this.dims[1])/2); - if(this.elementPositioning == 'absolute' || this.elementPositioning == 'fixed') { - if(!this.options.scaleFromTop) d.top = this.originalTop-topd + 'px'; - d.left = this.originalLeft-leftd + 'px'; - } else { - if(!this.options.scaleFromTop) d.top = -topd + 'px'; - d.left = -leftd + 'px'; - } - this.element.setStyle(d); - } -}); \ No newline at end of file diff --git a/posterita/posterita/web/javascripts/popup.js b/posterita/posterita/web/javascripts/popup.js deleted file mode 100644 index 8a50083090..0000000000 --- a/posterita/posterita/web/javascripts/popup.js +++ /dev/null @@ -1,470 +0,0 @@ -/* - popup.js - - A lightweight general purpose JavaScript DOM element popup class. - - Webpage: - http;//www.methods.co.nz/popup/popup.html - - Inspired by: - Lightbox2: http://www.huddletogether.com/projects/lightbox2/ - Lightbox Gone Wild: http://particletree.com/features/lightbox-gone-wild/ - Tooltip: http://blog.innerewut.de/pages/tooltip - Prototype library: http://www.prototypejs.org/ - Scriptaculous library: http://script.aculo.us/ - - Attributions: - - Uses the getPageSize() function from Lightbox v2.02 by Lokesh Dhakar - (http://www.huddletogether.com/projects/lightbox2/). - - Adapted the the modal overlay technique used in Lightbox v2.02 by Lokesh - Dhakar (http://www.huddletogether.com/projects/lightbox2/). - - Version: 1.0.1 - - Author: Stuart Rackham - License: This source code is released under the MIT license. - - Copyright (c) Stuart Rackham 2007 - -*/ - -var Popup = Class.create(); -Popup.zIndex = 1000; // z-index of first popup. - -Popup.prototype = { - - /* - Popup creation - */ - initialize: function(popup, link) { - var options = Object.extend({ - modal: false, - effect: 'fade', - hidden: true, - closebox: 'popup_closebox', // CSS class name of click-to-close elements. - draghandle: 'popup_draghandle' // CSS class name of drag handle elements. - }, arguments[2] || {}); - options.position = options.position || (options.modal ? 'center' : 'auto'); - options.trigger = options.trigger || (options.modal ? 'click' : 'mouseover'); - options.duration = this.first_value(options.duration, Popup.duration, 0.5); - options.show_duration = this.first_value(options.show_duration, options.duration); - options.hide_duration = this.first_value(options.hide_duration, options.duration); - options.opacity = this.first_value(options.opacity, Popup.opacity, 0.5); - options.show_delay = this.first_value(options.show_delay, Popup.show_delay, 500); - options.hide_delay = this.first_value(options.hide_delay, Popup.hide_delay, 200); - options.cursor_margin = this.first_value(options.cursor_margin, Popup.cursor_margin, 5); - this.options = options; - if (link) { - this.link = $(link); - } - this.popup = $(popup); - this.popup.popup = this; // Make the popup object a property of the DOM popup element. - if (options.hidden) { - this.popup.hide(); - } - if (options.closebox) { - this.closeboxes = document.getElementsByClassName(options.closebox, this.popup); - if (this.popup.hasClassName(options.closebox)) { - this.closeboxes[this.closeboxes.length] = this.popup; - } - } - else { - this.closeboxes = []; - } - if (options.draghandle) { - var draghandles = document.getElementsByClassName(options.draghandle, this.popup); - for (i = 0; i < draghandles.length; i++) { - new Draggable(this.popup, { handle: draghandles[i] }); - } - if (this.popup.hasClassName(options.draghandle)) { - new Draggable(this.popup, { handle: this.popup }); - } - } - this.register_events(); - }, - - - /* - Event functions - */ - - register_events: function() { - var trigger_function; - if (this.is_auto_open()) { - trigger_function = this.start_show_timer; - if (this.link) { - Event.observe(this.link, 'mouseout', this.stop_show_timer.bindAsEventListener(this)); - } - } - else { - trigger_function = this.show; - } - if (this.link) { - Event.observe(this.link, this.options.trigger, trigger_function.bindAsEventListener(this)); - } - if (!this.options.modal) { - Event.observe(this.popup, 'click', this.bring_to_front.bindAsEventListener(this)); - } - if (this.closeboxes.length > 0) { - for (var i = 0; i < this.closeboxes.length; i++) { - Event.observe(this.closeboxes[i], 'click', this.hide.bindAsEventListener(this)); - } - } - else { - if (this.link) { - Event.observe(this.link, 'mouseout', this.start_hide_timer.bindAsEventListener(this)); - } - Event.observe(this.popup, 'mouseover', this.stop_hide_timer.bindAsEventListener(this)); - Event.observe(this.popup, 'mouseout', this.start_hide_timer.bindAsEventListener(this)); - } - }, - - bring_to_front: function(event) { - // Bring to front if not already there. - if (Number(this.popup.style.zIndex) < Popup.zIndex - 1) { - this.popup.style.zIndex = Popup.zIndex++; - } - }, - - start_show_timer: function(event) { - // NOTE: event is bound to this.show but it's state changes between being - // bound here and arriving at this.show -- specifically, the mouse - // coordinates are reset to zero). I've no idea why. Anyway, this is the - // reason for passing the event mouse coordinates as properties of this. - this.stop_show_timer(event); - this.mouse_x = Event.pointerX(event); - this.mouse_y = Event.pointerY(event); - this.show_timer = setTimeout(this.show.bind(this, event), this.options.show_delay); - }, - - stop_show_timer: function(event) { - if (this.show_timer) { - clearTimeout(this.show_timer); - this.show_timer = null; - } - }, - - start_hide_timer: function(event) { - this.stop_hide_timer(event); - this.hide_timer = setTimeout(this.hide.bind(this, event), this.options.hide_delay); - }, - - stop_hide_timer: function(event) { - if (this.hide_timer) { - clearTimeout(this.hide_timer); - this.hide_timer = null; - } - }, - - show: function(event) { - this.stop_show_timer(event); - this.stop_hide_timer(event); - if (this.is_open) { - return; - } - if (this.options.modal) { - this.show_overlay(); - } - var pos; - if (!event) { - // We only arrive here if this.show has been called externally. - pos = this.get_popup_position(); - } - else if (this.is_auto_open()) { - // Because auto-open popups calls this.show indirectly via start_show_timer. - pos = this.get_popup_position(this.mouse_x, this.mouse_y); - } - else { - pos = this.get_popup_position(Event.pointerX(event), Event.pointerY(event)); - } - Element.setStyle(this.popup, { top: pos.y, left: pos.x, zIndex: Popup.zIndex++ }); - this.is_open = true; - switch (this.options.effect) { - case 'slide': - Effect.SlideDown(this.popup, {duration: this.options.show_duration}); - break; - case 'grow': - Effect.Grow(this.popup, {duration: this.options.show_duration}); - break; - case 'blind': - Effect.BlindDown(this.popup, {duration: this.options.show_duration}); - break; - case 'fade': - default: - Effect.Appear(this.popup, {duration: this.options.show_duration}); - break; - } - }, - - hide: function(event){ - this.is_open = false; - switch (this.options.effect) { - case 'slide': - Effect.SlideUp(this.popup, {duration: this.options.hide_duration}); - break; - case 'grow': - Effect.Shrink(this.popup, {duration: this.options.hide_duration}); - break; - case 'blind': - Effect.BlindUp(this.popup, {duration: this.options.hide_duration}); - break; - case 'fade': - default: - Effect.Fade(this.popup, {duration: this.options.hide_duration}); - break; - } - if (this.options.modal) { - this.hide_overlay(); - } - }, - - - /* - Helper functions - */ - - // Return the first function argument that is not undefined. - // Because when zero numerical value are possible you can't use || chains. - first_value: function() { - for (var i = 0; i < arguments.length; i++) { - if (arguments[i] !== undefined) { - return arguments[i]; - } - } - return undefined; - }, - - is_auto_open: function() { - return this.options.trigger == 'mouseover'; - }, - - show_overlay: function() { - if (!Popup.overlay) { - var overlay = document.createElement('div'); - overlay.setAttribute('id','popup_overlay'); - overlay.style.display = 'none'; - document.body.appendChild(overlay); - Popup.overlay = overlay; - Popup.overlay_levels = []; - } - Popup.overlay.style.height = this.get_page_dimensions().height + 'px'; - var z = Popup.zIndex++; - Popup.overlay.style.zIndex = z; - Popup.overlay_levels.push(z); - if ( Popup.overlay_levels.length == 1) { // Opening the first modal popup. - // Queue the global overlay effect to ensure correct execution order. - new Effect.Appear(Popup.overlay, - { duration: this.options.show_duration, - to: this.options.opacity, - queue: {position: 'end', scope: 'popup_overlay'} - }); - } - else { // There is another modal popup at a lower level so move the overlay forward. - Popup.overlay.style.zIndex = z; - } - }, - - hide_overlay: function() { - Popup.overlay_levels.pop(); - var z = Popup.overlay_levels.pop(); - if (z) { // There is another modal popup at a lower level so move the overlay back. - Popup.overlay_levels.push(z); - Popup.overlay.style.zIndex = z; - } - else { // The last modal popup is being closed so hide the overlay - // Queue the global overlay effect to ensure correct execution order. - new Effect.Fade(Popup.overlay, - { duration: this.options.hide_duration, - queue: {position: 'end', scope: 'popup_overlay'} - }); - } - }, - - - /* - Positioning functions - */ - - // Return the top and left CSS position strings as an {x,y} object that the - // popup should be shown at. mouse_x and mouse_y are the mouse x,y coordinates - // numbers when the popup was triggered. - get_popup_position: function(mouse_x, mouse_y) { - var pos; - switch (this.options.position) { - case 'auto': - pos = this.get_auto_position(mouse_x, mouse_y); - break; - case 'center': - pos = this.get_center_position(); - break; - case 'below': - pos = this.get_below_position(); - break; - default: - // Check for x,y postion format (x and y can be any valid CSS left or - // top property value). - if (mo = this.options.position.match(/^\s*([^\s,]+)\s*,\s*([^\s,]+)\s*$/)) { - pos = {x: mo[1], y: mo[2]}; - // If possible convert to numbers. - pos.x = Number(pos.x) || pos.x; - pos.y = Number(pos.y) || pos.y; - } - else { - pos = {x: 0, y: 0}; - } - break; - } - if (typeof pos.x == 'number') { - pos.x += 'px'; - } - if (typeof pos.y == 'number') { - pos.y += 'px'; - } - return pos; - }, - - get_below_position: function() { - var pos = Position.cumulativeOffset(this.link); - return {x: pos[0], y: pos[1] + Element.getHeight(this.link)}; - }, - - get_center_position: function() { - dim = Element.getDimensions(this.popup); - var popup_width = dim.width; - var popup_height = dim.height; - dim = this.get_viewport_dimensions(); - var viewport_width = dim.width; - var viewport_height = dim.height; - - var x; - if (popup_width >= viewport_width) { - x = 0; - } - else { - x = (viewport_width - popup_width)/2; - } - - var y; - if (popup_height >= viewport_height) { - y = 0; - } - else { - y = (viewport_height - popup_height)/2; - } - - return {x: x, y: y}; - }, - - get_auto_position: function(mouse_x, mouse_y) { - dim = Element.getDimensions(this.popup); - var popup_width = dim.width; - var popup_height = dim.height; - dim = this.get_viewport_dimensions(); - var viewport_width = dim.width; - var viewport_height = dim.height; - - var available_right = viewport_width - (mouse_x + this.options.cursor_margin); - var available_left = mouse_x - this.options.cursor_margin; - var available_top = mouse_y - this.options.cursor_margin; - var available_bottom = viewport_height - (mouse_x + this.options.cursor_margin); - var offset = this.options.cursor_margin; - var x = mouse_x; - var y = mouse_y; - - if (popup_width >= viewport_width) { - x = 0; - } - else if (popup_width <= available_right) { - x += offset; - } - else if (popup_width <= available_left) { - x -= popup_width + offset; - } - else if (available_right >= available_left) { - x = viewport_width - popup_width; - } - else { - x = 0; - } - - if (popup_height >= viewport_height) { - y = 0; - } - else if (popup_height <= available_bottom) { - y += offset; - } - else if (popup_height <= available_top) { - y -= popup_height + offset; - } - else if (available_bottom >= available_top) { - y = viewport_height - popup_height; - } - else { - y = 0; - } - - return {x: x, y: y}; - }, - - get_viewport_dimensions: function() { - var dim = this.getPageSize(); - return {width: dim[2], height: dim[3]}; - }, - - get_page_dimensions: function() { - var dim = this.getPageSize(); - return {width: dim[0], height: dim[1]}; - }, - - // This function from Lightbox v2.02 by Lokesh Dhakar - // (http://www.huddletogether.com/projects/lightbox2/). - // - // Returns array with page width, height and window width, height - // Core code from - quirksmode.org - // Edit for Firefox by pHaez - // - getPageSize: function() { - var xScroll, yScroll; - - if (window.innerHeight && window.scrollMaxY) { - xScroll = document.body.scrollWidth; - yScroll = window.innerHeight + window.scrollMaxY; - } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac - xScroll = document.body.scrollWidth; - yScroll = document.body.scrollHeight; - } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari - xScroll = document.body.offsetWidth; - yScroll = document.body.offsetHeight; - } - - var windowWidth, windowHeight; - if (self.innerHeight) { // all except Explorer - windowWidth = self.innerWidth; - windowHeight = self.innerHeight; - } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode - windowWidth = document.documentElement.clientWidth; - windowHeight = document.documentElement.clientHeight; - } else if (document.body) { // other Explorers - windowWidth = document.body.clientWidth; - windowHeight = document.body.clientHeight; - } - - // for small pages with total height less then height of the viewport - if(yScroll < windowHeight){ - pageHeight = windowHeight; - } else { - pageHeight = yScroll; - } - - // for small pages with total width less then width of the viewport - if(xScroll < windowWidth){ - pageWidth = windowWidth; - } else { - pageWidth = xScroll; - } - - arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); - return arrayPageSize; - } - -} diff --git a/posterita/posterita/web/javascripts/prototype.js b/posterita/posterita/web/javascripts/prototype.js deleted file mode 100644 index 8613914b1a..0000000000 --- a/posterita/posterita/web/javascripts/prototype.js +++ /dev/null @@ -1,4170 +0,0 @@ -/* Prototype JavaScript framework, version 1.6.0.1 - * (c) 2005-2007 Sam Stephenson - * - * Prototype is freely distributable under the terms of an MIT-style license. - * For details, see the Prototype web site: http://www.prototypejs.org/ - * - *--------------------------------------------------------------------------*/ - -var Prototype = { - Version: '1.6.0.1', - - Browser: { - IE: !!(window.attachEvent && !window.opera), - Opera: !!window.opera, - WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, - Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, - MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) - }, - - BrowserFeatures: { - XPath: !!document.evaluate, - ElementExtensions: !!window.HTMLElement, - SpecificElementExtensions: - document.createElement('div').__proto__ && - document.createElement('div').__proto__ !== - document.createElement('form').__proto__ - }, - - ScriptFragment: ']*>([\\S\\s]*?)<\/script>', - JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, - - emptyFunction: function() { }, - K: function(x) { return x } -}; - -if (Prototype.Browser.MobileSafari) - Prototype.BrowserFeatures.SpecificElementExtensions = false; - - -/* Based on Alex Arnell's inheritance implementation. */ -var Class = { - create: function() { - var parent = null, properties = $A(arguments); - if (Object.isFunction(properties[0])) - parent = properties.shift(); - - function klass() { - this.initialize.apply(this, arguments); - } - - Object.extend(klass, Class.Methods); - klass.superclass = parent; - klass.subclasses = []; - - if (parent) { - var subclass = function() { }; - subclass.prototype = parent.prototype; - klass.prototype = new subclass; - parent.subclasses.push(klass); - } - - for (var i = 0; i < properties.length; i++) - klass.addMethods(properties[i]); - - if (!klass.prototype.initialize) - klass.prototype.initialize = Prototype.emptyFunction; - - klass.prototype.constructor = klass; - - return klass; - } -}; - -Class.Methods = { - addMethods: function(source) { - var ancestor = this.superclass && this.superclass.prototype; - var properties = Object.keys(source); - - if (!Object.keys({ toString: true }).length) - properties.push("toString", "valueOf"); - - for (var i = 0, length = properties.length; i < length; i++) { - var property = properties[i], value = source[property]; - if (ancestor && Object.isFunction(value) && - value.argumentNames().first() == "$super") { - var method = value, value = Object.extend((function(m) { - return function() { return ancestor[m].apply(this, arguments) }; - })(property).wrap(method), { - valueOf: function() { return method }, - toString: function() { return method.toString() } - }); - } - this.prototype[property] = value; - } - - return this; - } -}; - -var Abstract = { }; - -Object.extend = function(destination, source) { - for (var property in source) - destination[property] = source[property]; - return destination; -}; - -Object.extend(Object, { - inspect: function(object) { - try { - if (Object.isUndefined(object)) return 'undefined'; - if (object === null) return 'null'; - return object.inspect ? object.inspect() : object.toString(); - } catch (e) { - if (e instanceof RangeError) return '...'; - throw e; - } - }, - - toJSON: function(object) { - var type = typeof object; - switch (type) { - case 'undefined': - case 'function': - case 'unknown': return; - case 'boolean': return object.toString(); - } - - if (object === null) return 'null'; - if (object.toJSON) return object.toJSON(); - if (Object.isElement(object)) return; - - var results = []; - for (var property in object) { - var value = Object.toJSON(object[property]); - if (!Object.isUndefined(value)) - results.push(property.toJSON() + ': ' + value); - } - - return '{' + results.join(', ') + '}'; - }, - - toQueryString: function(object) { - return $H(object).toQueryString(); - }, - - toHTML: function(object) { - return object && object.toHTML ? object.toHTML() : String.interpret(object); - }, - - keys: function(object) { - var keys = []; - for (var property in object) - keys.push(property); - return keys; - }, - - values: function(object) { - var values = []; - for (var property in object) - values.push(object[property]); - return values; - }, - - clone: function(object) { - return Object.extend({ }, object); - }, - - isElement: function(object) { - return object && object.nodeType == 1; - }, - - isArray: function(object) { - return object && object.constructor === Array; - }, - - isHash: function(object) { - return object instanceof Hash; - }, - - isFunction: function(object) { - return typeof object == "function"; - }, - - isString: function(object) { - return typeof object == "string"; - }, - - isNumber: function(object) { - return typeof object == "number"; - }, - - isUndefined: function(object) { - return typeof object == "undefined"; - } -}); - -Object.extend(Function.prototype, { - argumentNames: function() { - var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip"); - return names.length == 1 && !names[0] ? [] : names; - }, - - bind: function() { - if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; - var __method = this, args = $A(arguments), object = args.shift(); - return function() { - return __method.apply(object, args.concat($A(arguments))); - } - }, - - bindAsEventListener: function() { - var __method = this, args = $A(arguments), object = args.shift(); - return function(event) { - return __method.apply(object, [event || window.event].concat(args)); - } - }, - - curry: function() { - if (!arguments.length) return this; - var __method = this, args = $A(arguments); - return function() { - return __method.apply(this, args.concat($A(arguments))); - } - }, - - delay: function() { - var __method = this, args = $A(arguments), timeout = args.shift() * 1000; - return window.setTimeout(function() { - return __method.apply(__method, args); - }, timeout); - }, - - wrap: function(wrapper) { - var __method = this; - return function() { - return wrapper.apply(this, [__method.bind(this)].concat($A(arguments))); - } - }, - - methodize: function() { - if (this._methodized) return this._methodized; - var __method = this; - return this._methodized = function() { - return __method.apply(null, [this].concat($A(arguments))); - }; - } -}); - -Function.prototype.defer = Function.prototype.delay.curry(0.01); - -Date.prototype.toJSON = function() { - return '"' + this.getUTCFullYear() + '-' + - (this.getUTCMonth() + 1).toPaddedString(2) + '-' + - this.getUTCDate().toPaddedString(2) + 'T' + - this.getUTCHours().toPaddedString(2) + ':' + - this.getUTCMinutes().toPaddedString(2) + ':' + - this.getUTCSeconds().toPaddedString(2) + 'Z"'; -}; - -var Try = { - these: function() { - var returnValue; - - for (var i = 0, length = arguments.length; i < length; i++) { - var lambda = arguments[i]; - try { - returnValue = lambda(); - break; - } catch (e) { } - } - - return returnValue; - } -}; - -RegExp.prototype.match = RegExp.prototype.test; - -RegExp.escape = function(str) { - return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); -}; - -/*--------------------------------------------------------------------------*/ - -var PeriodicalExecuter = Class.create({ - initialize: function(callback, frequency) { - this.callback = callback; - this.frequency = frequency; - this.currentlyExecuting = false; - - this.registerCallback(); - }, - - registerCallback: function() { - this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - execute: function() { - this.callback(this); - }, - - stop: function() { - if (!this.timer) return; - clearInterval(this.timer); - this.timer = null; - }, - - onTimerEvent: function() { - if (!this.currentlyExecuting) { - try { - this.currentlyExecuting = true; - this.execute(); - } finally { - this.currentlyExecuting = false; - } - } - } -}); -Object.extend(String, { - interpret: function(value) { - return value == null ? '' : String(value); - }, - specialChar: { - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '\\': '\\\\' - } -}); - -Object.extend(String.prototype, { - gsub: function(pattern, replacement) { - var result = '', source = this, match; - replacement = arguments.callee.prepareReplacement(replacement); - - while (source.length > 0) { - if (match = source.match(pattern)) { - result += source.slice(0, match.index); - result += String.interpret(replacement(match)); - source = source.slice(match.index + match[0].length); - } else { - result += source, source = ''; - } - } - return result; - }, - - sub: function(pattern, replacement, count) { - replacement = this.gsub.prepareReplacement(replacement); - count = Object.isUndefined(count) ? 1 : count; - - return this.gsub(pattern, function(match) { - if (--count < 0) return match[0]; - return replacement(match); - }); - }, - - scan: function(pattern, iterator) { - this.gsub(pattern, iterator); - return String(this); - }, - - truncate: function(length, truncation) { - length = length || 30; - truncation = Object.isUndefined(truncation) ? '...' : truncation; - return this.length > length ? - this.slice(0, length - truncation.length) + truncation : String(this); - }, - - strip: function() { - return this.replace(/^\s+/, '').replace(/\s+$/, ''); - }, - - stripTags: function() { - return this.replace(/<\/?[^>]+>/gi, ''); - }, - - stripScripts: function() { - return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); - }, - - extractScripts: function() { - var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); - var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); - return (this.match(matchAll) || []).map(function(scriptTag) { - return (scriptTag.match(matchOne) || ['', ''])[1]; - }); - }, - - evalScripts: function() { - return this.extractScripts().map(function(script) { return eval(script) }); - }, - - escapeHTML: function() { - var self = arguments.callee; - self.text.data = this; - return self.div.innerHTML; - }, - - unescapeHTML: function() { - var div = new Element('div'); - div.innerHTML = this.stripTags(); - return div.childNodes[0] ? (div.childNodes.length > 1 ? - $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : - div.childNodes[0].nodeValue) : ''; - }, - - toQueryParams: function(separator) { - var match = this.strip().match(/([^?#]*)(#.*)?$/); - if (!match) return { }; - - return match[1].split(separator || '&').inject({ }, function(hash, pair) { - if ((pair = pair.split('='))[0]) { - var key = decodeURIComponent(pair.shift()); - var value = pair.length > 1 ? pair.join('=') : pair[0]; - if (value != undefined) value = decodeURIComponent(value); - - if (key in hash) { - if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; - hash[key].push(value); - } - else hash[key] = value; - } - return hash; - }); - }, - - toArray: function() { - return this.split(''); - }, - - succ: function() { - return this.slice(0, this.length - 1) + - String.fromCharCode(this.charCodeAt(this.length - 1) + 1); - }, - - times: function(count) { - return count < 1 ? '' : new Array(count + 1).join(this); - }, - - camelize: function() { - var parts = this.split('-'), len = parts.length; - if (len == 1) return parts[0]; - - var camelized = this.charAt(0) == '-' - ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) - : parts[0]; - - for (var i = 1; i < len; i++) - camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); - - return camelized; - }, - - capitalize: function() { - return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); - }, - - underscore: function() { - return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); - }, - - dasherize: function() { - return this.gsub(/_/,'-'); - }, - - inspect: function(useDoubleQuotes) { - var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { - var character = String.specialChar[match[0]]; - return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); - }); - if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; - return "'" + escapedString.replace(/'/g, '\\\'') + "'"; - }, - - toJSON: function() { - return this.inspect(true); - }, - - unfilterJSON: function(filter) { - return this.sub(filter || Prototype.JSONFilter, '#{1}'); - }, - - isJSON: function() { - var str = this; - if (str.blank()) return false; - str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); - return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); - }, - - evalJSON: function(sanitize) { - var json = this.unfilterJSON(); - try { - if (!sanitize || json.isJSON()) return eval('(' + json + ')'); - } catch (e) { } - throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); - }, - - include: function(pattern) { - return this.indexOf(pattern) > -1; - }, - - startsWith: function(pattern) { - return this.indexOf(pattern) === 0; - }, - - endsWith: function(pattern) { - var d = this.length - pattern.length; - return d >= 0 && this.lastIndexOf(pattern) === d; - }, - - empty: function() { - return this == ''; - }, - - blank: function() { - return /^\s*$/.test(this); - }, - - interpolate: function(object, pattern) { - return new Template(this, pattern).evaluate(object); - } -}); - -if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { - escapeHTML: function() { - return this.replace(/&/g,'&').replace(//g,'>'); - }, - unescapeHTML: function() { - return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); - } -}); - -String.prototype.gsub.prepareReplacement = function(replacement) { - if (Object.isFunction(replacement)) return replacement; - var template = new Template(replacement); - return function(match) { return template.evaluate(match) }; -}; - -String.prototype.parseQuery = String.prototype.toQueryParams; - -Object.extend(String.prototype.escapeHTML, { - div: document.createElement('div'), - text: document.createTextNode('') -}); - -with (String.prototype.escapeHTML) div.appendChild(text); - -var Template = Class.create({ - initialize: function(template, pattern) { - this.template = template.toString(); - this.pattern = pattern || Template.Pattern; - }, - - evaluate: function(object) { - if (Object.isFunction(object.toTemplateReplacements)) - object = object.toTemplateReplacements(); - - return this.template.gsub(this.pattern, function(match) { - if (object == null) return ''; - - var before = match[1] || ''; - if (before == '\\') return match[2]; - - var ctx = object, expr = match[3]; - var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; - match = pattern.exec(expr); - if (match == null) return before; - - while (match != null) { - var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; - ctx = ctx[comp]; - if (null == ctx || '' == match[3]) break; - expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); - match = pattern.exec(expr); - } - - return before + String.interpret(ctx); - }.bind(this)); - } -}); -Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; - -var $break = { }; - -var Enumerable = { - each: function(iterator, context) { - var index = 0; - iterator = iterator.bind(context); - try { - this._each(function(value) { - iterator(value, index++); - }); - } catch (e) { - if (e != $break) throw e; - } - return this; - }, - - eachSlice: function(number, iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var index = -number, slices = [], array = this.toArray(); - while ((index += number) < array.length) - slices.push(array.slice(index, index+number)); - return slices.collect(iterator, context); - }, - - all: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var result = true; - this.each(function(value, index) { - result = result && !!iterator(value, index); - if (!result) throw $break; - }); - return result; - }, - - any: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var result = false; - this.each(function(value, index) { - if (result = !!iterator(value, index)) - throw $break; - }); - return result; - }, - - collect: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var results = []; - this.each(function(value, index) { - results.push(iterator(value, index)); - }); - return results; - }, - - detect: function(iterator, context) { - iterator = iterator.bind(context); - var result; - this.each(function(value, index) { - if (iterator(value, index)) { - result = value; - throw $break; - } - }); - return result; - }, - - findAll: function(iterator, context) { - iterator = iterator.bind(context); - var results = []; - this.each(function(value, index) { - if (iterator(value, index)) - results.push(value); - }); - return results; - }, - - grep: function(filter, iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var results = []; - - if (Object.isString(filter)) - filter = new RegExp(filter); - - this.each(function(value, index) { - if (filter.match(value)) - results.push(iterator(value, index)); - }); - return results; - }, - - include: function(object) { - if (Object.isFunction(this.indexOf)) - if (this.indexOf(object) != -1) return true; - - var found = false; - this.each(function(value) { - if (value == object) { - found = true; - throw $break; - } - }); - return found; - }, - - inGroupsOf: function(number, fillWith) { - fillWith = Object.isUndefined(fillWith) ? null : fillWith; - return this.eachSlice(number, function(slice) { - while(slice.length < number) slice.push(fillWith); - return slice; - }); - }, - - inject: function(memo, iterator, context) { - iterator = iterator.bind(context); - this.each(function(value, index) { - memo = iterator(memo, value, index); - }); - return memo; - }, - - invoke: function(method) { - var args = $A(arguments).slice(1); - return this.map(function(value) { - return value[method].apply(value, args); - }); - }, - - max: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var result; - this.each(function(value, index) { - value = iterator(value, index); - if (result == null || value >= result) - result = value; - }); - return result; - }, - - min: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var result; - this.each(function(value, index) { - value = iterator(value, index); - if (result == null || value < result) - result = value; - }); - return result; - }, - - partition: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var trues = [], falses = []; - this.each(function(value, index) { - (iterator(value, index) ? - trues : falses).push(value); - }); - return [trues, falses]; - }, - - pluck: function(property) { - var results = []; - this.each(function(value) { - results.push(value[property]); - }); - return results; - }, - - reject: function(iterator, context) { - iterator = iterator.bind(context); - var results = []; - this.each(function(value, index) { - if (!iterator(value, index)) - results.push(value); - }); - return results; - }, - - sortBy: function(iterator, context) { - iterator = iterator.bind(context); - return this.map(function(value, index) { - return {value: value, criteria: iterator(value, index)}; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }).pluck('value'); - }, - - toArray: function() { - return this.map(); - }, - - zip: function() { - var iterator = Prototype.K, args = $A(arguments); - if (Object.isFunction(args.last())) - iterator = args.pop(); - - var collections = [this].concat(args).map($A); - return this.map(function(value, index) { - return iterator(collections.pluck(index)); - }); - }, - - size: function() { - return this.toArray().length; - }, - - inspect: function() { - return '#'; - } -}; - -Object.extend(Enumerable, { - map: Enumerable.collect, - find: Enumerable.detect, - select: Enumerable.findAll, - filter: Enumerable.findAll, - member: Enumerable.include, - entries: Enumerable.toArray, - every: Enumerable.all, - some: Enumerable.any -}); -function $A(iterable) { - if (!iterable) return []; - if (iterable.toArray) return iterable.toArray(); - var length = iterable.length || 0, results = new Array(length); - while (length--) results[length] = iterable[length]; - return results; -} - -if (Prototype.Browser.WebKit) { - function $A(iterable) { - if (!iterable) return []; - if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') && - iterable.toArray) return iterable.toArray(); - var length = iterable.length || 0, results = new Array(length); - while (length--) results[length] = iterable[length]; - return results; - } -} - -Array.from = $A; - -Object.extend(Array.prototype, Enumerable); - -if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse; - -Object.extend(Array.prototype, { - _each: function(iterator) { - for (var i = 0, length = this.length; i < length; i++) - iterator(this[i]); - }, - - clear: function() { - this.length = 0; - return this; - }, - - first: function() { - return this[0]; - }, - - last: function() { - return this[this.length - 1]; - }, - - compact: function() { - return this.select(function(value) { - return value != null; - }); - }, - - flatten: function() { - return this.inject([], function(array, value) { - return array.concat(Object.isArray(value) ? - value.flatten() : [value]); - }); - }, - - without: function() { - var values = $A(arguments); - return this.select(function(value) { - return !values.include(value); - }); - }, - - reverse: function(inline) { - return (inline !== false ? this : this.toArray())._reverse(); - }, - - reduce: function() { - return this.length > 1 ? this : this[0]; - }, - - uniq: function(sorted) { - return this.inject([], function(array, value, index) { - if (0 == index || (sorted ? array.last() != value : !array.include(value))) - array.push(value); - return array; - }); - }, - - intersect: function(array) { - return this.uniq().findAll(function(item) { - return array.detect(function(value) { return item === value }); - }); - }, - - clone: function() { - return [].concat(this); - }, - - size: function() { - return this.length; - }, - - inspect: function() { - return '[' + this.map(Object.inspect).join(', ') + ']'; - }, - - toJSON: function() { - var results = []; - this.each(function(object) { - var value = Object.toJSON(object); - if (!Object.isUndefined(value)) results.push(value); - }); - return '[' + results.join(', ') + ']'; - } -}); - -// use native browser JS 1.6 implementation if available -if (Object.isFunction(Array.prototype.forEach)) - Array.prototype._each = Array.prototype.forEach; - -if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) { - i || (i = 0); - var length = this.length; - if (i < 0) i = length + i; - for (; i < length; i++) - if (this[i] === item) return i; - return -1; -}; - -if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) { - i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; - var n = this.slice(0, i).reverse().indexOf(item); - return (n < 0) ? n : i - n - 1; -}; - -Array.prototype.toArray = Array.prototype.clone; - -function $w(string) { - if (!Object.isString(string)) return []; - string = string.strip(); - return string ? string.split(/\s+/) : []; -} - -if (Prototype.Browser.Opera){ - Array.prototype.concat = function() { - var array = []; - for (var i = 0, length = this.length; i < length; i++) array.push(this[i]); - for (var i = 0, length = arguments.length; i < length; i++) { - if (Object.isArray(arguments[i])) { - for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) - array.push(arguments[i][j]); - } else { - array.push(arguments[i]); - } - } - return array; - }; -} -Object.extend(Number.prototype, { - toColorPart: function() { - return this.toPaddedString(2, 16); - }, - - succ: function() { - return this + 1; - }, - - times: function(iterator) { - $R(0, this, true).each(iterator); - return this; - }, - - toPaddedString: function(length, radix) { - var string = this.toString(radix || 10); - return '0'.times(length - string.length) + string; - }, - - toJSON: function() { - return isFinite(this) ? this.toString() : 'null'; - } -}); - -$w('abs round ceil floor').each(function(method){ - Number.prototype[method] = Math[method].methodize(); -}); -function $H(object) { - return new Hash(object); -}; - -var Hash = Class.create(Enumerable, (function() { - - function toQueryPair(key, value) { - if (Object.isUndefined(value)) return key; - return key + '=' + encodeURIComponent(String.interpret(value)); - } - - return { - initialize: function(object) { - this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); - }, - - _each: function(iterator) { - for (var key in this._object) { - var value = this._object[key], pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); - } - }, - - set: function(key, value) { - return this._object[key] = value; - }, - - get: function(key) { - return this._object[key]; - }, - - unset: function(key) { - var value = this._object[key]; - delete this._object[key]; - return value; - }, - - toObject: function() { - return Object.clone(this._object); - }, - - keys: function() { - return this.pluck('key'); - }, - - values: function() { - return this.pluck('value'); - }, - - index: function(value) { - var match = this.detect(function(pair) { - return pair.value === value; - }); - return match && match.key; - }, - - merge: function(object) { - return this.clone().update(object); - }, - - update: function(object) { - return new Hash(object).inject(this, function(result, pair) { - result.set(pair.key, pair.value); - return result; - }); - }, - - toQueryString: function() { - return this.map(function(pair) { - var key = encodeURIComponent(pair.key), values = pair.value; - - if (values && typeof values == 'object') { - if (Object.isArray(values)) - return values.map(toQueryPair.curry(key)).join('&'); - } - return toQueryPair(key, values); - }).join('&'); - }, - - inspect: function() { - return '#'; - }, - - toJSON: function() { - return Object.toJSON(this.toObject()); - }, - - clone: function() { - return new Hash(this); - } - } -})()); - -Hash.prototype.toTemplateReplacements = Hash.prototype.toObject; -Hash.from = $H; -var ObjectRange = Class.create(Enumerable, { - initialize: function(start, end, exclusive) { - this.start = start; - this.end = end; - this.exclusive = exclusive; - }, - - _each: function(iterator) { - var value = this.start; - while (this.include(value)) { - iterator(value); - value = value.succ(); - } - }, - - include: function(value) { - if (value < this.start) - return false; - if (this.exclusive) - return value < this.end; - return value <= this.end; - } -}); - -var $R = function(start, end, exclusive) { - return new ObjectRange(start, end, exclusive); -}; - -var Ajax = { - getTransport: function() { - return Try.these( - function() {return new XMLHttpRequest()}, - function() {return new ActiveXObject('Msxml2.XMLHTTP')}, - function() {return new ActiveXObject('Microsoft.XMLHTTP')} - ) || false; - }, - - activeRequestCount: 0 -}; - -Ajax.Responders = { - responders: [], - - _each: function(iterator) { - this.responders._each(iterator); - }, - - register: function(responder) { - if (!this.include(responder)) - this.responders.push(responder); - }, - - unregister: function(responder) { - this.responders = this.responders.without(responder); - }, - - dispatch: function(callback, request, transport, json) { - this.each(function(responder) { - if (Object.isFunction(responder[callback])) { - try { - responder[callback].apply(responder, [request, transport, json]); - } catch (e) { } - } - }); - } -}; - -Object.extend(Ajax.Responders, Enumerable); - -Ajax.Responders.register({ - onCreate: function() { Ajax.activeRequestCount++ }, - onComplete: function() { Ajax.activeRequestCount-- } -}); - -Ajax.Base = Class.create({ - initialize: function(options) { - this.options = { - method: 'post', - asynchronous: true, - contentType: 'application/x-www-form-urlencoded', - encoding: 'UTF-8', - parameters: '', - evalJSON: true, - evalJS: true - }; - Object.extend(this.options, options || { }); - - this.options.method = this.options.method.toLowerCase(); - - if (Object.isString(this.options.parameters)) - this.options.parameters = this.options.parameters.toQueryParams(); - else if (Object.isHash(this.options.parameters)) - this.options.parameters = this.options.parameters.toObject(); - } -}); - -Ajax.Request = Class.create(Ajax.Base, { - _complete: false, - - initialize: function($super, url, options) { - $super(options); - this.transport = Ajax.getTransport(); - this.request(url); - }, - - request: function(url) { - this.url = url; - this.method = this.options.method; - var params = Object.clone(this.options.parameters); - - if (!['get', 'post'].include(this.method)) { - // simulate other verbs over post - params['_method'] = this.method; - this.method = 'post'; - } - - this.parameters = params; - - if (params = Object.toQueryString(params)) { - // when GET, append parameters to URL - if (this.method == 'get') - this.url += (this.url.include('?') ? '&' : '?') + params; - else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) - params += '&_='; - } - - try { - var response = new Ajax.Response(this); - if (this.options.onCreate) this.options.onCreate(response); - Ajax.Responders.dispatch('onCreate', this, response); - - this.transport.open(this.method.toUpperCase(), this.url, - this.options.asynchronous); - - if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); - - this.transport.onreadystatechange = this.onStateChange.bind(this); - this.setRequestHeaders(); - - this.body = this.method == 'post' ? (this.options.postBody || params) : null; - this.transport.send(this.body); - - /* Force Firefox to handle ready state 4 for synchronous requests */ - if (!this.options.asynchronous && this.transport.overrideMimeType) - this.onStateChange(); - - } - catch (e) { - this.dispatchException(e); - } - }, - - onStateChange: function() { - var readyState = this.transport.readyState; - if (readyState > 1 && !((readyState == 4) && this._complete)) - this.respondToReadyState(this.transport.readyState); - }, - - setRequestHeaders: function() { - var headers = { - 'X-Requested-With': 'XMLHttpRequest', - 'X-Prototype-Version': Prototype.Version, - 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' - }; - - if (this.method == 'post') { - headers['Content-type'] = this.options.contentType + - (this.options.encoding ? '; charset=' + this.options.encoding : ''); - - /* Force "Connection: close" for older Mozilla browsers to work - * around a bug where XMLHttpRequest sends an incorrect - * Content-length header. See Mozilla Bugzilla #246651. - */ - if (this.transport.overrideMimeType && - (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) - headers['Connection'] = 'close'; - } - - // user-defined headers - if (typeof this.options.requestHeaders == 'object') { - var extras = this.options.requestHeaders; - - if (Object.isFunction(extras.push)) - for (var i = 0, length = extras.length; i < length; i += 2) - headers[extras[i]] = extras[i+1]; - else - $H(extras).each(function(pair) { headers[pair.key] = pair.value }); - } - - for (var name in headers) - this.transport.setRequestHeader(name, headers[name]); - }, - - success: function() { - var status = this.getStatus(); - return !status || (status >= 200 && status < 300); - }, - - getStatus: function() { - try { - return this.transport.status || 0; - } catch (e) { return 0 } - }, - - respondToReadyState: function(readyState) { - var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); - - if (state == 'Complete') { - try { - this._complete = true; - (this.options['on' + response.status] - || this.options['on' + (this.success() ? 'Success' : 'Failure')] - || Prototype.emptyFunction)(response, response.headerJSON); - } catch (e) { - this.dispatchException(e); - } - - var contentType = response.getHeader('Content-type'); - if (this.options.evalJS == 'force' - || (this.options.evalJS && contentType - && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) - this.evalResponse(); - } - - try { - (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); - Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); - } catch (e) { - this.dispatchException(e); - } - - if (state == 'Complete') { - // avoid memory leak in MSIE: clean up - this.transport.onreadystatechange = Prototype.emptyFunction; - } - }, - - getHeader: function(name) { - try { - return this.transport.getResponseHeader(name) || null; - } catch (e) { return null } - }, - - evalResponse: function() { - try { - return eval((this.transport.responseText || '').unfilterJSON()); - } catch (e) { - this.dispatchException(e); - } - }, - - dispatchException: function(exception) { - (this.options.onException || Prototype.emptyFunction)(this, exception); - Ajax.Responders.dispatch('onException', this, exception); - } -}); - -Ajax.Request.Events = - ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; - -Ajax.Response = Class.create({ - initialize: function(request){ - this.request = request; - var transport = this.transport = request.transport, - readyState = this.readyState = transport.readyState; - - if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { - this.status = this.getStatus(); - this.statusText = this.getStatusText(); - this.responseText = String.interpret(transport.responseText); - this.headerJSON = this._getHeaderJSON(); - } - - if(readyState == 4) { - var xml = transport.responseXML; - this.responseXML = Object.isUndefined(xml) ? null : xml; - this.responseJSON = this._getResponseJSON(); - } - }, - - status: 0, - statusText: '', - - getStatus: Ajax.Request.prototype.getStatus, - - getStatusText: function() { - try { - return this.transport.statusText || ''; - } catch (e) { return '' } - }, - - getHeader: Ajax.Request.prototype.getHeader, - - getAllHeaders: function() { - try { - return this.getAllResponseHeaders(); - } catch (e) { return null } - }, - - getResponseHeader: function(name) { - return this.transport.getResponseHeader(name); - }, - - getAllResponseHeaders: function() { - return this.transport.getAllResponseHeaders(); - }, - - _getHeaderJSON: function() { - var json = this.getHeader('X-JSON'); - if (!json) return null; - json = decodeURIComponent(escape(json)); - try { - return json.evalJSON(this.request.options.sanitizeJSON); - } catch (e) { - this.request.dispatchException(e); - } - }, - - _getResponseJSON: function() { - var options = this.request.options; - if (!options.evalJSON || (options.evalJSON != 'force' && - !(this.getHeader('Content-type') || '').include('application/json')) || - this.responseText.blank()) - return null; - try { - return this.responseText.evalJSON(options.sanitizeJSON); - } catch (e) { - this.request.dispatchException(e); - } - } -}); - -Ajax.Updater = Class.create(Ajax.Request, { - initialize: function($super, container, url, options) { - this.container = { - success: (container.success || container), - failure: (container.failure || (container.success ? null : container)) - }; - - options = Object.clone(options); - var onComplete = options.onComplete; - options.onComplete = (function(response, json) { - this.updateContent(response.responseText); - if (Object.isFunction(onComplete)) onComplete(response, json); - }).bind(this); - - $super(url, options); - }, - - updateContent: function(responseText) { - var receiver = this.container[this.success() ? 'success' : 'failure'], - options = this.options; - - if (!options.evalScripts) responseText = responseText.stripScripts(); - - if (receiver = $(receiver)) { - if (options.insertion) { - if (Object.isString(options.insertion)) { - var insertion = { }; insertion[options.insertion] = responseText; - receiver.insert(insertion); - } - else options.insertion(receiver, responseText); - } - else receiver.update(responseText); - } - } -}); - -Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { - initialize: function($super, container, url, options) { - $super(options); - this.onComplete = this.options.onComplete; - - this.frequency = (this.options.frequency || 2); - this.decay = (this.options.decay || 1); - - this.updater = { }; - this.container = container; - this.url = url; - - this.start(); - }, - - start: function() { - this.options.onComplete = this.updateComplete.bind(this); - this.onTimerEvent(); - }, - - stop: function() { - this.updater.options.onComplete = undefined; - clearTimeout(this.timer); - (this.onComplete || Prototype.emptyFunction).apply(this, arguments); - }, - - updateComplete: function(response) { - if (this.options.decay) { - this.decay = (response.responseText == this.lastText ? - this.decay * this.options.decay : 1); - - this.lastText = response.responseText; - } - this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); - }, - - onTimerEvent: function() { - this.updater = new Ajax.Updater(this.container, this.url, this.options); - } -}); -function $(element) { - if (arguments.length > 1) { - for (var i = 0, elements = [], length = arguments.length; i < length; i++) - elements.push($(arguments[i])); - return elements; - } - if (Object.isString(element)) - element = document.getElementById(element); - return Element.extend(element); -} - -if (Prototype.BrowserFeatures.XPath) { - document._getElementsByXPath = function(expression, parentElement) { - var results = []; - var query = document.evaluate(expression, $(parentElement) || document, - null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - for (var i = 0, length = query.snapshotLength; i < length; i++) - results.push(Element.extend(query.snapshotItem(i))); - return results; - }; -} - -/*--------------------------------------------------------------------------*/ - -if (!window.Node) var Node = { }; - -if (!Node.ELEMENT_NODE) { - // DOM level 2 ECMAScript Language Binding - Object.extend(Node, { - ELEMENT_NODE: 1, - ATTRIBUTE_NODE: 2, - TEXT_NODE: 3, - CDATA_SECTION_NODE: 4, - ENTITY_REFERENCE_NODE: 5, - ENTITY_NODE: 6, - PROCESSING_INSTRUCTION_NODE: 7, - COMMENT_NODE: 8, - DOCUMENT_NODE: 9, - DOCUMENT_TYPE_NODE: 10, - DOCUMENT_FRAGMENT_NODE: 11, - NOTATION_NODE: 12 - }); -} - -(function() { - var element = this.Element; - this.Element = function(tagName, attributes) { - attributes = attributes || { }; - tagName = tagName.toLowerCase(); - var cache = Element.cache; - if (Prototype.Browser.IE && attributes.name) { - tagName = '<' + tagName + ' name="' + attributes.name + '">'; - delete attributes.name; - return Element.writeAttribute(document.createElement(tagName), attributes); - } - if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); - return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); - }; - Object.extend(this.Element, element || { }); -}).call(window); - -Element.cache = { }; - -Element.Methods = { - visible: function(element) { - return $(element).style.display != 'none'; - }, - - toggle: function(element) { - element = $(element); - Element[Element.visible(element) ? 'hide' : 'show'](element); - return element; - }, - - hide: function(element) { - $(element).style.display = 'none'; - return element; - }, - - show: function(element) { - $(element).style.display = ''; - return element; - }, - - remove: function(element) { - element = $(element); - element.parentNode.removeChild(element); - return element; - }, - - update: function(element, content) { - element = $(element); - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) return element.update().insert(content); - content = Object.toHTML(content); - element.innerHTML = content.stripScripts(); - content.evalScripts.bind(content).defer(); - return element; - }, - - replace: function(element, content) { - element = $(element); - if (content && content.toElement) content = content.toElement(); - else if (!Object.isElement(content)) { - content = Object.toHTML(content); - var range = element.ownerDocument.createRange(); - range.selectNode(element); - content.evalScripts.bind(content).defer(); - content = range.createContextualFragment(content.stripScripts()); - } - element.parentNode.replaceChild(content, element); - return element; - }, - - insert: function(element, insertions) { - element = $(element); - - if (Object.isString(insertions) || Object.isNumber(insertions) || - Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) - insertions = {bottom:insertions}; - - var content, insert, tagName, childNodes; - - for (position in insertions) { - content = insertions[position]; - position = position.toLowerCase(); - insert = Element._insertionTranslations[position]; - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - insert(element, content); - continue; - } - - content = Object.toHTML(content); - - tagName = ((position == 'before' || position == 'after') - ? element.parentNode : element).tagName.toUpperCase(); - - childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); - - if (position == 'top' || position == 'after') childNodes.reverse(); - childNodes.each(insert.curry(element)); - - content.evalScripts.bind(content).defer(); - } - - return element; - }, - - wrap: function(element, wrapper, attributes) { - element = $(element); - if (Object.isElement(wrapper)) - $(wrapper).writeAttribute(attributes || { }); - else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); - else wrapper = new Element('div', wrapper); - if (element.parentNode) - element.parentNode.replaceChild(wrapper, element); - wrapper.appendChild(element); - return wrapper; - }, - - inspect: function(element) { - element = $(element); - var result = '<' + element.tagName.toLowerCase(); - $H({'id': 'id', 'className': 'class'}).each(function(pair) { - var property = pair.first(), attribute = pair.last(); - var value = (element[property] || '').toString(); - if (value) result += ' ' + attribute + '=' + value.inspect(true); - }); - return result + '>'; - }, - - recursivelyCollect: function(element, property) { - element = $(element); - var elements = []; - while (element = element[property]) - if (element.nodeType == 1) - elements.push(Element.extend(element)); - return elements; - }, - - ancestors: function(element) { - return $(element).recursivelyCollect('parentNode'); - }, - - descendants: function(element) { - return $(element).getElementsBySelector("*"); - }, - - firstDescendant: function(element) { - element = $(element).firstChild; - while (element && element.nodeType != 1) element = element.nextSibling; - return $(element); - }, - - immediateDescendants: function(element) { - if (!(element = $(element).firstChild)) return []; - while (element && element.nodeType != 1) element = element.nextSibling; - if (element) return [element].concat($(element).nextSiblings()); - return []; - }, - - previousSiblings: function(element) { - return $(element).recursivelyCollect('previousSibling'); - }, - - nextSiblings: function(element) { - return $(element).recursivelyCollect('nextSibling'); - }, - - siblings: function(element) { - element = $(element); - return element.previousSiblings().reverse().concat(element.nextSiblings()); - }, - - match: function(element, selector) { - if (Object.isString(selector)) - selector = new Selector(selector); - return selector.match($(element)); - }, - - up: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(element.parentNode); - var ancestors = element.ancestors(); - return Object.isNumber(expression) ? ancestors[expression] : - Selector.findElement(ancestors, expression, index); - }, - - down: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return element.firstDescendant(); - return Object.isNumber(expression) ? element.descendants()[expression] : - element.select(expression)[index || 0]; - }, - - previous: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); - var previousSiblings = element.previousSiblings(); - return Object.isNumber(expression) ? previousSiblings[expression] : - Selector.findElement(previousSiblings, expression, index); - }, - - next: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); - var nextSiblings = element.nextSiblings(); - return Object.isNumber(expression) ? nextSiblings[expression] : - Selector.findElement(nextSiblings, expression, index); - }, - - select: function() { - var args = $A(arguments), element = $(args.shift()); - return Selector.findChildElements(element, args); - }, - - adjacent: function() { - var args = $A(arguments), element = $(args.shift()); - return Selector.findChildElements(element.parentNode, args).without(element); - }, - - identify: function(element) { - element = $(element); - var id = element.readAttribute('id'), self = arguments.callee; - if (id) return id; - do { id = 'anonymous_element_' + self.counter++ } while ($(id)); - element.writeAttribute('id', id); - return id; - }, - - readAttribute: function(element, name) { - element = $(element); - if (Prototype.Browser.IE) { - var t = Element._attributeTranslations.read; - if (t.values[name]) return t.values[name](element, name); - if (t.names[name]) name = t.names[name]; - if (name.include(':')) { - return (!element.attributes || !element.attributes[name]) ? null : - element.attributes[name].value; - } - } - return element.getAttribute(name); - }, - - writeAttribute: function(element, name, value) { - element = $(element); - var attributes = { }, t = Element._attributeTranslations.write; - - if (typeof name == 'object') attributes = name; - else attributes[name] = Object.isUndefined(value) ? true : value; - - for (var attr in attributes) { - name = t.names[attr] || attr; - value = attributes[attr]; - if (t.values[attr]) name = t.values[attr](element, value); - if (value === false || value === null) - element.removeAttribute(name); - else if (value === true) - element.setAttribute(name, name); - else element.setAttribute(name, value); - } - return element; - }, - - getHeight: function(element) { - return $(element).getDimensions().height; - }, - - getWidth: function(element) { - return $(element).getDimensions().width; - }, - - classNames: function(element) { - return new Element.ClassNames(element); - }, - - hasClassName: function(element, className) { - if (!(element = $(element))) return; - var elementClassName = element.className; - return (elementClassName.length > 0 && (elementClassName == className || - new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); - }, - - addClassName: function(element, className) { - if (!(element = $(element))) return; - if (!element.hasClassName(className)) - element.className += (element.className ? ' ' : '') + className; - return element; - }, - - removeClassName: function(element, className) { - if (!(element = $(element))) return; - element.className = element.className.replace( - new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); - return element; - }, - - toggleClassName: function(element, className) { - if (!(element = $(element))) return; - return element[element.hasClassName(className) ? - 'removeClassName' : 'addClassName'](className); - }, - - // removes whitespace-only text node children - cleanWhitespace: function(element) { - element = $(element); - var node = element.firstChild; - while (node) { - var nextNode = node.nextSibling; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) - element.removeChild(node); - node = nextNode; - } - return element; - }, - - empty: function(element) { - return $(element).innerHTML.blank(); - }, - - descendantOf: function(element, ancestor) { - element = $(element), ancestor = $(ancestor); - var originalAncestor = ancestor; - - if (element.compareDocumentPosition) - return (element.compareDocumentPosition(ancestor) & 8) === 8; - - if (element.sourceIndex && !Prototype.Browser.Opera) { - var e = element.sourceIndex, a = ancestor.sourceIndex, - nextAncestor = ancestor.nextSibling; - if (!nextAncestor) { - do { ancestor = ancestor.parentNode; } - while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode); - } - if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex); - } - - while (element = element.parentNode) - if (element == originalAncestor) return true; - return false; - }, - - scrollTo: function(element) { - element = $(element); - var pos = element.cumulativeOffset(); - window.scrollTo(pos[0], pos[1]); - return element; - }, - - getStyle: function(element, style) { - element = $(element); - style = style == 'float' ? 'cssFloat' : style.camelize(); - var value = element.style[style]; - if (!value) { - var css = document.defaultView.getComputedStyle(element, null); - value = css ? css[style] : null; - } - if (style == 'opacity') return value ? parseFloat(value) : 1.0; - return value == 'auto' ? null : value; - }, - - getOpacity: function(element) { - return $(element).getStyle('opacity'); - }, - - setStyle: function(element, styles) { - element = $(element); - var elementStyle = element.style, match; - if (Object.isString(styles)) { - element.style.cssText += ';' + styles; - return styles.include('opacity') ? - element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; - } - for (var property in styles) - if (property == 'opacity') element.setOpacity(styles[property]); - else - elementStyle[(property == 'float' || property == 'cssFloat') ? - (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : - property] = styles[property]; - - return element; - }, - - setOpacity: function(element, value) { - element = $(element); - element.style.opacity = (value == 1 || value === '') ? '' : - (value < 0.00001) ? 0 : value; - return element; - }, - - getDimensions: function(element) { - element = $(element); - var display = $(element).getStyle('display'); - if (display != 'none' && display != null) // Safari bug - return {width: element.offsetWidth, height: element.offsetHeight}; - - // All *Width and *Height properties give 0 on elements with display none, - // so enable the element temporarily - var els = element.style; - var originalVisibility = els.visibility; - var originalPosition = els.position; - var originalDisplay = els.display; - els.visibility = 'hidden'; - els.position = 'absolute'; - els.display = 'block'; - var originalWidth = element.clientWidth; - var originalHeight = element.clientHeight; - els.display = originalDisplay; - els.position = originalPosition; - els.visibility = originalVisibility; - return {width: originalWidth, height: originalHeight}; - }, - - makePositioned: function(element) { - element = $(element); - var pos = Element.getStyle(element, 'position'); - if (pos == 'static' || !pos) { - element._madePositioned = true; - element.style.position = 'relative'; - // Opera returns the offset relative to the positioning context, when an - // element is position relative but top and left have not been defined - if (window.opera) { - element.style.top = 0; - element.style.left = 0; - } - } - return element; - }, - - undoPositioned: function(element) { - element = $(element); - if (element._madePositioned) { - element._madePositioned = undefined; - element.style.position = - element.style.top = - element.style.left = - element.style.bottom = - element.style.right = ''; - } - return element; - }, - - makeClipping: function(element) { - element = $(element); - if (element._overflow) return element; - element._overflow = Element.getStyle(element, 'overflow') || 'auto'; - if (element._overflow !== 'hidden') - element.style.overflow = 'hidden'; - return element; - }, - - undoClipping: function(element) { - element = $(element); - if (!element._overflow) return element; - element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; - element._overflow = null; - return element; - }, - - cumulativeOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - positionedOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - if (element) { - if (element.tagName == 'BODY') break; - var p = Element.getStyle(element, 'position'); - if (p == 'relative' || p == 'absolute') break; - } - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - absolutize: function(element) { - element = $(element); - if (element.getStyle('position') == 'absolute') return; - // Position.prepare(); // To be done manually by Scripty when it needs it. - - var offsets = element.positionedOffset(); - var top = offsets[1]; - var left = offsets[0]; - var width = element.clientWidth; - var height = element.clientHeight; - - element._originalLeft = left - parseFloat(element.style.left || 0); - element._originalTop = top - parseFloat(element.style.top || 0); - element._originalWidth = element.style.width; - element._originalHeight = element.style.height; - - element.style.position = 'absolute'; - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.width = width + 'px'; - element.style.height = height + 'px'; - return element; - }, - - relativize: function(element) { - element = $(element); - if (element.getStyle('position') == 'relative') return; - // Position.prepare(); // To be done manually by Scripty when it needs it. - - element.style.position = 'relative'; - var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); - var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); - - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.height = element._originalHeight; - element.style.width = element._originalWidth; - return element; - }, - - cumulativeScrollOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.scrollTop || 0; - valueL += element.scrollLeft || 0; - element = element.parentNode; - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - getOffsetParent: function(element) { - if (element.offsetParent) return $(element.offsetParent); - if (element == document.body) return $(element); - - while ((element = element.parentNode) && element != document.body) - if (Element.getStyle(element, 'position') != 'static') - return $(element); - - return $(document.body); - }, - - viewportOffset: function(forElement) { - var valueT = 0, valueL = 0; - - var element = forElement; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - - // Safari fix - if (element.offsetParent == document.body && - Element.getStyle(element, 'position') == 'absolute') break; - - } while (element = element.offsetParent); - - element = forElement; - do { - if (!Prototype.Browser.Opera || element.tagName == 'BODY') { - valueT -= element.scrollTop || 0; - valueL -= element.scrollLeft || 0; - } - } while (element = element.parentNode); - - return Element._returnOffset(valueL, valueT); - }, - - clonePosition: function(element, source) { - var options = Object.extend({ - setLeft: true, - setTop: true, - setWidth: true, - setHeight: true, - offsetTop: 0, - offsetLeft: 0 - }, arguments[2] || { }); - - // find page position of source - source = $(source); - var p = source.viewportOffset(); - - // find coordinate system to use - element = $(element); - var delta = [0, 0]; - var parent = null; - // delta [0,0] will do fine with position: fixed elements, - // position:absolute needs offsetParent deltas - if (Element.getStyle(element, 'position') == 'absolute') { - parent = element.getOffsetParent(); - delta = parent.viewportOffset(); - } - - // correct by body offsets (fixes Safari) - if (parent == document.body) { - delta[0] -= document.body.offsetLeft; - delta[1] -= document.body.offsetTop; - } - - // set position - if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; - if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; - if (options.setWidth) element.style.width = source.offsetWidth + 'px'; - if (options.setHeight) element.style.height = source.offsetHeight + 'px'; - return element; - } -}; - -Element.Methods.identify.counter = 1; - -Object.extend(Element.Methods, { - getElementsBySelector: Element.Methods.select, - childElements: Element.Methods.immediateDescendants -}); - -Element._attributeTranslations = { - write: { - names: { - className: 'class', - htmlFor: 'for' - }, - values: { } - } -}; - -if (Prototype.Browser.Opera) { - Element.Methods.getStyle = Element.Methods.getStyle.wrap( - function(proceed, element, style) { - switch (style) { - case 'left': case 'top': case 'right': case 'bottom': - if (proceed(element, 'position') === 'static') return null; - case 'height': case 'width': - // returns '0px' for hidden elements; we want it to return null - if (!Element.visible(element)) return null; - - // returns the border-box dimensions rather than the content-box - // dimensions, so we subtract padding and borders from the value - var dim = parseInt(proceed(element, style), 10); - - if (dim !== element['offset' + style.capitalize()]) - return dim + 'px'; - - var properties; - if (style === 'height') { - properties = ['border-top-width', 'padding-top', - 'padding-bottom', 'border-bottom-width']; - } - else { - properties = ['border-left-width', 'padding-left', - 'padding-right', 'border-right-width']; - } - return properties.inject(dim, function(memo, property) { - var val = proceed(element, property); - return val === null ? memo : memo - parseInt(val, 10); - }) + 'px'; - default: return proceed(element, style); - } - } - ); - - Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( - function(proceed, element, attribute) { - if (attribute === 'title') return element.title; - return proceed(element, attribute); - } - ); -} - -else if (Prototype.Browser.IE) { - $w('positionedOffset getOffsetParent viewportOffset').each(function(method) { - Element.Methods[method] = Element.Methods[method].wrap( - function(proceed, element) { - element = $(element); - var position = element.getStyle('position'); - if (position != 'static') return proceed(element); - element.setStyle({ position: 'relative' }); - var value = proceed(element); - element.setStyle({ position: position }); - return value; - } - ); - }); - - Element.Methods.getStyle = function(element, style) { - element = $(element); - style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); - var value = element.style[style]; - if (!value && element.currentStyle) value = element.currentStyle[style]; - - if (style == 'opacity') { - if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) - if (value[1]) return parseFloat(value[1]) / 100; - return 1.0; - } - - if (value == 'auto') { - if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) - return element['offset' + style.capitalize()] + 'px'; - return null; - } - return value; - }; - - Element.Methods.setOpacity = function(element, value) { - function stripAlpha(filter){ - return filter.replace(/alpha\([^\)]*\)/gi,''); - } - element = $(element); - var currentStyle = element.currentStyle; - if ((currentStyle && !currentStyle.hasLayout) || - (!currentStyle && element.style.zoom == 'normal')) - element.style.zoom = 1; - - var filter = element.getStyle('filter'), style = element.style; - if (value == 1 || value === '') { - (filter = stripAlpha(filter)) ? - style.filter = filter : style.removeAttribute('filter'); - return element; - } else if (value < 0.00001) value = 0; - style.filter = stripAlpha(filter) + - 'alpha(opacity=' + (value * 100) + ')'; - return element; - }; - - Element._attributeTranslations = { - read: { - names: { - 'class': 'className', - 'for': 'htmlFor' - }, - values: { - _getAttr: function(element, attribute) { - return element.getAttribute(attribute, 2); - }, - _getAttrNode: function(element, attribute) { - var node = element.getAttributeNode(attribute); - return node ? node.value : ""; - }, - _getEv: function(element, attribute) { - attribute = element.getAttribute(attribute); - return attribute ? attribute.toString().slice(23, -2) : null; - }, - _flag: function(element, attribute) { - return $(element).hasAttribute(attribute) ? attribute : null; - }, - style: function(element) { - return element.style.cssText.toLowerCase(); - }, - title: function(element) { - return element.title; - } - } - } - }; - - Element._attributeTranslations.write = { - names: Object.clone(Element._attributeTranslations.read.names), - values: { - checked: function(element, value) { - element.checked = !!value; - }, - - style: function(element, value) { - element.style.cssText = value ? value : ''; - } - } - }; - - Element._attributeTranslations.has = {}; - - $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + - 'encType maxLength readOnly longDesc').each(function(attr) { - Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; - Element._attributeTranslations.has[attr.toLowerCase()] = attr; - }); - - (function(v) { - Object.extend(v, { - href: v._getAttr, - src: v._getAttr, - type: v._getAttr, - action: v._getAttrNode, - disabled: v._flag, - checked: v._flag, - readonly: v._flag, - multiple: v._flag, - onload: v._getEv, - onunload: v._getEv, - onclick: v._getEv, - ondblclick: v._getEv, - onmousedown: v._getEv, - onmouseup: v._getEv, - onmouseover: v._getEv, - onmousemove: v._getEv, - onmouseout: v._getEv, - onfocus: v._getEv, - onblur: v._getEv, - onkeypress: v._getEv, - onkeydown: v._getEv, - onkeyup: v._getEv, - onsubmit: v._getEv, - onreset: v._getEv, - onselect: v._getEv, - onchange: v._getEv - }); - })(Element._attributeTranslations.read.values); -} - -else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { - Element.Methods.setOpacity = function(element, value) { - element = $(element); - element.style.opacity = (value == 1) ? 0.999999 : - (value === '') ? '' : (value < 0.00001) ? 0 : value; - return element; - }; -} - -else if (Prototype.Browser.WebKit) { - Element.Methods.setOpacity = function(element, value) { - element = $(element); - element.style.opacity = (value == 1 || value === '') ? '' : - (value < 0.00001) ? 0 : value; - - if (value == 1) - if(element.tagName == 'IMG' && element.width) { - element.width++; element.width--; - } else try { - var n = document.createTextNode(' '); - element.appendChild(n); - element.removeChild(n); - } catch (e) { } - - return element; - }; - - // Safari returns margins on body which is incorrect if the child is absolutely - // positioned. For performance reasons, redefine Element#cumulativeOffset for - // KHTML/WebKit only. - Element.Methods.cumulativeOffset = function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - if (element.offsetParent == document.body) - if (Element.getStyle(element, 'position') == 'absolute') break; - - element = element.offsetParent; - } while (element); - - return Element._returnOffset(valueL, valueT); - }; -} - -if (Prototype.Browser.IE || Prototype.Browser.Opera) { - // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements - Element.Methods.update = function(element, content) { - element = $(element); - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) return element.update().insert(content); - - content = Object.toHTML(content); - var tagName = element.tagName.toUpperCase(); - - if (tagName in Element._insertionTranslations.tags) { - $A(element.childNodes).each(function(node) { element.removeChild(node) }); - Element._getContentFromAnonymousElement(tagName, content.stripScripts()) - .each(function(node) { element.appendChild(node) }); - } - else element.innerHTML = content.stripScripts(); - - content.evalScripts.bind(content).defer(); - return element; - }; -} - -if (document.createElement('div').outerHTML) { - Element.Methods.replace = function(element, content) { - element = $(element); - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - element.parentNode.replaceChild(content, element); - return element; - } - - content = Object.toHTML(content); - var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); - - if (Element._insertionTranslations.tags[tagName]) { - var nextSibling = element.next(); - var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); - parent.removeChild(element); - if (nextSibling) - fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); - else - fragments.each(function(node) { parent.appendChild(node) }); - } - else element.outerHTML = content.stripScripts(); - - content.evalScripts.bind(content).defer(); - return element; - }; -} - -Element._returnOffset = function(l, t) { - var result = [l, t]; - result.left = l; - result.top = t; - return result; -}; - -Element._getContentFromAnonymousElement = function(tagName, html) { - var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; - if (t) { - div.innerHTML = t[0] + html + t[1]; - t[2].times(function() { div = div.firstChild }); - } else div.innerHTML = html; - return $A(div.childNodes); -}; - -Element._insertionTranslations = { - before: function(element, node) { - element.parentNode.insertBefore(node, element); - }, - top: function(element, node) { - element.insertBefore(node, element.firstChild); - }, - bottom: function(element, node) { - element.appendChild(node); - }, - after: function(element, node) { - element.parentNode.insertBefore(node, element.nextSibling); - }, - tags: { - TABLE: ['', '
    ', 1], - TBODY: ['', '
    ', 2], - TR: ['', '
    ', 3], - TD: ['
    ', '
    ', 4], - SELECT: ['', 1] - } -}; - -(function() { - Object.extend(this.tags, { - THEAD: this.tags.TBODY, - TFOOT: this.tags.TBODY, - TH: this.tags.TD - }); -}).call(Element._insertionTranslations); - -Element.Methods.Simulated = { - hasAttribute: function(element, attribute) { - attribute = Element._attributeTranslations.has[attribute] || attribute; - var node = $(element).getAttributeNode(attribute); - return node && node.specified; - } -}; - -Element.Methods.ByTag = { }; - -Object.extend(Element, Element.Methods); - -if (!Prototype.BrowserFeatures.ElementExtensions && - document.createElement('div').__proto__) { - window.HTMLElement = { }; - window.HTMLElement.prototype = document.createElement('div').__proto__; - Prototype.BrowserFeatures.ElementExtensions = true; -} - -Element.extend = (function() { - if (Prototype.BrowserFeatures.SpecificElementExtensions) - return Prototype.K; - - var Methods = { }, ByTag = Element.Methods.ByTag; - - var extend = Object.extend(function(element) { - if (!element || element._extendedByPrototype || - element.nodeType != 1 || element == window) return element; - - var methods = Object.clone(Methods), - tagName = element.tagName, property, value; - - // extend methods for specific tags - if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); - - for (property in methods) { - value = methods[property]; - if (Object.isFunction(value) && !(property in element)) - element[property] = value.methodize(); - } - - element._extendedByPrototype = Prototype.emptyFunction; - return element; - - }, { - refresh: function() { - // extend methods for all tags (Safari doesn't need this) - if (!Prototype.BrowserFeatures.ElementExtensions) { - Object.extend(Methods, Element.Methods); - Object.extend(Methods, Element.Methods.Simulated); - } - } - }); - - extend.refresh(); - return extend; -})(); - -Element.hasAttribute = function(element, attribute) { - if (element.hasAttribute) return element.hasAttribute(attribute); - return Element.Methods.Simulated.hasAttribute(element, attribute); -}; - -Element.addMethods = function(methods) { - var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; - - if (!methods) { - Object.extend(Form, Form.Methods); - Object.extend(Form.Element, Form.Element.Methods); - Object.extend(Element.Methods.ByTag, { - "FORM": Object.clone(Form.Methods), - "INPUT": Object.clone(Form.Element.Methods), - "SELECT": Object.clone(Form.Element.Methods), - "TEXTAREA": Object.clone(Form.Element.Methods) - }); - } - - if (arguments.length == 2) { - var tagName = methods; - methods = arguments[1]; - } - - if (!tagName) Object.extend(Element.Methods, methods || { }); - else { - if (Object.isArray(tagName)) tagName.each(extend); - else extend(tagName); - } - - function extend(tagName) { - tagName = tagName.toUpperCase(); - if (!Element.Methods.ByTag[tagName]) - Element.Methods.ByTag[tagName] = { }; - Object.extend(Element.Methods.ByTag[tagName], methods); - } - - function copy(methods, destination, onlyIfAbsent) { - onlyIfAbsent = onlyIfAbsent || false; - for (var property in methods) { - var value = methods[property]; - if (!Object.isFunction(value)) continue; - if (!onlyIfAbsent || !(property in destination)) - destination[property] = value.methodize(); - } - } - - function findDOMClass(tagName) { - var klass; - var trans = { - "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", - "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", - "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", - "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", - "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": - "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": - "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": - "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": - "FrameSet", "IFRAME": "IFrame" - }; - if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; - if (window[klass]) return window[klass]; - klass = 'HTML' + tagName + 'Element'; - if (window[klass]) return window[klass]; - klass = 'HTML' + tagName.capitalize() + 'Element'; - if (window[klass]) return window[klass]; - - window[klass] = { }; - window[klass].prototype = document.createElement(tagName).__proto__; - return window[klass]; - } - - if (F.ElementExtensions) { - copy(Element.Methods, HTMLElement.prototype); - copy(Element.Methods.Simulated, HTMLElement.prototype, true); - } - - if (F.SpecificElementExtensions) { - for (var tag in Element.Methods.ByTag) { - var klass = findDOMClass(tag); - if (Object.isUndefined(klass)) continue; - copy(T[tag], klass.prototype); - } - } - - Object.extend(Element, Element.Methods); - delete Element.ByTag; - - if (Element.extend.refresh) Element.extend.refresh(); - Element.cache = { }; -}; - -document.viewport = { - getDimensions: function() { - var dimensions = { }; - var B = Prototype.Browser; - $w('width height').each(function(d) { - var D = d.capitalize(); - dimensions[d] = (B.WebKit && !document.evaluate) ? self['inner' + D] : - (B.Opera) ? document.body['client' + D] : document.documentElement['client' + D]; - }); - return dimensions; - }, - - getWidth: function() { - return this.getDimensions().width; - }, - - getHeight: function() { - return this.getDimensions().height; - }, - - getScrollOffsets: function() { - return Element._returnOffset( - window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, - window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); - } -}; -/* Portions of the Selector class are derived from Jack Slocum’s DomQuery, - * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style - * license. Please see http://www.yui-ext.com/ for more information. */ - -var Selector = Class.create({ - initialize: function(expression) { - this.expression = expression.strip(); - this.compileMatcher(); - }, - - shouldUseXPath: function() { - if (!Prototype.BrowserFeatures.XPath) return false; - - var e = this.expression; - - // Safari 3 chokes on :*-of-type and :empty - if (Prototype.Browser.WebKit && - (e.include("-of-type") || e.include(":empty"))) - return false; - - // XPath can't do namespaced attributes, nor can it read - // the "checked" property from DOM nodes - if ((/(\[[\w-]*?:|:checked)/).test(this.expression)) - return false; - - return true; - }, - - compileMatcher: function() { - if (this.shouldUseXPath()) - return this.compileXPathMatcher(); - - var e = this.expression, ps = Selector.patterns, h = Selector.handlers, - c = Selector.criteria, le, p, m; - - if (Selector._cache[e]) { - this.matcher = Selector._cache[e]; - return; - } - - this.matcher = ["this.matcher = function(root) {", - "var r = root, h = Selector.handlers, c = false, n;"]; - - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i in ps) { - p = ps[i]; - if (m = e.match(p)) { - this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : - new Template(c[i]).evaluate(m)); - e = e.replace(m[0], ''); - break; - } - } - } - - this.matcher.push("return h.unique(n);\n}"); - eval(this.matcher.join('\n')); - Selector._cache[this.expression] = this.matcher; - }, - - compileXPathMatcher: function() { - var e = this.expression, ps = Selector.patterns, - x = Selector.xpath, le, m; - - if (Selector._cache[e]) { - this.xpath = Selector._cache[e]; return; - } - - this.matcher = ['.//*']; - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i in ps) { - if (m = e.match(ps[i])) { - this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : - new Template(x[i]).evaluate(m)); - e = e.replace(m[0], ''); - break; - } - } - } - - this.xpath = this.matcher.join(''); - Selector._cache[this.expression] = this.xpath; - }, - - findElements: function(root) { - root = root || document; - if (this.xpath) return document._getElementsByXPath(this.xpath, root); - return this.matcher(root); - }, - - match: function(element) { - this.tokens = []; - - var e = this.expression, ps = Selector.patterns, as = Selector.assertions; - var le, p, m; - - while (e && le !== e && (/\S/).test(e)) { - le = e; - for (var i in ps) { - p = ps[i]; - if (m = e.match(p)) { - // use the Selector.assertions methods unless the selector - // is too complex. - if (as[i]) { - this.tokens.push([i, Object.clone(m)]); - e = e.replace(m[0], ''); - } else { - // reluctantly do a document-wide search - // and look for a match in the array - return this.findElements(document).include(element); - } - } - } - } - - var match = true, name, matches; - for (var i = 0, token; token = this.tokens[i]; i++) { - name = token[0], matches = token[1]; - if (!Selector.assertions[name](element, matches)) { - match = false; break; - } - } - - return match; - }, - - toString: function() { - return this.expression; - }, - - inspect: function() { - return "#"; - } -}); - -Object.extend(Selector, { - _cache: { }, - - xpath: { - descendant: "//*", - child: "/*", - adjacent: "/following-sibling::*[1]", - laterSibling: '/following-sibling::*', - tagName: function(m) { - if (m[1] == '*') return ''; - return "[local-name()='" + m[1].toLowerCase() + - "' or local-name()='" + m[1].toUpperCase() + "']"; - }, - className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", - id: "[@id='#{1}']", - attrPresence: function(m) { - m[1] = m[1].toLowerCase(); - return new Template("[@#{1}]").evaluate(m); - }, - attr: function(m) { - m[1] = m[1].toLowerCase(); - m[3] = m[5] || m[6]; - return new Template(Selector.xpath.operators[m[2]]).evaluate(m); - }, - pseudo: function(m) { - var h = Selector.xpath.pseudos[m[1]]; - if (!h) return ''; - if (Object.isFunction(h)) return h(m); - return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); - }, - operators: { - '=': "[@#{1}='#{3}']", - '!=': "[@#{1}!='#{3}']", - '^=': "[starts-with(@#{1}, '#{3}')]", - '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", - '*=': "[contains(@#{1}, '#{3}')]", - '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", - '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" - }, - pseudos: { - 'first-child': '[not(preceding-sibling::*)]', - 'last-child': '[not(following-sibling::*)]', - 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', - 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]", - 'checked': "[@checked]", - 'disabled': "[@disabled]", - 'enabled': "[not(@disabled)]", - 'not': function(m) { - var e = m[6], p = Selector.patterns, - x = Selector.xpath, le, v; - - var exclusion = []; - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i in p) { - if (m = e.match(p[i])) { - v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m); - exclusion.push("(" + v.substring(1, v.length - 1) + ")"); - e = e.replace(m[0], ''); - break; - } - } - } - return "[not(" + exclusion.join(" and ") + ")]"; - }, - 'nth-child': function(m) { - return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m); - }, - 'nth-last-child': function(m) { - return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m); - }, - 'nth-of-type': function(m) { - return Selector.xpath.pseudos.nth("position() ", m); - }, - 'nth-last-of-type': function(m) { - return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); - }, - 'first-of-type': function(m) { - m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m); - }, - 'last-of-type': function(m) { - m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); - }, - 'only-of-type': function(m) { - var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m); - }, - nth: function(fragment, m) { - var mm, formula = m[6], predicate; - if (formula == 'even') formula = '2n+0'; - if (formula == 'odd') formula = '2n+1'; - if (mm = formula.match(/^(\d+)$/)) // digit only - return '[' + fragment + "= " + mm[1] + ']'; - if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b - if (mm[1] == "-") mm[1] = -1; - var a = mm[1] ? Number(mm[1]) : 1; - var b = mm[2] ? Number(mm[2]) : 0; - predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " + - "((#{fragment} - #{b}) div #{a} >= 0)]"; - return new Template(predicate).evaluate({ - fragment: fragment, a: a, b: b }); - } - } - } - }, - - criteria: { - tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', - className: 'n = h.className(n, r, "#{1}", c); c = false;', - id: 'n = h.id(n, r, "#{1}", c); c = false;', - attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;', - attr: function(m) { - m[3] = (m[5] || m[6]); - return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m); - }, - pseudo: function(m) { - if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); - return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); - }, - descendant: 'c = "descendant";', - child: 'c = "child";', - adjacent: 'c = "adjacent";', - laterSibling: 'c = "laterSibling";' - }, - - patterns: { - // combinators must be listed first - // (and descendant needs to be last combinator) - laterSibling: /^\s*~\s*/, - child: /^\s*>\s*/, - adjacent: /^\s*\+\s*/, - descendant: /^\s/, - - // selectors follow - tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, - id: /^#([\w\-\*]+)(\b|$)/, - className: /^\.([\w\-\*]+)(\b|$)/, - pseudo: -/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/, - attrPresence: /^\[([\w]+)\]/, - attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ - }, - - // for Selector.match and Element#match - assertions: { - tagName: function(element, matches) { - return matches[1].toUpperCase() == element.tagName.toUpperCase(); - }, - - className: function(element, matches) { - return Element.hasClassName(element, matches[1]); - }, - - id: function(element, matches) { - return element.id === matches[1]; - }, - - attrPresence: function(element, matches) { - return Element.hasAttribute(element, matches[1]); - }, - - attr: function(element, matches) { - var nodeValue = Element.readAttribute(element, matches[1]); - return Selector.operators[matches[2]](nodeValue, matches[3]); - } - }, - - handlers: { - // UTILITY FUNCTIONS - // joins two collections - concat: function(a, b) { - for (var i = 0, node; node = b[i]; i++) - a.push(node); - return a; - }, - - // marks an array of nodes for counting - mark: function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) - node._counted = true; - return nodes; - }, - - unmark: function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) - node._counted = undefined; - return nodes; - }, - - // mark each child node with its position (for nth calls) - // "ofType" flag indicates whether we're indexing for nth-of-type - // rather than nth-child - index: function(parentNode, reverse, ofType) { - parentNode._counted = true; - if (reverse) { - for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { - var node = nodes[i]; - if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; - } - } else { - for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) - if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; - } - }, - - // filters out duplicates and extends all nodes - unique: function(nodes) { - if (nodes.length == 0) return nodes; - var results = [], n; - for (var i = 0, l = nodes.length; i < l; i++) - if (!(n = nodes[i])._counted) { - n._counted = true; - results.push(Element.extend(n)); - } - return Selector.handlers.unmark(results); - }, - - // COMBINATOR FUNCTIONS - descendant: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - h.concat(results, node.getElementsByTagName('*')); - return results; - }, - - child: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) { - for (var j = 0, child; child = node.childNodes[j]; j++) - if (child.nodeType == 1 && child.tagName != '!') results.push(child); - } - return results; - }, - - adjacent: function(nodes) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - var next = this.nextElementSibling(node); - if (next) results.push(next); - } - return results; - }, - - laterSibling: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - h.concat(results, Element.nextSiblings(node)); - return results; - }, - - nextElementSibling: function(node) { - while (node = node.nextSibling) - if (node.nodeType == 1) return node; - return null; - }, - - previousElementSibling: function(node) { - while (node = node.previousSibling) - if (node.nodeType == 1) return node; - return null; - }, - - // TOKEN FUNCTIONS - tagName: function(nodes, root, tagName, combinator) { - var uTagName = tagName.toUpperCase(); - var results = [], h = Selector.handlers; - if (nodes) { - if (combinator) { - // fastlane for ordinary descendant combinators - if (combinator == "descendant") { - for (var i = 0, node; node = nodes[i]; i++) - h.concat(results, node.getElementsByTagName(tagName)); - return results; - } else nodes = this[combinator](nodes); - if (tagName == "*") return nodes; - } - for (var i = 0, node; node = nodes[i]; i++) - if (node.tagName.toUpperCase() === uTagName) results.push(node); - return results; - } else return root.getElementsByTagName(tagName); - }, - - id: function(nodes, root, id, combinator) { - var targetNode = $(id), h = Selector.handlers; - if (!targetNode) return []; - if (!nodes && root == document) return [targetNode]; - if (nodes) { - if (combinator) { - if (combinator == 'child') { - for (var i = 0, node; node = nodes[i]; i++) - if (targetNode.parentNode == node) return [targetNode]; - } else if (combinator == 'descendant') { - for (var i = 0, node; node = nodes[i]; i++) - if (Element.descendantOf(targetNode, node)) return [targetNode]; - } else if (combinator == 'adjacent') { - for (var i = 0, node; node = nodes[i]; i++) - if (Selector.handlers.previousElementSibling(targetNode) == node) - return [targetNode]; - } else nodes = h[combinator](nodes); - } - for (var i = 0, node; node = nodes[i]; i++) - if (node == targetNode) return [targetNode]; - return []; - } - return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; - }, - - className: function(nodes, root, className, combinator) { - if (nodes && combinator) nodes = this[combinator](nodes); - return Selector.handlers.byClassName(nodes, root, className); - }, - - byClassName: function(nodes, root, className) { - if (!nodes) nodes = Selector.handlers.descendant([root]); - var needle = ' ' + className + ' '; - for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { - nodeClassName = node.className; - if (nodeClassName.length == 0) continue; - if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) - results.push(node); - } - return results; - }, - - attrPresence: function(nodes, root, attr) { - if (!nodes) nodes = root.getElementsByTagName("*"); - var results = []; - for (var i = 0, node; node = nodes[i]; i++) - if (Element.hasAttribute(node, attr)) results.push(node); - return results; - }, - - attr: function(nodes, root, attr, value, operator) { - if (!nodes) nodes = root.getElementsByTagName("*"); - var handler = Selector.operators[operator], results = []; - for (var i = 0, node; node = nodes[i]; i++) { - var nodeValue = Element.readAttribute(node, attr); - if (nodeValue === null) continue; - if (handler(nodeValue, value)) results.push(node); - } - return results; - }, - - pseudo: function(nodes, name, value, root, combinator) { - if (nodes && combinator) nodes = this[combinator](nodes); - if (!nodes) nodes = root.getElementsByTagName("*"); - return Selector.pseudos[name](nodes, value, root); - } - }, - - pseudos: { - 'first-child': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (Selector.handlers.previousElementSibling(node)) continue; - results.push(node); - } - return results; - }, - 'last-child': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (Selector.handlers.nextElementSibling(node)) continue; - results.push(node); - } - return results; - }, - 'only-child': function(nodes, value, root) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) - results.push(node); - return results; - }, - 'nth-child': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root); - }, - 'nth-last-child': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, true); - }, - 'nth-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, false, true); - }, - 'nth-last-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, true, true); - }, - 'first-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, "1", root, false, true); - }, - 'last-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, "1", root, true, true); - }, - 'only-of-type': function(nodes, formula, root) { - var p = Selector.pseudos; - return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); - }, - - // handles the an+b logic - getIndices: function(a, b, total) { - if (a == 0) return b > 0 ? [b] : []; - return $R(1, total).inject([], function(memo, i) { - if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); - return memo; - }); - }, - - // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type - nth: function(nodes, formula, root, reverse, ofType) { - if (nodes.length == 0) return []; - if (formula == 'even') formula = '2n+0'; - if (formula == 'odd') formula = '2n+1'; - var h = Selector.handlers, results = [], indexed = [], m; - h.mark(nodes); - for (var i = 0, node; node = nodes[i]; i++) { - if (!node.parentNode._counted) { - h.index(node.parentNode, reverse, ofType); - indexed.push(node.parentNode); - } - } - if (formula.match(/^\d+$/)) { // just a number - formula = Number(formula); - for (var i = 0, node; node = nodes[i]; i++) - if (node.nodeIndex == formula) results.push(node); - } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b - if (m[1] == "-") m[1] = -1; - var a = m[1] ? Number(m[1]) : 1; - var b = m[2] ? Number(m[2]) : 0; - var indices = Selector.pseudos.getIndices(a, b, nodes.length); - for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { - for (var j = 0; j < l; j++) - if (node.nodeIndex == indices[j]) results.push(node); - } - } - h.unmark(nodes); - h.unmark(indexed); - return results; - }, - - 'empty': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - // IE treats comments as element nodes - if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue; - results.push(node); - } - return results; - }, - - 'not': function(nodes, selector, root) { - var h = Selector.handlers, selectorType, m; - var exclusions = new Selector(selector).findElements(root); - h.mark(exclusions); - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node._counted) results.push(node); - h.unmark(exclusions); - return results; - }, - - 'enabled': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node.disabled) results.push(node); - return results; - }, - - 'disabled': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (node.disabled) results.push(node); - return results; - }, - - 'checked': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (node.checked) results.push(node); - return results; - } - }, - - operators: { - '=': function(nv, v) { return nv == v; }, - '!=': function(nv, v) { return nv != v; }, - '^=': function(nv, v) { return nv.startsWith(v); }, - '$=': function(nv, v) { return nv.endsWith(v); }, - '*=': function(nv, v) { return nv.include(v); }, - '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, - '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); } - }, - - matchElements: function(elements, expression) { - var matches = new Selector(expression).findElements(), h = Selector.handlers; - h.mark(matches); - for (var i = 0, results = [], element; element = elements[i]; i++) - if (element._counted) results.push(element); - h.unmark(matches); - return results; - }, - - findElement: function(elements, expression, index) { - if (Object.isNumber(expression)) { - index = expression; expression = false; - } - return Selector.matchElements(elements, expression || '*')[index || 0]; - }, - - findChildElements: function(element, expressions) { - var exprs = expressions.join(','); - expressions = []; - exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { - expressions.push(m[1].strip()); - }); - var results = [], h = Selector.handlers; - for (var i = 0, l = expressions.length, selector; i < l; i++) { - selector = new Selector(expressions[i].strip()); - h.concat(results, selector.findElements(element)); - } - return (l > 1) ? h.unique(results) : results; - } -}); - -if (Prototype.Browser.IE) { - // IE returns comment nodes on getElementsByTagName("*"). - // Filter them out. - Selector.handlers.concat = function(a, b) { - for (var i = 0, node; node = b[i]; i++) - if (node.tagName !== "!") a.push(node); - return a; - }; -} - -function $$() { - return Selector.findChildElements(document, $A(arguments)); -} -var Form = { - reset: function(form) { - $(form).reset(); - return form; - }, - - serializeElements: function(elements, options) { - if (typeof options != 'object') options = { hash: !!options }; - else if (Object.isUndefined(options.hash)) options.hash = true; - var key, value, submitted = false, submit = options.submit; - - var data = elements.inject({ }, function(result, element) { - if (!element.disabled && element.name) { - key = element.name; value = $(element).getValue(); - if (value != null && (element.type != 'submit' || (!submitted && - submit !== false && (!submit || key == submit) && (submitted = true)))) { - if (key in result) { - // a key is already present; construct an array of values - if (!Object.isArray(result[key])) result[key] = [result[key]]; - result[key].push(value); - } - else result[key] = value; - } - } - return result; - }); - - return options.hash ? data : Object.toQueryString(data); - } -}; - -Form.Methods = { - serialize: function(form, options) { - return Form.serializeElements(Form.getElements(form), options); - }, - - getElements: function(form) { - return $A($(form).getElementsByTagName('*')).inject([], - function(elements, child) { - if (Form.Element.Serializers[child.tagName.toLowerCase()]) - elements.push(Element.extend(child)); - return elements; - } - ); - }, - - getInputs: function(form, typeName, name) { - form = $(form); - var inputs = form.getElementsByTagName('input'); - - if (!typeName && !name) return $A(inputs).map(Element.extend); - - for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { - var input = inputs[i]; - if ((typeName && input.type != typeName) || (name && input.name != name)) - continue; - matchingInputs.push(Element.extend(input)); - } - - return matchingInputs; - }, - - disable: function(form) { - form = $(form); - Form.getElements(form).invoke('disable'); - return form; - }, - - enable: function(form) { - form = $(form); - Form.getElements(form).invoke('enable'); - return form; - }, - - findFirstElement: function(form) { - var elements = $(form).getElements().findAll(function(element) { - return 'hidden' != element.type && !element.disabled; - }); - var firstByIndex = elements.findAll(function(element) { - return element.hasAttribute('tabIndex') && element.tabIndex >= 0; - }).sortBy(function(element) { return element.tabIndex }).first(); - - return firstByIndex ? firstByIndex : elements.find(function(element) { - return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); - }); - }, - - focusFirstElement: function(form) { - form = $(form); - form.findFirstElement().activate(); - return form; - }, - - request: function(form, options) { - form = $(form), options = Object.clone(options || { }); - - var params = options.parameters, action = form.readAttribute('action') || ''; - if (action.blank()) action = window.location.href; - options.parameters = form.serialize(true); - - if (params) { - if (Object.isString(params)) params = params.toQueryParams(); - Object.extend(options.parameters, params); - } - - if (form.hasAttribute('method') && !options.method) - options.method = form.method; - - return new Ajax.Request(action, options); - } -}; - -/*--------------------------------------------------------------------------*/ - -Form.Element = { - focus: function(element) { - $(element).focus(); - return element; - }, - - select: function(element) { - $(element).select(); - return element; - } -}; - -Form.Element.Methods = { - serialize: function(element) { - element = $(element); - if (!element.disabled && element.name) { - var value = element.getValue(); - if (value != undefined) { - var pair = { }; - pair[element.name] = value; - return Object.toQueryString(pair); - } - } - return ''; - }, - - getValue: function(element) { - element = $(element); - var method = element.tagName.toLowerCase(); - return Form.Element.Serializers[method](element); - }, - - setValue: function(element, value) { - element = $(element); - var method = element.tagName.toLowerCase(); - Form.Element.Serializers[method](element, value); - return element; - }, - - clear: function(element) { - $(element).value = ''; - return element; - }, - - present: function(element) { - return $(element).value != ''; - }, - - activate: function(element) { - element = $(element); - try { - element.focus(); - if (element.select && (element.tagName.toLowerCase() != 'input' || - !['button', 'reset', 'submit'].include(element.type))) - element.select(); - } catch (e) { } - return element; - }, - - disable: function(element) { - element = $(element); - element.blur(); - element.disabled = true; - return element; - }, - - enable: function(element) { - element = $(element); - element.disabled = false; - return element; - } -}; - -/*--------------------------------------------------------------------------*/ - -var Field = Form.Element; -var $F = Form.Element.Methods.getValue; - -/*--------------------------------------------------------------------------*/ - -Form.Element.Serializers = { - input: function(element, value) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - return Form.Element.Serializers.inputSelector(element, value); - default: - return Form.Element.Serializers.textarea(element, value); - } - }, - - inputSelector: function(element, value) { - if (Object.isUndefined(value)) return element.checked ? element.value : null; - else element.checked = !!value; - }, - - textarea: function(element, value) { - if (Object.isUndefined(value)) return element.value; - else element.value = value; - }, - - select: function(element, index) { - if (Object.isUndefined(index)) - return this[element.type == 'select-one' ? - 'selectOne' : 'selectMany'](element); - else { - var opt, value, single = !Object.isArray(index); - for (var i = 0, length = element.length; i < length; i++) { - opt = element.options[i]; - value = this.optionValue(opt); - if (single) { - if (value == index) { - opt.selected = true; - return; - } - } - else opt.selected = index.include(value); - } - } - }, - - selectOne: function(element) { - var index = element.selectedIndex; - return index >= 0 ? this.optionValue(element.options[index]) : null; - }, - - selectMany: function(element) { - var values, length = element.length; - if (!length) return null; - - for (var i = 0, values = []; i < length; i++) { - var opt = element.options[i]; - if (opt.selected) values.push(this.optionValue(opt)); - } - return values; - }, - - optionValue: function(opt) { - // extend element because hasAttribute may not be native - return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; - } -}; - -/*--------------------------------------------------------------------------*/ - -Abstract.TimedObserver = Class.create(PeriodicalExecuter, { - initialize: function($super, element, frequency, callback) { - $super(callback, frequency); - this.element = $(element); - this.lastValue = this.getValue(); - }, - - execute: function() { - var value = this.getValue(); - if (Object.isString(this.lastValue) && Object.isString(value) ? - this.lastValue != value : String(this.lastValue) != String(value)) { - this.callback(this.element, value); - this.lastValue = value; - } - } -}); - -Form.Element.Observer = Class.create(Abstract.TimedObserver, { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.Observer = Class.create(Abstract.TimedObserver, { - getValue: function() { - return Form.serialize(this.element); - } -}); - -/*--------------------------------------------------------------------------*/ - -Abstract.EventObserver = Class.create({ - initialize: function(element, callback) { - this.element = $(element); - this.callback = callback; - - this.lastValue = this.getValue(); - if (this.element.tagName.toLowerCase() == 'form') - this.registerFormCallbacks(); - else - this.registerCallback(this.element); - }, - - onElementEvent: function() { - var value = this.getValue(); - if (this.lastValue != value) { - this.callback(this.element, value); - this.lastValue = value; - } - }, - - registerFormCallbacks: function() { - Form.getElements(this.element).each(this.registerCallback, this); - }, - - registerCallback: function(element) { - if (element.type) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - Event.observe(element, 'click', this.onElementEvent.bind(this)); - break; - default: - Event.observe(element, 'change', this.onElementEvent.bind(this)); - break; - } - } - } -}); - -Form.Element.EventObserver = Class.create(Abstract.EventObserver, { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.EventObserver = Class.create(Abstract.EventObserver, { - getValue: function() { - return Form.serialize(this.element); - } -}); -if (!window.Event) var Event = { }; - -Object.extend(Event, { - KEY_BACKSPACE: 8, - KEY_TAB: 9, - KEY_RETURN: 13, - KEY_ESC: 27, - KEY_LEFT: 37, - KEY_UP: 38, - KEY_RIGHT: 39, - KEY_DOWN: 40, - KEY_DELETE: 46, - KEY_HOME: 36, - KEY_END: 35, - KEY_PAGEUP: 33, - KEY_PAGEDOWN: 34, - KEY_INSERT: 45, - - cache: { }, - - relatedTarget: function(event) { - var element; - switch(event.type) { - case 'mouseover': element = event.fromElement; break; - case 'mouseout': element = event.toElement; break; - default: return null; - } - return Element.extend(element); - } -}); - -Event.Methods = (function() { - var isButton; - - if (Prototype.Browser.IE) { - var buttonMap = { 0: 1, 1: 4, 2: 2 }; - isButton = function(event, code) { - return event.button == buttonMap[code]; - }; - - } else if (Prototype.Browser.WebKit) { - isButton = function(event, code) { - switch (code) { - case 0: return event.which == 1 && !event.metaKey; - case 1: return event.which == 1 && event.metaKey; - default: return false; - } - }; - - } else { - isButton = function(event, code) { - return event.which ? (event.which === code + 1) : (event.button === code); - }; - } - - return { - isLeftClick: function(event) { return isButton(event, 0) }, - isMiddleClick: function(event) { return isButton(event, 1) }, - isRightClick: function(event) { return isButton(event, 2) }, - - element: function(event) { - var node = Event.extend(event).target; - return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node); - }, - - findElement: function(event, expression) { - var element = Event.element(event); - if (!expression) return element; - var elements = [element].concat(element.ancestors()); - return Selector.findElement(elements, expression, 0); - }, - - pointer: function(event) { - return { - x: event.pageX || (event.clientX + - (document.documentElement.scrollLeft || document.body.scrollLeft)), - y: event.pageY || (event.clientY + - (document.documentElement.scrollTop || document.body.scrollTop)) - }; - }, - - pointerX: function(event) { return Event.pointer(event).x }, - pointerY: function(event) { return Event.pointer(event).y }, - - stop: function(event) { - Event.extend(event); - event.preventDefault(); - event.stopPropagation(); - event.stopped = true; - } - }; -})(); - -Event.extend = (function() { - var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { - m[name] = Event.Methods[name].methodize(); - return m; - }); - - if (Prototype.Browser.IE) { - Object.extend(methods, { - stopPropagation: function() { this.cancelBubble = true }, - preventDefault: function() { this.returnValue = false }, - inspect: function() { return "[object Event]" } - }); - - return function(event) { - if (!event) return false; - if (event._extendedByPrototype) return event; - - event._extendedByPrototype = Prototype.emptyFunction; - var pointer = Event.pointer(event); - Object.extend(event, { - target: event.srcElement, - relatedTarget: Event.relatedTarget(event), - pageX: pointer.x, - pageY: pointer.y - }); - return Object.extend(event, methods); - }; - - } else { - Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__; - Object.extend(Event.prototype, methods); - return Prototype.K; - } -})(); - -Object.extend(Event, (function() { - var cache = Event.cache; - - function getEventID(element) { - if (element._eventID) return element._eventID; - arguments.callee.id = arguments.callee.id || 1; - return element._eventID = ++arguments.callee.id; - } - - function getDOMEventName(eventName) { - if (eventName && eventName.include(':')) return "dataavailable"; - return eventName; - } - - function getCacheForID(id) { - return cache[id] = cache[id] || { }; - } - - function getWrappersForEventName(id, eventName) { - var c = getCacheForID(id); - return c[eventName] = c[eventName] || []; - } - - function createWrapper(element, eventName, handler) { - var id = getEventID(element); - var c = getWrappersForEventName(id, eventName); - if (c.pluck("handler").include(handler)) return false; - - var wrapper = function(event) { - if (!Event || !Event.extend || - (event.eventName && event.eventName != eventName)) - return false; - - Event.extend(event); - handler.call(element, event); - }; - - wrapper.handler = handler; - c.push(wrapper); - return wrapper; - } - - function findWrapper(id, eventName, handler) { - var c = getWrappersForEventName(id, eventName); - return c.find(function(wrapper) { return wrapper.handler == handler }); - } - - function destroyWrapper(id, eventName, handler) { - var c = getCacheForID(id); - if (!c[eventName]) return false; - c[eventName] = c[eventName].without(findWrapper(id, eventName, handler)); - } - - function destroyCache() { - for (var id in cache) - for (var eventName in cache[id]) - cache[id][eventName] = null; - } - - if (window.attachEvent) { - window.attachEvent("onunload", destroyCache); - } - - return { - observe: function(element, eventName, handler) { - element = $(element); - var name = getDOMEventName(eventName); - - var wrapper = createWrapper(element, eventName, handler); - if (!wrapper) return element; - - if (element.addEventListener) { - element.addEventListener(name, wrapper, false); - } else { - element.attachEvent("on" + name, wrapper); - } - - return element; - }, - - stopObserving: function(element, eventName, handler) { - element = $(element); - var id = getEventID(element), name = getDOMEventName(eventName); - - if (!handler && eventName) { - getWrappersForEventName(id, eventName).each(function(wrapper) { - element.stopObserving(eventName, wrapper.handler); - }); - return element; - - } else if (!eventName) { - Object.keys(getCacheForID(id)).each(function(eventName) { - element.stopObserving(eventName); - }); - return element; - } - - var wrapper = findWrapper(id, eventName, handler); - if (!wrapper) return element; - - if (element.removeEventListener) { - element.removeEventListener(name, wrapper, false); - } else { - element.detachEvent("on" + name, wrapper); - } - - destroyWrapper(id, eventName, handler); - - return element; - }, - - fire: function(element, eventName, memo) { - element = $(element); - if (element == document && document.createEvent && !element.dispatchEvent) - element = document.documentElement; - - var event; - if (document.createEvent) { - event = document.createEvent("HTMLEvents"); - event.initEvent("dataavailable", true, true); - } else { - event = document.createEventObject(); - event.eventType = "ondataavailable"; - } - - event.eventName = eventName; - event.memo = memo || { }; - - if (document.createEvent) { - element.dispatchEvent(event); - } else { - element.fireEvent(event.eventType, event); - } - - return Event.extend(event); - } - }; -})()); - -Object.extend(Event, Event.Methods); - -Element.addMethods({ - fire: Event.fire, - observe: Event.observe, - stopObserving: Event.stopObserving -}); - -Object.extend(document, { - fire: Element.Methods.fire.methodize(), - observe: Element.Methods.observe.methodize(), - stopObserving: Element.Methods.stopObserving.methodize(), - loaded: false -}); - -(function() { - /* Support for the DOMContentLoaded event is based on work by Dan Webb, - Matthias Miller, Dean Edwards and John Resig. */ - - var timer; - - function fireContentLoadedEvent() { - if (document.loaded) return; - if (timer) window.clearInterval(timer); - document.fire("dom:loaded"); - document.loaded = true; - } - - if (document.addEventListener) { - if (Prototype.Browser.WebKit) { - timer = window.setInterval(function() { - if (/loaded|complete/.test(document.readyState)) - fireContentLoadedEvent(); - }, 0); - - Event.observe(window, "load", fireContentLoadedEvent); - - } else { - document.addEventListener("DOMContentLoaded", - fireContentLoadedEvent, false); - } - - } else { - document.write(" to your HTML - Add class="sortable" to any table you'd like to make sortable - Click on the headers to sort - - Thanks to many, many people for contributions and suggestions. - Licenced as X11: http://www.kryogenix.org/code/browser/licence.html - This basically means: do what you want with it. -*/ - - -var stIsIE = /*@cc_on!@*/false; - -sorttable = { - init: function() { - // quit if this function has already been called - if (arguments.callee.done) return; - // flag this function so we don't do the same thing twice - arguments.callee.done = true; - // kill the timer - if (_timer) clearInterval(_timer); - - if (!document.createElement || !document.getElementsByTagName) return; - - sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; - - forEach(document.getElementsByTagName('table'), function(table) { - if (table.className.search(/\bsortable\b/) != -1) { - sorttable.makeSortable(table); - } - }); - - }, - - makeSortable: function(table) { - if (table.getElementsByTagName('thead').length == 0) { - // table doesn't have a tHead. Since it should have, create one and - // put the first table row in it. - the = document.createElement('thead'); - the.appendChild(table.rows[0]); - table.insertBefore(the,table.firstChild); - } - // Safari doesn't support table.tHead, sigh - if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; - - if (table.tHead.rows.length != 1) return; // can't cope with two header rows - - // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as - // "total" rows, for example). This is B&R, since what you're supposed - // to do is put them in a tfoot. So, if there are sortbottom rows, - // for backwards compatibility, move them to tfoot (creating it if needed). - sortbottomrows = []; - for (var i=0; i5' : ' ▴'; - this.appendChild(sortrevind); - return; - } - if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { - // if we're already sorted by this column in reverse, just - // re-reverse the table, which is quicker - sorttable.reverse(this.sorttable_tbody); - this.className = this.className.replace('sorttable_sorted_reverse', - 'sorttable_sorted'); - this.removeChild(document.getElementById('sorttable_sortrevind')); - sortfwdind = document.createElement('span'); - sortfwdind.id = "sorttable_sortfwdind"; - sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; - this.appendChild(sortfwdind); - return; - } - - // remove sorttable_sorted classes - theadrow = this.parentNode; - forEach(theadrow.childNodes, function(cell) { - if (cell.nodeType == 1) { // an element - cell.className = cell.className.replace('sorttable_sorted_reverse',''); - cell.className = cell.className.replace('sorttable_sorted',''); - } - }); - sortfwdind = document.getElementById('sorttable_sortfwdind'); - if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } - sortrevind = document.getElementById('sorttable_sortrevind'); - if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } - - this.className += ' sorttable_sorted'; - sortfwdind = document.createElement('span'); - sortfwdind.id = "sorttable_sortfwdind"; - sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; - this.appendChild(sortfwdind); - - // build an array to sort. This is a Schwartzian transform thing, - // i.e., we "decorate" each row with the actual sort key, - // sort based on the sort keys, and then put the rows back in order - // which is a lot faster because you only do getInnerText once per row - row_array = []; - col = this.sorttable_columnindex; - rows = this.sorttable_tbody.rows; - for (var j=0; j 12) { - // definitely dd/mm - return sorttable.sort_ddmm; - } else if (second > 12) { - return sorttable.sort_mmdd; - } else { - // looks like a date, but we can't tell which, so assume - // that it's dd/mm (English imperialism!) and keep looking - sortfn = sorttable.sort_ddmm; - } - } - } - } - return sortfn; - }, - - getInnerText: function(node) { - // gets the text we want to use for sorting for a cell. - // strips leading and trailing whitespace. - // this is *not* a generic getInnerText function; it's special to sorttable. - // for example, you can override the cell text with a customkey attribute. - // it also gets .value for fields. - - hasInputs = (typeof node.getElementsByTagName == 'function') && - node.getElementsByTagName('input').length; - - if (node.getAttribute("sorttable_customkey") != null) { - return node.getAttribute("sorttable_customkey"); - } - else if (typeof node.textContent != 'undefined' && !hasInputs) { - return node.textContent.replace(/^\s+|\s+$/g, ''); - } - else if (typeof node.innerText != 'undefined' && !hasInputs) { - return node.innerText.replace(/^\s+|\s+$/g, ''); - } - else if (typeof node.text != 'undefined' && !hasInputs) { - return node.text.replace(/^\s+|\s+$/g, ''); - } - else { - switch (node.nodeType) { - case 3: - if (node.nodeName.toLowerCase() == 'input') { - return node.value.replace(/^\s+|\s+$/g, ''); - } - case 4: - return node.nodeValue.replace(/^\s+|\s+$/g, ''); - break; - case 1: - case 11: - var innerText = ''; - for (var i = 0; i < node.childNodes.length; i++) { - innerText += sorttable.getInnerText(node.childNodes[i]); - } - return innerText.replace(/^\s+|\s+$/g, ''); - break; - default: - return ''; - } - } - }, - - reverse: function(tbody) { - // reverse the rows in a tbody - newrows = []; - for (var i=0; i=0; i--) { - tbody.appendChild(newrows[i]); - } - delete newrows; - }, - - /* sort functions - each sort function takes two parameters, a and b - you are comparing a[0] and b[0] */ - sort_numeric: function(a,b) { - aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); - if (isNaN(aa)) aa = 0; - bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); - if (isNaN(bb)) bb = 0; - return aa-bb; - }, - sort_alpha: function(a,b) { - if (a[0]==b[0]) return 0; - if (a[0] 0 ) { - var q = list[i]; list[i] = list[i+1]; list[i+1] = q; - swap = true; - } - } // for - t--; - - if (!swap) break; - - for(var i = t; i > b; --i) { - if ( comp_func(list[i], list[i-1]) < 0 ) { - var q = list[i]; list[i] = list[i-1]; list[i-1] = q; - swap = true; - } - } // for - b++; - - } // while(swap) - } -} - -/* ****************************************************************** - Supporting functions: bundled here to avoid depending on a library - ****************************************************************** */ - -// Dean Edwards/Matthias Miller/John Resig - -/* for Mozilla/Opera9 */ -if (document.addEventListener) { - document.addEventListener("DOMContentLoaded", sorttable.init, false); -} - -/* for Internet Explorer */ -/*@cc_on @*/ -/*@if (@_win32) - document.write(" diff --git a/posterita/posterita/web/js/creditScreen.js b/posterita/posterita/web/js/creditScreen.js deleted file mode 100644 index 9d28c8b5cd..0000000000 --- a/posterita/posterita/web/js/creditScreen.js +++ /dev/null @@ -1,537 +0,0 @@ -//scripts for Posterita Ordering Screen -var product_id = null; -var qty = null; -var discountLimit = null; -var paymentPanels = null; -var activePanel = null; -var cartLines = null; -var cartIndex = null; -var orderType = null; -var tenderType = null; -var priceList = null; -var oldPriceList = -1; -var searchElement = null; -var isCustomerCompulsory = false; -var defaultPriceList = null; -var defaultPriceListName = null; - -var ORDER_TYPES = { - POS_ORDER : 'POS Order', - POS_GOOD_RECEIVE_NOTE : 'POS Goods Received Note', - CREDIT_ORDER : 'Credit Order' - }; - -var initScreen = function(){ - //set order type - orderType = $('orderType').value; - //set tender type - tenderType = $('tenderType').value; - //set priceList - priceList = $('priceListId').value; - - //set default data for price list - defaultPriceList = priceList; - defaultPriceListName = $('terminal').innerHTML; - - //set search element - var searchProductBy = $('searchProductBy').value; - if(searchProductBy == 'name') - { - searchElement = $('productQuery'); - } - else - { - searchElement = $(searchProductBy); - } - - //set is customer compulsory - if($('isCustomerCompulsory').value == 'true') - { - isCustomerCompulsory = true; - } - - initProductSearch(); - initSearchCustomer(); - initCartBtn(); - initAjaxResponder(); - initShortcuts(); - //initPaymentBtns(); - - //set payment rule - //simulateOnClick($(tenderType + 'Btn')); - - $('total').innerHTML = $('cartTotal').innerHTML; - - - searchElement.focus(); - - var barcode = $('barcode'); - barcode.onkeyup = function(e){ - if(e.keyCode == Event.KEY_RETURN) - { - if(this.value != null && this.value != "") - { - if(!validateBp()) - { - return; - } - - addToCart(this.value); - this.value = ""; - } - - } - }; - - $('qty').onkeyup = function(e){ - if(e.keyCode == Event.KEY_RETURN) - { - //update qty - updateQty(product_id, this.value); - } - }; - - $('checkoutBtn').onclick = function(e){ - if(cartLines == null || cartLines.length == 0) - { - showErrorMessage('Shopping cart is empty!'); - } - else - { - checkout();//shoppingcart.js - } - }; - - - /* - $('openDrawerBtn').onclick = function(e){ - openCashDrawer(); - }; - */ - - $('clearCartBtn').onclick = function(e){ - clearCart(); - }; - - $('discountBtn').showDiscount = $('discountBtn').onclick - $('discountBtn').onclick = function(){ - - if(cartLines == null || cartLines.length == 0) - { - showErrorMessage('Shopping cart is empty!'); - } - else - { - this.showDiscount(); - } - - }; - - - //add behaviour to exixting cart - addBehaviourToCart(); - try - { - showErrors(); - } - catch(e){}; -}; - -var initShortcuts = function(){ - shortcut.add("Ctrl+Space", function(e){simulateOnClick($('checkoutBtn'))}); - - shortcut.add("F1", function(e){$('barcode').select();}); - shortcut.add("F2", function(e){$('productQuery').select();}); - shortcut.add("F3", function(e){$('description').select();}); - shortcut.add("F4", function(e){$('qty').select();}); - - shortcut.add("F5", function(e){$('customerQuery').select();}); - shortcut.add("F6", function(e){simulateOnClick($('discountBtn'))}); - - // Barcode Btn - shortcut.add("Ctrl+B", function(e){simulateOnClick($('barcodeBtn'))}); - - //payment btns - //shortcut.add("F9", function(e){simulateOnClick($('cashBtn'))}); - //shortcut.add("F10", function(e){simulateOnClick($('cardBtn'))}); - //shortcut.add("F11", function(e){simulateOnClick($('chequeBtn'))}); - //shortcut.add("F12", function(e){simulateOnClick($('mixBtn'))}); - - shortcut.add("Ctrl+M", function(){simulateOnClick($('menuBtn'))}); - - shortcut.add("Ctrl+Delete", function(){ - simulateOnClick($('clearCartBtn')); - }); - shortcut.add("Ctrl+S", function(){simulateOnClick($('shortcutBtn'))}); - - //move between cart lines - shortcut.add("Ctrl+Up", function(){ - if(cartIndex > 0) - { - cartIndex = cartIndex -1; - var line = cartLines[cartIndex]; - simulateOnClick(line); - } - }); - - shortcut.add("Ctrl+Down", function(){ - if(cartIndex < cartLines.length - 1) - { - cartIndex = cartIndex + 1; - var line = cartLines[cartIndex]; - simulateOnClick(line); - } - }); - - //incrementing and decrementing qty - shortcut.add("Ctrl+Right", function(){ - simulateOnClick($('plusBtn')); - }); - - shortcut.add("Ctrl+Left", function(){ - simulateOnClick($('minusBtn')); - }); - - shortcut.add("Ctrl+Backspace", function(){ - simulateOnClick($('deleteBtn')); - }); - -}; - -var showResult = function(element, update){ - if(!update.style.position || update.style.position=='absolute') { - update.style.position = 'absolute'; - Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); - Position.clone($('maintop'), update, {setHeight: false, setTop: false, offsetTop: element.offsetHeight}); - } - - update.style.display = 'block'; - update.style.opacity = '1.0'; - - }; - - -var initProductSearch = function(){ - - // autocomplete for search by product name - var productAutocompleter = new Ajax.Autocompleter('productQuery','productSearchResult','SearchProductsAction.do',{ - paramName:'productName', - parameters : 'priceListId=' + priceList, - minChars:1, - frequency:1.0, - afterUpdateElement: afterAutocomplete, - onShow : showResult - }); - - productAutocompleter.xyz = true; - $('productQuery').Autocompleter = productAutocompleter; - - - // autocomplete for search by product description - var productAutocompleter2 = new Ajax.Autocompleter('description','productSearchByDescriptionResult','SearchProductsAction.do',{ - paramName:'description', - parameters : 'priceListId=' + priceList, - minChars:1, - frequency:1.0, - afterUpdateElement: afterAutocomplete, - onShow : showResult - }); - - $('description').Autocompleter = productAutocompleter2; -}; - - -var afterAutocomplete = function(e1,e2){ - - if(!validateBp()) - { - return; - } - - var barcode = e2.getAttribute('barcode'); - if(barcode=='null') - { - barcode = ""; - } - var productId = e2.getAttribute('productId'); - //$('barcode').value = barcode; - $('productId').value= productId; - - var description = e2.getAttribute('description'); - //$('description').value = description; - - incrementCart(productId); - - //reset focus to search input - searchElement.focus(); - - //show product details - getProductInfo(productId); - - //set global product - product_id = productId; - - $('description').value = ""; - $('productQuery').value = ""; - -}; - -function getProductInfo(productId) -{ - var url = 'POSProductAction2.do'; - var pars = 'action=getProductDetails&productId='+productId+'&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: showProductInfo, - onFailure: reportError - }); -} - -function showProductInfo(request) -{ - // - try - { - var response = request.responseText; - var product = eval('(' + response + ')'); - - //display product info in right column - $('product.name').innerHTML = product.name; - $('product.barcode').innerHTML = product.barcode; - $('product.taxCategory').innerHTML = product.taxCategory; - $('product.description').innerHTML = product.description; - $('product.stock.qty').innerHTML = product.stockQty; - $('product.price.std').innerHTML = new Number(product.priceStd).toFixed(2); - $('product.price.limit').innerHTML = new Number(product.priceLimit).toFixed(2); - $('product.price.list').innerHTML = new Number(product.priceList).toFixed(2); - - $('product.image').src = 'images/pos/blankimage.png'; - } - catch(e) - { - showErrorMessage(e); - } -} - -function reportError(request) -{ - alert("Ooops some error has occured while communicating with the server"); -} - -function convertString2Unicode(s) -{ - var uniString = "", hexVal, uniChar; - - for(var i = 0; i < s.length; ++i) - { - //Convert char to hex - //hexVal = Number(s.charCodeAt(i)).toString(16); - hexVal = Number(s.charCodeAt(i)).toString(10); - - //Convert to unicode by making sure hex is 4 chars long, padding with 0's if less - //uniChar = "\\u" + ("000" + hexVal).match(/.{4}$/)[0]; - uniChar = "&#" + ("000" + hexVal).match(/.{4}$/)[0] +";"; - - uniString += uniChar; - } - if(hexVal < 255) - return s; - - return uniString; -} - -// returns true if bp is valid -var validateBp = function(){ - if(orderType == ORDER_TYPES.POS_GOOD_RECEIVE_NOTE) - { - var bpartner = $('bpartnerId').value; - if(bpartner == null || bpartner == "") - { - showErrorMessage("Please choose a vendor",'customerQuery'); - return false; - } - } - - if(orderType == ORDER_TYPES.CREDIT_ORDER) - { - var bpartner = $('bpartnerId').value; - if(bpartner == null || bpartner == "") - { - showErrorMessage("Please choose a customer",'customerQuery'); - return false; - } - } - - if(isCustomerCompulsory) - { - var bpartner = $('bpartnerId').value; - if(bpartner == null || bpartner == "") - { - showErrorMessage("Please choose a customer"); - $('bpartnerId').focus(); - - return false; - } - } - - return true; -}; - -var initSearchCustomer = function(){ - - //validateBp(); // validates bp on load - - // auto complete for customer - $('customerQuery').Autocompleter = new Ajax.Autocompleter('customerQuery','customerSearchResult','SearchCustomerAction.do',{ - paramName:'customerQuery', - frequency:TROTTLE_TIME, - parameters : 'orderType=' + orderType, - onShow:function(element, update){ - if(!update.style.position || update.style.position=='absolute') { - update.style.position = 'absolute'; - Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); - } - update.style.display = 'block'; - }, - afterUpdateElement:function(e1,e2){ - var bpartner = $('bpartnerId'); - var bpartnerName = $('customer.name'); - - - if(e2.value != '-1') - { - toConsole('1'); - if(e2.value) - { - toConsole('1.1.1'); - bpartner.value = e2.value; - } - else - { - toConsole('1.1.2'); - bpartner.value = ''; - } - - $('customer.code').innerHTML = bpartner.value; - var creditLimit = e2.getAttribute('creditLimit'); - var name = e2.getAttribute('name'); - setBPartner(bpartner.value, name, creditLimit); - if(bpartnerName) - { - toConsole('1.2'); - $('customer.name').innerHTML = name; - $('credit.available').innerHTML = creditLimit; - - x = e2.getAttribute('priceList'); - if (parseInt(x) > 0) - { - $('terminal').innerHTML = e2.getAttribute('pricelistName'); - $('priceListId').value = x; - priceList = x; - } - else - { - priceList = defaultPriceList; - $('terminal').innerHTML = defaultPriceListName; - } - - //reload shopping cart for partner - if(oldPriceList != priceList) - { - setShoppingCartPriceList(); - oldPriceList = priceList; - } - - $('productQuery').Autocompleter.options.defaultParams='priceListId=' + priceList; - }//if - } - else - { - toConsole('2'); - - bpartner.value = ""; - if(bpartnerName) - { - toConsole('2.1'); - bpartnerName.value = ""; - }//if - }//if - - - $('customerQuery').value = ""; - - searchElement.focus(); - - } - - }); - -} - -function setBPartner(bPartnerValue, name, creditLimit) -{ - try - { - var url = 'CheckoutAction.do'; - var pars = 'action=setBPartner&bPartnerId='+bPartnerValue +'&name='+name+'&creditLimit='+creditLimit; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - }); - - } - catch(e) - { - toConsole(e); - } - return; -} - -var initCartBtn = function(){ - var plus = $('plusBtn'); - var minus = $('minusBtn'); - var del = $('deleteBtn'); - - plus.style.cursor = 'pointer'; - minus.style.cursor = 'pointer'; - del.style.cursor = 'pointer'; - - plus.onclick = function(e){ - if(product_id != null) - incrementCart(product_id); - searchElement.focus(); - }; - - minus.onclick = function(e){ - if(product_id != null) - decrementCart(product_id); - searchElement.focus(); - }; - - del.onclick = function(e){ - if(product_id != null) - deleteItemFromCart(product_id); - searchElement.focus(); - }; -}; - - - -var initAjaxResponder = function(){ - - Ajax.Responders.register({ - onCreate: function() { - $('indicator').style.display = 'block'; - }, - onComplete: function() { - $('indicator').style.display = 'none'; - } - }); -}; - -Event.observe(window,'load',initScreen,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/customer.js b/posterita/posterita/web/js/customer.js deleted file mode 100644 index 3e81a9cfb7..0000000000 --- a/posterita/posterita/web/js/customer.js +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author praveen - */ - - -//----------------------------------FUNCTION DECLARATIONS--------------------------------------------- -//create new customer -function createCustomer() -{ - window.location = "InitCreatePOSCustomer.do?action=initCreatePOSCustomer&creatingFromOrder=true"; -} - -//sets the current customer to default -function defaultCustomer() -{ - try - { - var bpartner = document.getElementsByName('bpartnerId')[0]; - var bpartnerName = document.getElementsByName('partnerName')[0]; - - bpartner.value = ""; - bpartnerName.value = ""; - } - catch(e) - { - toConsole('Unable to set default customer'); - toConsole(e); - } - -} - -//gets the custom name. -function getCustomerName() -{ - var customerID = $FElement('bpartnerId').value; - var url = 'POSCustomerAction.do'; - var pars = 'action=getNameByID&bpartnerId=' + customerID; - - toConsole('Requesting: ' + url + '?' + pars); - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: evaluateResponse, - onFailure: reportError - }); - -} - -//set customer name -function setCustomerName(name) -{ - $FElement('partnerName').value = name; -} - -function evaluateResponse(request) -{ - var script = request.responseText; - eval(script); -} - -function reportError(request) -{ - alert('Some error occured while communicating with the server. Please try again.'); -} -//------------------------------REGISTERING SOME EVENTS OR INITIALISATION----------------------------- - -$FElement('bpartnerId').onkeyup = function(e) -{ - try - { - var event = e||window.event; - - if(event.keyCode == 13) - { - //request client name - getCustomerName(); - this.blur(); - } - } - catch (e) - { - toConsole(e); - } -}; - -$('customerQuery').Autocompleter = new Ajax.Autocompleter('customerQuery','customerSearchResult','SearchCustomerAction.do',{ -paramName:'customerQuery', -frequency:TROTTLE_TIME, -afterUpdateElement:function(e1,e2){ - var bpartner = $FElement('bpartnerId'); - var bpartnerName = $FElement('partnerName'); - - - if(e2.value != '-1') - { - toConsole('1'); - if(e2.value) - { - toConsole('1.1.1'); - bpartner.value = e2.value; - } - else - { - toConsole('1.1.2'); - bpartner.value = ''; - } - - if(bpartnerName) - { - toConsole('1.2'); - bpartnerName.value = e2.getAttribute('name'); - }//if - } - else - { - toConsole('2'); - - bpartner.value = ""; - if(bpartnerName) - { - toConsole('2.1'); - bpartnerName.value = ""; - }//if - }//if - - toConsole('Setting customer-->' + bpartnerName.value); - - $('customerQuery').value = ""; - - //focusBarcode(); - - - } - -}); - -var bpartner = $FElement('bpartnerId'); -bpartner.initialValue = bpartner.value; \ No newline at end of file diff --git a/posterita/posterita/web/js/customer2.js b/posterita/posterita/web/js/customer2.js deleted file mode 100644 index 6216276a8b..0000000000 --- a/posterita/posterita/web/js/customer2.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author praveen - */ - - -//----------------------------------FUNCTION DECLARATIONS--------------------------------------------- -//create new customer -function createCustomer() -{ - window.location = "InitCreatePOSCustomer.do?action=initCreatePOSCustomer&creatingFromOrder=true"; -} - -//sets the current customer to default -function defaultCustomer() -{ - try - { - var bpartner = document.getElementsByName('bpartnerId')[0]; - var bpartnerName = document.getElementsByName('partnerName')[0]; - - bpartner.value = ""; - bpartnerName.value = ""; - } - catch(e) - { - toConsole('Unable to set default customer'); - toConsole(e); - } - -} - -//gets the custom name. -function getCustomerName() -{ - var customerID = $FElement('bpartnerId').value; - var url = 'POSCustomerAction.do'; - var pars = 'action=getNameByID&bpartnerId=' + customerID; - - toConsole('Requesting: ' + url + '?' + pars); - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: evaluateResponse, - onFailure: reportError - }); - -} - -//set customer name -function setCustomerName(name) -{ - $FElement('partnerName').value = name; - document.forms[0].submit(); -} - -function evaluateResponse(request) -{ - var script = request.responseText; - eval(script); -} - -function reportError(request) -{ - alert('Some error occured while communicating with the server. Please try again.'); -} -//------------------------------REGISTERING SOME EVENTS OR INITIALISATION----------------------------- - -$FElement('bpartnerId').onkeyup = function(e) -{ - try - { - var event = e||window.event; - - if(event.keyCode == 13) - { - //request client name - getCustomerName(); - } - } - catch (e) - { - toConsole(e); - } -}; - -$('customerQuery').Autocompleter = new Ajax.Autocompleter('customerQuery','customerSearchResult','SearchCustomerAction.do',{ -paramName:'customerQuery', -frequency:TROTTLE_TIME, -afterUpdateElement:function(e1,e2){ - var bpartner = $FElement('bpartnerId'); - var bpartnerName = $FElement('partnerName'); - - - if(e2.value != '-1') - { - toConsole('1'); - if(e2.value) - { - toConsole('1.1.1'); - bpartner.value = e2.value; - } - else - { - toConsole('1.1.2'); - bpartner.value = ''; - } - - if(bpartnerName) - { - toConsole('1.2'); - bpartnerName.value = e2.getAttribute('name'); - }//if - } - else - { - toConsole('2'); - - bpartner.value = ""; - if(bpartnerName) - { - toConsole('2.1'); - bpartnerName.value = ""; - }//if - }//if - - toConsole('Setting customer-->' + bpartnerName.value); - document.forms[0].submit(); - - $('customerQuery').value = ""; - - //focusBarcode(); - - - } - -}); - -var bpartner = $FElement('bpartnerId'); -bpartner.initialValue = bpartner.value; \ No newline at end of file diff --git a/posterita/posterita/web/js/dom-drag.js b/posterita/posterita/web/js/dom-drag.js deleted file mode 100644 index 0cd39c3e76..0000000000 --- a/posterita/posterita/web/js/dom-drag.js +++ /dev/null @@ -1,121 +0,0 @@ -/************************************************** - * dom-drag.js - * 09.25.2001 - * www.youngpup.net - ************************************************** - * 10.28.2001 - fixed minor bug where events - * sometimes fired off the handle, not the root. - **************************************************/ - -var Drag = { - - obj : null, - - init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper) - { - o.onmousedown = Drag.start; - - o.hmode = bSwapHorzRef ? false : true ; - o.vmode = bSwapVertRef ? false : true ; - - o.root = oRoot && oRoot != null ? oRoot : o ; - - if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px"; - if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px"; - if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px"; - if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px"; - - o.minX = typeof minX != 'undefined' ? minX : null; - o.minY = typeof minY != 'undefined' ? minY : null; - o.maxX = typeof maxX != 'undefined' ? maxX : null; - o.maxY = typeof maxY != 'undefined' ? maxY : null; - - o.xMapper = fXMapper ? fXMapper : null; - o.yMapper = fYMapper ? fYMapper : null; - - o.root.onDragStart = new Function(); - o.root.onDragEnd = new Function(); - o.root.onDrag = new Function(); - }, - - start : function(e) - { - var o = Drag.obj = this; - e = Drag.fixE(e); - var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); - var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); - o.root.onDragStart(x, y); - - o.lastMouseX = e.clientX; - o.lastMouseY = e.clientY; - - if (o.hmode) { - if (o.minX != null) o.minMouseX = e.clientX - x + o.minX; - if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX; - } else { - if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x; - if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x; - } - - if (o.vmode) { - if (o.minY != null) o.minMouseY = e.clientY - y + o.minY; - if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY; - } else { - if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y; - if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y; - } - - document.onmousemove = Drag.drag; - document.onmouseup = Drag.end; - - return false; - }, - - drag : function(e) - { - e = Drag.fixE(e); - var o = Drag.obj; - - var ey = e.clientY; - var ex = e.clientX; - var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); - var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); - var nx, ny; - - if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX); - if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX); - if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY); - if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY); - - nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1)); - ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1)); - - if (o.xMapper) nx = o.xMapper(y) - else if (o.yMapper) ny = o.yMapper(x) - - Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px"; - Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px"; - Drag.obj.lastMouseX = ex; - Drag.obj.lastMouseY = ey; - - Drag.obj.root.onDrag(nx, ny); - return false; - }, - - end : function() - { - document.onmousemove = null; - document.onmouseup = null; - Drag.obj.root.onDragEnd( parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), - parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"])); - Drag.obj = null; - }, - - fixE : function(e) - { - if (typeof e == 'undefined') e = window.event; - if (typeof e.layerX == 'undefined') e.layerX = e.offsetX; - if (typeof e.layerY == 'undefined') e.layerY = e.offsetY; - return e; - } -}; \ No newline at end of file diff --git a/posterita/posterita/web/js/draftedPOSOrder.js b/posterita/posterita/web/js/draftedPOSOrder.js deleted file mode 100644 index d9ceb801ef..0000000000 --- a/posterita/posterita/web/js/draftedPOSOrder.js +++ /dev/null @@ -1,174 +0,0 @@ - diff --git a/posterita/posterita/web/js/enableButton.js b/posterita/posterita/web/js/enableButton.js deleted file mode 100644 index 42ab5ee023..0000000000 --- a/posterita/posterita/web/js/enableButton.js +++ /dev/null @@ -1,405 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author tamak - */ - - -window.status=""; -function refreshList(varDoc) -{ - window.location="NatisReleaseAction.do?action=prepareRelease&tradeInDetailMake=" + varDoc.tradeInDetailMake.value + "&assetID=" + varDoc.assetID.value + "&financeOptionId=" + varDoc.financeOptionId.value + "&licensingOptionId=" + varDoc.licensingOptionId.value + "&userSalesRepId=" + varDoc.userSalesRepId.value; -} - -function cancelRelease() -{ - window.location="NatisReleaseAction.do?action=home"; -} - -function updateAttributeList(form,id) -{ - form.updateAttrValueId.value = id; - form.action.value = "updateProductAttributeValue"; - form.submit(); -} - -function setActionMethod(form,action) -{ - toConsole("setting action dynamically"); - toConsole("Form :" + form); - toConsole("action :" + action); - - try - { - document.getElementsByName('action')[0].value = action; - form.submit(); - } - catch(e) - { - toConsole("Unable to set Action " + e); - } - -} - - -/*function setAction(form,action,method) -{ - form.action = action; - form.action.value = method; - //form.bpartnerId.value=100; - //alert("Calling action: " + action + "/n Method="+method); - form.submit(); - -} -*/ -function setAction(form,action,method) -{ - var elements = form.elements; - - var getStr = action + "?action=" + method; - - for(i=0;i 0) - { - cartIndex = cartIndex -1; - var line = cartLines[cartIndex]; - scrollCart(); - simulateOnClick(line); - } - }); - - shortcut.add("Ctrl+Down", function(){ - if(cartIndex < cartLines.length - 1) - { - cartIndex = cartIndex + 1; - var line = cartLines[cartIndex]; - scrollCart(); - simulateOnClick(line); - } - }); - - //incrementing and decrementing qty - shortcut.add("Ctrl+Right", function(){ - simulateOnClick($('plusBtn')); - }); - - shortcut.add("Ctrl+Left", function(){ - simulateOnClick($('minusBtn')); - }); - - shortcut.add("Ctrl+Backspace", function(){ - simulateOnClick($('deleteBtn')); - }); - -}; - -var showResult = function(element, update){ - if(!update.style.position || update.style.position=='absolute') { - update.style.position = 'absolute'; - Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); - Position.clone($('maintop'), update, {setHeight: false, setTop: false, offsetTop: element.offsetHeight}); - } - - update.style.display = 'block'; - update.style.opacity = '1.0'; - - }; - - -var initProductSearch = function(){ - - // autocomplete for search by product name - var productAutocompleter = new Ajax.Autocompleter('productQuery','productSearchResult','SearchProductsAction.do',{ - paramName:'productName', - parameters : 'priceListId=' + priceList, - minChars:1, - frequency:1.0, - afterUpdateElement: afterAutocomplete, - onShow : showResult - }); - - productAutocompleter.xyz = true; - $('productQuery').Autocompleter = productAutocompleter; - - - // autocomplete for search by product description - var productAutocompleter2 = new Ajax.Autocompleter('description','productSearchByDescriptionResult','SearchProductsAction.do',{ - paramName:'description', - parameters : 'priceListId=' + priceList, - minChars:1, - frequency:1.0, - afterUpdateElement: afterAutocomplete, - onShow : showResult - }); - - $('description').Autocompleter = productAutocompleter2; -}; - -var afterAutocomplete = function(e1,e2){ - - var barcode = e2.getAttribute('barcode'); - if(barcode=='null') - { - barcode = ""; - } - var productId = e2.getAttribute('productId'); - - if(productId == null) - { - $('description').value = ""; - $('productQuery').value = ""; - - return; - } - - //$('barcode').value = barcode; - $('productId').value= productId; - - var description = e2.getAttribute('description'); - //$('description').value = description; - - incrementCart(productId); - - //reset focus to search input - searchElement.focus(); - - //show product details - getProductInfo(productId); - - //set global product - product_id = productId; - - $('description').value = ""; - $('productQuery').value = ""; - -}; - -function autoSave() -{ - if(cartLines == null || cartLines.length == 0) - { - //Do nothing - return; - } - else - { - Modalbox.show('
    Please Wait...

    ', {title: 'Saving Inventory', width: 800}); - Modalbox.deactivate(); - - var url = 'InventoryCartAction.do'; - var pars = 'action=autoSaveInventoryLines&inventoryId='+inventoryId+'&priceListId='+priceList+'&description='+description; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: showInventoryInfo, - onFailure: reportError - }); - } -} - - - -function showInventoryInfo(request) -{ - // - try - { - if (window.Modalbox) - Modalbox.hide(); - - var response = request.responseText; - var invInfo = eval('(' + response + ')'); - - //display info in right column - $('inventory.docno').innerHTML = invInfo.docNo; - $('inventory.description').innerHTML = invInfo.description; - $('inventory.status').innerHTML = invInfo.docStatus; - $('inventoryId').value = inventoryId = invInfo.inventoryID; - - } - catch(e) - { - showErrorMessage(e); - } -} - - -function getProductInfo(productId) -{ - var url = 'POSProductAction2.do'; - var pars = 'action=getProductDetails&productId='+productId+'&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: showProductInfo, - onFailure: reportError - }); -} - -function showProductInfo(request) -{ - // - try - { - var response = request.responseText; - var product = eval('(' + response + ')'); - - //display product info in right column - $('product.name').innerHTML = product.name; - $('product.barcode').innerHTML = product.barcode; - $('product.taxCategory').innerHTML = product.taxCategory; - $('product.description').innerHTML = product.description; - $('product.stock.qtyBook').innerHTML = product.stockQty; - $('product.price.list').innerHTML = new Number(product.priceList).toFixed(2); - - $('product.total.lines').innerHTML = cartLines.length; - $('product.total.count').innerHTML = $('cartTotalCount').innerHTML; - $('product.total.book').innerHTML = $('cartTotalBook').innerHTML; - $('product.total.csv').innerHTML = $('cartTotalCsv').innerHTML; - $('product.discrepancy').innerHTML = $('cartTotalCount').innerHTML - $('cartTotalBook').innerHTML; - - $('product.image').src = 'images/pos/blankimage.png'; - } - catch(e) - { - showErrorMessage(e); - } -} - -function reportError(request) -{ - alert("Ooops some error has occured while communicating with the server"); -} - -function convertString2Unicode(s) -{ - var uniString = "", hexVal, uniChar; - - for(var i = 0; i < s.length; ++i) - { - //Convert char to hex - //hexVal = Number(s.charCodeAt(i)).toString(16); - hexVal = Number(s.charCodeAt(i)).toString(10); - - //Convert to unicode by making sure hex is 4 chars long, padding with 0's if less - //uniChar = "\\u" + ("000" + hexVal).match(/.{4}$/)[0]; - uniChar = "&#" + ("000" + hexVal).match(/.{4}$/)[0] +";"; - - uniString += uniChar; - } - if(hexVal < 255) - return s; - - return uniString; -} - -var initSearchCustomer = function(){ - - //validateBp(); // validates bp on load - - // auto complete for customer - $('customerQuery').Autocompleter = new Ajax.Autocompleter('customerQuery','customerSearchResult','SearchCustomerAction.do',{ - paramName:'customerQuery', - frequency:TROTTLE_TIME, - parameters : 'orderType=' + orderType, // if credit order, do not validate for standard customer - onShow:function(element, update){ - if(!update.style.position || update.style.position=='absolute') { - update.style.position = 'absolute'; - Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); - } - update.style.display = 'block'; - }, - afterUpdateElement:function(e1,e2){ - var bpartner = $('bpartnerId'); - var bpartnerName = $('customer.name'); - - - if(e2.value != '-1') - { - if(e2.value) - { - bpartner.value = e2.value; - } - else - { - bpartner.value = ''; - } - - $('customer.code').innerHTML = bpartner.value; - var creditLimit = e2.getAttribute('creditLimit'); - var name = e2.getAttribute('name'); - - if(bpartnerName) - { - $('customer.name').innerHTML = name; - $('credit.available').innerHTML = creditLimit==null?0:creditLimit; - - if (e2.getAttribute('priceList') && parseInt(e2.getAttribute('priceList')) > 0) - { - priceList = e2.getAttribute('priceList'); - $('priceListId').value = priceList; - $('terminal').innerHTML = e2.getAttribute('pricelistName'); - } - else - { - priceList = defaultPriceList; - $('terminal').innerHTML = defaultPriceListName; - } - if(cartLines != null && cartLines.length != 0) - { - //reload shopping cart for partner - if(oldPriceList != priceList) - { - setShoppingCartPriceList(); - oldPriceList = priceList; - } - } - $('productQuery').Autocompleter.options.defaultParams='priceListId=' + priceList; - saveBPartnerInfo(bpartner.value, name, creditLimit, priceList); - }//if - } - else - { - bpartner.value = ""; - if(bpartnerName) - { - bpartnerName.value = ""; - }//if - }//if - - - $('customerQuery').value = ""; - - searchElement.focus(); - } - - }); - -} - - -var initCartBtn = function(){ - var plus = $('plusBtn'); - var minus = $('minusBtn'); - var del = $('deleteBtn'); - - plus.style.cursor = 'pointer'; - minus.style.cursor = 'pointer'; - del.style.cursor = 'pointer'; - - plus.onclick = function(e){ - if(product_id != null) - incrementCart(product_id); - searchElement.focus(); - }; - - minus.onclick = function(e){ - if(product_id != null) - decrementCart(product_id); - - if(cartLines == null || cartLines.length == 0) - { - resetInfo(); - } - - searchElement.focus(); - }; - - del.onclick = function(e){ - if(product_id != null) - deleteItemFromCart(product_id); - - if(cartLines == null || cartLines.length == 0) - { - resetInfo(); - } - - searchElement.focus(); - - }; -}; - - - -var initAjaxResponder = function(){ - - Ajax.Responders.register({ - onCreate: function() { - $('indicator').style.display = 'block'; - }, - onComplete: function() { - $('indicator').style.display = 'none'; - } - }); -}; - - - -//---------------------------------------------------------------------------- - - -function getCartTotal() -{ - var amtStr = $('total').innerHTML; - amtStr = amtStr.strip(); - amtStr = amtStr.replace(',', "") - - var amount = parseFloat(amtStr); - while(isNaN(amount)) - { - if(amtStr.length == 0) return 0.0; - - amtStr = amtStr.slice(1); - amount = parseFloat(amtStr); - } - - //amtStr = parseFloat(amtStr); - //var amount = new Number(amtStr); - - return amount; -} - -function displaySortPanel() -{ - $('csvBtn').style.display = 'none'; - $('saveCsvBtn').style.display = 'block'; - $('saveBtn').style.display = 'none'; - $('clearCartBtn').style.display = 'none'; - $('reloatCartBtn').style.display = 'none'; - $('completeBtn').style.display = 'none'; - $('newBtn').style.display = 'none'; - $('cartSearch').style.display = 'none'; - $('editProductContainer').style.display = 'none'; - $('sortPanel').style.display = 'block'; - $('searchBtn').innerHTML = 'SWITCH BACK'; - $('filter').value = ''; - $('filter').focus(); - $('searchBtn').onclick = function() { switchBack(); }; -} - -function switchBack() -{ - $('csvBtn').style.display = 'block'; - $('saveCsvBtn').style.display = 'none'; - $('saveBtn').style.display = 'block'; - $('clearCartBtn').style.display = 'block'; - $('completeBtn').style.display = 'block'; - $('cartSearch').style.display = 'none'; - $('sortPanel').style.display = 'none'; - $('editProductContainer').style.display = 'block'; - $('cartSearch').style.display = 'block'; - $('newBtn').style.display = 'block'; - $('reloatCartBtn').style.display = 'none'; - $('searchBtn').innerHTML = 'SEARCH'; - $('filter').value = ''; - $('barcode').value = ''; - $('barcode').focus(); - $('searchBtn').onclick = function() { displaySortPanel(); }; - reloadCart(); - -} - -function showCsvImport() -{ - $('importBtn').style.display = 'block'; - $('saveCsvBtn').style.display = 'block'; - $('menuBtn').style.display = 'none'; - $('clearCartBtn').style.display = 'none'; - $('printBtn').style.display = 'none'; - $('completeBtn').style.display = 'none'; - $('searchBtn').style.display = 'none'; - $('reloatCartBtn').style.display = 'block'; - $('newBtn').style.display = 'none'; - $('csvBtn').innerHTML = 'BACK'; - $('csvBtn').onclick = function() { goBack(); }; -} - -function diplayCsvOptions() -{ - $('importBtn').style.display = 'block'; - $('saveCsvBtn').style.display = 'block'; - $('menuBtn').style.display = 'none'; - $('clearCartBtn').style.display = 'none'; - $('printBtn').style.display = 'none'; - $('completeBtn').style.display = 'none'; - $('searchBtn').style.display = 'none'; - $('newBtn').style.display = 'none'; - $('reloatCartBtn').style.display = 'block'; - $('csvBtn').innerHTML = 'BACK'; - $('csvBtn').onclick = function() { goBack(); }; - - -} - -function goBack() -{ - $('importBtn').style.display = 'none'; - $('saveCsvBtn').style.display = 'none'; - $('menuBtn').style.display = 'block'; - $('clearCartBtn').style.display = 'block'; - $('printBtn').style.display = 'block'; - $('completeBtn').style.display = 'block'; - $('searchBtn').style.display = 'block'; - $('newBtn').style.display = 'block'; - $('reloatCartBtn').style.display = 'none'; - $('csvBtn').innerHTML = 'CSV'; - $('csvBtn').onclick = function() { diplayCsvOptions(); }; -} -function addPaging() -{ - // -} - -function trim(sString) -{ - while (sString.substring(0,1) == ' ') - { - sString = sString.substring(1, sString.length); - } - while (sString.substring(sString.length-1, sString.length) == ' ') - { - sString = sString.substring(0,sString.length-1); - } - return sString; -} - -function editDescription() -{ - description = $('inventory.description').innerHTML; - var userInput = prompt("Change inventory description", description) - - if(userInput == 'null' || userInput == '' || userInput == null) - { - userInput = description; - $('inventory.description').innerHTML = userInput; - } - else - { - description = userInput; - $('inventory.description').innerHTML = userInput; - } - - return false; - -} - -function addUploadField() -{ - - var tbl = $('upload'); - var lastRow = tbl.rows.length; - // if there's no header row in the table, then iteration = lastRow + 1 - var iteration = lastRow; - var row = tbl.insertRow(1); - row.className = 'upload'; - - // right cell - var cellRight = row.insertCell(0); - cellRight.className = "tdUpload" - var el = document.createElement('input'); - el.type = 'file'; - el.name = 'file' + iteration; - el.id = 'file' + iteration; - el.size = 40; - - cellRight.appendChild(el); - - var div = document.createElement('div') - div.id = 'attachment'+iteration; - - var i = iteration - 1; - - if($('attachment'+i).innerHTML != '') - { - $('attachment'+i).innerHTML = ''; - $('attachment'+i).className = ''; - - } - - - div.className = 'button floatLeft'; - div.innerHTML = 'Add another file' - div.onclick = function() - { - validateRow(); - } - cellRight.appendChild(div); - - var span=document.createElement('span'); - span.id = 'progressfile'+iteration; - - cellRight.appendChild(span); - - cellRight.focus(); - -} - -function validate(obj) -{ - var sfile = obj.value; - - if(sfile == "" || sfile == null || sfile == 'null') - return false; - - var fileType = sfile.substring(sfile.length -3, sfile.length); - if(fileType.toLowerCase() != 'csv') - { - alert('Only csv file is allowed!!!'); - obj.value=''; - obj.focus(); - return false; - } - else - { - obj.disabled = true; - uploadStockSheets(sfile); - } - -} - -function addFileInput() -{ - var d = document.createElement("div"); - var file = document.createElement("input"); - file.setAttribute("type", "file"); - file.setAttribute("name", "attachment"+upload_number); - d.appendChild(file); - document.getElementById("moreUploads").appendChild(d); - upload_number++; -} - - -function uploadStockSheets(form) -{ - $('importStock').request({ - contentType: 'multipart/form-data', - method: 'get', - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - return false; -} - -function generateCsv() -{ - var url = 'InventoryCartAction.do?action=generateInventoryCSV'; - window.location = url; -} - - -function addCSV(file) -{ - $('uploadHeader').style.display="block"; - $('uploadCsv').style.display="block"; - var tbl = $('csv'); - var lastRow = tbl.rows.length; - // if there's no header row in the table, then iteration = lastRow + 1 - var iteration = lastRow; - var row = tbl.insertRow(1); - row.className = 'upload'; - // right cell - var cellRight = row.insertCell(0); - cellRight.className = "tdUpload" - cellRight.innerHTML = "Adempiere.properties"; - -} - -function validateRow() -{ - var tbl = document.getElementById('upload'); - var lastRow = tbl.rows.length - 1; - - if(lastRow == 10) - { - alert('Maximum file to upload reached.'); - return false; - } - - var i; - for (i=1; i<=lastRow; i++) - { - var aRow = document.getElementById('file' + i); - if (aRow.value.length <= 0) - { - alert('Row ' + i + ' is empty'); - return false; - } - else - { - addUploadField(); - addTable(); - } - } -} - -function redirect(url) -{ - window.location = url; -} - -function resetInfo() -{ - $('product.name').innerHTML = ""; - $('product.barcode').innerHTML = ""; - $('product.taxCategory').innerHTML = ""; - $('product.description').innerHTML = ""; - $('product.stock.qtyBook').innerHTML = ""; - $('product.price.list').innerHTML = ""; - - $('product.total.lines').innerHTML = ""; - $('product.total.count').innerHTML = ""; - $('product.total.book').innerHTML = ""; - $('product.total.csv').innerHTML = ""; - $('product.discrepancy').innerHTML = ""; - -} - -function newCart() -{ - var answer = confirm("Click OK if you want to save the inventory cart and start a new one.\nClick CANCEL to only clear the cart.\nNote: Clearing the cart will erase all the data. ") - if (answer) - { - if(cartLines == null || cartLines.length == 0) - { - redirect('InventoryCartAction.do?action=newInventoryCart'); - } - else - { - Modalbox.show('
    Please Wait...

    ', {title: 'Saving Inventory', width: 800}); - Modalbox.deactivate(); - - var url = 'InventoryCartAction.do'; - var pars = 'action=autoSaveInventoryLines&inventoryId='+inventoryId+'&priceListId='+priceList+'&description='+description; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: function(){redirect('InventoryCartAction.do?action=newInventoryCart');}, - onFailure: reportError - }); - - } - - } - else - { - clearCart(); - } -} - -Event.observe(window,'load',initScreen,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/inventoryCart.js b/posterita/posterita/web/js/inventoryCart.js deleted file mode 100644 index 603146c345..0000000000 --- a/posterita/posterita/web/js/inventoryCart.js +++ /dev/null @@ -1,432 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author praveen - */ - - -//----------------------------------FUNCTION DECLARATIONS--------------------------------------------- -//scrolls to the bottom of the cart -function scrollDownCart() -{ - if($('shoppingCart')) - { - $('shoppingCart').scrollTop = $('shoppingCart').scrollHeight; - } -} - - -//adding product to cart -function addToCart(barcode) -{ - cartIndex = null; - if(barcode == null) return; - if(barcode == '') return; - - try - { - - var url = 'InventoryCartAction.do'; - var pars = 'action=addProduct&barCode='+barcode+'&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - - } - catch(e) - { - toConsole(e); - } -} - -//incrementing, decrementing and deleting the shopping cart items using ajax -// 1.Increment the qty for the product -function incrementCart(productId) -{ - if(productId == null) return; - - try - { - - var url = 'InventoryCartAction.do'; - var pars = 'action=incrementQty&productId='+productId+ '&ifAdd=true&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - - } - catch(e) - { - toConsole(e); - } -} - -//2.Decrement the qty for the product -function decrementCart(productId) -{ - if(productId == null) return; - - try - { - - - var url = 'InventoryCartAction.do'; - var pars = 'action=decrementQty&productId='+productId+ '&ifAdd=false&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } -} - -//3.Delete all the products with the ID from the cart -function deleteItemFromCart(productId) -{ - if(productId == null) return; - - cartIndex = null; - updateQty(productId, '0'); -} - -//Refreshs the content of the shopping cart -function refreshShoppingCart(request) -{ - try - { - var response = request.responseText; - $('shoppingCart').innerHTML = response; - $('total').innerHTML = $('cartTotalCount').innerHTML; - $('product.total.lines').innerHTML = cartLines.length; - $('product.total.count').innerHTML = $('cartTotalCount').innerHTML; - $('product.total.book').innerHTML = $('cartTotalBook').innerHTML; - $('product.total.csv').innerHTML = $('cartTotalCsv').innerHTML; - $('product.discrepancy').innerHTML = $('cartTotalCount').innerHTML - $('cartTotalBook').innerHTML; - scrollDownCart(); - response.evalScripts(); //display error messages - } - catch(e) - { - showErrorMessage('Failed to resfresh cart! Cause:' + e); - } - - addBehaviourToCart(); -} - -//Reports an error -function reportShoppingCartError(request) -{ - alert('Some error occured while communicating with the server. Please try again.'); - alert(request.responseText); - var win = window.open(); - win.document.write(request.responseText); - win.document.close(); -} - -//addRequiredLibrary('js/test.js'); -var requestIndicator; - -/* -var ShoppingCart = { - - init : function(){ - //this.indicator = new AJAXIndicator('Please wait...'); - alert('Shopping Cart'); - }, - - indicator : null -}; -*/ - -function completeInventory() -{ - $('inventoryForm').submit(); -} - -//Update the qty for the product -function updateQty(productId, quantity) -{ - if(productId == null) return; - - if (quantity == "") - { - return; - } - - var amount = parseFloat(quantity); - - if (isNaN(amount) || amount < 0) - { - showErrorMessage('Invalid quantity! ' + quantity, 'qty'); - $('qty').value = ""; - return; - } - - try - { - var url = 'InventoryCartAction.do'; - var pars = 'action=updateQty&productId=' + productId + '&ifAdd=false' + '&priceListId='+priceList +'&qtyCount=' + amount; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - return false; - } - catch(e) - { - toConsole(e); - } - - return false; - -} - -//Reload shopping cart -function reloadCart() -{ - try - { - var url = 'InventoryCartAction.do'; - var pars = 'action=reloadCart'; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } - -} - - -function clearCart() -{ - maxRows = 0; - excessRows = 0; - - try - { - var url = 'InventoryCartAction.do'; - var pars = 'action=clearCart'; - - $('inventory.docno').innerHTML = 'N/A'; - $('inventory.description').innerHTML = description; - $('inventory.status').innerHTML = 'N/A'; - $('inventoryId').value = inventoryId = 0; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onComplete: resetInfo, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } - -} - -function handleCheckout(request) -{ - var response = request.responseText; - var result = eval('(' + response + ')'); - - if(result.error) - { - showErrorMessage(result.error); - } - else - { - printOrder(result.orderID); - reloadCart(); - } -} - - -function addBehaviourToCart() -{ - var rows = new Array(); - var count = 1; - - while(true) - { - var row = $('row' + count); - if(row == null) break; - - rows.push(row); - count ++; - } - - for(var i=0; i 0) - { - var line = cartLines[cartIndex]; - simulateOnClick(line); - - } - - if(cartLines.length > maxRows) - { - var shoppingCart = $('shoppingCart'); - shoppingCart.scrollTop = shoppingCart.scrollHeight; - } - -} - -//Reload the shopping cart. Prices are calculated for the pricelist -function setShoppingCartPriceList() -{ - try - { - var url = 'AddToPOSShoppingCartAction.do'; - var pars = 'action=updatePriceList&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } -} - -function scrollCart() -{ - var shoppingCart = $('shoppingCart'); - - if(cartIndex > maxRows) - { - shoppingCart.scrollTop = shoppingCart.scrollHeight; - } - else - { - shoppingCart.scrollTop = 0; - } -} - - -//Event.observe(window,'load',init,false); -//--------------------------------------------------------------------------------------- -//calling methods \ No newline at end of file diff --git a/posterita/posterita/web/js/inventoryHistory.js b/posterita/posterita/web/js/inventoryHistory.js deleted file mode 100644 index db744899e5..0000000000 --- a/posterita/posterita/web/js/inventoryHistory.js +++ /dev/null @@ -1,152 +0,0 @@ -//scripts for Posterita Inventory History -var product_id = null; -var priceList = null; -var searchElement = null; -var defaultPriceList = null; - -var initHistory = function(){ - priceList = $('priceListId').value; - - defaultPriceList = priceList; - - var searchProductBy = $('searchProductBy').value; - if(searchProductBy == 'name') - { - searchElement = $('productQuery'); - } - else - { - searchElement = $(searchProductBy); - } - - - initProductSearch(); - - searchElement.focus(); - - var barcode = $('barcode'); - barcode.onkeyup = function(e){ - if(e.keyCode == Event.KEY_RETURN) - { - if(this.value != null && this.value != "") - { - redirect('ViewInventoryHistoryAction.do?action=searchProductInInventory&barCode=' + this.value); - } - - } - }; -}; - -var showProduct = function(element, update) -{ - update.style.display = 'block'; - update.style.opacity = '1.0'; - - if(!update.style.position || update.style.position=='absolute') { - update.style.position = 'absolute'; - Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); - Position.clone($('maintop'), update, {setHeight: false, setTop: false, offsetTop: element.offsetHeight}); - } - - }; - - -var initProductSearch = function(){ - - // autocomplete for search by product name - var productAutocompleter = new Ajax.Autocompleter('productQuery','productSearchResult','SearchProductsAction.do',{ - paramName:'productName', - parameters : 'priceListId=' + priceList, - minChars:1, - frequency:1.0, - afterUpdateElement: afterAutocomplete2, - onShow : showProduct - }); - - productAutocompleter.xyz = true; - $('productQuery').Autocompleter = productAutocompleter; - - - // autocomplete for search by product description - var productAutocompleter2 = new Ajax.Autocompleter('description','productSearchByDescriptionResult','SearchProductsAction.do',{ - paramName:'description', - parameters : 'priceListId=' + priceList, - minChars:1, - frequency:1.0, - afterUpdateElement: afterAutocomplete2, - onShow : showProduct - }); - - $('description').Autocompleter = productAutocompleter2; -}; - -var afterAutocomplete2 = function(e1,e2){ - - - var barcode = e2.getAttribute('barcode'); - if(barcode=='null') - { - barcode = ""; - } - var productId = e2.getAttribute('productId'); - - if(productId == null) - { - $('description').value = ""; - $('productQuery').value = ""; - - return; - } - - //$('barcode').value = barcode; - $('productId').value= productId; - - var description = e2.getAttribute('description'); - //$('description').value = description; - - redirect('ViewInventoryHistoryAction.do?action=searchProductInInventory&productId=' + productId); - - //reset focus to search input - searchElement.focus(); - - //set global product - product_id = productId; - - $('description').value = ""; - $('productQuery').value = ""; - -}; - -function reportError(request) -{ - alert("Some error has occured while communicating with the server"); -}; - -function convertString2Unicode(s) -{ - var uniString = "", hexVal, uniChar; - - for(var i = 0; i < s.length; ++i) - { - //Convert char to hex - //hexVal = Number(s.charCodeAt(i)).toString(16); - hexVal = Number(s.charCodeAt(i)).toString(10); - - //Convert to unicode by making sure hex is 4 chars long, padding with 0's if less - //uniChar = "\\u" + ("000" + hexVal).match(/.{4}$/)[0]; - uniChar = "&#" + ("000" + hexVal).match(/.{4}$/)[0] +";"; - - uniString += uniChar; - } - if(hexVal < 255) - return s; - - return uniString; -} - -function redirect(url) -{ - window.location = url; -} - -Event.observe(window,'load',initHistory,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/js-calendar.js b/posterita/posterita/web/js/js-calendar.js deleted file mode 100644 index c2524839db..0000000000 --- a/posterita/posterita/web/js/js-calendar.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author praveen - */ - - -try -{ - addRequiredLibrary('javascripts/js-calendar/calendar.js'); - addRequiredLibrary('javascripts/js-calendar/calendar-en.js'); - addRequiredLibrary('javascripts/js-calendar/calendar-setup.js'); - addRequiredStyleSheet('css/js-calendar/calendar-win2k-1.css'); - - toConsole('js-calendar initialised'); -} -catch(e){toConsole(e);} \ No newline at end of file diff --git a/posterita/posterita/web/js/js-date.js b/posterita/posterita/web/js/js-date.js deleted file mode 100644 index cf2687144c..0000000000 --- a/posterita/posterita/web/js/js-date.js +++ /dev/null @@ -1,55 +0,0 @@ -function setStartDate(calendar) - { - var y = calendar.date.getFullYear(); - var m = calendar.date.getMonth(); - var d = calendar.date.getDate(); - - $FElement('startDay').options[d-1].selected = true; - $FElement('startMonth').options[m].selected = true; - - var options = $FElement('startYear').options; - - for(var i = 0; i < options.length; i++) - { - if(options[i].value == y) - { - $FElement('startYear').options[i].selected = true; - break; - } - } - - updateStartDate(); - - } - - function updateStartDate() - { - var d = $FElement('startDay').selectedIndex + 1; - var m = $FElement('startMonth').selectedIndex + 1; - var y = $FElement('startYear').selectedIndex; - y = $FElement('startYear').options[y].value; - - d = (d > 9) ? d : ('0' + d); - m = (m > 9) ? m : ('0' + m); - - $('startDate').value = d + '/' + m + '/' + y; - $FElement('fromDate').value = $('startDate').value; - } - - function initStartCalendar() - { - $FElement('startDay').onchange = updateStartDate; - $FElement('startMonth').onchange = updateStartDate; - $FElement('startYear').onchange = updateStartDate; - - Calendar.setup( - { inputField : "startDate", - ifFormat : "%d/%m/%Y", - showTime : true, - button : "startDateBtn", - onUpdate : setStartDate - } - ); - - $('startDate').value = $FElement('fromDate').value; - } \ No newline at end of file diff --git a/posterita/posterita/web/js/keyboard.js b/posterita/posterita/web/js/keyboard.js deleted file mode 100644 index 9c1ca9910f..0000000000 --- a/posterita/posterita/web/js/keyboard.js +++ /dev/null @@ -1,422 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author praveen - */ - - -function insertAtCursor(myField, myValue) -{ - //IE support - if (document.selection) - { - myField.focus(); - sel = document.selection.createRange(); - sel.text = myValue; - } - //MOZILLA/NETSCAPE support - else if (myField.selectionStart || myField.selectionStart == 0) - { - var startPos = myField.selectionStart; - var endPos = myField.selectionEnd; - myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length); - } - else - { - myField.value += myValue; - } -} - -function init() -{ - var textfield = this.output; - var keyboard = document.getElementById('keyboard'); - var keys = keyboard.getElementsByTagName('td'); - - for(var i=0; i' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - ' ' + - '' + - '' + - '' + - '' + - '' + - '
    1234567890HIDE
    QWERTYUIOPBACK
    ASDFGHJKLENTER
    CAPSZXCVBNM,.
    SPACE
    ' + - '' + - '
    ' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - ' ' + - '' + - '' + - '' + - '' + - '' + - '
    1234567890HIDE
    qwertyuiopBACK
    asdfghjklENTER
    CAPSzxcvbnm,.
    SPACE
    ' + - '
    ' + - '
    '; - -} - -Keyboard.prototype.show = function(e){ - - if(this.hidden) - { - this.keypadpanel.style.visibility = 'hidden'; - this.keypadpanel.style.display = 'block'; - //this.keypadpanel.style.top = '10px'; - //this.keypadpanel.style.left = '10px'; - this.hidden = false; - - try - { - //setting keyboard state in cookie - createCookie('pos_keyboard_on',"true",7); - } - catch(e) - { - toConsole(e); - } - - } -}; - -Keyboard.prototype.hide = function(e){ - this.keypadpanel.style.display = 'none'; - this.hidden = true; - - try - {toConsole - //setting keyboard state in cookie - createCookie('pos_keyboard_on',"false",7); - } - catch(e) - { - toConsole(e); - } -}; - -Keyboard.prototype.setCaps = function(e){ - - var uppercasekeyboard = document.getElementById('uppercase'); - var lowercasekeyboard = document.getElementById('lowercase'); - - //toConsole(uppercasekeyboard.style.display); - //toConsole(lowercasekeyboard.style.display); - - if(this.caps) - { - uppercasekeyboard.style.display = 'block'; - lowercasekeyboard.style.display = 'none'; - } - else - { - uppercasekeyboard.style.display = 'none'; - lowercasekeyboard.style.display = 'block'; - } - - -}; - -Keyboard.prototype.init = init; - -function showKeyboard() -{ - keyboard.show(); - keyboard.init(); - keyboard.setCaps(); - - kH = parseInt(keyboard.keypadpanel.scrollHeight); - kW = parseInt(keyboard.keypadpanel.scrollWidth); - - sH = parseInt(getViewportHeight()); - sW = parseInt(getViewportWidth()); - - cH = (sH - kH)/2; - cW = (sW - kW)/2; - - //centering the keyboard - keyboard.keypadpanel.style.top = cH + "px"; - keyboard.keypadpanel.style.left = cW + "px"; - keyboard.keypadpanel.style.visibility = 'visible'; - -} - -function bindKeyboard(output) -{ - keyboard.output = output; - keyboard.init(); - keyboard.setCaps(); -} - -function enableVirtualKeyboard() -{ - keyboard = new Keyboard(); - - var keyboardicon = document.getElementById('keyboardicon'); - - keyboardicon.style.display = 'inline'; - keyboardicon.onclick = function(e){ - showKeyboard(); - }; - - var textfields = document.getElementsByTagName('input'); - - for(var i=0; i 0) return true; - - return false; - } -}; - -var BP_CREDIT_STATUS = SO_CREDIT_STATUS.CreditOK; - -var initScreen = function(){ - DISCOUNT_LIMIT = getDiscountAllowed(); - OVERRIDE_PRICE_LIMIT = overrideLimit; - ISDISCOUNTUPTOLIMITPRICE = isDiscountUptoLimitPrice; - ISDISCOUNTONTOTAL = isDiscountAllowedOnTotal; - - - if(!ISDISCOUNTUPTOLIMITPRICE) - { - $('discountUptoLimitPrice').hide(); - } - - if(!OVERRIDE_PRICE_LIMIT) - { - $('overridePriceLimit').hide(); - } - - if(!ISDISCOUNTONTOTAL) - { - $('discountAllowedOnTotal').hide(); - $('linesTotal').hide(); - } - - if(DISCOUNT_LIMIT == 0) - { - $('userDiscLimit').hide(); - } - - //reset user pin - $('resetPinBtn').hide(); - - //set order type - orderType = $('orderType').value; - //set tender type - tenderType = $('tenderType').value; - //set priceList - priceList = $('priceListId').value; - - //set default data for price list - defaultPriceList = priceList; - defaultPriceListName = $('terminal').innerHTML; - - //set search element - var searchProductBy = $('searchProductBy').value; - if(searchProductBy == 'name') - { - searchElement = $('productQuery'); - } - else - { - searchElement = $(searchProductBy); - } - - //set is customer compulsory - if($('isCustomerCompulsory').value == 'true') - { - isCustomerCompulsory = true; - } - - initProductSearch(); - initSearchCustomer(); - initCartBtn(); - initAjaxResponder(); - initPIN(); - initShortcuts(); - initPaymentBtns(); - initSystemBtns(); - - //set payment rule - if(tenderType == null) - { - tenderType = PAYMENT_RULES.PAYMENT_RULE_CASH; - simulateOnClick($('cashBtn')); - } - else - { - simulateOnClick($(tenderType + 'Btn')); - } - - $('total').innerHTML = $('cartTotal').innerHTML; - - - searchElement.focus(); - - var barcode = $('barcode'); - barcode.focus(); - barcode.onkeyup = function(e){ - if(e.keyCode == Event.KEY_RETURN) - { - if(this.value != null && this.value != "") - { - if(!validateBp()) - { - return; - } - - addToCart(this.value); - this.value = ""; - } - - } - }; - - var incPrice = $('incPrice'); - incPrice.onkeyup = function(e){ - - ERROR_MSG = null; - var DISC_PERC = null; - - var discount = LIST_PRICE - this.value; - DISC_PERC = new Number((discount / LIST_PRICE)*100).toFixed(2); - $('disc').value = DISC_PERC; - - if (isNaN(this.value)) - { - showErrorMessage('Invalid Price Entered: ' + newPrice, this); - this.value = LIST_PRICE; - return; - } - - var newPrice = parseFloat(this.value); - - if(this.value == "") - { - newPrice = 0; - } - - - var totalAmt = $('qty').value * newPrice; - $('totalAmount').value = new Number(totalAmt).toFixed(2); - - $('discountOnTotal').value = $('isDiscOnTotal').value = 'false'; - $('isDiscOnInclUnitPrice').value = 'true'; - $('isDiscOnPerc').value = 'false'; - - validateDiscount(parseFloat(newPrice), parseFloat(DISC_PERC)); - - }; - - var disc = $('disc'); - disc.onkeyup = function(e){ - - ERROR_MSG = null; - var DISC_PERC = null; - - DISC_PERC = this.value; - $('disc').value = DISC_PERC; - - var discAmt = new Number((DISC_PERC / 100) * LIST_PRICE); - var newPrice = new Number(LIST_PRICE - discAmt).toFixed(2); - $('incPrice').value = newPrice; - var newTotal = new Number(((100 - DISC_PERC) / 100) * (LIST_PRICE * $('qty').value)).toFixed(2); - $('totalAmount').value = newTotal; - - $('discountOnTotal').value = $('isDiscOnTotal').value = 'false'; - $('isDiscOnInclUnitPrice').value = 'true'; - $('isDiscOnPerc').value = 'false'; - - validateDiscount(newPrice, DISC_PERC); - }; - - - var totalAmount = $('totalAmount'); - totalAmount.onkeyup = function(e){ - - ERROR_MSG = null; - var DISC_PERC = null; - var qty = $('qty').value; - var total = this.value; - var totalPriceLimit = LIMIT_PRICE * qty; - var newPrice = new Number(total/qty).toFixed(2); - $('incPrice').value = newPrice; - - var disount = LIST_PRICE - newPrice; - DISC_PERC = new Number((discount/LIST_PRICE) * 100).toFixed(2); - $('disc').value = DISC_PERC; - - $('discountOnTotal').value = $('isDiscOnTotal').value = 'false'; - $('isDiscOnInclUnitPrice').value = 'true'; - $('isDiscOnPerc').value = 'false'; - - validateDiscount(newPrice, DISC_PERC); - }; - - var GrandTotal = $('grandTotal'); - GrandTotal.onkeyup = function(e) - { - var totalLines = this.value; - var ERROR_MSG = null; - - if((ISDISCOUNTUPTOLIMITPRICE == true) && (OVERRIDE_PRICE_LIMIT == false)) - { - if((totalLines > TOTAL_LIST_PRICE) && (ORIG_TOTAL_LINES != totalLines)) - { - ERROR_MSG = "DISCOUNTED TOTAL EXCEEDS TOTAL LINES!!!"; - } - if((totalLines < TOTAL_LIMIT_PRICE) && (ORIG_TOTAL_LINES != totalLines)) - { - ERROR_MSG = "TOTAL DISCOUNT EXCEEDED!!!"; - } - - if((totalLines > TOTAL_LIST_PRICE) && (totalLines < TOTAL_LIMIT_PRICE)) - ERROR_MSG = null; - } - - if((ISDISCOUNTUPTOLIMITPRICE == false) && (OVERRIDE_PRICE_LIMIT == true)) - { - if(DISCOUNT_LIMIT > 0) - { - var discount = TOTAL_LIST_PRICE - totalLines; - DISC_PERC = new Number((discount/TOTAL_LIST_PRICE)*100).toFixed(2); - - if(DISC_PERC > DISCOUNT_LIMIT) - { - ERROR_MSG = "DISCOUNT LIMIT EXCEEDED!!!"; - } - - discAmt = totalLines - GRAND_TOTAL; - if(discAmt > 0) - { - ERROR_MSG = "DISCOUNT CANNOT BE NAGATIVE"; - } - - } - - if(DISCOUNT_LIMIT == 0) - { - ERROR_MSG = "CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"; - } - } - - if((ISDISCOUNTUPTOLIMITPRICE == false) && (OVERRIDE_PRICE_LIMIT == false)) - { - if(DISCOUNT_LIMIT > 0) - { - if((totalLines < TOTAL_LIMIT_PRICE) && (ORIG_TOTAL_LINES != totalLines)) - { - ERROR_MSG = "CANNOT OVERRIDE LIMIT PRICE!!!"; - } - - if((totalLines > TOTAL_LIST_PRICE) && (ORIG_TOTAL_LINES != totalLines)) - { - ERROR_MSG = "DISCOUNTED TOTAL EXCEEDS TOTAL LINES!!!"; - } - } - - if(DISCOUNT_LIMIT == 0) - { - ERROR_MSG = "CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"; - } - } - - if((ISDISCOUNTUPTOLIMITPRICE == true) && (OVERRIDE_PRICE_LIMIT == true)) - { - $('discountUptoLimitPrice').className = "error"; - $('overridePriceLimit').className = "error"; - ERROR_MSG = "DISCOUNT ERROR!! CANNOT PROCESS YOUR REQUEST!!!"; - } - - if(ERROR_MSG == null) - { - if(ORIG_TOTAL_LINES == totalLines) - { - $('applyDiscBtn').disabled = true; - } - else - { - $('applyDiscBtn').disabled = false; - } - } - else - { - $('applyDiscBtn').disabled = true; - } - - $('errorMsg').innerHTML = ERROR_MSG; - - $('discountOnTotal').value = $('isDiscOnTotal').value = 'true'; - $('isDiscOnInclUnitPrice').value = 'false'; - $('isDiscOnPerc').value = 'false'; - - }; - - - $('qty').onkeyup = function(e){ - if(e.keyCode == Event.KEY_RETURN) - { - //update qty - done = true; - updateQty(product_id, this.value); - } - }; - - $('checkoutBtn').onclick = function(e){ - initSystemBtns(); - this.className = 'selected'; - if(cartLines == null || cartLines.length == 0) - { - showErrorMessage('Shopping cart is empty!', 'productQuery'); - } - else - { - if(orderType == ORDER_TYPES.CUSTOMER_RETURNED_ORDER) - { - $('creditPanel').show(); - } - else if(orderType == ORDER_TYPES.POS_GOODS_RETURNED_NOTE) - { - $('creditPanel').show(); - } - else - { - activePanel.show(); - } - - } - }; - - $('openDrawerBtn').onclick = function(e){ - initSystemBtns(); - this.className = 'selected'; - openCashDrawer(); - }; - - $('discountBtn').showDiscount = $('discountBtn').onclick - $('discountBtn').onclick = function(){ - initSystemBtns(); - this.className = 'selected'; - if(cartLines == null || cartLines.length == 0) - { - showErrorMessage('Shopping cart is empty!', 'productQuery'); - } - else - { - this.showDiscount(); - } - - }; - - $('clearCartBtn').onclick = function(e){ - initSystemBtns(); - this.className = 'selected'; - cartIndex = null; - cartLines = null; - clearCart(); - }; - - $('quickDiscountBtn').onclick = function(e){ - initSystemBtns(); - this.className = 'selected'; - var QuickDiscountForm = $('QuickDiscountForm'); - - if(cartLines == null || cartLines.length == 0) - { - isQuickDiscount = false; - QuickDiscountForm.disable(); - showErrorMessage('Shopping cart is empty!', 'barcode'); - } - else - { - if(!OVERRIDE_PRICE_LIMIT && !ISDISCOUNTUPTOLIMITPRICE && !ISDISCOUNTONTOTAL && DISCOUNT_LIMIT == 0) - { - isQuickDiscount = false; - QuickDiscountForm.disable(); - $('errorMsg').innerHTML = "DISCOUNT NOT ALLOWED!!!"; - showErrorMessage('You are not allowed to give discount!', 'barcode'); - } - else - { - isQuickDiscount = true; - QuickDiscountForm.enable(); - - } - - } - - if(isQuickDiscount) - { - if(isDiscountFormOpen) - { - closeDiscount(); - } - else - { - quickDiscount(); - } - } - else - { - closeDiscount(); - } - - }; - - $('applyDiscBtn').onclick = function(e){ - if(cartLines == null || cartLines.length == 0) - { - showErrorMessage('Shopping cart is empty!', 'productQuery'); - } - else - { - applyDiscount(); - } - }; - - $('changePinBtn').onclick = function(e){ - - var isOverlay = $('PINPanel').style.display; - - if(isOverlay == 'none' || isOverlay == '') - { - popUp(); - } - showDisableMask(); - popPanel($('PINPanel')); - $('PIN').focus(); - }; - - //add behaviour to existing cart - addBehaviourToCart(); - - $('barcode').focus(); - showErrors(); -}; - -var initPIN = function(){ - var pinPanel = $('PINPanel'); - var inputs = pinPanel.getElementsByTagName('input'); - - pinPanel.pin = inputs[0]; - pinPanel.ok = inputs[1]; - pinPanel.cancel = inputs[2]; - - var validatePIN = function() - { - if($('PINPanel').pin.value == null || $('PINPanel').pin.value == '') - { - return; - } - - var url = 'AddToPOSShoppingCartAction.do'; - var pars = 'action=validatePIN&pin=' + $('PINPanel').pin.value; - - var refreshDiscountLimit = function(request){ - var response = request.responseText; - var result = eval('(' + response + ')'); - - if(result.error) - { - $('PINPanel').pin.value = ''; - showErrorMessage(result.error, 'PIN'); - } - else - { - roleId = result.roleId; - discountLimit = result.discountLimit; - overrideLimit = result.overrideLimit; - discountOnTotal = result.discountOnTotal; - discountUptoPriceLimit = result.discountUptoPriceLimit; - - DISCOUNT_LIMIT = discountLimit; - OVERRIDE_PRICE_LIMIT = overrideLimit; - ISDISCOUNTONTOTAL = discountOnTotal; - ISDISCOUNTUPTOLIMITPRICE = discountUptoPriceLimit; - - if(!ISDISCOUNTUPTOLIMITPRICE) - { - $('discountUptoLimitPrice').hide(); - } - else - { - $('discountUptoLimitPrice').show(); - } - - if(!OVERRIDE_PRICE_LIMIT) - { - $('overridePriceLimit').hide(); - } - else - { - $('overridePriceLimit').show(); - } - - if(!ISDISCOUNTONTOTAL) - { - $('discountAllowedOnTotal').hide(); - } - else - { - $('discountAllowedOnTotal').show(); - } - - if(DISCOUNT_LIMIT == 0) - { - $('userDiscLimit').hide(); - } - else - { - $('userDiscLimit').show(); - } - - $('isDiscountUptoLimitPrice').innerHTML = discountUptoPriceLimit + ''; - $('overrideLimit').innerHTML = overrideLimit + ''; - $('isDiscountOnTotal').innerHTML = discountOnTotal + ''; - $('discountLimit').innerHTML = discountLimit + '%'; - $('roleId').value = roleId; - $('PINPanel').pin.value = ''; - - $('resetPinBtn').show(); - $('changePinBtn').hide(); - popUp(); - hidePanel($('PINPanel')); - hideDisableMask(); - refreshCart(); - } - }; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshDiscountLimit, - onFailure: reportShoppingCartError - }); - } - - pinPanel.ok.onclick = validatePIN; - - pinPanel.pin.onkeyup = function(e){ - if(e.keyCode == Event.KEY_RETURN) - { - validatePIN(); - } - }; - - pinPanel.cancel.onclick = function(e){ - $('PINPanel').pin.value = ''; - popUp(); - hidePanel($('PINPanel')); - hideDisableMask(); - }; -}; - -function resetUser(roleId) -{ - var url = 'AddToPOSShoppingCartAction.do'; - var pars = 'action=resetUser&roleId=' + roleId; - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshUser, - onFailure: reportShoppingCartError - }); - -} - -function refreshUser(request) -{ - var response = request.responseText; - var result = eval('(' + response + ')'); - - if(result.error) - { - showErrorMessage(result.error, 'barcode'); - } - else - { - roleId = result.roleId; - discountLimit = result.discountLimit; - overrideLimit = result.overrideLimit; - discountOnTotal = result.discountOnTotal; - discountUptoPriceLimit = result.discountUptoPriceLimit; - - DISCOUNT_LIMIT = discountLimit; - OVERRIDE_PRICE_LIMIT = overrideLimit; - ISDISCOUNTONTOTAL = discountOnTotal; - ISDISCOUNTUPTOLIMITPRICE = discountUptoPriceLimit; - - $('isDiscountUptoLimitPrice').innerHTML = discountUptoPriceLimit + ''; - $('overrideLimit').innerHTML = overrideLimit + ''; - $('isDiscountOnTotal').innerHTML = discountOnTotal + ''; - $('discountLimit').innerHTML = discountLimit + '%'; - $('roleId').value = roleId; - $('PINPanel').pin.value = ''; - - $('changePinBtn').show(); - $('resetPinBtn').hide(); - - refreshCart(); - } -} - -var initShortcuts = function() -{ - shortcut.add("Ctrl+Space", function(e){simulateOnClick($('checkoutBtn'))}); - - shortcut.add("F1", function(e){$('barcode').select();}); - shortcut.add("F2", function(e){$('productQuery').select();}); - shortcut.add("F3", function(e){$('description').select();}); - shortcut.add("F4", function(e){$('qty').select();}); - - shortcut.add("F5", function(e){$('customerQuery').select();}); - shortcut.add("F6", function(e){simulateOnClick($('discountBtn'))}); - - // Barcode Btn - shortcut.add("Ctrl+B", function(e){simulateOnClick($('barcodeBtn'))}); - - // Quick Discount - shortcut.add("F8", function(e){simulateOnClick($('quickDiscountBtn'))}); - //payment btns - shortcut.add("F9", function(e){simulateOnClick($('cashBtn'))}); - shortcut.add("F10", function(e){simulateOnClick($('cardBtn'))}); - shortcut.add("F11", function(e){simulateOnClick($('chequeBtn'))}); - shortcut.add("F12", function(e){simulateOnClick($('mixBtn'))}); - - shortcut.add("Ctrl+M", function(){simulateOnClick($('menuBtn'))}); - shortcut.add("Ctrl+D", function(){ - //simulateOnClick($('openDrawerBtn')); - showErrorMessage('Opening Cash Drawer'); - - }); - shortcut.add("Ctrl+Delete", function(){ - simulateOnClick($('clearCartBtn')); - }); - shortcut.add("Ctrl+P", function(){simulateOnClick($('changePinBtn'))}); - shortcut.add("Ctrl+R", function(){simulateOnClick($('resetPinBtn'))}); - shortcut.add("Ctrl+S", function(){simulateOnClick($('shortcutBtn'))}); - - shortcut.add("Ctrl+C", function(){simulateOnClick($('creditBtn'))}); - - //move between cart lines - shortcut.add("Ctrl+Up", function(){ - closeDiscount(); - if(cartIndex > 0) - { - cartIndex = cartIndex -1; - var line = cartLines[cartIndex]; - scrollCart(); - simulateOnClick(line); - } - }); - - shortcut.add("Ctrl+Down", function(){ - closeDiscount(); - if(cartIndex < cartLines.length - 1) - { - cartIndex = cartIndex + 1; - var line = cartLines[cartIndex]; - scrollCart(); - simulateOnClick(line); - } - }); - - //incrementing and decrementing qty - shortcut.add("Ctrl+Right", function(){ - closeDiscount(); - simulateOnClick($('plusBtn')); - }); - - shortcut.add("Ctrl+Left", function(){ - closeDiscount(); - simulateOnClick($('minusBtn')); - }); - - shortcut.add("Ctrl+Backspace", function(){ - closeDiscount(); - simulateOnClick($('deleteBtn')); - }); - - //Enable create product for GRN - if(orderType == ORDER_TYPES.POS_GOODS_RECEIVE_NOTE) - { - shortcut.add("Alt+P", function(){CreateProduct.showPopup(0);}); - shortcut.add("Alt+U", function(){ - if(product_id != null) - CreateProduct.showPopup(product_id); - }); - - shortcut.add("Esc", function(){ - CreateProduct.hidePopup(); - }); - } - -}; - -var showResult = function(element, update){ - if(!update.style.position || update.style.position=='absolute') { - update.style.position = 'absolute'; - Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); - Position.clone($('maintop'), update, {setHeight: false, setTop: false, offsetTop: element.offsetHeight}); - } - - update.style.display = 'block'; - update.style.opacity = '1.0'; - - }; - - -var initProductSearch = function(){ - - // autocomplete for search by product name - var productAutocompleter = new Ajax.Autocompleter('productQuery','productSearchResult','SearchProductsAction.do',{ - paramName:'productName', - parameters : 'priceListId=' + priceList, - minChars:1, - frequency:1.0, - afterUpdateElement: afterAutocomplete, - onShow : showResult - }); - - productAutocompleter.xyz = true; - $('productQuery').Autocompleter = productAutocompleter; - - - // autocomplete for search by product description - var productAutocompleter2 = new Ajax.Autocompleter('description','productSearchByDescriptionResult','SearchProductsAction.do',{ - paramName:'description', - parameters : 'priceListId=' + priceList, - minChars:1, - frequency:1.0, - afterUpdateElement: afterAutocomplete, - onShow : showResult - }); - - $('description').Autocompleter = productAutocompleter2; -}; - -var afterAutocomplete = function(e1,e2){ - - if(!validateBp()) - { - return; - } - - var barcode = e2.getAttribute('barcode'); - if(barcode=='null') - { - barcode = ""; - } - var productId = e2.getAttribute('productId'); - - if(productId == null) - { - $('description').value = ""; - $('productQuery').value = ""; - - return; - } - - //$('barcode').value = barcode; - $('productId').value= productId; - - var description = e2.getAttribute('description'); - //$('description').value = description; - - incrementCart(productId); - - //reset focus to search input - searchElement.focus(); - - //show product details - getProductInfo(productId); - - //set global product - product_id = productId; - - $('description').value = ""; - $('productQuery').value = ""; - -}; - -function getProductInfo(productId) -{ - var url = 'POSProductAction2.do'; - var pars = 'action=getProductDetails&productId='+productId+'&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: showProductInfo, - onFailure: reportError - }); -} - -function showProductInfo(request) -{ - // - try - { - var response = request.responseText; - var product = eval('(' + response + ')'); - - //display product info in right column - $('m_productId').value = product.id; - $('product.name').innerHTML = product.name; - $('product.barcode').innerHTML = product.barcode; - $('product.taxCategory').innerHTML = product.taxCategory; - $('product.description').innerHTML = product.description; - $('product.stock.qty').innerHTML = product.stockQty; - TAX_RATE = $('taxRate').value = new Number(product.taxRate).toFixed(2); - var taxPercentage = new Number(1 + (TAX_RATE / 100)); - - ISTAXINCLUDED = product.isTaxIncluded; - - if(ISTAXINCLUDED == "false") - { - LIMIT_PRICE = $('priceLimit').innerHTML = new Number(product.priceLimit * taxPercentage).toFixed(2); - LIST_PRICE = new Number(product.priceList * taxPercentage).toFixed(2); - ORIG_TOTAL = new Number($('qty').value * product.priceList * taxPercentage).toFixed(2); - } - else - { - LIMIT_PRICE = $('priceLimit').innerHTML = new Number(product.priceLimit).toFixed(2); - LIST_PRICE = new Number(product.priceList).toFixed(2); - ORIG_TOTAL = new Number($('qty').value * product.priceList).toFixed(2); - } - - $('product.price.list').innerHTML = LIST_PRICE; - - if(ISDISCOUNTUPTOLIMITPRICE) - { - $('product.price.limit').innerHTML = LIMIT_PRICE; - } - - $('product.image').src = 'images/newUI/productpreview.gif'; - - } - catch(e) - { - showErrorMessage(e); - } -} - -function reportError(request) -{ - alert("Some error has occured while communicating with the server"); - var w = window.open("","Error"); - var d = w.document; - d.write(request.responseText); -} - -function convertString2Unicode(s) -{ - var uniString = "", hexVal, uniChar; - - for(var i = 0; i < s.length; ++i) - { - //Convert char to hex - //hexVal = Number(s.charCodeAt(i)).toString(16); - hexVal = Number(s.charCodeAt(i)).toString(10); - - //Convert to unicode by making sure hex is 4 chars long, padding with 0's if less - //uniChar = "\\u" + ("000" + hexVal).match(/.{4}$/)[0]; - uniChar = "&#" + ("000" + hexVal).match(/.{4}$/)[0] +";"; - - uniString += uniChar; - } - if(hexVal < 255) - return s; - - return uniString; -} - -// returns true if bp is valid -var validateBp = function(){ - if(orderType == ORDER_TYPES.POS_GOODS_RECEIVE_NOTE || - orderType == ORDER_TYPES.POS_GOODS_RETURNED_NOTE) - { - var bpartner = $('bpartnerId').value; - if(bpartner == null || bpartner == "") - { - showErrorMessage("Please choose a vendor", 'customerQuery'); - //$('bpartnerId').focus(); - - return false; - } - } - - if(isCustomerCompulsory) - { - var bpartner = $('bpartnerId').value; - if(bpartner == null || bpartner == "") - { - showErrorMessage("Please choose a customer", 'customerQuery'); - //$('bpartnerId').focus(); - - return false; - } - } - - if(orderType == ORDER_TYPES.CREDIT_ORDER || orderType == ORDER_TYPES.POS_ORDER) - if($('tenderType').value == PAYMENT_RULES.PAYMENT_RULE_CREDIT) - { - var bpartner = $('bpartnerId').value; - if(bpartner == null || bpartner == "") - { - showErrorMessage("Please choose a customer", 'customerQuery'); - //$('bpartnerId').focus(); - - return false; - } - - if(BP.creditStatus == SO_CREDIT_STATUS.NoCreditCheck) - { - showErrorMessage("Please set credit status for customer", 'customerQuery'); - return false; - } - - if(BP.creditLimit == 0) - { - showErrorMessage("Please set credit limit for customer", 'customerQuery'); - return false; - } - - if(BP.openBalance > BP.creditLimit) - { - showErrorMessage("Credit Limit has been exceed!", 'customerQuery'); - return false; - } - - if(BP.creditStatus != SO_CREDIT_STATUS.CreditOK) - { - var errmsg = 'Invalid credit status! '; - - if(BP.creditStatus == SO_CREDIT_STATUS.CreditHold) - { - errmsg += 'Credit Hold'; - } - - if(BP.creditStatus == SO_CREDIT_STATUS.CreditStop) - { - errmsg += 'Credit Stop'; - } - - if(BP.creditStatus == SO_CREDIT_STATUS.CreditWatch) - { - errmsg += 'Credit Watch'; - } - - showErrorMessage(errmsg, 'customerQuery'); - return false; - } - - } - - return true; -}; - -var initSearchCustomer = function(){ - - //validateBp(); // validates bp on load - - // auto complete for customer - $('customerQuery').Autocompleter = new Ajax.Autocompleter('customerQuery','customerSearchResult','SearchCustomerAction.do',{ - paramName:'customerQuery', - frequency:TROTTLE_TIME, - parameters : 'orderType=' + orderType, // if credit order, do not validate for standard customer - onShow:function(element, update){ - if(!update.style.position || update.style.position=='absolute') { - update.style.position = 'absolute'; - Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); - } - update.style.display = 'block'; - }, - afterUpdateElement:function(e1,e2){ - var bpartner = $('bpartnerId'); - var bpartnerName = $('customer.name'); - - - if(e2.value != '-1') - { - if(e2.value) - { - bpartner.value = e2.value; - } - else - { - bpartner.value = ''; - } - - $('customer.code').innerHTML = bpartner.value; - var creditLimit = e2.getAttribute('creditLimit'); - var creditAvailable = e2.getAttribute('creditAvailable'); - var openBalance = e2.getAttribute('openBalance'); - var creditStatus = e2.getAttribute('creditStatus'); - var name = e2.getAttribute('name'); - - if(bpartnerName) - { - BP.id = bpartner.value; - BP.name = name; - BP.priceList = e2.getAttribute('priceList'); - BP.priceListName = e2.getAttribute('pricelistName'); - BP.creditStatus = creditStatus; - BP.creditAvailable = parseFloat(creditAvailable); - BP.creditLimit = parseFloat(creditLimit); - BP.openBalance = parseFloat(openBalance); - - $('customerCode').style.display = 'table-row'; - $('customerName').style.display = 'table-row'; - $('creditAvailable').style.display = 'table-row'; - $('creditLimit').style.display = 'table-row'; - $('openBalance').style.display = 'table-row'; - - $('customer.name').innerHTML = name; - $('credit.available').innerHTML = creditAvailable; - $('credit.limit').innerHTML = creditLimit; - $('open.balance').innerHTML = openBalance; - - BP_CREDIT_STATUS = creditStatus; - - if (e2.getAttribute('priceList') && parseInt(e2.getAttribute('priceList')) > 0) - { - priceList = e2.getAttribute('priceList'); - $('priceListId').value = priceList; - $('terminal').innerHTML = e2.getAttribute('pricelistName'); - } - else - { - priceList = defaultPriceList; - $('terminal').innerHTML = defaultPriceListName; - } - if(cartLines != null && cartLines.length != 0) - { - //reload shopping cart for partner - if(oldPriceList != priceList) - { - setShoppingCartPriceList(); - oldPriceList = priceList; - } - } - $('productQuery').Autocompleter.options.defaultParams='priceListId=' + priceList; - saveBPartnerInfo(bpartner.value, name, creditLimit, priceList); - }//if - } - else - { - bpartner.value = ""; - if(bpartnerName) - { - bpartnerName.value = ""; - }//if - }//if - - - $('customerQuery').value = ""; - - searchElement.focus(); - } - - }); - -} - -function saveBPartnerInfo(bPartnerValue, name, creditLimit, priceListId) -{ - try - { - var url = 'CheckoutAction.do'; - var pars = 'action=saveBPartnerInfo&bPartnerId='+bPartnerValue +'&name='+name+'&creditLimit='+creditLimit+'&priceListId='+priceListId; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars - }); - - } - catch(e) - { - toConsole(e); - } - return; -} - -var initCartBtn = function(){ - var plus = $('plusBtn'); - var minus = $('minusBtn'); - var del = $('deleteBtn'); - - plus.style.cursor = 'pointer'; - minus.style.cursor = 'pointer'; - del.style.cursor = 'pointer'; - - plus.onclick = function(e){ - if(product_id != null) - incrementCart(product_id); - searchElement.focus(); - }; - - minus.onclick = function(e){ - if(product_id != null) - decrementCart(product_id); - searchElement.focus(); - }; - - del.onclick = function(e){ - if(product_id != null) - deleteItemFromCart(product_id); - - if(cartLines == null || cartLines.length == 0) - { - resetDetails(); - } - - searchElement.focus(); - }; -}; - - - -var initAjaxResponder = function(){ - - Ajax.Responders.register({ - onCreate: function() { - $('indicator').style.display = 'block'; - }, - onComplete: function() { - $('indicator').style.display = 'none'; - } - }); -}; - - - -//---------------------------------------------------------------------------- - - -var hidePaymentPanels = function(){ - paymentPanels.each(hidePanel); -}; - -var initOkCancel = function(panel){ - var inputs = panel.getElementsByTagName('input'); - - if(inputs.length > 2) - { - var length = inputs.length; - var ok = inputs[length-2]; - var cancel = inputs[length-1]; - - ok.panel = panel; - cancel.panel = panel; - - ok.onclick = function(){this.panel.validate();}; - cancel.onclick = function() - { - hidePanel(this.panel); - }; - - shortcut.add("Esc", function() - { - simulateOnClick(cancel); - }); - - } - -}; - -// add behaviour to different payment panels -var initCashPanel = function(){ - var cashPanel = $('cashPanel'); - - if(orderType == ORDER_TYPES.POS_GOODS_RECEIVE_NOTE) - { - $('writeOffAmt').style.display = 'none'; - $('actualPaymentAmt').style.display = 'none'; - } - - $('amountTendered').focus(); - - $('amountTendered').onkeypress = function(e){ - - if(e.keyCode == Event.KEY_RETURN) - { - if(this.value == null || this.value == '') - { - showErrorMessage('Enter an amount!', 'amountTendered'); - return; - } - - $('cashPanel').validate(); - } - } - $('amountTendered').onkeyup = function(e){ - - var amount = getCartTotal(); - var amountRefunded = null; - var writeOffAmt = 0; - - var paymentAmt = new Number(amount).toFixed(2); - if(orderType == ORDER_TYPES.POS_ORDER) - { - var roundOffFactor = $('roundOffFactor').value; - var writeOffAmt = 0; - - if (roundOffFactor != null && roundOffFactor != 0) - { - var multiple = amount/roundOffFactor; - var index1 = multiple.toString().indexOf('.'); - if(index1 == -1) - { - writeOffAmt = 0; - } - else - { - multiple = parseInt(multiple); - writeOffAmt = amount - (multiple * roundOffFactor); - writeOffAmt = writeOffAmt.toFixed(2); - } - } - paymentAmt = new Number(amount - writeOffAmt).toFixed(2); - $('writeOffCash').innerHTML = new Number(writeOffAmt).toFixed(2); - $('paymentCash').innerHTML = paymentAmt; - } - - amountRefunded = this.value - paymentAmt; - //Round amountRefunded to two decimal places if its greater than 2 decimal places - var amtstr = new Number(amountRefunded).toString(); - var index = amtstr.indexOf('.'); - - var noOfDecimalPlaces = amountRefunded.toString().length - index; - if(index != -1 && noOfDecimalPlaces > 2) - { - $('amountRefunded').innerHTML = Math.round(amountRefunded * 100) / 100; - } - else - { - $('amountRefunded').innerHTML = amountRefunded; - } - - }; - - cashPanel.validate =function(){ - var amount = getCartTotal(); - var amountTendered = new Number($('amountTendered').value); - var writeOff = $('writeOffCash').innerHTML; - var writeOffAmt = new Number(writeOff); - - if (isNaN(amountTendered)) - { - showErrorMessage('Please enter a numeric value', 'amountTendered'); - return; - } - if (isNaN(writeOffAmt)) - { - writeOffAmt = 0; - } - var total = amountTendered + writeOffAmt; - - if(amount > total) - { - showErrorMessage('Amount tendered is less that total amount', 'amountTendered'); - } - else - { - $FElement('tenderType').value = 'cash'; - $FElement('amountTendered').value = $('amountTendered').value; - $FElement('amountRefunded').value = new Number(amountTendered - amount).toFixed(2); - - hidePanel(this); - - checkout(); - - } - };//cashPanel.validate - - cashPanel.show = function(){ - hidePaymentPanels(); - popPanel(this); - $('cashTotal').innerHTML = $('total').innerHTML; - $('amountTendered').focus(); - }; - - cashPanel.reset = function(){ - $('amountTendered').value = ''; - $('amountRefunded').innerHTML = ''; - }; -}; - -var initCardPanel = function(){ - var cardPanel = $('cardPanel'); - - $('cardNo').onkeypress = function(e){ - - if(e.keyCode == Event.KEY_RETURN) - { - if(this.value == null || this.value == '') - { - showErrorMessage('Enter Credit Card Number!','cardNo'); - return; - } - - $('cardPanel').validate(); - } - }; - - cardPanel.validate = function(){ - //validate credit card no - var cardNo = $('cardNo').value; - - if(cardNo == null || cardNo == '') - { - showErrorMessage('Enter Credit Card Number!','cardNo'); - } - else - { - $FElement('tenderType').value = 'card'; - $FElement('cardNo').value = cardNo; - - hidePanel(this); - - checkout(); - } - }; - - cardPanel.show = function(){ - hidePaymentPanels(); - popPanel(this); - $('cardTotal').innerHTML = $('total').innerHTML; - $('cardList').focus(); - }; - - cardPanel.reset = function(){ - $('cardNo').value = ''; - $('cardList').selectedIndex = 0; - }; -}; - -var initChequePanel = function(){ - var chequePanel = $('chequePanel'); - - $('chequeNo').onkeypress = function(e){ - - if(e.keyCode == Event.KEY_RETURN) - { - if(this.value == null || this.value == '') - { - showErrorMessage('Enter Cheque Number!','chequeNo'); - return; - } - - $('chequePanel').validate(); - } - }; - - chequePanel.validate = function(){ - //validate cheque no - var chequeNo = $('chequeNo').value; - - if(chequeNo == null || chequeNo == '') - { - showErrorMessage('Enter Cheque Number!'); - } - else - { - $FElement('tenderType').value = 'cheque'; - $FElement('chequeNo').value = chequeNo; - - hidePanel(this); - - checkout(); - } - }; - - chequePanel.show = function(){ - hidePaymentPanels(); - popPanel(this); - $('chequeTotal').innerHTML = $('total').innerHTML; - $('chequeNo').focus(); - }; - - chequePanel.reset = function(){ - $('chequeNo').value = ''; - }; -}; - -var initMixPanel = function(){ - var mixPanel = $('mixPanel'); - - var bgColorError = '#FF0000'; - var bgColorNormal = '#FFFFFF'; - var cardAmount; - var cashAmount; - var chequeAmount; - - var inputs = mixPanel.getElementsByTagName('input'); - - $('mix_cashAmt').onkeyup = function(e){ - var total = getCartTotal(); - - if (this.value <= total && this.value >= 0) - { - cashAmount = new Number(this.value); - cardAmount = new Number($('mix_cardAmt').value); - chequeAmount = new Number($('mix_chequeAmt').value); - - var diff = (cashAmount + cardAmount + chequeAmount) - total; - - if (diff < 0) - { - cardAmount = total - (cashAmount + chequeAmount); - } - if (diff > 0) - { - var cardAmountDiff = cardAmount - diff; - - if (cardAmountDiff > 0) - { - cardAmount = cardAmountDiff; - } - else - { - chequeAmount = chequeAmount + cardAmountDiff; - cardAmount = 0; - } - } - $('mix_cardAmt').value = new Number(cardAmount).toFixed(2); - $('mix_chequeAmt').value = new Number(chequeAmount).toFixed(2); - this.style.backgroundColor = bgColorNormal; - inputs[5].disabled = false; - } - else - { - this.style.backgroundColor = bgColorError; - inputs[5].disabled = true; - } - }; - - $('mix_chequeAmt').onkeyup = function(e){ - var total = getCartTotal(); - - if (this.value <= total && this.value >= 0) - { - chequeAmount = new Number(this.value); - cashAmount = new Number($('mix_cashAmt').value); - cardAmount = new Number($('mix_cardAmt').value); - var diff = (chequeAmount + cashAmount + cardAmount) - total; - - if (diff < 0) - { - cardAmount = total - (chequeAmount + cashAmount); - } - if (diff > 0) - { - var cardAmountDiff = cardAmount - diff; - if (cardAmountDiff > 0) - { - cardAmount = cardAmountDiff; - } - else - { - cashAmount = cashAmount + cardAmountDiff; - cardAmount = 0; - } - } - $('mix_cardAmt').value = new Number(cardAmount).toFixed(2); - $('mix_cashAmt').value = new Number(cashAmount).toFixed(2); - this.style.backgroundColor = bgColorNormal; - inputs[5].disabled = false; - } - else - { - this.style.backgroundColor = bgColorError; - inputs[5].disabled = true; - } - }; - - $('mix_cardAmt').onkeyup = function(e){ - var total = getCartTotal(); - - if(this.value <= total && this.value >= 0) - { - chequeAmount = new Number($('mix_chequeAmt').value); - cashAmount = new Number($('mix_cashAmt').value); - cardAmount = new Number(this.value); - - var diff = (cardAmount + cashAmount + chequeAmount) - total; - - if (diff < 0) - { - chequeAmount = total - (cardAmount + cashAmount); - } - if (diff > 0) - { - var chequeAmountDiff = chequeAmount - diff; - - if (chequeAmountDiff > 0) - { - chequeAmount = chequeAmountDiff; - } - else - { - cashAmount = cashAmount + chequeAmountDiff; - chequeAmount = 0; - } - } - $('mix_chequeAmt').value = new Number(chequeAmount).toFixed(2); - $('mix_cashAmt').value = new Number(cashAmount).toFixed(2); - this.style.backgroundColor = bgColorNormal; - inputs[5].disabled = false; - } - else - { - this.style.backgroundColor = bgColorError; - inputs[5].disabled = true; - } - }; - - $('mix_cashAmt').onkeypress = function(e){ - - if(e.keyCode == Event.KEY_RETURN) - { - mixPanel.validate(); - } - }; - - $('mix_chequeAmt').onkeypress = function(e){ - - if(e.keyCode == Event.KEY_RETURN) - { - mixPanel.validate(); - } - }; - - $('mix_cardAmt').onkeypress = function(e){ - - if(e.keyCode == Event.KEY_RETURN) - { - mixPanel.validate(); - } - }; - - $('mix_chequeNo').onkeypress = function(e){ - - if(e.keyCode == Event.KEY_RETURN) - { - mixPanel.validate(); - } - }; - - $('mix_cardNo').onkeypress = function(e){ - - if(e.keyCode == Event.KEY_RETURN) - { - mixPanel.validate(); - } - }; - - mixPanel.validate = function(){ - //validate net amt - if (inputs[5].disabled == true) - { - return; - } - - var total = getCartTotal(); - - var cashAmt = $('mix_cashAmt').value; - var chequeAmt = $('mix_chequeAmt').value; - var chequeNo = $('mix_chequeNo').value; - var cardAmt = $('mix_cardAmt').value; - var cardNo = $('mix_cardNo').value; - - if((cashAmt == null || cashAmt == '') && (chequeAmt == null || chequeAmt == '') && (cardAmt == null || cardAmt == '')) - { - showErrorMessage('Please enter an amount', 'mix_cashAmt'); - } - else if((chequeNo == null || chequeNo == '') && (chequeAmt.length > 0)) - { - showErrorMessage('Enter Cheque Number!', 'mix_chequeNo'); - } - else if(chequeNo.length > 0 && (chequeAmt == null || chequeAmt == '') && (chequeAmt != 0)) - { - showErrorMessage('Enter Cheque Amount!', 'mix_chequeAmt'); - } - else if(cardNo.length > 0 && (cardAmt == null || cardAmt == '')) - { - showErrorMessage('Enter Card Amount!', 'mix_cardAmt'); - } - else if((cardNo == null || cardNo == '') && (cardAmt.length > 0) && (cardAmt != 0)) - { - showErrorMessage('Enter Card Number!', 'mix_cardNo'); - } - else - { - var total1 = new Number(0); - var cashAmt = new Number($('mix_cashAmt').value); - var chequeAmt = new Number($('mix_chequeAmt').value); - var cardAmt = new Number($('mix_cardAmt').value); - - if (!isNaN(cashAmt)) - { - total1 = total1 + cashAmt; - } - if (!isNaN(cardAmt)) - { - total1 = total1 + cardAmt; - } - if (!isNaN(chequeAmt)) - { - total1 = total1 + chequeAmt; - } - - if(total1 < total) - { - showErrorMessage('Amount tendered is less than total amount!', 'mix_cashAmt'); - } - else - { - $FElement('tenderType').value = 'mixed'; - $FElement('chequeNo').value = chequeNo; - $FElement('chequeAmt').value = chequeAmt; - $FElement('cardNo').value = cardNo; - $FElement('cardAmt').value = cardAmt; - $FElement('cashAmt').value = cashAmt; - - hidePanel(this); - - checkout(); - } - - } - }; - - mixPanel.show = function(){ - hidePaymentPanels(); - popPanel(this); - $('mixTotal').innerHTML = $('total').innerHTML; - - $('mix_cashAmt').value = getCartTotal(); - $('mix_cashAmt').select(); - - }; - - mixPanel.reset = function(){ - $('mix_cashAmt').value = ''; - $('mix_chequeAmt').value = ''; - $('mix_chequeNo').value = ''; - $('mix_cardAmt').value = ''; - $('mix_cardNo').value = ''; - }; -}; - -var initCreditPanel = function(){ - var creditPanel = $('creditPanel'); - - creditPanel.show = function(){ - $('isCustomerCompulsory').value = 'true'; - isCustomerCompulsory = 'true'; - - if (!creditPanel.validate()) - { - creditPanel.reset(); - return; - } - checkout(); - }; - - creditPanel.reset = function(){ - if ($('orderType').value == ORDER_TYPES.POS_ORDER) - { - $('isCustomerCompulsory').value = 'false'; - } - }; - - creditPanel.validate = function(){ - return validateBp(); - }; - -}; - - -var initPaymentPanels = function(){ - paymentPanels = [$('cashPanel'), $('cardPanel'), $('chequePanel'), $('mixPanel'), $('creditPanel')]; - paymentPanels = $A(paymentPanels); - paymentPanels.each(initOkCancel); - - initCashPanel(); - initCardPanel(); - initChequePanel(); - initMixPanel(); - initCreditPanel(); -}; - -var initPaymentBtns = function(){ - - initPaymentPanels(); - - paymentbtns = new Array(); - paymentbtns.push($('cashBtn')); - paymentbtns.push($('cardBtn')); - paymentbtns.push($('chequeBtn')); - paymentbtns.push($('mixBtn')); - paymentbtns.push($('creditBtn')); - paymentbtns = $A(paymentbtns); - - for(var i=0; iPlease wait ....."; - div.style.border = 'solid 2px #333'; - div.style.width = '800px'; - div.style.height = '700px'; - div.style.position = 'absolute'; - div.style.zIndex = '1000'; - div.style.backgroundColor = '#FFF'; - div.style.visibility = 'hidden'; - document.body.appendChild(div); - this.popup = div; - popPanel(this.popup); - }, - - showPopup : function(productId){ - if(this.visible) return; - this.updateCart = (productId != 0); - this.createPopup(productId); - this.visible = true; - }, - - hidePopup : function(){ - hidePanel(this.popup); - if(this.updateCart) - { - updateQty(product_id, $('qty').value); - this.updateCart = false; - } - this.visible = false; - } -}; - - -function resetDetails() -{ - $('product.name').innerHTML = ""; - $('product.barcode').innerHTML = ""; - $('product.taxCategory').innerHTML = ""; - $('product.description').innerHTML = ""; - $('product.stock.qty').innerHTML = ""; - $('product.price.list').innerHTML = ""; - $('product.price.limit').innerHTML = ""; - $('product.price.std').innerHTML = ""; - $('priceLimit').innerHTML = ""; - $('qty').value = ""; - $('incPrice').value = ""; - $('disc').value = ""; - $('totalAmount').value = ""; - $('grandTotal').value = ""; - $('customer.code').innerHTML = ""; - $('customer.name').innerHTML = ""; - $('credit.available').innerHTML = ""; - $('credit.limit').innerHTML = ""; - $('open.balance').innerHTML = ""; - $('barcode').value = ""; - $('productQuery').value = ""; - $('description').value = ""; - - $('customerCode').hide(); - $('customerName').hide(); - $('creditAvailable').hide(); - $('creditLimit').hide(); - $('openBalance').hide(); - $('barcode').focus(); - closeDiscount(); - -} - -function quickDiscount() -{ - isQuickDiscount = true; - isDiscountFormOpen = true; - $('customerContainer').hide(); - $('paymentContainer').hide(); - $('editProductContainer').hide(); - $('quickDiscountDetails').show(); - $('quickDiscountDetails').show(); - $('checkoutContainer').hide(); - $('incPrice').activate(); -} - -function closeDiscount() -{ - isQuickDiscount = false; - isDiscountFormOpen = false; - $('customerContainer').show(); - $('paymentContainer').show(); - $('editProductContainer').show(); - $('quickDiscountDetails').hide(); - $('quickDiscountDetails').hide(); - $('checkoutContainer').show(); - $('barcode').focus(); -} - -function validateDiscount(newPrice, DISC_PERC) -{ - ERROR_MSG = null; - - if((ISDISCOUNTUPTOLIMITPRICE == true) && (OVERRIDE_PRICE_LIMIT == false)) - { - if(newPrice < LIMIT_PRICE) - { - ERROR_MSG = "DISCOUNT AMOUNT EXCEEDED!!!"; - } - if(newPrice > LIST_PRICE) - { - ERROR_MSG = "YOU CANNOT EXCEED THE LIST PRICE!!!" - } - } - - if((ISDISCOUNTUPTOLIMITPRICE == false) && (OVERRIDE_PRICE_LIMIT == true)) - { - if(DISCOUNT_LIMIT > 0) - { - if(DISC_PERC > DISCOUNT_LIMIT) - { - ERROR_MSG = "DISCOUNT LIMIT EXCEEDED!!!"; - } - } - - if(DISC_PERC < 0) - { - ERROR_MSG = "DISCOUNT CANNOT BE NEGATIVE!!!"; - } - - if(DISCOUNT_LIMIT == 0) - { - ERROR_MSG = "CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"; - } - } - - if((ISDISCOUNTUPTOLIMITPRICE == false) && (OVERRIDE_PRICE_LIMIT == false)) - { - if(DISCOUNT_LIMIT > 0) - { - if(DISC_PERC > DISCOUNT_LIMIT) - { - ERROR_MSG = "DISCOUNT LIMIT EXCEEDED!!!"; - } - - if(DISC_PERC < 0) - { - ERROR_MSG = "DISCOUNT CANNOT BE NEGATIVE!!!"; - } - - if(newPrice < LIMIT_PRICE) - { - ERROR_MSG = "CANNOT OVER RIDE LIMIT PRICE!!!"; - } - } - - if(DISCOUNT_LIMIT == 0) - { - ERROR_MSG = "CANNOT APPLY DISCOUNT!!!
    NO DISCOUNT PERCENTAGE SET"; - } - } - - if((ISDISCOUNTUPTOLIMITPRICE == true) && (OVERRIDE_PRICE_LIMIT == true)) - { - $('discountUptoLimitPrice').className = "error"; - $('overridePriceLimit').className = "error"; - ERROR_MSG = "DISCOUNT ERROR!! CANNOT PROCESS YOUR REQUEST!!!" - } - - if(ERROR_MSG == null) - { - $('applyDiscBtn').disabled = false; - } - else - { - $('applyDiscBtn').disabled = true; - } - - $('errorMsg').innerHTML = ERROR_MSG; -} - -function applyDiscount() -{ - var incPrice = $('incPrice').value; - var discPerc = $('disc').value; - var totalAmount = $('totalAmount').value; - - if(incPrice == null || incPrice == "") - { - showErrorMessage('Inc Price cannot be null!', 'incPrice'); - return ; - } - - if(discPerc == null || discPerc == "") - { - showErrorMessage('Discount % cannot be null!', 'disc'); - return ; - } - - if(totalAmount == null || totalAmount == "") - { - showErrorMessage('Total amount cannot be null!', 'totalAmount'); - return ; - } - - var form = $('QuickDiscountForm'); - form.request({ - onComplete: refreshQuickDiscount - }); - -} - -function refreshQuickDiscount(request) -{ - var response = request.responseText; - var result = eval('(' + response + ')'); - - if(result.error) - { - showErrorMessage(result.error, 'barcode'); - closeDiscount(); - } - - if(result.status == "OK") - { - reloadCart(); - closeDiscount(); - } -} - -function trim(stringToTrim) -{ - return stringToTrim.replace(/^\s+|\s+$/g,""); -} - - -function redirect(url) -{ - window.location = url; -} - -function popUp() -{ - var check = $('pop_overlay').style.display; - if(check == 'none' || check == '') - { - $('pop_overlay').style.display = 'block'; - $('pop_container').style.display = 'block'; - } - else - { - $('pop_overlay').style.display = 'none'; - $('pop_container').style.display = 'none'; - } - -} - -Event.observe(window,'load',initScreen,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/paymentTerm.js b/posterita/posterita/web/js/paymentTerm.js deleted file mode 100644 index a2bb1426a7..0000000000 --- a/posterita/posterita/web/js/paymentTerm.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author praveen - */ - - -//scripts for payment term -var netDays = null; -var fixDate = null; -var fixDay = null; -var fixCutOff = null; -var fixOffset = null; - -function initPaymentScreen(){ - fixDate = $FElement('fixedDueDate'); - - netDays = $FElement('netDays'); - fixDay = $FElement('fixedMonthDay'); - fixCutOff = $FElement('fiedMonthCutoff'); - fixOffset = $FElement('fixedMonthOffset'); - - showHideDates(); - fixDate.onclick = showHideDates; - -} - -function showHideDates(){ - if(fixDate.checked){ - netDays.disabled = true; - fixDay.disabled = false; - fixCutOff.disabled = false; - fixOffset.disabled = false; - } - else{ - netDays.disabled = false; - fixDay.disabled = true; - fixCutOff.disabled = true; - fixOffset.disabled = true; - } -} - -//registering event -Event.observe(window,'load',initPaymentScreen,false); diff --git a/posterita/posterita/web/js/pin.js b/posterita/posterita/web/js/pin.js deleted file mode 100644 index 659c28d8e6..0000000000 --- a/posterita/posterita/web/js/pin.js +++ /dev/null @@ -1,175 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author praveen - */ - - -var PINPanel = $('PINPanel'); -var divBack = $('divBack'); -var PIN = $('PIN'); -var closeBtn = $('closeBtn'); - -function checkout() -{ - showPINPanel(); -} - -function focusBarcode() -{ - document.getElementsByName('barCode')[0].focus(); - //toConsole("Setting focus to barcode"); -} - -function initializeComponents() -{ - PINPanel.style.top = '' + (getViewportHeight()- 60)/2 ; - PINPanel.style.left = '' + (getViewportWidth() - 100)/2; - PINPanel.style.display = 'none'; - PINPanel.style.position = 'absolute'; - divBack.style.zIndex = '1000'; - - - //PIN.focus(); - - closeBtn.onblur = function(){ - try - { - PIN.focus(); - } - catch(e) - { - toConsole(e); - } - }; - - divBack.style.position = 'absolute'; - divBack.style.zIndex = '900'; - divBack.style.display = 'none'; - divBack.style.top = '0'; - divBack.style.left = '0'; - divBack.style.width = getViewportWidth(); - divBack.style.height = getViewportHeight(); - - PINPanel.onblur = function(){ - //PIN.focus(); - }; - - PIN.onkeyup = function(e) - { - try - { - var event = e||window.event; - - if(event.keyCode == 13) - { - validatePIN(); - } - } - catch (e) - { - toConsole(e); - } - }; - - toConsole('PIN Panel initialised'); -} - -function enablePIN() -{ - PIN.disabled = false; - closeBtn.style.visibility = 'visible'; -} - -function disablePIN() -{ - PIN.disabled = true; - closeBtn.style.visibility = 'hidden'; -} - -function reportError(request) -{ - alert('Some error occured while communicating with the server. Please try again.') -} - -function PINError(msg) -{ - alert(msg); - hidePINPanel(); - enablePIN(); - PIN.value=''; -} - -function showPINPanel() -{ - PINPanel.style.display = 'block'; - divBack.style.display = 'block'; - PIN.focus(); -} - -function hidePINPanel() -{ - PINPanel.style.display = 'none'; - divBack.style.display = 'none'; -} - -/* -function validatePIN() -{ - var pin = PIN.value; - var url = 'GetPOSPaymentDetailsAction.do'; - var pars = 'action=validateAdvanceOrderPIN&userPIN=' + pin; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: evaluateResponse, - onFailure: reportError - }); - - disablePIN(); -} -*/ - -function evaluateResponse(request) -{ - var scripts = request.responseText; - eval(scripts); -} - - -function getViewportHeight() { - if (window.innerHeight!=window.undefined) return window.innerHeight; - if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight; - if (document.body) return document.body.clientHeight; - return window.undefined; -} - -function getViewportWidth() { - if (window.innerWidth!=window.undefined) return window.innerWidth; - if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth; - if (document.body) return document.body.clientWidth; - return window.undefined; -} - -//initialising -Event.observe(window,'load',initializeComponents,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/pos.js b/posterita/posterita/web/js/pos.js deleted file mode 100644 index e4b645f5a3..0000000000 --- a/posterita/posterita/web/js/pos.js +++ /dev/null @@ -1,644 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author praveen - */ - - -var MAXIMUM_WAITING_TIME = 10000; -//var TROTTLE_PERIOD = 1000; -var TROTTLE_TIME = 0.5; -var ENABLE_LOGGING = true; -var ENABLE_VIRTUAL_KEYBOARD = true; - - -//The maps stores key-action mappings -var keyMap = new Array(); - -function addKey(key,action) -{ - keyMap[key] = action; -} - -function getAction(key) -{ - if(keyMap[key]) - { - eval(keyMap[key]); - - return false; - } - - return true; -} - -//capture shortcut keys -function captureKey(e) -{ - var evtobj=window.event? event : e; //distinguish between IE's explicit event object (window.event) and Firefox's implicit. - var unicode=evtobj.charCode? evtobj.charCode : evtobj.keyCode; - - var msg = ""; - - if(evtobj['ctrlKey']) - msg = msg + "CTRL-"; - - if(evtobj['altKey']) - msg = msg + "ALT-"; - - if(evtobj['shiftKey']) - msg = msg + "SHIFT "; - - - var key = unicode; - - key = String.fromCharCode(unicode); - msg = msg + key; - msg = msg.toUpperCase(); - - //perform the action associated with that key - return getAction(msg); - -} - -function hideResult() -{ - displayResult(""); -} - -function printDocument() -{ - var w = window.open("","POS Order","width=800"); - var d = w.document; - - var printDiv = document.getElementById("printDiv"); - - d.write(""); - d.write(" "); - d.write(""); - d.write(printDiv.innerHTML); - d.write(""); - d.close(); -} - -function enableDelete() -{ - var btn = document.getElementsByName("deleteBtn"); - - btn[0].disabled = enableButton(); -} - -function enableButton() -{ - /* - var chk = document.getElementsByName("posOrderLineIds"); - for(i=0;i "+msg); - - //console.appendChild(text); - //document.body.appendChild(console); - } - catch(e) - { - alert(e); - } - -} - -function $focus(element) -{ - var el = document.getElementsByName(element); - - if(el) - { - el[0].focus(); - toConsole('Setting focus to :' + element); - } - else - { - toConsole('Unable to set focus to :' + element); - } - -} - -function $FElement(element) -{ - var el = document.getElementsByName(element)[0]; - return el; - -} - -function focusBarcode() -{ - $FElement('barCode').focus(); - toConsole("Setting focus to barcode"); -} - -function openCashDrawer() -{ - var url = 'CompletePOSOrderAction.do'; - var param = 'action=openCashDrawer'; - - var success = function(request){alert('Opening drawer!');}; - var failure = function(request){alert('Oop some problem occured while communicating with server!');}; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: param, - onSuccess: success, - onFailure: failure - }); -} - -function fullScreen(theURL) -{ - window.open(theURL, '', 'fullscreen=yes, scrollbars=auto'); -} - -function disableButtons() -{ - try - { - var elements = document.getElementsByTagName('input'); - - for(var i = 0; i < elements.length; i++) - { - if(elements[i].name != 'action') - { - elements[i].disabled = true; - elements[i].style.cursor = 'wait'; - } - } - - toConsole('Disable ' + elements.length + ' buttons'); - - return true; - - } - catch(e) - { - toConsole(e); - } -} - - -function initDisableButtons() -{ - toConsole('initDisableButtons'); - - var elements = document.getElementsByTagName('input'); - - for(var i = 0; i < elements.length; i++) - { - var type = elements[i].type; - - if(type == 'button') - { - var button = elements[i]; - var accessKey = button.accessKey; - - if(accessKey == 'c') - { - //button.onclick = disableButtons; - var action = button.onclick; - button.onclick = function(e){ - - }; - - toConsole('Found 1 button with accesskey: C'); - } - } - } -} - -function setNumericInputMask(e) -{ - var evtobj = window.event? event : e; //distinguish between IE's explicit event object (window.event) and Firefox's implicit. - var unicode = evtobj.charCode? evtobj.charCode : evtobj.keyCode; - - var validKeys = [8,9,13,20,27,37,38,39,40,45,46,48,49,50,51,52,53,54,55,56,57]; - - for(var i = 0; i < validKeys.length; i++) - { - if(validKeys[i] == unicode) - { - return true; - } - } - - alert('Accepts numeric values only'); - return false; - -} - -function showDocumentPDF(id) -{ - window.open('ViewDocumentPDFAction.do?action=viewOrderDocumentPDF&documentId=' + id, '_blank', 'width=800, height=600, status=no, toolbar=no, location=no, resizable=yes'); -} - -function showInventoryPDF(id) -{ - window.open('ViewInventoryPDFAction.do?action=viewInventoryDocumentPDF&inventoryId=' + id, '_blank', 'width=800, height=600, status=no, toolbar=no, location=no, resizable=yes'); -} - -function showInvoiceDocumentPDF(id) -{ - window.open('ViewDocumentPDFAction.do?action=viewInvoiceDocumentPDF&documentId=' + id, '_blank', 'width=800, height=600, status=no, toolbar=no, location=no, resizable=yes'); -} - -function showShipmentDocumentPDF(id) -{ - window.open('ViewDocumentPDFAction.do?action=viewShipmentDocumentPDF&documentId=' + id, '_blank', 'width=800, height=600, status=no, toolbar=no, location=no, resizable=yes'); -} - -function showPaymentDocumentPDF(id) -{ - window.open('ViewDocumentPDFAction.do?action=viewPaymentDocumentPDF&documentId=' + id, '_blank', 'width=800, height=600, status=no, toolbar=no, location=no, resizable=yes'); -} - - - -function enableVirtualKeyboard() -{ - if(!ENABLE_VIRTUAL_KEYBOARD) - { - return; - } - - var textfields = document.getElementsByTagName('input'); - - for(var i=0; i= 0) - { - cashInput.value = newValue; - cardInput.previousAmount = newValue; - - } - else - { - var max = cashInput.initialAmount - chequeInput.value; - alert('Card Amount should not exceed ' + max); - - cardInput.value = 0.0; - - newValue = new Number(cashInput.initialAmount - cardInput.value - chequeInput.value).toFixed(2); - cashInput.value = newValue; - } - } - catch(e) - { - toConsole(e); - } - - } - - chequeInput.onkeyup = function() - { - try - { - var newValue = new Number(cashInput.initialAmount - cardInput.value - chequeInput.value).toFixed(2); - - if(newValue >= 0) - { - cashInput.value = newValue; - chequeInput.previousAmount = newValue; - - } - else - { - var max = cashInput.initialAmount - cardInput.value; - alert('Cheque Amount should not exceed ' + max); - - chequeInput.value = 0.0; - - newValue = new Number(cashInput.initialAmount - cardInput.value - chequeInput.value).toFixed(2); - cashInput.value = newValue; - } - } - catch(e) - { - toConsole(e); - } - } - - return false; -} - -function showCheque() -{ - show("chequeNoLabel");show("chequeNoTxt"); - - hide("cashLabel");hide("cashTxt"); - hide("cardLabel");hide("cardTxt"); - hide("cardNoLabel");hide("cardNoTxt"); - hide("chequeLabel");hide("chequeTxt"); - - setTrxType("Cheque"); - - var chequeTf = document.getElementsByName('chequeNo')[0]; - - chequeTf.focus(); - - return false; -} - -function showCard() -{ - show("cardNoLabel");show("cardNoTxt"); - - hide("cashLabel");hide("cashTxt"); - hide("cardLabel");hide("cardTxt"); - hide("chequeLabel");hide("chequeTxt"); - hide("chequeNoLabel");hide("chequeNoTxt"); - - setTrxType("Card"); - - var cardTf = document.getElementsByName('creditCardNumber')[0]; - - cardTf.focus(); - - return false; -} - -function showCash() -{ - hide('cashLabel');hide('cashTxt'); - hide('cardLabel');hide('cardTxt'); - hide('cardNoLabel');hide('cardNoTxt'); - hide('chequeLabel');hide('chequeTxt'); - hide('chequeNoLabel');hide('chequeNoTxt'); - - setTrxType("Cash"); - - return false; -} - -function setTrxType(type) -{ - document.forms[0].trxType.value = type; -} - - - -//adding behaviour to discount&actual price textfields -var price = document.getElementsByName('price'); -var discount = document.getElementsByName('discountPercent'); -var actualPrice = document.getElementsByName('actualPrice'); - -/* -var totalDiscount = $('totalDiscount'); -var totalPrice = $('totalPrice'); - -totalPrice.initialAmount = 0; -for(var i=0;i discountAllowed) - { - var errormsg = 'You are authorised to give ' + discountAllowed + '% discount only!'; - - this.className = 'text medium error'; - this.title = errormsg; - - totalDiscount.className = 'text medium error'; - totalDiscount.title = errormsg; - - //alert(errormsg); - } - else - { - var className = 'text medium'; - - - this.className = className; - this.title = ''; - - totalDiscount.className = className; - totalDiscount.title = ''; - } -}; - -totalDiscount.onkeyup = function() -{ - var newprice = ((100-this.value)*totalPrice.initialAmount)/100; - newprice = new Number(newprice).toFixed(2); //rounding calculate price - totalPrice.value = newprice; - - if(this.value > discountAllowed) - { - var errormsg = 'You are authorised to give ' + discountAllowed + '% discount only!'; - - this.className = 'text medium error'; - this.title = errormsg; - - totalPrice.className = 'text medium error'; - totalPrice.title = errormsg; - - //alert(errormsg); - } - else - { - var className = 'text medium'; - - this.className = className; - this.title = ''; - - totalPrice.className = className; - totalPrice.title = ''; - } -}; -*/ - -for(var i=0;i discountAllowed) - { - var errormsg = 'You are authorised to give ' + discountAllowed + '% discount only!'; - - this.className = 'text medium error'; - this.title = errormsg; - - actualPrice[index].className = 'text medium error'; - actualPrice[index].title = errormsg; - - //alert(errormsg); - } - else if(this.value < 0) - { - var errormsg = 'Discount cannot be negative!'; - - this.className = 'text medium error'; - this.title = errormsg; - - actualPrice[index].className = 'text medium error'; - actualPrice[index].title = errormsg; - - //alert(errormsg); - } - else - { - var className = 'text medium'; - - this.className = className; - this.title = ''; - - actualPrice[index].className = className; - actualPrice[index].title = ''; - } - - } - - element = actualPrice[i]; - element.position = i; //adding attribute position - - element.onkeypress = setNumericInputMask; - element.onkeyup = function(e) - { - var index = this.position; - - var calculateDiscount = 100-((this.value*100)/price[index].value); - calculateDiscount = new Number(calculateDiscount).toFixed(2); //rounding calculate discount - - discount[index].value = calculateDiscount; - updateTotal(); - - if(calculateDiscount > discountAllowed) - { - var errormsg = 'You are authorised to give ' + discountAllowed + '% discount only!'; - - this.className = 'text medium error'; - this.title = errormsg; - - discount[index].className = 'text medium error'; - discount[index].title = errormsg; - - //alert(errormsg); - } - else if(calculateDiscount < 0) - { - var errormsg = 'Discount cannot be negative!'; - - this.className = 'text medium error'; - this.title = errormsg; - - discount[index].className = 'text medium error'; - discount[index].title = errormsg; - - //alert(errormsg); - } - else - { - var className = 'text medium'; - - - this.className = className; - this.title = ''; - - discount[index].className = className; - discount[index].title = ''; - } - } - -} - -function updateTotal() -{ - init(); - - var cardInput = document.getElementsByName('paymentByCard')[0].value=""; - var chequeInput = document.getElementsByName('paymentByChq')[0].value=""; -} - -function init() -{ - var total = 0; - - for(var i=0;i discountAllowed) - { - actualPrice[i].className = 'error medium'; - actualPrice[i].title = errormsg; - - discount[i].className = 'error medium'; - discount[i].title = errormsg; - } - else if(discount[i].value < 0) - { - actualPrice[i].className = 'error medium'; - actualPrice[i].title = errormsg2; - - discount[i].className = 'error medium'; - discount[i].title = errormsg2; - } - else - { - actualPrice[i].className = 'text medium'; - actualPrice[i].title = ""; - - discount[i].className = 'text medium'; - discount[i].title = ""; - } - } - - if(discountTotal.value > discountAllowed) - { - grandTotal.className = 'error medium'; - grandTotal.title = errormsg; - - discountTotal.className = 'error medium'; - discountTotal.title = errormsg; - } - else if(discountTotal.value < 0) - { - grandTotal.className = 'error medium'; - grandTotal.title = errormsg2; - - discountTotal.className = 'error medium'; - discountTotal.title = errormsg2; - } - else - { - grandTotal.className = 'text medium'; - grandTotal.title = ""; - - discountTotal.className = 'text medium'; - discountTotal.title = ""; - } - - -} - - -var discountTotal = null; -var grandTotal = null; -var priceTotal = null; - -var discountAllowed = ; -var errorCount = 0; - - - - - diff --git a/posterita/posterita/web/js/product.js b/posterita/posterita/web/js/product.js deleted file mode 100644 index f12752d2de..0000000000 --- a/posterita/posterita/web/js/product.js +++ /dev/null @@ -1,316 +0,0 @@ -//autocomplete for revenue recognition -copyValueInto('revenueRecognition','revenue_recognition'); -new Ajax.Autocompleter('revenue_recognition','revenue_recognitionDiv','SearchPOSGarmentAttributes.do',{ - paramName:'revenue_recognition', - frequency:TROTTLE_TIME, - afterUpdateElement:function(e1,e2){ - $('revenue_recognition').value = e1.value; - } - }); - - -function $FF(elementName) -{ - return document.getElementsByName(elementName)[0]; -} - -function copyValueInto(e1,e2) -{ - toConsole("Copying " + e1 + " into " + e2); - - try - { - $FF(e2).value = $FF(e1).value; - } - catch(e) - { - toConsole("Copying failed!"); - toConsole(e); - } - - -} - -function setValues(form) -{ - try - { - toConsole('Going to submit form'); - copyValueInto('revenue_recognition','revenueRecognition'); - - form.submit(); - } - catch(e) - { - toConsole("Submit failed!"); - toConsole(e); - - toConsole(form); - } -} - -//------------------------------------------------------ -// Validation of barcode & product name using AJAX -//------------------------------------------------------ -function validateBarcode() -{ - if($FF('barCode').initialValue == $FF('barCode').value) return; - - var barcode = $FF('barCode').value; - - var url = 'ValidatePOSProductAction.do'; - var pars = 'action=validateProductBarcode&barCode=' + barcode; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: doesBarcodeExists, - onFailure: reportError - }); -} - -function validateProductName() -{ - if($FF('productName').initialValue == $FF('productName').value) return; - - var productName = $FF('productName').value; - var url = 'ValidatePOSProductAction.do'; - var pars = 'action=validateProductName&productName=' + productName; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: doesProductExists, - onFailure: reportError - }); -} - -function doesBarcodeExists(request) -{ - try - { - var response = request.responseText; - - if(response == 'true') - { - Element.show('barcodeError'); - $FF('barCode').className = 'error'; - } - else - { - Element.hide('barcodeError'); - $FF('barCode').className = 'text'; - } - - } - catch(e) - { - toConsole(e); - } -} - -function doesProductExists(request) -{ - try - { - var response = request.responseText; - - if(response == 'true') - { - Element.show('productError'); - $FF('productName').className = 'error'; - } - else - { - Element.hide('productError'); - $FF('productName').className = 'text'; - } - - } - catch(e) - { - toConsole(e); - } -} - -function reportError(request) -{ - alert('Some error occured while communicating with the server. Please try again.'); -} - -//------------------------------------------------------ -var barcode = $FF('barCode'); -var productName = $FF('productName'); -var taxCategory = $FF('taxCategoryId'); - -var purchasePriceStandard = $FF('purchasePriceStandard'); -var salesPriceStandard = $FF('salesPriceStandard'); -var salesPriceList = $FF('salesPriceList'); -var salesPriceLimit = $FF('salesPriceLimit'); - -var purchasePriceStandardTax = $FF('purchasePriceStandardTax'); -var salesPriceStandardTax = $FF('salesPriceStandardTax'); -var salesPriceListTax = $FF('salesPriceListTax'); -var salesPriceLimitTax = $FF('salesPriceLimitTax'); - -/** - * Calculates price including tax - * @param price without tax - * @return price with tax - */ -function getPriceIncludingTax(price) -{ - var tax = getTax(); - var priceWithoutTax = price || 0; - var priceWithTax = ((100+tax)/100)*priceWithoutTax; - - priceWithTax = new Number(priceWithTax).toFixed(2); - - return priceWithTax; - -}//getPriceIncludingTax(price) - -/** - * Calculates price excluding tax - * @param price with tax - * @return price without tax - */ -function getPriceExcludingTax(price) -{ - var tax = getTax(); - var priceWithTax = price || 0; - var priceWithoutTax = (100*priceWithTax)/(100+tax); - - priceWithoutTax = new Number(priceWithoutTax).toFixed(2); - - return priceWithoutTax; - -}//getPriceExcludingTax(price) - -/** - * Gets the current tax - */ -function getTax() -{ - var select = taxCategory; - var index = select.selectedIndex; - - if(index == -1) index = 0; - - var option = select.options[select.selectedIndex]; - var v = option.label || option.text; - - var s = v.split('%'); - - if(s.length < 2) return 0; - - var tax = parseFloat(s[1]); - - return tax; - -}//getTax() - -/* -function setPriceIncludingTax() -{ - purchasePriceStandardTax.value = getPriceIncludingTax(purchasePriceStandard.value); - salesPriceLimitTax.value = getPriceIncludingTax(salesPriceLimit.value); - salesPriceListTax.value = getPriceIncludingTax(salesPriceList.value); - salesPriceStandardTax.value = getPriceIncludingTax(salesPriceStandard.value); - -}//setPriceIncludingTax() - -//-------------------------------------------------------------------------- -// Initialising components & adding behaviour -//-------------------------------------------------------------------------- - -//update all prices -taxCategory.onchange = setPriceIncludingTax; - - -purchasePriceStandard.onkeyup = function(e){ - purchasePriceStandardTax.value = getPriceIncludingTax(this.value); -}; -purchasePriceStandardTax.onkeyup = function(e){ - purchasePriceStandard.value = getPriceExcludingTax(this.value); -}; - -salesPriceLimit.onkeyup = function(e){ - salesPriceLimitTax.value = getPriceIncludingTax(this.value); -}; -salesPriceLimitTax.onkeyup = function(e){ - salesPriceLimit.value = getPriceExcludingTax(this.value); -}; - -salesPriceStandard.onkeyup = function(e){ - salesPriceStandardTax.value = getPriceIncludingTax(this.value); -}; -salesPriceStandardTax.onkeyup = function(e){ - salesPriceStandard.value = getPriceExcludingTax(this.value); -}; - -salesPriceList.onkeyup = function(e){ - salesPriceListTax.value = getPriceIncludingTax(this.value); - - //overwrite the other prices - salesPriceLimit.value = this.value; - salesPriceStandard.value = this.value; - salesPriceLimitTax.value = getPriceIncludingTax(this.value); - salesPriceStandardTax.value = getPriceIncludingTax(this.value); -}; - -salesPriceListTax.onkeyup = function(e){ - salesPriceList.value = getPriceExcludingTax(this.value) ; -}; - -barcode.onblur = validateBarcode; -barcode.initialValue = barcode.value; -barcode.onkeyup = function(e) -{ - try - { - if(this.initialValue == this.value) return; - - var event = e || window.event; - - if(event.keyCode == 13) - { - toConsole('validating barcode'); - validateBarcode(); - } - } - catch (e) - { - toConsole(e); - } -}; - -productName.onblur = validateProductName; -productName.initialValue = productName.value; -productName.onkeyup = function(e) -{ - try - { - if(this.initialValue == this.value) return; - - var event = e || window.event; - - if(event.keyCode == 13) - { - toConsole('validating product name'); - validateProductName(); - } - } - catch (e) - { - toConsole(e); - } -}; - -$('barcodeError').style.display = 'none'; -$('productError').style.display = 'none'; - -setPriceIncludingTax(); -*/ \ No newline at end of file diff --git a/posterita/posterita/web/js/product2.js b/posterita/posterita/web/js/product2.js deleted file mode 100644 index 5eeff0b148..0000000000 --- a/posterita/posterita/web/js/product2.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author praveen - */ - - -//------------------------------------------------------ -var taxCategory = $FF('taxCategoryId'); - -var purchasePriceStandard = $FF('purchasePriceStandard'); -var salesPriceStandard = $FF('salesPriceStandard'); -var salesPriceList = $FF('salesPriceList'); -var salesPriceLimit = $FF('salesPriceLimit'); - -var purchasePriceStandardTax = $FF('purchasePriceStandardTax'); -var salesPriceStandardTax = $FF('salesPriceStandardTax'); -var salesPriceListTax = $FF('salesPriceListTax'); -var salesPriceLimitTax = $FF('salesPriceLimitTax'); - -/** - * Calculates price including tax - * @param price without tax - * @return price with tax - */ -function getPriceIncludingTax(price) -{ - var tax = getTax(); - var priceWithoutTax = price || 0; - var priceWithTax = ((100+tax)/100)*priceWithoutTax; - - priceWithTax = new Number(priceWithTax).toFixed(2); - - return priceWithTax; - -}//getPriceIncludingTax(price) - -/** - * Calculates price excluding tax - * @param price with tax - * @return price without tax - */ -function getPriceExcludingTax(price) -{ - var tax = getTax(); - var priceWithTax = price || 0; - var priceWithoutTax = (100*priceWithTax)/(100+tax); - - priceWithoutTax = new Number(priceWithoutTax).toFixed(2); - - return priceWithoutTax; - -}//getPriceExcludingTax(price) - -/** - * Gets the current tax - */ -function getTax() -{ - var select = taxCategory; - var index = select.selectedIndex; - - if(index == -1) index = 0; - - var option = select.options[select.selectedIndex]; - var v = option.label || option.text; - - var s = v.split('%'); - - if(s.length < 2) return 0; - - var tax = parseFloat(s[1]); - - return tax; - -}//getTax() - -function setPriceIncludingTax() -{ - purchasePriceStandardTax.value = getPriceIncludingTax(purchasePriceStandard.value); - salesPriceLimitTax.value = getPriceIncludingTax(salesPriceLimit.value); - salesPriceListTax.value = getPriceIncludingTax(salesPriceList.value); - salesPriceStandardTax.value = getPriceIncludingTax(salesPriceStandard.value); - -}//setPriceIncludingTax() - -//-------------------------------------------------------------------------- -// Initialising components & adding behaviour -//-------------------------------------------------------------------------- - -//update all prices -taxCategory.onchange = setPriceIncludingTax; - -purchasePriceStandard.onkeyup = function(e){ - purchasePriceStandardTax.value = getPriceIncludingTax(this.value); -}; -purchasePriceStandardTax.onkeyup = function(e){ - purchasePriceStandard.value = getPriceExcludingTax(this.value); -}; - -salesPriceLimit.onkeyup = function(e){ - salesPriceLimitTax.value = getPriceIncludingTax(this.value); -}; -salesPriceLimitTax.onkeyup = function(e){ - salesPriceLimit.value = getPriceExcludingTax(this.value); -}; - -salesPriceStandard.onkeyup = function(e){ - salesPriceStandardTax.value = getPriceIncludingTax(this.value); -}; -salesPriceStandardTax.onkeyup = function(e){ - salesPriceStandard.value = getPriceExcludingTax(this.value); -}; - -salesPriceList.onkeyup = function(e){ - salesPriceListTax.value = getPriceIncludingTax(this.value); - - //overwrite the other prices - salesPriceLimit.value = this.value; - salesPriceStandard.value = this.value; - salesPriceLimitTax.value = getPriceIncludingTax(this.value); - salesPriceStandardTax.value = getPriceIncludingTax(this.value); -}; - -salesPriceListTax.onkeyup = function(e){ - salesPriceList.value = getPriceExcludingTax(this.value) ; -}; - -setPriceIncludingTax(); \ No newline at end of file diff --git a/posterita/posterita/web/js/productTax.js b/posterita/posterita/web/js/productTax.js deleted file mode 100644 index 7f1c4a90a3..0000000000 --- a/posterita/posterita/web/js/productTax.js +++ /dev/null @@ -1,131 +0,0 @@ -// script for calculating excl and incl prices for Posterita products - -var taxRateFactor = 1.0; - -var updateTax = function(e) -{ - var taxCategoryId = document.forms[0].taxCategoryId.value; - var url = "TaxAction.do"; - var pars = "action=getTaxRate&taxCategoryId="+ taxCategoryId; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: setTaxRate, - onFailure: reportError - }); -}; - -var setTaxRate = function(request) -{ - try - { - var response = request.responseText; - var taxRate = parseFloat(response); - taxRateFactor = new Number((taxRate/100)+1).toFixed(2); - loadPriceListBehaviour(); - } - catch(e) - {} -}; - -function reportError(request) -{ - alert("Some error has occured while communicating with the server"); -} - -var loadPriceListBehaviour = function(){ - - var rows = new Array(); - var count = 1; - - while(true) - { - var row = $('row' + count); - if(row == null) break; - - rows.push(row); - count ++; - } - - for(var i=0; i 2 && inputs.length <= 6) - { - listPrice = inputs[2]; - listPriceIncl = inputs[3]; - limitPrice = inputs[4]; - limitPriceIncl = inputs[5]; - - listPrice.tr = tr; - listPriceIncl.tr = tr; - limitPrice.tr = tr; - limitPriceIncl.tr = tr; - - tr.listPrice = listPrice; - tr.listPriceIncl = listPriceIncl; - tr.limitPrice = limitPrice; - tr.limitPriceIncl = limitPriceIncl; - - tr.listPriceIncl.value = calculatePrice(listPrice.value, false); - tr.limitPriceIncl.value = calculatePrice(limitPrice.value, false); - - listPrice.onkeyup = function(){ - this.tr.listPriceIncl.value = calculatePrice(this.value, false); - }; - - listPriceIncl.onkeyup = function(){ - this.tr.listPrice.value = calculatePrice(this.value, true); - }; - - limitPrice.onkeyup = function(){ - this.tr.limitPriceIncl.value = calculatePrice(this.value, false); - }; - - limitPriceIncl.onkeyup = function(){ - this.tr.limitPrice.value = calculatePrice(this.value, true); - }; - } - } -}; - -var calculatePrice = function(value, isTaxIncluded) -{ - if (isTaxIncluded) - { - return new Number(value / taxRateFactor).toFixed(2); - } - else - { - return new Number(value * taxRateFactor).toFixed(2); - } -}; - -Event.observe(window, 'load', updateTax, false); \ No newline at end of file diff --git a/posterita/posterita/web/js/shoppingCart.js b/posterita/posterita/web/js/shoppingCart.js deleted file mode 100644 index c0bdac0b9f..0000000000 --- a/posterita/posterita/web/js/shoppingCart.js +++ /dev/null @@ -1,505 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author praveen - */ - -//----------------------------------FUNCTION DECLARATIONS--------------------------------------------- -//scrolls to the bottom of the cart -function scrollDownCart() -{ - if($('shoppingCart')) - { - $('shoppingCart').scrollTop = $('shoppingCart').scrollHeight; - } -} - - -//adding product to cart -function addToCart(barcode) -{ - cartIndex = null; - done = false; - if(barcode == null) return; - if(barcode == '') return; - - try - { - - var url = 'AddToPOSShoppingCartAction.do'; - var pars = 'action=addProduct&barCode='+barcode+ '&orderType=' + orderType + '&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - - } - catch(e) - { - toConsole(e); - } -} - -//incrementing, decrementing and deleting the shopping cart items using ajax -// 1.Increment the qty for the product -function incrementCart(productId) -{ - if(productId == null) return; - - try - { - - var url = 'AddToPOSShoppingCartAction.do'; - var pars = 'action=incrementQty&productId='+productId+ '&ifAdd=true'+ '&orderType=' + orderType + '&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } - -} - -//2.Decrement the qty for the product -function decrementCart(productId) -{ - if(productId == null) return; - - try - { - - - var url = 'AddToPOSShoppingCartAction.do'; - var pars = 'action=decrementQty&productId='+productId+ '&ifAdd=false'+ '&orderType=' + orderType + '&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } -} - -//3.Delete all the products with the ID from the cart -function deleteItemFromCart(productId) -{ - if(productId == null) return; - - cartIndex = null; - updateQty(productId, '0'); -} - -//Refreshs the content of the shopping cart -function refreshShoppingCart(request) -{ - try - { - //var top = $('items').scrollTop; - var response = request.responseText; - $('shoppingCart').innerHTML = response; - $('total').innerHTML = $('cartTotal').innerHTML; - closeDiscount(); - scrollDownCart(); - response.evalScripts(); //display error messages - } - catch(e) - { - showErrorMessage('Failed to resfresh cart! Cause:' + e); - } - - addBehaviourToCart(); -} - -//Reports an error -function reportShoppingCartError(request) -{ - alert('Some error occured while communicating with the server. Please try again.'); - alert(request.responseText); - var win = window.open(); - win.document.write(request.responseText); - win.document.close(); -} - -//addRequiredLibrary('js/test.js'); -var requestIndicator; - -/* -var ShoppingCart = { - - init : function(){ - //this.indicator = new AJAXIndicator('Please wait...'); - alert('Shopping Cart'); - }, - - indicator : null -}; -*/ - -function checkout() -{ - //do normal submit - $('checkoutForm').submit(); -/* - var pars = Form.serialize('checkoutForm'); - var url = 'CheckoutAction.do'; - - try - { - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: handleCheckout, - onFailure: reportShoppingCartError - }); - } - catch(e) - { - toConsole(e); - } -*/ -} - -//Update the qty for the product -function updateQty(productId, quantity) -{ - if(productId == null) return; - - if (quantity == "") - { - return; - } - - if(quantity < 0) - { - showErrorMessage('Quantity cannot be negative!', 'qty'); - $('qty').value = ""; - return; - } - - var amount = parseFloat(quantity); - - if (isNaN(amount)) - { - showErrorMessage('Invalid quantity! ' + quantity, 'qty'); - $('qty').value = ""; - return; - } - - try - { - var url = 'AddToPOSShoppingCartAction.do'; - var pars = 'action=updateQty&productId=' + productId + '&ifAdd=false'+ '&orderType=' + orderType + '&priceListId='+priceList +'&quantity=' + quantity; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } - -} - -//Reload shopping cart -function reloadCart() -{ - try - { - var url = 'AddToPOSShoppingCartAction.do'; - var pars = 'action=reloadCart&orderType=posOrder'; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } - -} - - -function clearCart() -{ - maxRows = 0; - excessRows = 0; - resetDetails(); - - try - { - var url = 'CheckoutAction.do'; - var pars = 'action=clearCart' + '&orderType=' + orderType; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - } - catch(e) - { - toConsole(e); - } - -} - -function handleCheckout(request) -{ - var response = request.responseText; - var result = eval('(' + response + ')'); - - if(result.error) - { - showErrorMessage(result.error); - } - else - { - printOrder(result.orderID); - reloadCart(); - } -} - - -function addBehaviourToCart() -{ - var rows = new Array(); - var count = 1; - var grandTotal = 0; - var totalPriceLimit = 0; - var totalPriceList = 0; - - while(true) - { - var row = $('row' + count); - if(row == null) break; - - rows.push(row); - count ++; - } - - for(var i=0; i 0) - { - var line = cartLines[cartIndex]; - simulateOnClick(line); - - } - - if(cartLines.length > maxRows) - { - var shoppingCart = $('shoppingCart'); - shoppingCart.scrollTop = shoppingCart.scrollHeight; - } - -} - -//Reload the shopping cart. Prices are calculated for the pricelist -function setShoppingCartPriceList() -{ - try - { - var url = 'AddToPOSShoppingCartAction.do'; - var pars = 'action=updatePriceList&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } -} - -function scrollCart() -{ - var shoppingCart = $('shoppingCart'); - - if(cartIndex > maxRows) - { - shoppingCart.scrollTop = shoppingCart.scrollHeight; - } - else - { - shoppingCart.scrollTop = 0; - } -} - - -//Event.observe(window,'load',init,false); -//--------------------------------------------------------------------------------------- -//calling methods \ No newline at end of file diff --git a/posterita/posterita/web/js/shortcut.js b/posterita/posterita/web/js/shortcut.js deleted file mode 100644 index 460a17b96b..0000000000 --- a/posterita/posterita/web/js/shortcut.js +++ /dev/null @@ -1,223 +0,0 @@ -/** - * http://www.openjs.com/scripts/events/keyboard_shortcuts/ - * Version : 2.01.A - * By Binny V A - * License : BSD - */ -shortcut = { - 'all_shortcuts':{},//All the shortcuts are stored in this array - 'add': function(shortcut_combination,callback,opt) { - //Provide a set of default options - var default_options = { - 'type':'keydown', - 'propagate':false, - 'disable_in_input':false, - 'target':document, - 'keycode':false - } - if(!opt) opt = default_options; - else { - for(var dfo in default_options) { - if(typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo]; - } - } - - var ele = opt.target - if(typeof opt.target == 'string') ele = document.getElementById(opt.target); - var ths = this; - shortcut_combination = shortcut_combination.toLowerCase(); - - //The function to be called at keypress - var func = function(e) { - e = e || window.event; - - if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields - var element; - if(e.target) element=e.target; - else if(e.srcElement) element=e.srcElement; - if(element.nodeType==3) element=element.parentNode; - - if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return; - } - - //Find Which key is pressed - if (e.keyCode) code = e.keyCode; - else if (e.which) code = e.which; - var character = String.fromCharCode(code).toLowerCase(); - - if(code == 188) character=","; //If the user presses , when the type is onkeydown - if(code == 190) character="."; //If the user presses , when the type is onkeydown - - var keys = shortcut_combination.split("+"); - //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked - var kp = 0; - - //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken - var shift_nums = { - "`":"~", - "1":"!", - "2":"@", - "3":"#", - "4":"$", - "5":"%", - "6":"^", - "7":"&", - "8":"*", - "9":"(", - "0":")", - "-":"_", - "=":"+", - ";":":", - "'":"\"", - ",":"<", - ".":">", - "/":"?", - "\\":"|" - } - //Special Keys - and their codes - var special_keys = { - 'esc':27, - 'escape':27, - 'tab':9, - 'space':32, - 'return':13, - 'enter':13, - 'backspace':8, - - 'scrolllock':145, - 'scroll_lock':145, - 'scroll':145, - 'capslock':20, - 'caps_lock':20, - 'caps':20, - 'numlock':144, - 'num_lock':144, - 'num':144, - - 'pause':19, - 'break':19, - - 'insert':45, - 'home':36, - 'delete':46, - 'end':35, - - 'pageup':33, - 'page_up':33, - 'pu':33, - - 'pagedown':34, - 'page_down':34, - 'pd':34, - - 'left':37, - 'up':38, - 'right':39, - 'down':40, - - 'f1':112, - 'f2':113, - 'f3':114, - 'f4':115, - 'f5':116, - 'f6':117, - 'f7':118, - 'f8':119, - 'f9':120, - 'f10':121, - 'f11':122, - 'f12':123 - } - - var modifiers = { - shift: { wanted:false, pressed:false}, - ctrl : { wanted:false, pressed:false}, - alt : { wanted:false, pressed:false}, - meta : { wanted:false, pressed:false} //Meta is Mac specific - }; - - if(e.ctrlKey) modifiers.ctrl.pressed = true; - if(e.shiftKey) modifiers.shift.pressed = true; - if(e.altKey) modifiers.alt.pressed = true; - if(e.metaKey) modifiers.meta.pressed = true; - - for(var i=0; k=keys[i],i 1) { //If it is a special key - if(special_keys[k] == code) kp++; - - } else if(opt['keycode']) { - if(opt['keycode'] == code) kp++; - - } else { //The special keys did not match - if(character == k) kp++; - else { - if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase - character = shift_nums[character]; - if(character == k) kp++; - } - } - } - } - - if(kp == keys.length && - modifiers.ctrl.pressed == modifiers.ctrl.wanted && - modifiers.shift.pressed == modifiers.shift.wanted && - modifiers.alt.pressed == modifiers.alt.wanted && - modifiers.meta.pressed == modifiers.meta.wanted) { - callback(e); - - if(!opt['propagate']) { //Stop the event - //e.cancelBubble is supported by IE - this will kill the bubbling process. - e.cancelBubble = true; - e.returnValue = false; - - //e.stopPropagation works in Firefox. - if (e.stopPropagation) { - e.stopPropagation(); - e.preventDefault(); - } - return false; - } - } - } - this.all_shortcuts[shortcut_combination] = { - 'callback':func, - 'target':ele, - 'event': opt['type'] - }; - //Attach the function with the event - if(ele.addEventListener) ele.addEventListener(opt['type'], func, false); - else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func); - else ele['on'+opt['type']] = func; - }, - - //Remove the shortcut - just specify the shortcut and I will remove the binding - 'remove':function(shortcut_combination) { - shortcut_combination = shortcut_combination.toLowerCase(); - var binding = this.all_shortcuts[shortcut_combination]; - delete(this.all_shortcuts[shortcut_combination]) - if(!binding) return; - var type = binding['event']; - var ele = binding['target']; - var callback = binding['callback']; - - if(ele.detachEvent) ele.detachEvent('on'+type, callback); - else if(ele.removeEventListener) ele.removeEventListener(type, callback, false); - else ele['on'+type] = false; - } -} \ No newline at end of file diff --git a/posterita/posterita/web/js/stockCart.js b/posterita/posterita/web/js/stockCart.js deleted file mode 100644 index 8a5481fc49..0000000000 --- a/posterita/posterita/web/js/stockCart.js +++ /dev/null @@ -1,518 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author shameem - */ - -//----------------------------------FUNCTION DECLARATIONS--------------------------------------------- -//scrolls to the bottom of the cart -function scrollDownCart() -{ - if($('shoppingCart')) - { - $('shoppingCart').scrollTop = $('shoppingCart').scrollHeight; - } -} - - -//adding product to cart -function addToCart(barcode) -{ - cartIndex = null; - done = false; - if(barcode == null) return; - if(barcode == '') return; - - try - { - var url = 'StockMovementAction.do'; - var pars = 'action=addProduct&barCode='+ barcode + '&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - - } - catch(e) - { - toConsole(e); - } -} - -//incrementing, decrementing and deleting the shopping cart items using ajax -// 1.Increment the qty for the product -function incrementCart(productId) -{ - if(productId == null) return; - - try - { - - var url = 'StockMovementAction.do'; - var pars = 'action=incrementQty&productId='+productId+ '&ifAdd=true' + '&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } - -} - -//2.Decrement the qty for the product -function decrementCart(productId) -{ - if(productId == null) return; - - try - { - - - var url = 'StockMovementAction.do'; - var pars = 'action=decrementQty&productId='+productId+ '&ifAdd=false&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } -} - -//3.Delete all the products with the ID from the cart -function deleteItemFromCart(productId) -{ - if(productId == null) return; - - cartIndex = null; - updateQty(productId, '0'); -} - -//Refreshs the content of the shopping cart -function refreshShoppingCart(request) -{ - try - { - //var top = $('items').scrollTop; - var response = request.responseText; - $('shoppingCart').innerHTML = response; - //$('items').scrollTop = top; - scrollDownCart(); - response.evalScripts(); //display error messages - } - catch(e) - { - showErrorMessage('Failed to resfresh cart! Cause:' + e); - } - - addBehaviourToCart(); -} - -//Reports an error -function reportShoppingCartError(request) -{ - alert('Some error occured while communicating with the server. Please try again.'); - alert(request.responseText); - var win = window.open(); - win.document.write(request.responseText); - win.document.close(); -} - -//addRequiredLibrary('js/test.js'); -var requestIndicator; - -/* -var ShoppingCart = { - - init : function(){ - //this.indicator = new AJAXIndicator('Please wait...'); - alert('Shopping Cart'); - }, - - indicator : null -}; -*/ - -function checkout() -{ - //do normal submit - $('checkoutForm').submit(); -/* - var pars = Form.serialize('checkoutForm'); - var url = 'CheckoutAction.do'; - - try - { - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: handleCheckout, - onFailure: reportShoppingCartError - }); - } - catch(e) - { - toConsole(e); - } -*/ -} - -//Update the qty for the product -function updateQty(productId, quantity) -{ - if(productId == null) return; - - if (quantity == "") - { - return; - } - - if(quantity < 0) - { - showErrorMessage('Quantity cannot be negative!', 'qty'); - $('qty').value = ""; - return; - } - - var amount = parseFloat(quantity); - - if (isNaN(amount)) - { - showErrorMessage('Invalid quantity! ' + quantity, 'qty'); - $('qty').value = ""; - return; - } - - try - { - var url = 'StockMovementAction.do'; - var pars = 'action=updateQty&productId=' + productId + '&ifAdd=false&qtyToMove=' + quantity + '&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } - -} - -function updateNoOfPack(productId, noOfPack) -{ - if(productId == null) return; - - if (noOfPack == "") - { - return; - } - - if(noOfPack < 0) - { - showErrorMessage('No of Pack cannot be negative!', 'qty'); - return; - } - - var amount = parseFloat(noOfPack); - - if (isNaN(amount)) - { - showErrorMessage('Invalid No of Pack! ' + quantity, 'qty'); - return; - } - - try - { - var url = 'StockMovementAction.do'; - var pars = 'action=updateNoOfPack&productId=' + productId + '&ifAdd=false&noOfPack=' + noOfPack; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } - -} - -//Reload shopping cart -function reloadCart() -{ - try - { - var url = 'StockMovementAction.do'; - var pars = 'action=reloadCart'; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } - -} - - -function clearCart() -{ - maxRows = 0; - excessRows = 0; - resetDetails(); - - try - { - var url = 'StockMovementAction.do'; - var pars = 'action=clearCart'; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - } - catch(e) - { - toConsole(e); - } - -} - -function handleCheckout(request) -{ - var response = request.responseText; - var result = eval('(' + response + ')'); - - if(result.error) - { - showErrorMessage(result.error); - } - else - { - printOrder(result.orderID); - reloadCart(); - } -} - - -function addBehaviourToCart() -{ - var rows = new Array(); - var count = 1; - - while(true) - { - var row = $('row' + count); - if(row == null) break; - - rows.push(row); - count ++; - } - - for(var i=0; i 0) - { - var line = cartLines[cartIndex]; - simulateOnClick(line); - - } - - if(cartLines.length > maxRows) - { - var shoppingCart = $('shoppingCart'); - shoppingCart.scrollTop = shoppingCart.scrollHeight; - } - -} - -//Reload the shopping cart. Prices are calculated for the pricelist -function setShoppingCartPriceList() -{ - try - { - var url = 'AddToPOSShoppingCartAction.do'; - var pars = 'action=updatePriceList&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: refreshShoppingCart, - onFailure: reportShoppingCartError - }); - - } - catch(e) - { - toConsole(e); - } -} - -function scrollCart() -{ - var shoppingCart = $('shoppingCart'); - - if(cartIndex > maxRows) - { - shoppingCart.scrollTop = shoppingCart.scrollHeight; - } - else - { - shoppingCart.scrollTop = 0; - } -} - - -//Event.observe(window,'load',init,false); -//--------------------------------------------------------------------------------------- -//calling methods \ No newline at end of file diff --git a/posterita/posterita/web/js/stockTransfer.js b/posterita/posterita/web/js/stockTransfer.js deleted file mode 100644 index c9379a962e..0000000000 --- a/posterita/posterita/web/js/stockTransfer.js +++ /dev/null @@ -1,537 +0,0 @@ -//scripts for Posterita Ordering Screen -var product_id = null; -var cartLines = null; -var cartIndex = null; -var priceList = null; -var movementId = null; -var description = null; -var reference = null; -var oldPriceList = -1; -var searchElement = null; -var defaultPriceList = null; -var defaultPriceListName = null; -var ISTAXINCLUDED = null; -var TAX_RATE = null; -var ERROR_MSG = null; -var itemRowHeight = null; -var totalAmount = null; -var maxRows = 15; -var done = false; -var STOCKQTY = null; -var orgFromId = null; -var orgToId = null; - -var initScreen = function(){ - priceList = $('priceListId').value; - movementId = $('movementId').value; - - var orgFrom = $('orgFromId'); - orgFromId = orgFrom[orgFrom.selectedIndex].value; - - var orgTo = $('orgToId'); - orgToId = orgTo[orgTo.selectedIndex].value; - - //set default data for price list - defaultPriceList = priceList; - defaultPriceListName = $('terminal').innerHTML; - - //set search element - var searchProductBy = $('searchProductBy').value; - if(searchProductBy == 'name') - { - searchElement = $('productQuery'); - } - else - { - searchElement = $(searchProductBy); - } - - initProductSearch();; - initCartBtn(); - initAjaxResponder(); - initShortcuts(); - initSystemBtns(); - - searchElement.focus(); - - var barcode = $('barcode'); - barcode.focus(); - barcode.onkeyup = function(e){ - if(e.keyCode == Event.KEY_RETURN) - { - if(this.value != null && this.value != "") - { - done = true; - - addToCart(this.value); - this.value = ""; - } - - } - }; - - $('qty').onkeyup = function(e){ - if(e.keyCode == Event.KEY_RETURN) - { - //update qty - updateQty(product_id, this.value); - return false; - } - }; - - - $('clearCartBtn').onclick = function(e){ - initSystemBtns(); - this.className = 'selected'; - clearCart(); - }; - - $('saveBtn').onclick = function(e){ - initSystemBtns(); - this.className = 'selected'; - - if(cartLines == null || cartLines.length == 0) - { - showErrorMessage('Shopping cart is empty!', 'productQuery'); - return; - } - - if(orgFromId == orgToId) - { - showErrorMessage('You cannot transfer stocks to the same organisation', 'orgFromId'); - return; - } - else - { - saveMMovement(); - } - }; - - $('completeBtn').onclick = function(e){ - initSystemBtns(); - this.className = 'selected'; - - if(cartLines == null || cartLines.length == 0) - { - showErrorMessage('Shopping cart is empty!', 'productQuery'); - return; - } - - if(orgFromId == orgToId) - { - showErrorMessage('You cannot transfer stocks to the same organisation', 'orgFromId'); - return; - } - else - { - $('StockMovementForm').submit(); - } - }; - - $('newStockBtn').onclick = function(e){ - initSystemBtns(); - this.className = 'selected'; - - redirect("StockMovementAction.do?action=createNewStockTransfer"); - }; - - //add behaviour to existing cart - addBehaviourToCart(); -}; - -var initShortcuts = function() -{ - shortcut.add("Ctrl+Space", function(e){simulateOnClick($('checkoutBtn'))}); - - shortcut.add("F1", function(e){$('barcode').select();}); - shortcut.add("F2", function(e){$('productQuery').select();}); - shortcut.add("F3", function(e){$('description').select();}); - shortcut.add("F4", function(e){$('qty').select();}); - - shortcut.add("Ctrl+M", function(){simulateOnClick($('menuBtn'))}); - - shortcut.add("Ctrl+Delete", function(){ - simulateOnClick($('clearCartBtn')); - }); - - shortcut.add("Ctrl+R", function() - { - $('reference').focus(); - }); - - shortcut.add("Ctrl+S", function(){simulateOnClick($('saveBtn'))}); - shortcut.add("Ctrl+C", function(){simulateOnClick($('completeBtn'))}); - - //move between cart lines - shortcut.add("Ctrl+Up", function(){ - if(cartIndex > 0) - { - cartIndex = cartIndex -1; - var line = cartLines[cartIndex]; - scrollCart(); - simulateOnClick(line); - } - }); - - shortcut.add("Ctrl+Down", function(){ - if(cartIndex < cartLines.length - 1) - { - cartIndex = cartIndex + 1; - var line = cartLines[cartIndex]; - scrollCart(); - simulateOnClick(line); - } - }); - - //incrementing and decrementing qty - shortcut.add("Ctrl+Right", function(){ - simulateOnClick($('plusBtn')); - }); - - shortcut.add("Ctrl+Left", function(){ - simulateOnClick($('minusBtn')); - }); - - shortcut.add("Ctrl+Backspace", function(){ - simulateOnClick($('deleteBtn')); - }); - - -}; - -var showResult = function(element, update){ - if(!update.style.position || update.style.position=='absolute') { - update.style.position = 'absolute'; - Position.clone(element, update, {setHeight: false, offsetTop: element.offsetHeight}); - Position.clone($('maintop'), update, {setHeight: false, setTop: false, offsetTop: element.offsetHeight}); - } - - update.style.display = 'block'; - update.style.opacity = '1.0'; - - }; - - -var initProductSearch = function(){ - - // autocomplete for search by product name - var productAutocompleter = new Ajax.Autocompleter('productQuery','productSearchResult','SearchProductsAction.do',{ - paramName:'productName', - parameters : 'priceListId=' + priceList, - minChars:1, - frequency:1.0, - afterUpdateElement: afterAutocomplete, - onShow : showResult - }); - - productAutocompleter.xyz = true; - $('productQuery').Autocompleter = productAutocompleter; - - - // autocomplete for search by product description - var productAutocompleter2 = new Ajax.Autocompleter('description','productSearchByDescriptionResult','SearchProductsAction.do',{ - paramName:'description', - parameters : 'priceListId=' + priceList, - minChars:1, - frequency:1.0, - afterUpdateElement: afterAutocomplete, - onShow : showResult - }); - - $('description').Autocompleter = productAutocompleter2; -}; - -var afterAutocomplete = function(e1,e2){ - - var barcode = e2.getAttribute('barcode'); - if(barcode=='null') - { - barcode = ""; - } - var productId = e2.getAttribute('productId'); - - if(productId == null) - { - $('description').value = ""; - $('productQuery').value = ""; - - return; - } - - //$('barcode').value = barcode; - $('productId').value= productId; - - var description = e2.getAttribute('description'); - //$('description').value = description; - - incrementCart(productId); - - //reset focus to search input - searchElement.focus(); - - //show product details - getProductInfo(productId); - - //set global product - product_id = productId; - - $('description').value = ""; - $('productQuery').value = ""; - -}; - -function getProductInfo(productId) -{ - var url = 'POSProductAction2.do'; - var pars = 'action=getProductDetails&productId='+productId+'&priceListId='+priceList; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: showProductInfo, - onFailure: reportError - }); -} - -function showProductInfo(request) -{ - // - try - { - var response = request.responseText; - var product = eval('(' + response + ')'); - - //display product info in right column - $('product.name').innerHTML = product.name; - $('product.barcode').innerHTML = product.barcode; - $('product.taxCategory').innerHTML = product.taxCategory; - $('product.description').innerHTML = product.description; - STOCKQTY = $('product.stock.qty').innerHTML = product.stockQty; - TAX_RATE = new Number(product.taxRate).toFixed(2); - var taxPercentage = new Number(1 + (TAX_RATE / 100)); - - ISTAXINCLUDED = product.isTaxIncluded; - - if(ISTAXINCLUDED == "false") - { - $('product.price.list').innerHTML = new Number(product.priceList * taxPercentage).toFixed(2); - } - else - { - $('product.price.list').innerHTML = new Number(product.priceList).toFixed(2); - } - - $('product.units.pack').innerHTML = product.unitsPerPack; - $('product.image').src = 'images/newUI/productpreview.gif'; - - } - catch(e) - { - showErrorMessage(e); - } -} - -function reportError(request) -{ - alert("Some error has occured while communicating with the server"); - var w = window.open("","Error"); - var d = w.document; - d.write(request.responseText); -} - -function convertString2Unicode(s) -{ - var uniString = "", hexVal, uniChar; - - for(var i = 0; i < s.length; ++i) - { - //Convert char to hex - //hexVal = Number(s.charCodeAt(i)).toString(16); - hexVal = Number(s.charCodeAt(i)).toString(10); - - //Convert to unicode by making sure hex is 4 chars long, padding with 0's if less - //uniChar = "\\u" + ("000" + hexVal).match(/.{4}$/)[0]; - uniChar = "&#" + ("000" + hexVal).match(/.{4}$/)[0] +";"; - - uniString += uniChar; - } - if(hexVal < 255) - return s; - - return uniString; -} - -var initCartBtn = function(){ - var plus = $('plusBtn'); - var minus = $('minusBtn'); - var del = $('deleteBtn'); - - plus.style.cursor = 'pointer'; - minus.style.cursor = 'pointer'; - del.style.cursor = 'pointer'; - - plus.onclick = function(e){ - if(product_id != null) - incrementCart(product_id); - searchElement.focus(); - }; - - minus.onclick = function(e){ - if(product_id != null) - decrementCart(product_id); - searchElement.focus(); - }; - - del.onclick = function(e){ - if(product_id != null) - deleteItemFromCart(product_id); - - if(cartLines == null || cartLines.length == 0) - { - resetDetails(); - } - - searchElement.focus(); - }; -}; - - - -var initAjaxResponder = function(){ - - Ajax.Responders.register({ - onCreate: function() { - $('indicator').style.display = 'block'; - }, - onComplete: function() { - $('indicator').style.display = 'none'; - } - }); -}; - - - -//---------------------------------------------------------------------------- - -function initSystemBtns() -{ - - systemBtns = new Array(); - - systemBtns.push($('completeBtn')); - systemBtns.push($('clearCartBtn')); - systemBtns.push($('saveBtn')); - systemBtns.push($('newStockBtn')); - - systemBtns = $A(systemBtns); - - for(var i=0; iPlease Wait...

    ', {title: 'Saving Inventory Move', width: 800}); - Modalbox.deactivate(); - - reference = $('reference').value; - var url = 'StockMovementAction.do'; - var pars = 'action=createMMovement&movementId='+movementId+'&priceListId='+priceList+'&description='+reference+'&orgFromId='+orgFromId+'&orgToId='+orgToId; - - var myAjax = new Ajax.Request( url, - { - method: 'get', - parameters: pars, - onSuccess: showMovementInfo, - onFailure: reportError - }); - } -} - -function showMovementInfo(request) -{ - // - try - { - if (window.Modalbox) - Modalbox.hide(); - - var response = request.responseText; - var movementInfo = eval('(' + response + ')'); - - //display info in right column - $('docNo').innerHTML = movementInfo.docNo; - - if(movementInfo.description == null || movementInfo.description == 'null' || movementInfo.description == "") - { - $('reference').value = ""; - } - else - { - $('reference').value = movementInfo.description; - } - - $('mainTitle').innerHTML = "STATUS: " + movementInfo.docStatus; - $('movementId').value = movementId = movementInfo.movementId; - - } - catch(e) - { - showErrorMessage(e); - } -} -function setOrgFromTo() -{ - var orgFrom = $('orgFromId'); - orgFromId = orgFrom[orgFrom.selectedIndex].value; - - var orgTo = $('orgToId'); - orgToId = orgTo[orgTo.selectedIndex].value; - - if(orgFromId == orgToId) - { - showErrorMessage('You cannot transfer stocks to the same organisation', 'orgFromId'); - } -} - -Event.observe(window,'load',initScreen,false); \ No newline at end of file diff --git a/posterita/posterita/web/js/timer.js b/posterita/posterita/web/js/timer.js deleted file mode 100644 index 477b1a0696..0000000000 --- a/posterita/posterita/web/js/timer.js +++ /dev/null @@ -1,36 +0,0 @@ -var rTimer; -var sds ; - -TimeTick(); - -function TimeTick() -{ - var d = new Date(); - - var sds = new Date(); - - var hours = d.getHours(); - var minutes = d.getMinutes(); - var seconds = d.getSeconds(); - var month = d.getMonth()+1; - var date= d.getDate(); - var year = d.getFullYear(); - - - hours = (hours < 10)? '0'+hours : hours; - minutes = (minutes < 10)? '0'+minutes : minutes; - seconds = (seconds < 10)? '0'+seconds : seconds; - date =(date <10) ? '0'+date : date; - month =(month<10) ? '0'+ month : month; - - - $('timer').innerHTML= date+"/"+ month +"/"+year+" "+hours+":"+minutes+":"+seconds; - if(rTimer) - { - clearTimeout(rTimer); - } - - rTimer = setTimeout('TimeTick()', 1000); -} - - diff --git a/posterita/posterita/web/js/tooltip.js b/posterita/posterita/web/js/tooltip.js deleted file mode 100644 index d707fcc866..0000000000 --- a/posterita/posterita/web/js/tooltip.js +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - @author praveen - */ - - -//some methods for tooltip -function showTooltip(e) -{ - //Remove previous tooltips - if($('tooltipdiv')) - { - document.body.removeChild($('tooltipdiv')); - } - - var tip = this.getAttribute('tooltip'); - if(!tip) - { - return; - } - - var tooltip = document.createElement('div'); - var newAttr = document.createAttribute('id'); - newAttr.nodeValue = "tooltipdiv" - tooltip.setAttributeNode(newAttr); - - tooltip.onclick = function(){ - document.body.removeChild(this); - }; - - var event = window.event || e; - - var xcoor = Event.pointerX(event); - var ycoor = Event.pointerY(event); - - //tooltip.style.left = 10 + xcoor + "px"; - //tooltip.style.top = 10 + ycoor + "px"; - tooltip.style.visibility = 'hidden'; - tooltip.className = "tooltip"; - tooltip.innerHTML = tip; - document.body.appendChild(tooltip); - - var sWidth = getViewportWidth(); - var sHeigth = getViewportHeight(); - - var ttLeft = 10 + xcoor; - var ttTop = 10 + ycoor; - var ttWidth = tooltip.scrollWidth; - var ttHeight = tooltip.scrollHeight; - - if((ttLeft+ttWidth)>sWidth){ - ttLeft = sWidth - (10 + ttWidth); - } - - if((ttTop+ttHeight)>sHeigth){ - ttTop = sHeigth - (10 + ttHeight); - } - - tooltip.style.left = ttLeft + "px"; - tooltip.style.top = ttTop + "px"; - tooltip.style.visibility = 'visible'; - - //toConsole('Width:' + tooltip.scrollWidth); - //toConsole('Height:' + tooltip.scrollHeight); - -} - -var initTooltip = function() -{ - var help = document.getElementsByName('help'); - for(var i=0; i - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - - - - - - - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - - - - -
    - -
    - - - - - - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - -
    - -
    - -
    - -
    - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/changePassword.jsp b/posterita/posterita/web/jsp/admin/changePassword.jsp deleted file mode 100644 index 34360a7031..0000000000 --- a/posterita/posterita/web/jsp/admin/changePassword.jsp +++ /dev/null @@ -1,79 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - - - - - - - - - -<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - - - - -
    - -
    - - - - - - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - -
    - -
    - -
    -
    - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/checkDataIntegritySuccess.jsp b/posterita/posterita/web/jsp/admin/checkDataIntegritySuccess.jsp deleted file mode 100644 index 4159b268d2..0000000000 --- a/posterita/posterita/web/jsp/admin/checkDataIntegritySuccess.jsp +++ /dev/null @@ -1,48 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.user.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - - - - - - - - - - - - - - -
    -
    - -
    -
    -<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/checkSequenceSuccess.jsp b/posterita/posterita/web/jsp/admin/checkSequenceSuccess.jsp deleted file mode 100644 index 17aca74ba2..0000000000 --- a/posterita/posterita/web/jsp/admin/checkSequenceSuccess.jsp +++ /dev/null @@ -1,55 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CashBookAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - -Update Sequence -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -
    - The sequences have been updated successfully -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/createRole.jsp b/posterita/posterita/web/jsp/admin/createRole.jsp deleted file mode 100644 index 92fa36db37..0000000000 --- a/posterita/posterita/web/jsp/admin/createRole.jsp +++ /dev/null @@ -1,179 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author praveen ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> -<%@ page import="org.posterita.core.MenuItem" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - - - - - - - - - -<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - - - - - - -
    - -
    - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - Can Create Order - - -
    - Can Alter Order - - -
    - Can View Order - - -
    -

    - Available Menus -
    -
    - - - - - - - - - - - - - - - - - -
    - -
            - - - -
    -
    -
    - - Clear All - - - Select All - - - - -
    - -
    -
    - - - -<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/emailChanged.jsp b/posterita/posterita/web/jsp/admin/emailChanged.jsp deleted file mode 100644 index 0a13ee080c..0000000000 --- a/posterita/posterita/web/jsp/admin/emailChanged.jsp +++ /dev/null @@ -1,48 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> - - - - - - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - -
    - -
    - -<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/listOrganisations.jsp b/posterita/posterita/web/jsp/admin/listOrganisations.jsp deleted file mode 100644 index 432a5d380c..0000000000 --- a/posterita/posterita/web/jsp/admin/listOrganisations.jsp +++ /dev/null @@ -1,91 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<%@page import="org.posterita.struts.admin.OrganisationAction"%> -<%@page import="org.posterita.Constants"%> -Organisations -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -
    - - - - - - "> - Create Organisation - -
    - -

    - - - - - - - - - - - - - - - - - - - - -
    Organisation NameAddressActiveUpdate Details
    - - - - - - - - "> - update organisation - - "> - activate/deactivate organisation - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/listRoles.jsp b/posterita/posterita/web/jsp/admin/listRoles.jsp deleted file mode 100644 index 9dbb4cf645..0000000000 --- a/posterita/posterita/web/jsp/admin/listRoles.jsp +++ /dev/null @@ -1,92 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - - - - - - - - - - - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - - - - - - - -
    - -
    - <%@ include file="/jsp/include/errors.jsp" %> - -
    - Add Record -
    - - - - - - - - - - - - - - - - - - -
     
    - - <%-- - ">Edit - --%> - ">View - <%--">Delete--%> -
    -
    - - - -<%@ include file="/jsp/include/footerTableBottom.jsp" %> diff --git a/posterita/posterita/web/jsp/admin/passwordChanged.jsp b/posterita/posterita/web/jsp/admin/passwordChanged.jsp deleted file mode 100644 index aeffa1b345..0000000000 --- a/posterita/posterita/web/jsp/admin/passwordChanged.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> - - - Change password - - - - - - <%@ include file="/jsp/include/errors.jsp"%> - - - - - -
    - -
    - - -<%@ include file="/jsp/include/tshirtFooter.jsp"%> diff --git a/posterita/posterita/web/jsp/admin/updateOrCreateOrganisation.jsp b/posterita/posterita/web/jsp/admin/updateOrCreateOrganisation.jsp deleted file mode 100644 index be97acaa7d..0000000000 --- a/posterita/posterita/web/jsp/admin/updateOrCreateOrganisation.jsp +++ /dev/null @@ -1,128 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * ---%> -<%@ page import="org.posterita.Constants" %> -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - -
    - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - -
    *
    - - - -
    -
    -
    -
    - Receipt Footer Message - - - - - -
    - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    - -
    - - - - -
    - -
    -
    -
    -   -
    -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/userDeleted.jsp b/posterita/posterita/web/jsp/admin/userDeleted.jsp deleted file mode 100644 index 19ff9c5030..0000000000 --- a/posterita/posterita/web/jsp/admin/userDeleted.jsp +++ /dev/null @@ -1,49 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> - -<%@ page import="org.posterita.user.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - - - - - - - - - - - - - - -
    -
    - -
    -
    - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/viewMyDetails.jsp b/posterita/posterita/web/jsp/admin/viewMyDetails.jsp deleted file mode 100644 index 20d15326ec..0000000000 --- a/posterita/posterita/web/jsp/admin/viewMyDetails.jsp +++ /dev/null @@ -1,138 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - - - - - - - - - - - - - - - -
    - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -

    - -

    -
    -
    - -
    -
    - - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/viewOrganisation.jsp b/posterita/posterita/web/jsp/admin/viewOrganisation.jsp deleted file mode 100644 index 07773623fb..0000000000 --- a/posterita/posterita/web/jsp/admin/viewOrganisation.jsp +++ /dev/null @@ -1,67 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -
    - - - - - - - - - - - - - - - - - - -
    Organisation NameAddressActiveUpdate Details
    - - - - - - - - - - - - - - - - - - - -
    -
    -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/viewRole.jsp b/posterita/posterita/web/jsp/admin/viewRole.jsp deleted file mode 100644 index 44f91a89df..0000000000 --- a/posterita/posterita/web/jsp/admin/viewRole.jsp +++ /dev/null @@ -1,96 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - - - <%@ include file="/jsp/include/tabTop.jsp" %>View Role<%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - - - - -
    - -
    - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - -
    Role Name :

    Menus
    - - - - - - - - - - - - - - - - -
    - -
            - -
    -
    -
    -
    - - - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/viewUserDetails.jsp b/posterita/posterita/web/jsp/admin/viewUserDetails.jsp deleted file mode 100644 index 68d409baf7..0000000000 --- a/posterita/posterita/web/jsp/admin/viewUserDetails.jsp +++ /dev/null @@ -1,120 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - - - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - - - - -
    - -
    - - - - - - - - - - - - <%-- - - - - - --%> - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - - - - - - - - -
    - - - -
    -
    -
    - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/admin/viewUsers.jsp b/posterita/posterita/web/jsp/admin/viewUsers.jsp deleted file mode 100644 index 8d6236b754..0000000000 --- a/posterita/posterita/web/jsp/admin/viewUsers.jsp +++ /dev/null @@ -1,110 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - - - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - - - - -
    - -
    - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - -
    - - - - - Active -   - -
    - - - - - - Yes - - - No - - - "> - - -
    -
    - - - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/attachment/createAttachment.jsp b/posterita/posterita/web/jsp/attachment/createAttachment.jsp deleted file mode 100644 index a0d58d6040..0000000000 --- a/posterita/posterita/web/jsp/attachment/createAttachment.jsp +++ /dev/null @@ -1,87 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.struts.attachment.AttachmentAction" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - -Attach Logo - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - <%@ include file="/jsp/include/tabTop.jsp" %>Attach Logo<%@ include file="/jsp/include/tabBottom.jsp" %> - <%@ include file="/jsp/include/errors.jsp" %> -
    - find logo - - -
    Name - -
    - - - -
    -
    -<%@ include file="/jsp/include/footerTableBottom.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/bPartner/bPartnerCreated.jsp b/posterita/posterita/web/jsp/bPartner/bPartnerCreated.jsp deleted file mode 100644 index e927c3a166..0000000000 --- a/posterita/posterita/web/jsp/bPartner/bPartnerCreated.jsp +++ /dev/null @@ -1,180 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import ="org.posterita.Constants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - --%> -
    - - - -   -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - Yes - - - No - -
    - - Yes - - - No - -
    - - Yes - - - No - -
    - - Yes - - - No - -
    - - - -
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/bPartner/bPartnerDetails.jsp b/posterita/posterita/web/jsp/bPartner/bPartnerDetails.jsp deleted file mode 100644 index b9715c06b9..0000000000 --- a/posterita/posterita/web/jsp/bPartner/bPartnerDetails.jsp +++ /dev/null @@ -1,184 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import ="org.posterita.Constants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -   -
    - - - -
    - - - -
    - - - -
    - - - -
    - : - - -
    - : - - -
    - - Yes - - - No - -
    - - Yes - - - No - -
    - - Yes - - - No - -
    - - Yes - - - No - -
    - - Yes - - - No - -
    - - -
    - -
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/bPartner/createBPartner.jsp b/posterita/posterita/web/jsp/bPartner/createBPartner.jsp deleted file mode 100644 index 3ee0ad598d..0000000000 --- a/posterita/posterita/web/jsp/bPartner/createBPartner.jsp +++ /dev/null @@ -1,218 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.struts.bPartner.BPartnerAction" %> -<%@ page import ="org.posterita.Constants" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - - - - - - - - - - - - - - --%> - - - - - - -
    - * - - -
    - * - - -
    - * - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - - - - -
    - - - - - -
    - * - - - - -
    - - - - - -
    - - - - - -
    - - - - - -
    -   - - -   - -
    - -
    -<%@ include file="/jsp/include/posFooter.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/bPartner/editBPartner.jsp b/posterita/posterita/web/jsp/bPartner/editBPartner.jsp deleted file mode 100644 index 89615b9f20..0000000000 --- a/posterita/posterita/web/jsp/bPartner/editBPartner.jsp +++ /dev/null @@ -1,220 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.struts.bPartner.BPartnerAction" %> -<%@ page import ="org.posterita.Constants" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - - - - - - - - - - - - - - --%> - - - - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - - - - -
    - - - - - -
    - * - - - - -
    - - - - - -
    - - - - - -
    - - - - - -
    -   - - -   - -
    - -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/bPartner/viewBPartner.jsp b/posterita/posterita/web/jsp/bPartner/viewBPartner.jsp deleted file mode 100644 index 49363e880f..0000000000 --- a/posterita/posterita/web/jsp/bPartner/viewBPartner.jsp +++ /dev/null @@ -1,185 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import ="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -
    - - - - - - - -
    - - - - - -   - - - - - Add Business Partner - -
    -
    - - - - - - - - - - - - - - <% - String url = "BusinessPartners.do"; - String collection = Constants.ALLBUSINESSPARTNERS; - %> - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - -   -
    - -   - - - Yes - - - No - - - - Yes - - - No - - - - Yes - - - No - - - - Yes - - - No - - - - Yes - - - No - - - "> - View Business Partner - -   - "> - Edit Business Partner - -   - - - "> - Deactivate - - - - - "> - Activate - - -
    -<%@ include file="/jsp/include/pager.jsp" %> -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> - - diff --git a/posterita/posterita/web/jsp/cashBook/cashBook.jsp b/posterita/posterita/web/jsp/cashBook/cashBook.jsp deleted file mode 100644 index c3a2068f1d..0000000000 --- a/posterita/posterita/web/jsp/cashBook/cashBook.jsp +++ /dev/null @@ -1,181 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<%@page import="org.posterita.struts.pos.CashBookAction"%> - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - <% - boolean readonly = new Boolean((String)strReadOnly).booleanValue(); - - boolean orgReadOnly = true; - - if (cashBookId != null) - { - try - { - orgReadOnly = (Integer.parseInt((String)cashBookId) > 0); - } - catch (Exception ex) - {} - } - %> - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - * - - -
    - * - - - - -
    - - - - -
    - - - - -
    - - - - - -
    - - - -
    -
    - - - Copy As - - - - - Edit - - - - - Save - - - - - Cancel - - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/client/createClient.jsp b/posterita/posterita/web/jsp/client/createClient.jsp deleted file mode 100644 index 3bcba630d5..0000000000 --- a/posterita/posterita/web/jsp/client/createClient.jsp +++ /dev/null @@ -1,206 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - - - -<%@ page import="org.posterita.Constants" %> - -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - POSterita:. Create Client - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/footer.jsp b/posterita/posterita/web/jsp/include/footer.jsp deleted file mode 100644 index 3878b621ab..0000000000 --- a/posterita/posterita/web/jsp/include/footer.jsp +++ /dev/null @@ -1,50 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> - -<%@ page import="org.posterita.Constants" %> -<% -String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); -%> - - - - - - - -
    -
    - -
    - - - - - - - -
    - -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/inOut/viewMinOut.jsp b/posterita/posterita/web/jsp/inOut/viewMinOut.jsp deleted file mode 100644 index 98ca1c751d..0000000000 --- a/posterita/posterita/web/jsp/inOut/viewMinOut.jsp +++ /dev/null @@ -1,103 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> - - - - - - - - - -<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> - - -
    - - - - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - -
    -
    - Client - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Client Name
    Organisation Name
    Currency - - - -
    Address
    Postal Address
    City
    Country - - - -
    -
    -
    -
    - Administrator - - - - - - - - - - - - - - - - - - - - - - - - - - -
    User Name
    Role Name
    Password
    Confirm Password
    User PIN
    Email
    -
    -
    -
    - Accounting - - - - - -
    Load Accounting Values
    -
    -
    - -   - -
    -
    - - - - - - diff --git a/posterita/posterita/web/jsp/customer/createPOSCustomer.jsp b/posterita/posterita/web/jsp/customer/createPOSCustomer.jsp deleted file mode 100644 index 2ed3d144e2..0000000000 --- a/posterita/posterita/web/jsp/customer/createPOSCustomer.jsp +++ /dev/null @@ -1,51 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.struts.customer.CustomerAction" %> -<%@ page import="org.compiere.model.MBPartner" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - -<%@ include file="/jsp/pos/customerDetails.jsp" %> - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/customer/existingPOSCustomers.jsp b/posterita/posterita/web/jsp/customer/existingPOSCustomers.jsp deleted file mode 100644 index a0990658fe..0000000000 --- a/posterita/posterita/web/jsp/customer/existingPOSCustomers.jsp +++ /dev/null @@ -1,138 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import ="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - -<%@ include file="/jsp/include/tabTop.jsp" %>Customers<%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - - - - -
    - - <%@ include file="/jsp/include/errors.jsp" %> -
    - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Surname - - Name - - Customer ID No. - - Phone No. - - Cell No. - - AA Card No. - - Address - - City -   - -
    - - - - - - - - - - - - - - - -
    -
    - - - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> - - diff --git a/posterita/posterita/web/jsp/customer/savePOSCustomer.jsp b/posterita/posterita/web/jsp/customer/savePOSCustomer.jsp deleted file mode 100644 index 341884474a..0000000000 --- a/posterita/posterita/web/jsp/customer/savePOSCustomer.jsp +++ /dev/null @@ -1,50 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.struts.customer.CustomerAction" %> -<%@ page import="org.compiere.model.MBPartner" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -<%@ include file="/jsp/pos/customerDetails.jsp" %> - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/error/error.jsp b/posterita/posterita/web/jsp/error/error.jsp deleted file mode 100644 index c9d0bf1d63..0000000000 --- a/posterita/posterita/web/jsp/error/error.jsp +++ /dev/null @@ -1,78 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Tamak ---%> - - -<%@ page import="org.apache.struts.Globals" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - - - - - - - - - - - - - - -
    - - - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - - -
    - - - - <%-- - Exception xception = (Exception) request.getAttribute(Globals.EXCEPTION_KEY); - out.println(xception.getMessage()); - - --%> - - <%-- - Exception xception = (Exception) request.getAttribute(Globals.EXCEPTION_KEY); - StackTraceElement[] stackTraceElem = xception.getStackTrace(); - - for(int i = 0;i - - -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/help/contactUs.jsp b/posterita/posterita/web/jsp/help/contactUs.jsp deleted file mode 100644 index b7937c3b04..0000000000 --- a/posterita/posterita/web/jsp/help/contactUs.jsp +++ /dev/null @@ -1,87 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    : - -
    : -
    -
    - -   - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/help/emailSuccess.jsp b/posterita/posterita/web/jsp/help/emailSuccess.jsp deleted file mode 100644 index 191df241ee..0000000000 --- a/posterita/posterita/web/jsp/help/emailSuccess.jsp +++ /dev/null @@ -1,44 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> -Your query has been successfully sent to support@posterita.org -
    We will get back to you as soon as possible -
    Thank you -

    Posterita Support Team - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/inOut/minOutDetails.jsp b/posterita/posterita/web/jsp/inOut/minOutDetails.jsp deleted file mode 100644 index e29a9cf2c7..0000000000 --- a/posterita/posterita/web/jsp/inOut/minOutDetails.jsp +++ /dev/null @@ -1,153 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ page import="org.posterita.Constants" %> - - -
    - - - - - - -
    - - - - - -
    -
    - - - - -
    - Document Type: -
    -
    - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - Invoice Ref No: - - - - - -
    - Shipment Ref No: - - Counter Shipment Ref No: -
    - Doc Status: -
    -   -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Quantity
    - - - - - - - - - - - 1 -
    -
    - <%@ include file="/jsp/include/errors.jsp" %> - - - - - <%@ include file="/jsp/inOut/webStoreMinOutDetails.jsp" %> - - - - - -
    - - - - - - -
    - - - - - -
    -
    - - - - -
    - - - - - - - - - - - - - - - - -
    - - - -
    -
    -
    - -<%@ include file="/jsp/include/footerTableBottom.jsp" %> diff --git a/posterita/posterita/web/jsp/inOut/viewReceiptHistory.jsp b/posterita/posterita/web/jsp/inOut/viewReceiptHistory.jsp deleted file mode 100644 index daa3651549..0000000000 --- a/posterita/posterita/web/jsp/inOut/viewReceiptHistory.jsp +++ /dev/null @@ -1,118 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.posterita.struts.InOut.InOutAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - - - - - - - - -
    - -
    - - - - - <%@ include file="/jsp/include/filter.jsp"%> - - -
    -
    - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - -
    - - - - - - - <%-- --%> - - - - -
    -
    - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/inOut/viewShipmentHistory.jsp b/posterita/posterita/web/jsp/inOut/viewShipmentHistory.jsp deleted file mode 100644 index ffb0b7887c..0000000000 --- a/posterita/posterita/web/jsp/inOut/viewShipmentHistory.jsp +++ /dev/null @@ -1,118 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.posterita.struts.InOut.InOutAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> - - - - - - - - - - - - -
    - -
    - - - - - <%@ include file="/jsp/include/filter.jsp"%> - - -
    -
    - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - -
    - - - - - - - <%-- --%> - - - - -
    -
    - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/backBt.jsp b/posterita/posterita/web/jsp/include/backBt.jsp deleted file mode 100644 index 6e6cab57d2..0000000000 --- a/posterita/posterita/web/jsp/include/backBt.jsp +++ /dev/null @@ -1,28 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Tamak ---%> - - -
    - -<%-- Go Back--%> - -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/completePOSOrder.jsp b/posterita/posterita/web/jsp/include/completePOSOrder.jsp deleted file mode 100644 index 164a226e77..0000000000 --- a/posterita/posterita/web/jsp/include/completePOSOrder.jsp +++ /dev/null @@ -1,115 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> -<% String orderlines = Constants.POS_ORDER_LINES; %> -<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - -
     
    - -
    - - -
    -<%@ include file="/jsp/include/printOrderApplet.jsp" %> -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/completePOSOrderIncl.jsp b/posterita/posterita/web/jsp/include/completePOSOrderIncl.jsp deleted file mode 100644 index 5fc9ce9cbe..0000000000 --- a/posterita/posterita/web/jsp/include/completePOSOrderIncl.jsp +++ /dev/null @@ -1,115 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> -<% String orderlines = Constants.POS_ORDER_LINES; %> -<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - -
     
    - -
    - - -
    -<%@ include file="/jsp/include/printOrderApplet.jsp" %> -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/creditOrderPart1FocusBarCode.jsp b/posterita/posterita/web/jsp/include/creditOrderPart1FocusBarCode.jsp deleted file mode 100644 index a8a728f5d8..0000000000 --- a/posterita/posterita/web/jsp/include/creditOrderPart1FocusBarCode.jsp +++ /dev/null @@ -1,121 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/posterita/web/jsp/include/endCalendar.jsp b/posterita/posterita/web/jsp/include/endCalendar.jsp deleted file mode 100644 index f97c9feb9f..0000000000 --- a/posterita/posterita/web/jsp/include/endCalendar.jsp +++ /dev/null @@ -1,121 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -
    - - <%@ include file="/jsp/include/posOrderBarCode.jsp" %> - - <%@ include file="/jsp/include/posOrderSearch.jsp" %> -
    -
    -
    - <%@ include file="/jsp/pos/creditOrderShoppingCart.jsp" %> -
    -
    - - - - - - - - - - - - - - -
    -
    - -
    - - - - - - - - - -
    -
    -
    -
    - <%@ include file="/jsp/include/customerInfoPanel.jsp" %> - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/creditOrderWithAdvanced.jsp b/posterita/posterita/web/jsp/include/creditOrderWithAdvanced.jsp deleted file mode 100644 index 5cc0e0c83e..0000000000 --- a/posterita/posterita/web/jsp/include/creditOrderWithAdvanced.jsp +++ /dev/null @@ -1,33 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> -<%@ include file="/jsp/include/creditOrderPart1FocusBarCode.jsp" %> - - - - - -<%@ include file="/jsp/include/posOrderPart2.jsp" %> - - - diff --git a/posterita/posterita/web/jsp/include/customerInfoPanel.jsp b/posterita/posterita/web/jsp/include/customerInfoPanel.jsp deleted file mode 100644 index 1c91d2e943..0000000000 --- a/posterita/posterita/web/jsp/include/customerInfoPanel.jsp +++ /dev/null @@ -1,42 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -
    - -
    -
    - -
    - -
    - -
    - - <%@ include file="/jsp/include/searchCustomerPanel.jsp" %> -
    - -
    - - -
    -
    diff --git a/posterita/posterita/web/jsp/include/customerInfoPanel2.jsp b/posterita/posterita/web/jsp/include/customerInfoPanel2.jsp deleted file mode 100644 index 887aec0174..0000000000 --- a/posterita/posterita/web/jsp/include/customerInfoPanel2.jsp +++ /dev/null @@ -1,40 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -
    -Customer Info -
    -
    - -
    - -
    - -
    - - <%@ include file="/jsp/include/searchCustomerPanel.jsp" %> -
    - -
    - -
    -
    diff --git a/posterita/posterita/web/jsp/include/dateFilter.jsp b/posterita/posterita/web/jsp/include/dateFilter.jsp deleted file mode 100644 index 04ee1f067f..0000000000 --- a/posterita/posterita/web/jsp/include/dateFilter.jsp +++ /dev/null @@ -1,34 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author vishee ---%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -
    -   -
    -   -
    - - - - - - -
    - <%@ include file="/jsp/include/startCalendar.jsp" %> -
    - <%@ include file="/jsp/include/endCalendar.jsp" %> -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/dayList.jsp b/posterita/posterita/web/jsp/include/dayList.jsp deleted file mode 100644 index e904b5ed18..0000000000 --- a/posterita/posterita/web/jsp/include/dayList.jsp +++ /dev/null @@ -1,54 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 diff --git a/posterita/posterita/web/jsp/include/documentStatusFilter.jsp b/posterita/posterita/web/jsp/include/documentStatusFilter.jsp deleted file mode 100644 index 75ddb27da9..0000000000 --- a/posterita/posterita/web/jsp/include/documentStatusFilter.jsp +++ /dev/null @@ -1,29 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@ page import="org.compiere.process.DocAction" %> - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/draftedCreditOrder.jsp b/posterita/posterita/web/jsp/include/draftedCreditOrder.jsp deleted file mode 100644 index 4e59f97668..0000000000 --- a/posterita/posterita/web/jsp/include/draftedCreditOrder.jsp +++ /dev/null @@ -1,82 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - -
     
    - <% String orderlines = Constants.POS_ORDER_LINES; %> - <%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> - - > -
    -
    -
    -   -
    -
    -
    - -   - -   -
    -
    - - - - - - - -
    - - - - - - - -
    -
    -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/draftedPOSOrder.jsp b/posterita/posterita/web/jsp/include/draftedPOSOrder.jsp deleted file mode 100644 index 3699ff99de..0000000000 --- a/posterita/posterita/web/jsp/include/draftedPOSOrder.jsp +++ /dev/null @@ -1,115 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - -
     
    -
    - - - - - - - -
    - - - - - - - - -
    -
    -
    - <% String orderlines = Constants.POS_ORDER_LINES; %> - <%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> - - > -
    -
    - -
    -   -
    -
    -
    -
    - - - - -   - - - - - - -   -
    -
    - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - - - - - -
    - - - - <%@ include file="/jsp/include/dayList.jsp" %> - - - - <%@ include file="/jsp/include/monthList.jsp" %> - - - - <%@ include file="/jsp/include/yearList.jsp" %> - - - - - - - - <%@ include file="/jsp/include/hourList.jsp" %> - - - - <%@ include file="/jsp/include/minuteList.jsp" %> - - -
    - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/errorMsg.jsp b/posterita/posterita/web/jsp/include/errorMsg.jsp deleted file mode 100644 index 244a0bc597..0000000000 --- a/posterita/posterita/web/jsp/include/errorMsg.jsp +++ /dev/null @@ -1,65 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> -
    - - - - - - -
    -
    - -
    - -
    -
    -
    -
    -
    - ERROR! -
    -
    -
    - - - - - - - -
    -
    - -
    - -
    -
    -
    -
    -
    - ERROR! -
    -
    -
    -
    - diff --git a/posterita/posterita/web/jsp/include/errors.jsp b/posterita/posterita/web/jsp/include/errors.jsp deleted file mode 100644 index f3abb3ae91..0000000000 --- a/posterita/posterita/web/jsp/include/errors.jsp +++ /dev/null @@ -1,45 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> -
    - -
    -
    - -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    - diff --git a/posterita/posterita/web/jsp/include/filter.jsp b/posterita/posterita/web/jsp/include/filter.jsp deleted file mode 100644 index 1708fa5495..0000000000 --- a/posterita/posterita/web/jsp/include/filter.jsp +++ /dev/null @@ -1,91 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -
    - :   - - - - - - - - -
    -   - - - - <%@include file="/jsp/include/month.jsp"%> - - - - - <% - int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); - %> - <%= currentYear %> - <%= currentYear - 1 %> - - - - - - - - - - - - - - - -
    -   -
    - - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/footerTableBottom1.jsp b/posterita/posterita/web/jsp/include/footerTableBottom1.jsp deleted file mode 100644 index e502929fe0..0000000000 --- a/posterita/posterita/web/jsp/include/footerTableBottom1.jsp +++ /dev/null @@ -1,77 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> - - - -<%-- start tablebottom.jsp --%> - -   - - - - - -<%-- end tablebottom.jsp --%> - - - - - - - - - - - - - - - -<%-- start footer.jsp --%> - - - - - - - - - - - - - - - -
    -   - -
    - - - - - -<%-- end footer.jsp --%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/historyMonthYearFilter.jsp b/posterita/posterita/web/jsp/include/historyMonthYearFilter.jsp deleted file mode 100644 index 1bb10bf671..0000000000 --- a/posterita/posterita/web/jsp/include/historyMonthYearFilter.jsp +++ /dev/null @@ -1,41 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - <%@include file="/jsp/include/month.jsp"%> - - - - - - - <% - int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); - %> - <%= currentYear %> - <%= currentYear - 1 %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/historyfilter.jsp b/posterita/posterita/web/jsp/include/historyfilter.jsp deleted file mode 100644 index 2173b2a87e..0000000000 --- a/posterita/posterita/web/jsp/include/historyfilter.jsp +++ /dev/null @@ -1,62 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - - -
    - :   - - - - -
    -   - - - - <%@include file="/jsp/include/month.jsp"%> - - - - - <% - int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); - %> - <%= currentYear %> - <%= currentYear - 1 %> - -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/hourList.jsp b/posterita/posterita/web/jsp/include/hourList.jsp deleted file mode 100644 index bf722aef1d..0000000000 --- a/posterita/posterita/web/jsp/include/hourList.jsp +++ /dev/null @@ -1,47 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - 00 - 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/minuteList.jsp b/posterita/posterita/web/jsp/include/minuteList.jsp deleted file mode 100644 index b275b57463..0000000000 --- a/posterita/posterita/web/jsp/include/minuteList.jsp +++ /dev/null @@ -1,82 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - 00 - 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/month.jsp b/posterita/posterita/web/jsp/include/month.jsp deleted file mode 100644 index ab3bb9c990..0000000000 --- a/posterita/posterita/web/jsp/include/month.jsp +++ /dev/null @@ -1,34 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/monthList.jsp b/posterita/posterita/web/jsp/include/monthList.jsp deleted file mode 100644 index f4f1b28c35..0000000000 --- a/posterita/posterita/web/jsp/include/monthList.jsp +++ /dev/null @@ -1,23 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ include file="/jsp/include/month.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/pager.jsp b/posterita/posterita/web/jsp/include/pager.jsp deleted file mode 100644 index 7e5cb59cd5..0000000000 --- a/posterita/posterita/web/jsp/include/pager.jsp +++ /dev/null @@ -1,142 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.core.businesslogic.ElementManager" %> -<%@ page import="org.posterita.core.bean.ElementBean" %> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<% -int firstOffset = 0; -int lastOffset = 0; -int currentOffset = Integer.parseInt(offset); -int previousOffset = currentOffset - Integer.parseInt(length); -int nextOffset = currentOffset + Integer.parseInt(length); - -boolean isFirst = (currentOffset == 0); -boolean isLast = ((currentOffset + Integer.parseInt(length)) >= recordSize.intValue()); - -ElementBean elementBean = null; - -if(url.indexOf("?") != -1) -{ - url = url + "&"; -} -else -{ - url = url + "?"; -} -%> -
    -
    - - - - - -
    -<% -if(!isFirst){ - out.print("
    "); - out.print(ElementManager.getMsg(ctx, "prev").getName()); - out.print(""); -} -int len = Integer.parseInt(length); - -lastOffset = recordSize.intValue() - (recordSize.intValue() % len); -int b = currentOffset/len + 1; -int d = lastOffset/len; - -if((recordSize.intValue() % len) != 0) -{ - d = d + 1; -} - -b = (b < 1) ? 1 : b; - -int a = b - 2; -int c = b + 2; - -a = (a < 1) ? 1 : a; -c = (c < d) ? c : d; - - - -if(Integer.parseInt(length) != recordSize.intValue()) -{ - if(recordSize.intValue() > len) - { - - for(int i= a ; i < b ; i++) - { - out.print("" + i + " "); - } - - out.print(b + " "); - - for(int j= b+1 ; j < c+1 ; j++) - { - out.print("" + j + " "); - } - } - - out.print("
    "); - - if(recordSize.intValue() > len){ - out.print(""); - } - - - if(!isLast){ - out.print(""); - } - - -} -else -{ - out.print(""); - out.print(ElementManager.getMsg(ctx, "switch.to.paging").getName()); - out.print(""); -} - -%> -
    -
    -
    - diff --git a/posterita/posterita/web/jsp/include/paymentRuleFilter.jsp b/posterita/posterita/web/jsp/include/paymentRuleFilter.jsp deleted file mode 100644 index d87b5efa0a..0000000000 --- a/posterita/posterita/web/jsp/include/paymentRuleFilter.jsp +++ /dev/null @@ -1,29 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.compiere.model.MOrder" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/paymentTermsDetails.jsp b/posterita/posterita/web/jsp/include/paymentTermsDetails.jsp deleted file mode 100644 index 73c7fb3038..0000000000 --- a/posterita/posterita/web/jsp/include/paymentTermsDetails.jsp +++ /dev/null @@ -1,135 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - * - - - - - - - - - - - - * - - - - - - - - - - - - - - - - - - * - - - - - - - - - * - - - - - - - - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/pinPanel.jsp b/posterita/posterita/web/jsp/include/pinPanel.jsp deleted file mode 100644 index 82bac39197..0000000000 --- a/posterita/posterita/web/jsp/include/pinPanel.jsp +++ /dev/null @@ -1,49 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -
    -
    - - - - - - - - - - -
    - -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    diff --git a/posterita/posterita/web/jsp/include/posFooter.jsp b/posterita/posterita/web/jsp/include/posFooter.jsp deleted file mode 100644 index fd418278bb..0000000000 --- a/posterita/posterita/web/jsp/include/posFooter.jsp +++ /dev/null @@ -1,66 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - -
    - - - -
    - - - -
    -
    - - - diff --git a/posterita/posterita/web/jsp/include/posHeader.jsp b/posterita/posterita/web/jsp/include/posHeader.jsp deleted file mode 100644 index 7fc2bfccd9..0000000000 --- a/posterita/posterita/web/jsp/include/posHeader.jsp +++ /dev/null @@ -1,255 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.compiere.model.MRole" %> -<%@ page import="java.util.Properties" %> -<%@ page import="org.posterita.core.TmkJSPEnv" %> -<%@ page import="org.compiere.util.Env" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - - - - - - - - - - - - - - - - - -<% -response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 -response.setHeader("Cache-Control","no-store"); //HTTP 1.1 -response.setHeader("Pragma","no-cache"); //HTTP 1.0 -response.setDateHeader ("Expires", 0); //prevents caching at the proxy server - -String path = request.getContextPath(); -String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; -Properties ctx = TmkJSPEnv.getCtx(request); -String posName = POSTerminalManager.getTerminalName(ctx); -String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); -String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); -Integer userId = new Integer(Env.getAD_User_ID(ctx)); -String version = UdiConstants.POS_VERSION; -String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); -boolean isTerminalLocked = POSTerminalManager.isTerminalLocked(ctx); - -if (isTerminalLocked) -{ - posName += " (Locked)"; -} -%> - -<%-- - - - ---%> - - - - - <% - if (displayCookie != null && displayCookie.getValue() != null) - { - displayPageSize = displayCookie.getValue().toString(); - } - %> - -<% - Integer pageSize = new Integer(displayPageSize); -%> - - -<%@page import="org.posterita.struts.login.GoToHomePageAction"%> -<%@page import="org.compiere.model.MStore"%> -<%@page import="org.posterita.businesslogic.StoreManager"%> - - - - - <%=appName%> - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - -
    -
    -
    - -
    - -
    -
    -
    - : - <%=orgName%> -
    -
    - : - <%=posName%> -
    -
    -
    -
    - : - -
    -
    - : - <%=roleName%> -
    -
    -
    -
    -
    -
    -
    -
    - - - - - "> - - -
    -
    -
    -
    - - - - -
    - - - -
    -
    - - - - - -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posHeader2.jsp b/posterita/posterita/web/jsp/include/posHeader2.jsp deleted file mode 100644 index ac1dfda3e0..0000000000 --- a/posterita/posterita/web/jsp/include/posHeader2.jsp +++ /dev/null @@ -1,255 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.compiere.model.MRole" %> -<%@ page import="java.util.Properties" %> -<%@ page import="org.posterita.core.TmkJSPEnv" %> -<%@ page import="org.compiere.util.Env" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - - - - - - - - - - - - - - - - - -<% -response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 -response.setHeader("Cache-Control","no-store"); //HTTP 1.1 -response.setHeader("Pragma","no-cache"); //HTTP 1.0 -response.setDateHeader ("Expires", 0); //prevents caching at the proxy server - -String path = request.getContextPath(); -String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; -Properties ctx = TmkJSPEnv.getCtx(request); -String posName = POSTerminalManager.getTerminalName(ctx); -String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); -String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); -Integer userId = new Integer(Env.getAD_User_ID(ctx)); -String version = UdiConstants.POS_VERSION; -String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); -boolean isTerminalLocked = POSTerminalManager.isTerminalLocked(ctx); - -if (isTerminalLocked) -{ - posName += " (Locked)"; -} -%> - -<%-- - - - ---%> - - - - - <% - if (displayCookie != null && displayCookie.getValue() != null) - { - displayPageSize = displayCookie.getValue().toString(); - } - %> - -<% - Integer pageSize = new Integer(displayPageSize); -%> - - -<%@page import="org.posterita.struts.login.GoToHomePageAction"%> -<%@page import="org.compiere.model.MStore"%> -<%@page import="org.posterita.businesslogic.StoreManager"%> - - - - - <%=appName%> - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posHeaderAdministration.jsp b/posterita/posterita/web/jsp/include/posHeaderAdministration.jsp deleted file mode 100644 index 6275e9de85..0000000000 --- a/posterita/posterita/web/jsp/include/posHeaderAdministration.jsp +++ /dev/null @@ -1,278 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.compiere.model.MRole" %> -<%@ page import="java.util.Properties" %> -<%@ page import="org.posterita.core.TmkJSPEnv" %> -<%@ page import="org.compiere.util.Env" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - - - - - - - - - - - - - - - - - -<% -response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 -response.setHeader("Cache-Control","no-store"); //HTTP 1.1 -response.setHeader("Pragma","no-cache"); //HTTP 1.0 -response.setDateHeader ("Expires", 0); //prevents caching at the proxy server - -String path = request.getContextPath(); -String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; -Properties ctx = TmkJSPEnv.getCtx(request); -String posName = POSTerminalManager.getTerminalName(ctx); -String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); -String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); -Integer userId = new Integer(Env.getAD_User_ID(ctx)); -String version = UdiConstants.POS_VERSION; -String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); -boolean isTerminalLocked = POSTerminalManager.isTerminalLocked(ctx); - -if (isTerminalLocked) -{ - posName += " (Locked)"; -} -%> - -<%-- - - - ---%> - - - - - <% - if (displayCookie != null && displayCookie.getValue() != null) - { - displayPageSize = displayCookie.getValue().toString(); - } - %> - -<% - Integer pageSize = new Integer(displayPageSize); -%> - - -<%@page import="org.posterita.struts.login.GoToHomePageAction"%> -<%@page import="org.compiere.model.MStore"%> -<%@page import="org.posterita.businesslogic.StoreManager"%> - - - - - <%=appName%> - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - -
    -
    -
    - -
    - -
    -
    -
    - - - - - "> - - -
    -
    -
    -
    - : - <%=orgName%> -
    -
    - : - <%=posName%> -
    -
    -
    -
    - : - -
    -
    - : - <%=roleName%> -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - - - - -
    - - - -
    - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posHistoryFilter.jsp b/posterita/posterita/web/jsp/include/posHistoryFilter.jsp deleted file mode 100644 index 8b60e5c20d..0000000000 --- a/posterita/posterita/web/jsp/include/posHistoryFilter.jsp +++ /dev/null @@ -1,92 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   - - - - - - <%@include file="/jsp/include/documentStatusFilter.jsp"%> - - - - <%@ include file="/jsp/include/historyMonthYearFilter.jsp"%> - - - - - - - - - - - - - - - - - - <%@include file="/jsp/include/paymentRuleFilter.jsp"%> - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posHistoryFilter2.jsp b/posterita/posterita/web/jsp/include/posHistoryFilter2.jsp deleted file mode 100644 index af6feccf5e..0000000000 --- a/posterita/posterita/web/jsp/include/posHistoryFilter2.jsp +++ /dev/null @@ -1,75 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - - - - - - - - - - - - - -   - - - - - - <%@include file="/jsp/include/documentStatusFilter.jsp"%> - - - - <%@ include file="/jsp/include/historyMonthYearFilter.jsp"%> - - - - - - - <%@include file="/jsp/include/paymentRuleFilter.jsp"%> - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrder.jsp b/posterita/posterita/web/jsp/include/posOrder.jsp deleted file mode 100644 index f1f8103c13..0000000000 --- a/posterita/posterita/web/jsp/include/posOrder.jsp +++ /dev/null @@ -1,27 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> -<%@ include file="/jsp/include/posOrderPart1FocusBarCode.jsp" %> - -<%@ include file="/jsp/include/posOrderPart2.jsp" %> - - - diff --git a/posterita/posterita/web/jsp/include/posOrderBarCode.jsp b/posterita/posterita/web/jsp/include/posOrderBarCode.jsp deleted file mode 100644 index 49e69c8584..0000000000 --- a/posterita/posterita/web/jsp/include/posOrderBarCode.jsp +++ /dev/null @@ -1,43 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - - - <%-- -   - - --%> - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrderFocusBarCode.jsp b/posterita/posterita/web/jsp/include/posOrderFocusBarCode.jsp deleted file mode 100644 index 6a61f1d2d4..0000000000 --- a/posterita/posterita/web/jsp/include/posOrderFocusBarCode.jsp +++ /dev/null @@ -1,29 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ include file="/jsp/include/posOrderPart1.jsp" %> - -<%@ include file="/jsp/include/posOrderPart2.jsp" %> - - - diff --git a/posterita/posterita/web/jsp/include/posOrderFocusSearch.jsp b/posterita/posterita/web/jsp/include/posOrderFocusSearch.jsp deleted file mode 100644 index 6a61f1d2d4..0000000000 --- a/posterita/posterita/web/jsp/include/posOrderFocusSearch.jsp +++ /dev/null @@ -1,29 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ include file="/jsp/include/posOrderPart1.jsp" %> - -<%@ include file="/jsp/include/posOrderPart2.jsp" %> - - - diff --git a/posterita/posterita/web/jsp/include/posOrderPart1.jsp b/posterita/posterita/web/jsp/include/posOrderPart1.jsp deleted file mode 100644 index d4469468d9..0000000000 --- a/posterita/posterita/web/jsp/include/posOrderPart1.jsp +++ /dev/null @@ -1,101 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - - - - - - - - - - - <%@ include file="/jsp/include/tablebottom.jsp" %> - - - -
    - - - - - - - - - - - - - - - - - -
    - - - - - - - - - -   -
    - - -
    - <%@ include file="/jsp/include/searchProductPanel.jsp" %> -
    -
     
    -
    -
    - <%@ include file="/jsp/pos/posShoppingCartFirstPage.jsp" %> -
    -
    - - - - - - -<%@ include file="/jsp/include/footer.jsp" %> - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/forgot.jsp b/posterita/posterita/web/jsp/login/forgot.jsp deleted file mode 100644 index 9f44eb94c5..0000000000 --- a/posterita/posterita/web/jsp/login/forgot.jsp +++ /dev/null @@ -1,103 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ page import="org.posterita.Constants" %> - - - - -Welcome to Posterita - - - - - - -
    - <%@ include file="/jsp/include/tenderPanel.jsp" %> - - <%@ include file="/jsp/include/customerInfoPanel.jsp" %> - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrderPart1FocusBarCode.jsp b/posterita/posterita/web/jsp/include/posOrderPart1FocusBarCode.jsp deleted file mode 100644 index c0177aaceb..0000000000 --- a/posterita/posterita/web/jsp/include/posOrderPart1FocusBarCode.jsp +++ /dev/null @@ -1,70 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - - - - - - - - - - - -
    -   -
    - - - - - - - - - - - -<%@ include file="/jsp/include/footer.jsp" %> - - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/chooseUser.jsp b/posterita/posterita/web/jsp/login/chooseUser.jsp deleted file mode 100644 index ecfaf15005..0000000000 --- a/posterita/posterita/web/jsp/login/chooseUser.jsp +++ /dev/null @@ -1,119 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.OrgUsersBean"%> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - - - - - - -<%@ include file="/jsp/include/tablebottom.jsp" %> - - - -
    - - <%@ include file="/jsp/include/posOrderBarCode.jsp" %> - - <%@ include file="/jsp/include/posOrderSearch.jsp" %> -
    -
    -
    - <%@ include file="/jsp/pos/posShoppingCartFirstPage.jsp" %> -
    -
    - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrderWithAdvanced.jsp b/posterita/posterita/web/jsp/include/posOrderWithAdvanced.jsp deleted file mode 100644 index 43b61a5dc7..0000000000 --- a/posterita/posterita/web/jsp/include/posOrderWithAdvanced.jsp +++ /dev/null @@ -1,97 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%--<%@ include file="/jsp/include/posOrderPart1FocusBarCode.jsp"%>--%> - - - - - - - - - - - - -
    - <%@ include file="/jsp/include/tenderPanel.jsp" %> - - <%@ include file="/jsp/include/customerInfoPanel.jsp" %> - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrderPart1FocusSearch.jsp b/posterita/posterita/web/jsp/include/posOrderPart1FocusSearch.jsp deleted file mode 100644 index 271910ce5e..0000000000 --- a/posterita/posterita/web/jsp/include/posOrderPart1FocusSearch.jsp +++ /dev/null @@ -1,61 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - - -
    -   -
    - - - - - - - - - - - - - - - - - - -
    - - <%@ include file="/jsp/include/posOrderSearch.jsp" %> - - <%@ include file="/jsp/include/posOrderBarCode.jsp" %> -
    -
    -
    - <%@ include file="/jsp/pos/posShoppingCartFirstPage.jsp" %> -
    -
    - - - - - - -
    - <%@ include file="/jsp/include/tenderPanel.jsp" %> - - <%@ include file="/jsp/include/customerInfoPanel.jsp" %> - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posOrderPart2.jsp b/posterita/posterita/web/jsp/include/posOrderPart2.jsp deleted file mode 100644 index 8ea0225c14..0000000000 --- a/posterita/posterita/web/jsp/include/posOrderPart2.jsp +++ /dev/null @@ -1,85 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -
    -   -
    -
    -
     
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    diff --git a/posterita/posterita/web/jsp/include/posOrderSearch.jsp b/posterita/posterita/web/jsp/include/posOrderSearch.jsp deleted file mode 100644 index 54e2ed7da8..0000000000 --- a/posterita/posterita/web/jsp/include/posOrderSearch.jsp +++ /dev/null @@ -1,35 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Preveen ---%> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -
    - - -
    - <%@ include file="/jsp/include/searchProductPanel.jsp" %> -
    -
     
    - - - - - <%@ include file="/jsp/include/tablebottom.jsp" %> - - - -
    - - - - - - - - -
    - - <%@ include file="/jsp/include/posOrderBarCode.jsp" %> - - <%@ include file="/jsp/include/posOrderSearch.jsp" %> -
    -
    -
    - <%@ include file="/jsp/pos/posShoppingCartFirstPage.jsp" %> -
    -
    -
    - - - - - - - - - - - - - - - - - -
    - <%@ include file="/jsp/include/customerInfoPanel.jsp" %> -
    - <%@ include file="/jsp/include/tenderPanel.jsp" %> -
    - - - - - - - - -<%-- - - - ---%> -<%@ include file="/jsp/include/posOrderPart2.jsp"%> - - - diff --git a/posterita/posterita/web/jsp/include/posOrderWithAdvancedFocusSearch.jsp b/posterita/posterita/web/jsp/include/posOrderWithAdvancedFocusSearch.jsp deleted file mode 100644 index 70ef35d89a..0000000000 --- a/posterita/posterita/web/jsp/include/posOrderWithAdvancedFocusSearch.jsp +++ /dev/null @@ -1,39 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ include file="/jsp/include/posOrderPart1FocusSearch.jsp" %> - - - - - - - - -<%@ include file="/jsp/include/posOrderPart2.jsp" %> - - - diff --git a/posterita/posterita/web/jsp/include/posPaymentDetails.jsp b/posterita/posterita/web/jsp/include/posPaymentDetails.jsp deleted file mode 100644 index 25f8e8fa42..0000000000 --- a/posterita/posterita/web/jsp/include/posPaymentDetails.jsp +++ /dev/null @@ -1,307 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> -<%@ page import="org.posterita.form.OrderLineForm" %> -<%@ page import="org.posterita.form.OrderLineForm" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@ page import="java.text.DecimalFormat" %> - -
    -   -
    - <%@ include file="/jsp/include/pinPanel.jsp"%> -
    -   -
    - <%@ include file="/jsp/include/pinPanel.jsp" %> -
    -   -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - <% - String defaultDiscount = "0"; - String defaultPrice = element.getPrice().toString(); - - OrderLineForm form = (OrderLineForm)request.getAttribute("OrderLineForm"); - - if(form!=null) - { - String[] discountPercentage = form.getDiscountPercent(); - String[] actualPrice = form.getActualPrice(); - - if(discountPercentage!= null) - if(discountPercentage.length!=0) - defaultDiscount = discountPercentage[count.intValue()].toString(); - - if(actualPrice!=null) - if(actualPrice.length!=0) - defaultPrice = actualPrice[count.intValue()]; - - } - %> - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - "/> - - - - - -
    - - - - - - - -   - -
    - -
    -
     
    -
    -
    -
     
    - - - - - - - - - - -
    - -   - - - -   - - - -   - - - -   - -
    -
     
    - - - - - -
    - - - - -
    - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
     
    - "> - - -
    - -   - -
     
    - - - - - - - - -
    - - - - - - - - - -
    -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/posPaymentDetails2.jsp b/posterita/posterita/web/jsp/include/posPaymentDetails2.jsp deleted file mode 100644 index bbb373f776..0000000000 --- a/posterita/posterita/web/jsp/include/posPaymentDetails2.jsp +++ /dev/null @@ -1,307 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> -<%@ page import="org.posterita.form.OrderLineForm" %> -<%@ page import="java.text.DecimalFormat" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - <% - String defaultDiscount = "0"; - String defaultPrice = element.getPrice().toString(); - DecimalFormat df = new DecimalFormat("0.00"); - - OrderLineForm form = (OrderLineForm)request.getAttribute("OrderLineForm"); - - if(form!=null) - { - String[] discountPercentage = form.getDiscountPercent(); - String[] actualPrice = form.getActualPrice(); - - if(discountPercentage!= null) - if(discountPercentage.length!=0) - defaultDiscount = discountPercentage[count.intValue()].toString(); - - if(actualPrice!=null) - if(actualPrice.length!=0) - defaultPrice = actualPrice[count.intValue()]; - - } - %> - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - "/> - - - - - -
    - - - - - - - -   - -
    - -
    -
     
    -
    -
    -
     
    - - - - - - - - - - -
    - -   - - - -   - - - -   - - - -   - -
    -
     
    - - - - - -
    - - - - -
    - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
     
    - "> - - -
    - -   - -
     
    - - - - - - - - -
    - - - - - - - - - -
    -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/printOrderApplet.jsp b/posterita/posterita/web/jsp/include/printOrderApplet.jsp deleted file mode 100644 index 58d15a10a6..0000000000 --- a/posterita/posterita/web/jsp/include/printOrderApplet.jsp +++ /dev/null @@ -1,45 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - -
    - " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> -
    - -
    -
    diff --git a/posterita/posterita/web/jsp/include/printOrderApplet2.jsp b/posterita/posterita/web/jsp/include/printOrderApplet2.jsp deleted file mode 100644 index cbc67db52d..0000000000 --- a/posterita/posterita/web/jsp/include/printOrderApplet2.jsp +++ /dev/null @@ -1,77 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - -
    - " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> -
    - -
    -
    - - - - - - - - - - diff --git a/posterita/posterita/web/jsp/include/searchCustomerPanel.jsp b/posterita/posterita/web/jsp/include/searchCustomerPanel.jsp deleted file mode 100644 index 7bf12ce13c..0000000000 --- a/posterita/posterita/web/jsp/include/searchCustomerPanel.jsp +++ /dev/null @@ -1,25 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -
    - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchCustomerPanel2.jsp b/posterita/posterita/web/jsp/include/searchCustomerPanel2.jsp deleted file mode 100644 index 10118c73ca..0000000000 --- a/posterita/posterita/web/jsp/include/searchCustomerPanel2.jsp +++ /dev/null @@ -1,26 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -
    - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchProductPanel.jsp b/posterita/posterita/web/jsp/include/searchProductPanel.jsp deleted file mode 100644 index e93c7d5246..0000000000 --- a/posterita/posterita/web/jsp/include/searchProductPanel.jsp +++ /dev/null @@ -1,89 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<% - String minChars = "1"; -%> - - - - - <% - if (minCharsCookie.getValue() != null || !minCharsCookie.getValue().equals("")) - minChars = minCharsCookie.getValue(); - %> - - - - - - - -
    - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchProductPanel2.jsp b/posterita/posterita/web/jsp/include/searchProductPanel2.jsp deleted file mode 100644 index ed37034acc..0000000000 --- a/posterita/posterita/web/jsp/include/searchProductPanel2.jsp +++ /dev/null @@ -1,65 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<% - String minChars = "1"; -%> - - - - - <% - if (minCharsCookie.getValue() != null || !minCharsCookie.getValue().equals("")) - minChars = minCharsCookie.getValue(); - %> - - - - -
    - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchProductPanel3.jsp b/posterita/posterita/web/jsp/include/searchProductPanel3.jsp deleted file mode 100644 index fadf0d66c5..0000000000 --- a/posterita/posterita/web/jsp/include/searchProductPanel3.jsp +++ /dev/null @@ -1,89 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Sendy ---%> - -<%@page import="org.posterita.Constants"%> -<% - String minChars = "1"; -%> - - - - - <% - if (minCharsCookie.getValue() != null || !minCharsCookie.getValue().equals("")) - minChars = minCharsCookie.getValue(); - %> - - - - - - - -
    - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchVendorPanel.jsp b/posterita/posterita/web/jsp/include/searchVendorPanel.jsp deleted file mode 100644 index 2ca0b561c7..0000000000 --- a/posterita/posterita/web/jsp/include/searchVendorPanel.jsp +++ /dev/null @@ -1,46 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -
    - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/searchVendorPanel2.jsp b/posterita/posterita/web/jsp/include/searchVendorPanel2.jsp deleted file mode 100644 index e90289b7e7..0000000000 --- a/posterita/posterita/web/jsp/include/searchVendorPanel2.jsp +++ /dev/null @@ -1,20 +0,0 @@ - -
    - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/showErrors.jsp b/posterita/posterita/web/jsp/include/showErrors.jsp deleted file mode 100644 index fa72d6c051..0000000000 --- a/posterita/posterita/web/jsp/include/showErrors.jsp +++ /dev/null @@ -1,34 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> - - - - - diff --git a/posterita/posterita/web/jsp/include/startCalendar.jsp b/posterita/posterita/web/jsp/include/startCalendar.jsp deleted file mode 100644 index 1ba7baef55..0000000000 --- a/posterita/posterita/web/jsp/include/startCalendar.jsp +++ /dev/null @@ -1,66 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - - - - - - - - - -
    - - - - <%@ include file="/jsp/include/dayList.jsp" %> - - - - <%@ include file="/jsp/include/monthList.jsp" %> - - - - <%@ include file="/jsp/include/yearList.jsp" %> - - - - - - - - <%@ include file="/jsp/include/hourList.jsp" %> - - - - <%@ include file="/jsp/include/minuteList.jsp" %> - - -
    - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/success.jsp b/posterita/posterita/web/jsp/include/success.jsp deleted file mode 100644 index 8b4a4df7cf..0000000000 --- a/posterita/posterita/web/jsp/include/success.jsp +++ /dev/null @@ -1,34 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Servansingh ---%> -
    - -
    - -
    - -
    -
    -
    -
    -
    -
    - diff --git a/posterita/posterita/web/jsp/include/tabBottom.jsp b/posterita/posterita/web/jsp/include/tabBottom.jsp deleted file mode 100644 index 8842fd4508..0000000000 --- a/posterita/posterita/web/jsp/include/tabBottom.jsp +++ /dev/null @@ -1,24 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author tamak ---%> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/tabTop.jsp b/posterita/posterita/web/jsp/include/tabTop.jsp deleted file mode 100644 index ba2f13906b..0000000000 --- a/posterita/posterita/web/jsp/include/tabTop.jsp +++ /dev/null @@ -1,25 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author vishee ---%> - - -
    - diff --git a/posterita/posterita/web/jsp/include/tabTop_big.jsp b/posterita/posterita/web/jsp/include/tabTop_big.jsp deleted file mode 100644 index 89f05a0c11..0000000000 --- a/posterita/posterita/web/jsp/include/tabTop_big.jsp +++ /dev/null @@ -1,27 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author vishee ---%> - - - - - - - - - - - - - - - - -
      \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/tablebottom.jsp b/posterita/posterita/web/jsp/include/tablebottom.jsp deleted file mode 100644 index 6f5a7955c2..0000000000 --- a/posterita/posterita/web/jsp/include/tablebottom.jsp +++ /dev/null @@ -1,37 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author vishee ---%> - - - -  
         
    - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/taxDetails.jsp b/posterita/posterita/web/jsp/include/taxDetails.jsp deleted file mode 100644 index a1a1752c70..0000000000 --- a/posterita/posterita/web/jsp/include/taxDetails.jsp +++ /dev/null @@ -1,84 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - * - - -
    - * - - -
    - - - -
    - - - -
    - * - - - - -
      - -   - -  
    diff --git a/posterita/posterita/web/jsp/include/tenderPanel.jsp b/posterita/posterita/web/jsp/include/tenderPanel.jsp deleted file mode 100644 index 4fd5f3472d..0000000000 --- a/posterita/posterita/web/jsp/include/tenderPanel.jsp +++ /dev/null @@ -1,126 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -
    - -
    - - - - - - - -
    - - - - - - - - -
    -   - -   - -   -
    -
    - - - - - - - - - - - - - - - - - - - - -
     
    -
    -
    -
    - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/include/tenderPanel2.jsp b/posterita/posterita/web/jsp/include/tenderPanel2.jsp deleted file mode 100644 index 6aa589c32b..0000000000 --- a/posterita/posterita/web/jsp/include/tenderPanel2.jsp +++ /dev/null @@ -1,116 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -
    - Tender -
    - - - - - - - -
    - - - - - - -
    -   - -   -
    -
    - - - - - - - - - - - - - - -
    -
    -
    -
    - diff --git a/posterita/posterita/web/jsp/include/vendorInfoPanel.jsp b/posterita/posterita/web/jsp/include/vendorInfoPanel.jsp deleted file mode 100644 index cad6ceb7d1..0000000000 --- a/posterita/posterita/web/jsp/include/vendorInfoPanel.jsp +++ /dev/null @@ -1,47 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -
    - -
    -
    - -
    - -
    - -
    - - <%@ include file="/jsp/include/searchVendorPanel2.jsp" %> -
    - -
    -
    - diff --git a/posterita/posterita/web/jsp/include/year.jsp b/posterita/posterita/web/jsp/include/year.jsp deleted file mode 100644 index 388537a45f..0000000000 --- a/posterita/posterita/web/jsp/include/year.jsp +++ /dev/null @@ -1,39 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<% -java.util.Calendar c = java.util.Calendar.getInstance(); -int curYear = c.get(java.util.Calendar.YEAR); -curYear = curYear - 57; -%> -<% - for(int i=0;i<=57;i++) - { -%> - <%=curYear + i%> -<% - } -%> - - - diff --git a/posterita/posterita/web/jsp/include/yearList.jsp b/posterita/posterita/web/jsp/include/yearList.jsp deleted file mode 100644 index 3c2dcf2ae5..0000000000 --- a/posterita/posterita/web/jsp/include/yearList.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<% -java.util.Calendar c = java.util.Calendar.getInstance(); -int curYear = c.get(java.util.Calendar.YEAR); -%> - - -<%=curYear-1%> -<%=curYear%> -<%=curYear+1%> -<%=curYear+2%> -<%=curYear+3%> -<%=curYear+4%> -<%=curYear+5%> diff --git a/posterita/posterita/web/jsp/invoice/webstoreInvoice.jsp b/posterita/posterita/web/jsp/invoice/webstoreInvoice.jsp deleted file mode 100644 index 150f4144a4..0000000000 --- a/posterita/posterita/web/jsp/invoice/webstoreInvoice.jsp +++ /dev/null @@ -1,126 +0,0 @@ - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.struts.stock.StockAction" %> - -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.beans.OrderLineBean" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - -Invoice - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - -
    - Order Ref No: - "> - - - -
    - Invoice Ref No: -
    - Doc Status: - -
    -
    -
    - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameQtyPriceVATTotal
    - - - - - - - - - - - -
    - - - - - - - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/chooseApplication.jsp b/posterita/posterita/web/jsp/login/chooseApplication.jsp deleted file mode 100644 index 2e61c7f045..0000000000 --- a/posterita/posterita/web/jsp/login/chooseApplication.jsp +++ /dev/null @@ -1,246 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@ page import="org.posterita.Constants" %> -<% -String path = request.getContextPath(); -String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; -%> - - - - - Welcome to Posterita - - - - - - - - - - - - - - - - - - - - - - -
    -
    - -
    Posterita POS
    -
    -
    -
    -
    -
    - Choose your -
    - POS APPLICATION -
    -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -

    Recent News

    -
    - - -
    -
    - -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -

    Help us better Posterita POS

    -
    -
    - We are constantly trying to improve the product, and we are interested to hear from you. There are several ways you can help us. - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -

    Donate

    -
    -
    - If you find this software helpful, kindly donate and help us support it.

    - -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - - -
    -
      - -
    • - - - -
    • -
      -
    -
    -
    -
    -
    - -
    -
    - - - -
    -
    -
    -
    - -
    -
    - - diff --git a/posterita/posterita/web/jsp/login/chooseRole.jsp b/posterita/posterita/web/jsp/login/chooseRole.jsp deleted file mode 100644 index 5e079f61e7..0000000000 --- a/posterita/posterita/web/jsp/login/chooseRole.jsp +++ /dev/null @@ -1,136 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - -
    - - - - - - - - - -
    -

    - -

    -
    -

    - -

    -
    - - - - - -
    - - - - - - - - - - - -
    - - Please choose an Organisation and a Role - -
    - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - -
    -   -
    Organisation - - - -
    Role - - - -
    - - - -
    -
    -
    - - - -
    -
    -
    -
    -

    - -

    - - - - <% - if ((count.intValue()%4) == 0) - { - - %> - - - <% - } - %> - - - - <% - if ((count.intValue()%4-4) == 0) - { - - %> - - - <% - } - %> - - -
    - - - - - - - - - - - - -
    - -
    -
    - - - -     " styleClass="submenu"> - - -
    - -
    - -
     
    -
    -
    -
    -
    - - - - - - - - - - - - -
    - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/forgot1.jsp b/posterita/posterita/web/jsp/login/forgot1.jsp deleted file mode 100644 index 3d04546b1c..0000000000 --- a/posterita/posterita/web/jsp/login/forgot1.jsp +++ /dev/null @@ -1,87 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ page import="org.posterita.Constants" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - - - -
    -

    - - - - - -
    - - - - - -
    - - - - -
    -
    - -
      - -
    • -
      -
    -
    -
    -
    - - - - - - - - - - - - - - - -



      - -

    -
    -
    -
    -
    - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/home.jsp b/posterita/posterita/web/jsp/login/home.jsp deleted file mode 100644 index caa41ed53f..0000000000 --- a/posterita/posterita/web/jsp/login/home.jsp +++ /dev/null @@ -1,100 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - -
    - - - - - - - - - -
    -

    - -

    -
    -

    - -

    -
    - - - - - -
    - - - - - - - - -
    - - <%@ include file="/jsp/include/errors.jsp" %> - - - - <%@ include file="/jsp/login/loginForm.jsp" %> - - -
    - - - -
    -
    -
    - - -<%@ include file="/jsp/include/footer.jsp" %> - - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/index.jsp b/posterita/posterita/web/jsp/login/index.jsp deleted file mode 100644 index 5f5c4a3a3d..0000000000 --- a/posterita/posterita/web/jsp/login/index.jsp +++ /dev/null @@ -1,93 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> - - - - - - - <bean:message key="login.home.title"/> - - - <%@ include file="/js/enableButton.js" %> - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - - - -
    - - - -
    - - - - -
    - All Content © 2007 Posterita Ltd -
    - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/loginForm.jsp b/posterita/posterita/web/jsp/login/loginForm.jsp deleted file mode 100644 index 3cf611275f..0000000000 --- a/posterita/posterita/web/jsp/login/loginForm.jsp +++ /dev/null @@ -1,56 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - - - -
    -
    -
    - - - - - - - - - - - - - - - - -
    - -
    - - - - -
    - diff --git a/posterita/posterita/web/jsp/login/logout.jsp b/posterita/posterita/web/jsp/login/logout.jsp deleted file mode 100644 index 54328db6dd..0000000000 --- a/posterita/posterita/web/jsp/login/logout.jsp +++ /dev/null @@ -1,61 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - - - - - - - - -
    - -
    - - <%@ include file="/jsp/login/loginForm.jsp" %> -
    - - - - <%@ include file="/jsp/include/tshirtFooter.jsp"%> - - - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/maintenance.jsp b/posterita/posterita/web/jsp/login/maintenance.jsp deleted file mode 100644 index 2acf6aaccb..0000000000 --- a/posterita/posterita/web/jsp/login/maintenance.jsp +++ /dev/null @@ -1,89 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> - - - - - - - <bean:message key="login.home.title"/> - - - <%@ include file="/js/enableButton.js" %> - - - - - -
    - - - - -
    -
    - - - - -
    - - - - - - - - -
    -
    -
    -
    - - - - - -
    - This Server is Down for Maintenance
    - We will be back shortly
    - Thank You! -
    -
    -
    - -

    All Content © 2007 Posterita Ltd

    -
    -
    -
    - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/password.jsp b/posterita/posterita/web/jsp/login/password.jsp deleted file mode 100644 index 3f5d92f02b..0000000000 --- a/posterita/posterita/web/jsp/login/password.jsp +++ /dev/null @@ -1,103 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ page import="org.posterita.Constants" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - - - - - - - -

    - - - - - -
    - - - - -
    - - - - -
    -
    - -
      - -
    • -
      -
    -
    -
    -
    - - - - - - - - -
    - - - -
    - -
    -
    - - - <%@ include file="/jsp/include/tablebottom.jsp" %> - - - - - - -<%@ include file="/jsp/include/footer.jsp" %> - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/login/posLogin.html b/posterita/posterita/web/jsp/login/posLogin.html deleted file mode 100644 index 3348c9581e..0000000000 --- a/posterita/posterita/web/jsp/login/posLogin.html +++ /dev/null @@ -1,81 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - - - -Welcome to Tamak POS - - - - - - - - - - - - - - - - diff --git a/posterita/posterita/web/jsp/login/success.jsp b/posterita/posterita/web/jsp/login/success.jsp deleted file mode 100644 index c7f9cff6b3..0000000000 --- a/posterita/posterita/web/jsp/login/success.jsp +++ /dev/null @@ -1,121 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - -
    - - - -
    -


    -
    -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    - " target="_blank"> - - -
    -
    -

    From To

    -
    -
    -
    -
    - -
    - -<%@ include file="/jsp/include/footerTableBottom.jsp" %> diff --git a/posterita/posterita/web/jsp/materialmovement/viewMMovement.jsp b/posterita/posterita/web/jsp/materialmovement/viewMMovement.jsp deleted file mode 100644 index 27f4fa3032..0000000000 --- a/posterita/posterita/web/jsp/materialmovement/viewMMovement.jsp +++ /dev/null @@ -1,166 +0,0 @@ -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<% - String path = request.getContextPath(); - String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); - String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; - Properties ctx = TmkJSPEnv.getCtx(request); - String posName = POSTerminalManager.getTerminalName(ctx); - String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); - String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); - -%> - -<%@page import="org.posterita.Constants"%> -<%@page import="java.util.Properties"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.compiere.model.MPriceList"%> -<%@page import="org.compiere.model.MOrg"%> -<%@page import="org.compiere.model.MRole"%> -<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> -<%@page import="org.posterita.util.HtmlOrderPrintFormatter"%> -<%@page import="org.compiere.model.MOrder"%> -<%@page import="org.posterita.businesslogic.POSManager"%> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> -<%@page import="org.compiere.model.MPayment"%> -<%@page import="java.math.BigDecimal"%> -<%@page import="org.compiere.model.I_M_PriceList"%> -<%@page import="org.posterita.order.UDIOrderTypes"%> -<%@page import="org.posterita.TangoColors"%> -<%@page import="org.posterita.businesslogic.administration.PriceListManager"%> -<%@page import="org.posterita.businesslogic.stock.MMovementManager"%> - - - - - <%=appName%> - - - - - - - - - - - - - - - - -<% -int priceListId = PriceListManager.getDefaultPriceListId(ctx, false); -MPriceList priceList = new MPriceList(ctx, priceListId, null); -String priceListName = priceList.getName(); -%> - - - - - - - - - - - - - - - - - - - - -
    -
    - - -
    - Stock Transfer -
    -
    -
    -
    - : - <%=orgName%> -
    -
    - : - <%=posName%> -
    -
    -
    -
    - : - -
    -
    - : - <%=roleName%> -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -   - -
    -
    - <%=priceListName%> -
    -
    -
    -
    -
    -
    - <%= MMovementManager.getMMovementCartFromInventoryMove(ctx, Integer.parseInt(movementId), null) %> -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    - <%String newOrderAction = "/StockMovementAction.do?action=createNewStockTransfer"; %> -
    NEW ORDER
    -
    -
    -
    - Ctrl+Space New Order | Ctrl-M Menu
    -
    - <%@ include file="/jsp/include/printOrderApplet2.jsp" %> - - diff --git a/posterita/posterita/web/jsp/materialmovement/viewMMovementHistory.jsp b/posterita/posterita/web/jsp/materialmovement/viewMMovementHistory.jsp deleted file mode 100644 index ca8647b1ff..0000000000 --- a/posterita/posterita/web/jsp/materialmovement/viewMMovementHistory.jsp +++ /dev/null @@ -1,127 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="org.posterita.struts.stock.StockMovementAction" %> -<%@ page import="org.compiere.process.DocAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> -<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> - -<%@page import="org.posterita.core.Configuration"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.compiere.model.MPriceListVersion"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="java.util.Properties"%> -<%@page import="org.posterita.businesslogic.administration.PriceListManager"%> - History -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> -<% - -%> - - - - - - - - - - - - - - - - - - - - - - - - - - <%@ include file="/jsp/include/historyMonthYearFilter.jsp"%> - - - - - - -
    - - - - - - - - - -
    -   - - - - - - - - - - - - - - - <%@include file="/jsp/include/paymentRuleFilter.jsp"%> - - -
    -
    - - - - - - - - - - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/materialmovement/viewMMovementLines.jsp b/posterita/posterita/web/jsp/materialmovement/viewMMovementLines.jsp deleted file mode 100644 index 401ddbe1f4..0000000000 --- a/posterita/posterita/web/jsp/materialmovement/viewMMovementLines.jsp +++ /dev/null @@ -1,132 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<%@page import="org.posterita.Constants"%> -<%@page import="org.posterita.struts.stock.StockMovementAction"%> -<%@page import="org.posterita.beans.StockMovementBean"%> -Stock Movement -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -
     
    - -
    - - -<% - StockMovementBean movementBean = (StockMovementBean)request.getSession().getAttribute(Constants.MMOVEMENT); - String orgFrom = movementBean.getOrgFromName(); - String orgTo = movementBean.getOrgToName(); - String addressFrom = movementBean.getAddress1(); - String addressTo = movementBean.getAddress2(); - String docStatus = movementBean.getDocStatus(); - String date = movementBean.getMovementDate(); - String movementId = movementBean.getDocumentNo().toString(); -%> - - - - - -
    -
    <%=orgFrom%>
    -
    <%=addressFrom %>
    -
    <%=docStatus %>
    -
    <%=movementId %>
    -
    -
    <%=orgTo %>
    -
    <%=addressTo %>
    -
    -
     
    -
    -
     
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Product NameDescriptionUom ActiveQuantity
    - - - - - - - - - - -
    - - - - - - -
    - " class="newbutton" onclick="get('ViewMMovement.do?action=viewMMovement')"> - -   -
    - - - - - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/materialmovement/viewMoveConfirm.jsp b/posterita/posterita/web/jsp/materialmovement/viewMoveConfirm.jsp deleted file mode 100644 index 5a97c30a95..0000000000 --- a/posterita/posterita/web/jsp/materialmovement/viewMoveConfirm.jsp +++ /dev/null @@ -1,95 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.Constants"%> -<%@page import="org.posterita.struts.stock.StockMovementAction"%> -Move Confirmation -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -
    - <% - String collection = Constants.MOVE_CONFIRM; - %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    DocNoInventory Move From Organisation Active DocStatusDateAction
    - - - - - - - - - - - - - - <% if (!stock.getDocStatus().equals("CO")) - { - %> - ">Complete - <% - } - %> -
    - -
    -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/materialmovement/viewMoveConfirmLines.jsp b/posterita/posterita/web/jsp/materialmovement/viewMoveConfirmLines.jsp deleted file mode 100644 index d25dc73e1e..0000000000 --- a/posterita/posterita/web/jsp/materialmovement/viewMoveConfirmLines.jsp +++ /dev/null @@ -1,130 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<%@page import="org.posterita.Constants"%> -<%@page import="org.posterita.struts.stock.StockMovementAction"%> -<%@page import="org.posterita.beans.StockMovementBean"%> -Move Confirmation -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -
     
    - -
    - - -<% - StockMovementBean movementBean = (StockMovementBean)request.getSession().getAttribute(Constants.MMOVEMENT); - String orgFrom = movementBean.getOrgFromName(); - String orgTo = movementBean.getOrgToName(); - String addressFrom = movementBean.getAddress1(); - String addressTo = movementBean.getAddress2(); - String docStatus = movementBean.getDocStatus(); - String date = movementBean.getMovementDate(); - String movementId = movementBean.getDocumentNo().toString(); - String moveConfirmId = movementBean.getMoveConfirmId().toString(); -%> - - - - - -
    -
    <%=orgFrom%>
    -
    <%=addressFrom %>
    -
    <%=docStatus %>
    -
    <%=movementId %>
    -
    -
    <%=orgTo %>
    -
    <%=addressTo %>
    -
    -
     
    -
    -
     
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Product NameDescriptionUom ActiveQuantity
    - - - - - - - - - - -
    - - - - -
    - " class="newbutton" onclick="get('ViewMoveConfirm.do?action=viewMoveConfirm')"> - -   -
    - - - - - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/materialmovement/viewMoveLinesHistory.jsp b/posterita/posterita/web/jsp/materialmovement/viewMoveLinesHistory.jsp deleted file mode 100644 index 992cf3badd..0000000000 --- a/posterita/posterita/web/jsp/materialmovement/viewMoveLinesHistory.jsp +++ /dev/null @@ -1,120 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<%@page import="org.posterita.Constants"%> -<%@page import="org.posterita.struts.stock.StockMovementAction"%> -<%@page import="org.posterita.beans.StockMovementBean"%> - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -
     
    - -
    - - -<% - StockMovementBean movementBean = (StockMovementBean)request.getSession().getAttribute(Constants.MMOVEMENT); - String orgFrom = movementBean.getOrgFromName(); - String orgTo = movementBean.getOrgToName(); - String addressFrom = movementBean.getAddress1(); - String addressTo = movementBean.getAddress2(); - String docStatus = movementBean.getDocStatus(); - String date = movementBean.getMovementDate(); - String movementId = movementBean.getDocumentNo().toString(); -%> -
     
    - - - - - -
    -
    <%=orgFrom%>
    -
    <%=addressFrom %>
    -
    <%=docStatus %>
    -
    <%=movementId %>
    -
    -
    <%=orgTo %>
    -
    <%=addressTo %>
    -
    -
     
    -
    -
     
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Product NameDescriptionUom ActiveQuantity
    - - - - - - - - - - -
    - - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/materialmovement/viewStock.jsp b/posterita/posterita/web/jsp/materialmovement/viewStock.jsp deleted file mode 100644 index 827e32e6e8..0000000000 --- a/posterita/posterita/web/jsp/materialmovement/viewStock.jsp +++ /dev/null @@ -1,394 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 - 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author shameem ---%> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - -<% - String path = request.getContextPath(); - String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; - String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); - Properties ctx = TmkJSPEnv.getCtx(request); - String posName = POSTerminalManager.getTerminalName(ctx); - String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); - String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); - - Object bPId = request.getSession().getAttribute(Constants.BPARTNER_ID); - Object bPName = request.getSession().getAttribute(Constants.BPARTNER_NAME); - Object bPCredit = request.getSession().getAttribute(Constants.BPARTNER_CREDIT); - String bPartnerId = bPId == null? "":bPId.toString(); - String bPartnerName = bPName == null? "": bPName.toString(); - String bPartnerCredit = bPCredit == null? "": bPCredit.toString(); - - //set configuration - Configuration configuration = Configuration.getConfiguration(request); - String paymentRule = configuration.getPaymentRule(); - String searchProductBy = configuration.getSearchProductBy(); - boolean isCustomerCompulsory = configuration.isCustomerCompulsory(); - boolean isTerminalLocked = POSTerminalManager.isTerminalLocked(ctx); - int movementId = Env.getContextAsInt(ctx, Constants.MMOVEMENT_ID); - - Integer priceListId = PriceListManager.getDefaultPriceListId(ctx, false); - Object plId = request.getSession().getAttribute(Constants.ORDER_PRICE_LIST); - if (plId != null) - { - try - { - priceListId = Integer.valueOf(String.valueOf(plId)); - } - catch (NumberFormatException e){} - } - MPriceList priceList = MPriceList.get(ctx, priceListId.intValue(), null); - String priceListName = priceList.getName(); - MCurrency currency = MCurrency.get(ctx, priceList.getC_Currency_ID()); - BigDecimal roundOffFactor = currency.getRoundOffFactor(); - - if (isTerminalLocked) - { - posName += " (Locked)"; - } - - int roleId = Env.getAD_Role_ID(ctx); - - Object orgFrom = request.getSession().getAttribute(Constants.ORG_FROM_ID); - Integer ctxOrg = Integer.valueOf(Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)); - String org = orgFrom == null? ctxOrg.toString(): orgFrom.toString(); - - int menuId = MenuManager.getMenuId(ctx, "pmenu.stock"); -%> - -<%@page import="org.posterita.struts.stock.StockMovementAction"%> -<%@page import="org.posterita.Constants"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.posterita.businesslogic.stock.StockList"%> -<%@page import="java.math.BigDecimal"%> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> -<%@page import="java.util.Properties"%> -<%@page import="org.compiere.model.MProductPrice"%> -<%@page import="org.posterita.businesslogic.administration.PriceListManager"%> -<%@page import="org.posterita.user.WebUserInfo"%> -<%@page import="org.compiere.model.MOrg"%> -<%@page import="org.compiere.model.MRole"%> -<%@page import="org.posterita.core.Configuration"%> -<%@page import="org.compiere.model.MPriceList"%> -<%@page import="org.compiere.model.MCurrency"%> -<%@page import="org.posterita.order.UDIOrderTypes"%> -<%@page import="org.posterita.businesslogic.administration.RoleManager"%> -<%@page import="org.posterita.businesslogic.MenuManager"%> -<%@page import="org.posterita.businesslogic.stock.MMovementManager"%> - - - - - <%=appName%> - - - - - - - - - - - - - - - - - -<%@ include file="/jsp/include/showErrors.jsp" %> -
    Please wait...
    - - - - - - - - - - - - - " styleId="movementId"/> - - - - - - - - - - - - -
    -
    - - -
    - STOCK TRANSFER -
    -
    -
    -
    - : - <%=orgName%> -
    -
    - : - <%=posName%> -
    -
    -
    -
    - : - -
    -
    - : - <%=roleName%> -
    -
    -
    -
    -
    -
    -
    -
    -
    STATUS: DRAFTED
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - -
    - BARCODE: - - - NAME: -
    -
    - DESC: -
    -
    -
    -
    -
    -
    -
    -
    - <%=priceListName%> -
    -
    -
    -
    -
    -
    - <%= MMovementManager.getMMovementCartAsHTML(request)%> -
    -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Barcode - - -
    - Name - - -
    - Description - - -
    - Tax Cat - - -
    - Stock Qty - - -
    - Price List - - -
    - Units Per Pack - - -
    -
    -
    -
    - - Increase item quantity - Decrease item quantity - Remove item -
    -
    -
    -
    - - - - - - - - - -
    - - - -
    - - - -
    -
    -
    - - - - - - - - - -
    DOCUMENT NO:
    REFERENCE:
    - -
    -
    -
    -
    - New Stock Tansfer - Clear all items -
    -
    -
    -
    -
    - Save - Complete -
    -
    -
    -
    -
    - F1 Barcode | F2 Name | F3 Description | F4 Quantity | Ctrl+Up MoveUp | Ctrl+Down MoveDown | Ctrl+Left Decrement | Ctrl-Right Increment | Ctrl-Backspace Remove | Ctrl+M Menu | - Ctrl-S Save | Ctrl-Delete Clear | Ctrl+Space Checkout | Ctrl+C Complete -
    -
    -
    -
    - " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> -
    - -
    -
    -
    -
    - - diff --git a/posterita/posterita/web/jsp/materialmovement/viewStockList.jsp b/posterita/posterita/web/jsp/materialmovement/viewStockList.jsp deleted file mode 100644 index 16a78a7c35..0000000000 --- a/posterita/posterita/web/jsp/materialmovement/viewStockList.jsp +++ /dev/null @@ -1,173 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSProductAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> -<%@page import="org.posterita.struts.stock.StockMovementAction"%> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -
    -
    -
    - -
    -
    - - -
    - - - - - - - - - - - - - -
    -
    -
    - - - - - - - - - - - - <% - String url = "ViewStockList.do"; - String collection = Constants.MATERIAL_MOVEMENT_DETAILS; - %> - - - <% - String styleClass = "label"; - if ((index.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - -
     
    - - - - - - - - - - - - - - - - - - ">Remove -
    - - - -
    -   -
    - - -
    -
    - -
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/payment/paymentDetails.jsp b/posterita/posterita/web/jsp/payment/paymentDetails.jsp deleted file mode 100644 index 5ea34a198d..0000000000 --- a/posterita/posterita/web/jsp/payment/paymentDetails.jsp +++ /dev/null @@ -1,127 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - - - - - - - -
    - - - - - -
    - - - - - - - - - -
    - Document Type: -
    - - - - - - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - -
    - - - - - - - Invoice Ref No: - - - - - -
    - Payment Ref No: - - Counter Payment Ref No: -
    - Status: -
    -   -
    - - - - - - - - - - - - - - - - - - - - - - -
    Date PaidPay Amount
    - - - - - -
    - - diff --git a/posterita/posterita/web/jsp/payment/viewPayment.jsp b/posterita/posterita/web/jsp/payment/viewPayment.jsp deleted file mode 100644 index b7eb31a701..0000000000 --- a/posterita/posterita/web/jsp/payment/viewPayment.jsp +++ /dev/null @@ -1,96 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok Pathak ---%> - - -<%@ page import="com.posterita.Constants" %> -<%@ page import="com.posterita.user.WebUserInfo" %> -<%@ page import="com.posterita.order.UDIOrderTypes" %> -<%@ page import="org.compiere.model.MPayment" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> - - -Payment - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -<%-- -@TODO by Alok - ---%> - - - <%@ include file="/jsp/webstore/webDocumentHeader.jsp" %> - - - - - - - - - - -
    - - Payment By: -
    -
    - Ref Payment No: -
    - Status: -
    -
    - - - - - - - - - - - -
    Payment DateAmount
    - - - - -
    -
    - - - - <%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/payment/viewPaymentHistory.jsp b/posterita/posterita/web/jsp/payment/viewPaymentHistory.jsp deleted file mode 100644 index affc3992fb..0000000000 --- a/posterita/posterita/web/jsp/payment/viewPaymentHistory.jsp +++ /dev/null @@ -1,124 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.posterita.struts.payment.PaymentAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - - - - - - - - - - - - - - -
    - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> -
    - - - - - <%@ include file="/jsp/include/filter.jsp"%> - - -
    -
    - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - -
    -
    - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/AllPOSCustomer.jsp b/posterita/posterita/web/jsp/pos/AllPOSCustomer.jsp deleted file mode 100644 index 5849356121..0000000000 --- a/posterita/posterita/web/jsp/pos/AllPOSCustomer.jsp +++ /dev/null @@ -1,442 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -
    - - - - - - - - - - - - -
    - - - - -   - - - - - <%@include file="/jsp/include/dayList.jsp"%> - - - - <%@include file="/jsp/include/month.jsp"%> - - - - - <% - int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); - %> - <%= currentYear %> - <%= currentYear - 1 %> - - - - All - Active - Not Active - - - - - <pos:message textOnly="true" key="add"/> - - - "> - Import POS Customers - -
    -
    - - - <% - org.posterita.businesslogic.CustomerCart cart = (org.posterita.businesslogic.CustomerCart)request.getSession().getAttribute(Constants.CUSTOMER_CART); - %> - - -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    :
    -
    -
    - - - - - - - - - - - - - - -<% - String url = "ViewAllCustomers.do"; - String collection = Constants.ALL_CUSTOMERS; -%> - - - <% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - -
      
    - - - -
    - -
    - - - - - - - - - - Y - - - N - - - - - - "> - <pos:message textOnly="true" key="edit.customer"/> - - - -   - "> - <pos:message textOnly="true" key="view"/> - - - -   - - "> - <pos:message textOnly="true" key="deactivate"/> - - - - "> - <pos:message textOnly="true" key="activate"/> - - - - - - <% - if(((org.posterita.businesslogic.CustomerCart)request.getSession().getAttribute(Constants.CUSTOMER_CART)).hasCustomer(Integer.parseInt(bpartnerId+""))) - { - %> - - - <% - } - else - { - %> - - <% - } - %> - - - - -
    -<%@ include file="/jsp/include/pager.jsp" %> -
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/ViewAllPosVendors.jsp b/posterita/posterita/web/jsp/pos/ViewAllPosVendors.jsp deleted file mode 100644 index 883245fa6b..0000000000 --- a/posterita/posterita/web/jsp/pos/ViewAllPosVendors.jsp +++ /dev/null @@ -1,173 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - -<%@ include file="/jsp/include/posHeader.jsp" %> - - - -
    - - - - - - - - - - -
    - - - - - -   - - - - - Add Vendor - -
    -
    - - - -
    :
    -
    -
    -
    - - - - -<% - String url = "ViewAllVendors.do"; - String collection = Constants.VENDOR_LIST; -%> - - - - - - - - - - - - - - - - - - - - - - - - - -<% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; -%> - - - - - - - - - - - - - -
     
    - - - - - - - - - - - - Y - - - N - - - - "> - <%=editmsg%> - - - "> - <%=viewmsg%> - - - - "> - <%=deactivatemsg%> - - - - - "> - <%=activatemsg%> - - -
    - -<%@ include file="/jsp/include/pager.jsp" %> - -
    - -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/adjustCashBook.jsp b/posterita/posterita/web/jsp/pos/adjustCashBook.jsp deleted file mode 100644 index 0fe4760bf3..0000000000 --- a/posterita/posterita/web/jsp/pos/adjustCashBook.jsp +++ /dev/null @@ -1,93 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CashBookAction" %> -<%@ page import="org.compiere.model.MCashLine" %> - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -
    - - - - - - - - - - - - - - - - - -
    - * - - -
    - * - - - - - - -
    - * - - - -
    -   - - -   - -
    -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/adjustInventory.jsp b/posterita/posterita/web/jsp/pos/adjustInventory.jsp deleted file mode 100644 index 0039eaf096..0000000000 --- a/posterita/posterita/web/jsp/pos/adjustInventory.jsp +++ /dev/null @@ -1,102 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.posterita.struts.pos.InventoryAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - <% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - -
    -
    - - - - - - - - - - - -
     
    - - - - - - - - - - Save - -
    - - Complete - -
    - -
    -
    - -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/adjustStock.jsp b/posterita/posterita/web/jsp/pos/adjustStock.jsp deleted file mode 100644 index 2d50a11666..0000000000 --- a/posterita/posterita/web/jsp/pos/adjustStock.jsp +++ /dev/null @@ -1,498 +0,0 @@ - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - -<% - String path = request.getContextPath(); - String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; - String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); - Properties ctx = TmkJSPEnv.getCtx(request); - String posName = POSTerminalManager.getTerminalName(ctx); - String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); - String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); - - int menu_id = MenuManager.getMenuId(ctx, "pmenu.stock"); - - String orderType = "Stock Adjustment"; - int purchasePriceListVersionId=Env.getContextAsInt(ctx,UdiConstants.POS_PURCHASE_PL_VERSION); - MPriceListVersion priceListVersion = new MPriceListVersion(ctx,purchasePriceListVersionId,null); - int m_pricelist_id = priceListVersion.getM_PriceList_ID(); - MPriceList priceList = new MPriceList(ctx,m_pricelist_id,null); - - int inventoryId = Env.getContextAsInt(ctx, Constants.INVENTORY_ID); - String description = Env.getContext(ctx, Constants.DESCRIPTION); - long currentTimeInMillis = System.currentTimeMillis(); - Date today = new Date( currentTimeInMillis ); - if(description == "") - { - description = "Stock Adjustment - " + today; - } - - String docNo = (String)request.getSession().getAttribute(Constants.DOC_NO); - if(docNo == "" || docNo == null) - { - docNo = "N/A"; - } - - String docStatus = (String)request.getSession().getAttribute(Constants.DOC_STATUS); - if(docStatus == "" || docStatus == null) - { - docStatus = "N/A"; - } - else - { - - if (DocAction.STATUS_Drafted.equals(docStatus)) - docStatus = Constants.DOC_STATUS_DRAFTED; - else - if (DocAction.STATUS_InProgress.equals(docStatus)) - docStatus = Constants.DOC_STATUS_INPROGRESS; - else - if (DocAction.STATUS_Completed.equals(docStatus)) - docStatus = Constants.DOC_STATUS_COMPLETED; - else - if (DocAction.STATUS_Closed.equals(docStatus)) - docStatus = Constants.DOC_STATUS_CLOSED; - else - if (DocAction.STATUS_Invalid.equals(docStatus)) - docStatus = Constants.DOC_STATUS_INVALID; - else - if (DocAction.STATUS_Voided.equals(docStatus)) - docStatus = Constants.DOC_STATUS_VOID; - } - - String priceListName = priceList.getName(); - MCurrency currency = MCurrency.get(ctx, priceList.getC_Currency_ID()); - BigDecimal roundOffFactor = currency.getRoundOffFactor(); - - //set configuration - Configuration configuration = Configuration.getConfiguration(request); - String paymentRule = configuration.getPaymentRule(); - String searchProductBy = configuration.getSearchProductBy(); - boolean isCustomerCompulsory = configuration.isCustomerCompulsory(); - -%> - -<%@page import="org.posterita.Constants"%> -<%@page import="java.util.Properties"%> -<%@page import="java.util.Calendar"%> -<%@page import="java.util.Date"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="org.compiere.model.MPOS"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.compiere.model.MPriceList"%> -<%@page import="org.compiere.model.MOrg"%> -<%@page import="org.compiere.model.MRole"%> -<%@page import="org.posterita.businesslogic.stock.InventoryCartManager"%> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> -<%@page import="org.posterita.core.Configuration"%> -<%@page import="java.math.BigDecimal"%> -<%@page import="org.compiere.model.MCurrency"%> -<%@page import="org.compiere.model.MPriceListVersion"%> -<%@page import="org.compiere.util.WebSessionCtx"%> -<%@page import="org.posterita.user.WebUserInfo"%> - -<%@page import="org.posterita.businesslogic.MenuManager"%> -<%@page import="org.compiere.process.DocAction"%> - - - - - <%=appName%> - - - - - - - - - - - - - - - - - - - -
    Please wait...
    - - - - - - - - - - - - - " styleId="priceListId"/> - " styleId="invdescription"/> - " styleId="inventoryId"/> - " styleId = "roundOffFactor" /> - - " id="isCustomerCompulsory"/> - - - - - - - - - - - -
    -
    - - -
    - <%= orderType %> -
    -
    -
    -
    - : - <%=orgName%> -
    -
    - : - <%=posName%> -
    -
    -
    -
    - : - -
    -
    - : - <%=roleName%> -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - -
    - BARCODE: - - - NAME: -
    -
    - DESC: -
    -
    -
    -
    - -
    -
    -
    -
    -
    - <%=priceListName%> -
    -
    -
    -
    -
    -
    - <%= InventoryCartManager.getInventoryCartAsHTML(request)%> -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Barcode - - -
    - Name - - -
    - Description - - -
    - Tax Cat - - -
    - Qty Book - - -
    - Price List - - -
    - -
    -
    - - Increase item quantity - Decrease item quantity - Remove item -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    - Total Products - - -
    - Total Qty CSV - - -
    - Total Qty Book - - -
    - Total Qty Count - - -
    - Discrepancy - - -
    -
    -
    - - - - - - - - - - - - - - -
    - Reference - - <%=description + ""%> -
    - Doc No - - <%=docNo%> -
    - Status - - <%=docStatus%> -
    - -
    -
    -
    -
    -
    -
    PRINT
    -
    CSV
    -
    SAVE AS CSV
    -
    ADD CSV
    -
    CLEAR
    -
    SAVE
    -
    NEW
    -
    SEARCH
    -
    REFRESH CART
    -
    -
    -
    -
    -
    COMPLETE
    -
    -
    -
    - F1 Barcode | F2 Name | F3 Description | F4 Qty | F5 Save | F6 Search | F7 Import CSV | F8 CSV | F9 Save CSV | F10 Refresh Cart | - Ctrl+Up MoveUp | Ctrl+Down MoveDown | Ctrl+Left Decrement | Ctrl-Right Increment | Ctrl-Backspace Remove | Ctrl+M Menu | Ctrl+N New Cart | Ctrl+R Reference | - Ctrl-P Print | Ctrl-C Complete | Ctrl-Delete Clear -
    -
    - -
    - " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> -
    - - - - - - - - - - - - - - - - - - -
    - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/adjustedStock.jsp b/posterita/posterita/web/jsp/pos/adjustedStock.jsp deleted file mode 100644 index c04ee37868..0000000000 --- a/posterita/posterita/web/jsp/pos/adjustedStock.jsp +++ /dev/null @@ -1,97 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.posterita.struts.pos.InventoryAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - <% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - -
    -
    - - - -
    -
    -
    -
    - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/advancedOrderScreen.jsp b/posterita/posterita/web/jsp/pos/advancedOrderScreen.jsp deleted file mode 100644 index 7ab7332292..0000000000 --- a/posterita/posterita/web/jsp/pos/advancedOrderScreen.jsp +++ /dev/null @@ -1,369 +0,0 @@ -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<% - String path = request.getContextPath(); - String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; - //String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); - Properties ctx = TmkJSPEnv.getCtx(request); - String posName = POSTerminalManager.getTerminalName(ctx); - String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); - String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); -%> - -<%@page import="org.posterita.Constants"%> -<%@page import="java.util.Properties"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.compiere.model.MPriceList"%> -<%@page import="org.posterita.businesslogic.administration.RoleManager"%> -<%@page import="java.math.BigDecimal"%> -<%@page import="org.compiere.model.MOrg"%> -<%@page import="org.compiere.model.MRole"%> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> -<%@page import="org.posterita.TangoColors"%> -<%@page import="org.compiere.model.MCurrency"%> - - - - - - - - - - - - - - - - - - - - - -<% - MPriceList priceList = MPriceList.get(ctx, Integer.valueOf(priceListId).intValue(), null); - String priceListName = priceList.getName(); - int currencyId = priceList.getC_Currency_ID(); - MCurrency currency = MCurrency.get(ctx, currencyId); - String curSymbole = currency.getCurSymbol(); -%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - POS Order -
    -
    -
    -
    - - Organisation : - Posterita -
    -
    - Terminal : - Test teminal -
    -
    -
    - -
    - User : - admin -
    -
    - Role : - admin -
    -
    - -
    -
    -
    -
    -
    -
    -
    - <%=curSymbole%> - - - -
    -
    -
    -
    -
    -   - -
    -
    - <%=priceListName%> -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - String trStyleClass = ""; - - if ((count.intValue()%2) == 0) - { - //use same color for sales and purchase for time being - if(orderType.equals("POS Order")) - { - trStyleClass = "evenRow"; - } - else if(orderType.equals("POS Goods Receive Note")) - { - trStyleClass = "evenRow"; - } - } - else - { - trStyleClass = "oddRow"; - } - %> - " qty="<%=element.getQty()%>" id="<%= "row" + (count.intValue()+1)%>"> - - - - - - - - - - - - - - - "> - - - - - - - -
    - - - - - " name="qtyPerLine"/> - - - - " name="inclPrice" size="10"/> - - - " name="taxRate"/> - - - - - - - - - " name="discount"/> - - " name="discountedPrice"/> - " name="limitPrice"/> - " name="isDiscOnInclUnitPrice"/> - " name="discInclUnitPrice"/> - " name="isDiscOnPerc"/> - " name="isDiscOnTotal"/> - " name="listPrice"/> -
       -
    - -
    -
    - - " name="inclPrice"/> - - - " format="0.00"/>"id="totalDiscount" name="totalDiscount" class="numeric"/> - - - - - - - " format="0.00"/>" id="grandTotal" name="discountedTotal"/> - - - " id="grandTotal" name="discountedTotal"/> - - - - - - -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - -
    - Override Price Limit: - - <%=isAllowedOverridePriceLimit%> -
    - Discount Limit: - - <%=discountAllowed%> -
    - Price Limit: - - -
    - -
    -
    -
    -
    - <% String loadScreen = "CreatePOSOrderScreen.do?orderType="+orderType; - %> - "/>')" value="Cancel"/> - - -
    -
    -
    - -
    -
    -
    - Ctrl+Enter APPLY | Ctrl+Space OVERRIDE | Ctrl+Backspace CANCEL -
    -
    -
    -
    - - - - - - - - - - -
    - -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/allBlackListCheque.jsp b/posterita/posterita/web/jsp/pos/allBlackListCheque.jsp deleted file mode 100644 index 0748d3271e..0000000000 --- a/posterita/posterita/web/jsp/pos/allBlackListCheque.jsp +++ /dev/null @@ -1,114 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.compiere.model.MBlackListCheque" %> -<%@ page import="org.posterita.beans.BlackListedBean" %> -<%@ page import="org.posterita.struts.pos.BlackListedAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> - - -
    - - - - - - - - - -
    - -
    -
    - -
    - - - - - -   - -
    - - - - -
    -
    -
    - -
    - - - - - - - - <% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - -
     
    - - - - - - ">Edit -   - ">Delete - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashBookAdjustmentCompleted.jsp b/posterita/posterita/web/jsp/pos/cashBookAdjustmentCompleted.jsp deleted file mode 100644 index badebe9270..0000000000 --- a/posterita/posterita/web/jsp/pos/cashBookAdjustmentCompleted.jsp +++ /dev/null @@ -1,55 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CashBookAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -
    - -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashDetails.jsp b/posterita/posterita/web/jsp/pos/cashDetails.jsp deleted file mode 100644 index 9f2b5c3bd9..0000000000 --- a/posterita/posterita/web/jsp/pos/cashDetails.jsp +++ /dev/null @@ -1,137 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.CashAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.compiere.process.DocAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - -
    - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - <%@ include file="/jsp/include/historyMonthYearFilter.jsp"%> - -
    - - - -
    -
    - - - <% - String url = "CashDetails.do"; - String collection = Constants.CASH_DETAILS; - %> - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - -
    > - "> - - - > - - > - - - > - - - > - - > - -
    - <%@ include file="/jsp/include/pager.jsp" %> -
    -
    - - -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashLineDetails.jsp b/posterita/posterita/web/jsp/pos/cashLineDetails.jsp deleted file mode 100644 index 4267f38ff8..0000000000 --- a/posterita/posterita/web/jsp/pos/cashLineDetails.jsp +++ /dev/null @@ -1,80 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - -<%@ page import="org.posterita.Constants" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - -
    - - <% - Integer invoiceId = element.getInvoiceId(); - String cashTypeLink = ""; - if(invoiceId.intValue() == 0) - cashTypeLink = element.getCashTypeName(); - else - { - cashTypeLink = ""; - cashTypeLink += element.getCashTypeName(); - cashTypeLink += ""; - } - %> - - <%= cashTypeLink%> - - - - - - - -
    -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashSummary.jsp b/posterita/posterita/web/jsp/pos/cashSummary.jsp deleted file mode 100644 index 948c5ab550..0000000000 --- a/posterita/posterita/web/jsp/pos/cashSummary.jsp +++ /dev/null @@ -1,53 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.compiere.process.DocAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<% - String requestURI = "CashLineReportAction.do"; -%> - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -<%@ include file="/jsp/pos/cashSummaryInc.jsp"%> - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashSummaryDate.jsp b/posterita/posterita/web/jsp/pos/cashSummaryDate.jsp deleted file mode 100644 index c4d43c260b..0000000000 --- a/posterita/posterita/web/jsp/pos/cashSummaryDate.jsp +++ /dev/null @@ -1,91 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.compiere.process.DocAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<% - String requestURI = "CashSummaryReportAction.do"; -%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - -
    - <%@ include file="/jsp/include/dateFilter.jsp" %> -
    -   -
    - <%@ include file="/jsp/pos/cashSummaryInc.jsp"%> -
    -<%@ include file="/jsp/include/posFooter.jsp" %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/cashSummaryInc.jsp b/posterita/posterita/web/jsp/pos/cashSummaryInc.jsp deleted file mode 100644 index 669ab4e9e4..0000000000 --- a/posterita/posterita/web/jsp/pos/cashSummaryInc.jsp +++ /dev/null @@ -1,192 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> -<%@ page import="org.posterita.Constants" %> - -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
    - - - - -
    - - - - -
    - - - - -
    - - - - -
    - - - - -
    - - - - -
    - - - - -
    -
    -
    - -
    -			
    -			
    -
    -
    - - - - - -
    -   - - - - -   - -
    -
    - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/chooseFastMovingItemReport.jsp b/posterita/posterita/web/jsp/pos/chooseFastMovingItemReport.jsp deleted file mode 100644 index 561360f8d2..0000000000 --- a/posterita/posterita/web/jsp/pos/chooseFastMovingItemReport.jsp +++ /dev/null @@ -1,48 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> -
    - -
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/choosePOS.jsp b/posterita/posterita/web/jsp/pos/choosePOS.jsp deleted file mode 100644 index 41dad2e728..0000000000 --- a/posterita/posterita/web/jsp/pos/choosePOS.jsp +++ /dev/null @@ -1,103 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.login.POSLoginAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<% -String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); -%> - - - - -<%=appName%> - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/choosePOSInfo.jsp b/posterita/posterita/web/jsp/pos/choosePOSInfo.jsp deleted file mode 100644 index 753e9398f4..0000000000 --- a/posterita/posterita/web/jsp/pos/choosePOSInfo.jsp +++ /dev/null @@ -1,43 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> -
    - -
    -
    - - -
    -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/closeCashBook.jsp b/posterita/posterita/web/jsp/pos/closeCashBook.jsp deleted file mode 100644 index 1d2b0071e5..0000000000 --- a/posterita/posterita/web/jsp/pos/closeCashBook.jsp +++ /dev/null @@ -1,145 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen,Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CashBookAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -<% int noOfOpenedCashbook = 0;%> - - - - - - - - - - - - - - - - - - - -<% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; -%> - - - - - - - - - - - - - - - - - - - - - - -
    - Cash Book Name - - Beginining Balance - - Ending Balance - - Net Transection - - Status - - Amount transfer - - Transfer Full Amount -
    - - - - - "/> - - - - "/> - - - - - - - - - - - <% noOfOpenedCashbook++; %> - - -
    -
    -
    -<% - if (noOfOpenedCashbook > 0) - { -%> - -   - -<% - } -%> -
    - -
    -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/closePOSTill.jsp b/posterita/posterita/web/jsp/pos/closePOSTill.jsp deleted file mode 100644 index 94e3eb4490..0000000000 --- a/posterita/posterita/web/jsp/pos/closePOSTill.jsp +++ /dev/null @@ -1,299 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen, Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CashBookAction" %> -<%@ page import="org.posterita.businesslogic.POSTerminalManager" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - - - - - - <% - String styleClass = "label"; - %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
    - - - - -
    - - - - -
    - - - - "> -
    -   -
    - -
    -
    - -   - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/closedPOSTill.jsp b/posterita/posterita/web/jsp/pos/closedPOSTill.jsp deleted file mode 100644 index 72fa54e41a..0000000000 --- a/posterita/posterita/web/jsp/pos/closedPOSTill.jsp +++ /dev/null @@ -1,184 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants"%> -<%@ page import="org.posterita.user.*"%> -<%@ page import="org.posterita.beans.*"%> -<%@ page import="org.posterita.struts.pos.CashBookAction"%> -<%@ page import="org.posterita.businesslogic.POSTerminalManager"%> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> -<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp"%> -<%@ include file="/jsp/include/errors.jsp"%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    : -
    :
    : -
    :
    :
    :
    :
    :
    :
    :
    :
    - - : -
    - -<%@ include file="/jsp/include/printOrderApplet2.jsp"%> - - - - - - -<%@ include file="/jsp/include/posFooter.jsp"%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/completePOSOrder.jsp b/posterita/posterita/web/jsp/pos/completePOSOrder.jsp deleted file mode 100644 index e2b9eea2bc..0000000000 --- a/posterita/posterita/web/jsp/pos/completePOSOrder.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/completePOSOrderIncl.jsp" %> - - diff --git a/posterita/posterita/web/jsp/pos/completePOSOrder2.jsp b/posterita/posterita/web/jsp/pos/completePOSOrder2.jsp deleted file mode 100644 index b9db816393..0000000000 --- a/posterita/posterita/web/jsp/pos/completePOSOrder2.jsp +++ /dev/null @@ -1,41 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/completePOSOrderIncl.jsp" %> - - - diff --git a/posterita/posterita/web/jsp/pos/completePOSOrder3.jsp b/posterita/posterita/web/jsp/pos/completePOSOrder3.jsp deleted file mode 100644 index 83f171f36e..0000000000 --- a/posterita/posterita/web/jsp/pos/completePOSOrder3.jsp +++ /dev/null @@ -1,41 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/completePOSOrderIncl.jsp" %> - - - diff --git a/posterita/posterita/web/jsp/pos/completePOSOrderWA.jsp b/posterita/posterita/web/jsp/pos/completePOSOrderWA.jsp deleted file mode 100644 index 5b999b7e0d..0000000000 --- a/posterita/posterita/web/jsp/pos/completePOSOrderWA.jsp +++ /dev/null @@ -1,34 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/completePOSOrderIncl.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/completePOSShoppingCart.jsp b/posterita/posterita/web/jsp/pos/completePOSShoppingCart.jsp deleted file mode 100644 index 8e8b402414..0000000000 --- a/posterita/posterita/web/jsp/pos/completePOSShoppingCart.jsp +++ /dev/null @@ -1,221 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> -<% - boolean isFullDetails = false; - - if(request.getParameter("isFullDetails") != null) - { - isFullDetails = Boolean.parseBoolean(request.getParameter("isFullDetails")); - } -%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - <%@page import="org.posterita.Constants"%> - - - - - - - - - - - - - <% - if(isFullDetails) - { - %> - - - - <% - } - %> - - - - <%String styleClass = "label"; %> - - - - <% - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - <% - if(isFullDetails) - { - %> - - - - <% - } - %> - - - - - - - - - - - - - - - <% - if(isFullDetails) - { - %> - - - - <% - } - %> - - - <% styleClass = styleClass.equals("label")? "contentName":"label"; %> - - - - - - - - - <% - if(isFullDetails) - { - %> - - - - <% - } - %> - - - <% styleClass = styleClass.equals("label")? "contentName":"label"; %> - - - - - - - - - <% - if(isFullDetails) - { - %> - - - - <% - } - %> - - - - - - - - - - <% - if(isFullDetails) - { - %> - - - - <% - } - %> - - - -
    > align="right"> align="right"> align="right"> align="right"> align="right"> align="right"> align="right"> align="right"> align="right"> align="right">
    - - - -   - -   - - - - -   - - - - - - -   - - - -
    > - - align="right"> - -
    > - - align="right"> - -
    - - - -   - -   - - - - -   - - - - - - -    
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/completedCreditOrder.jsp b/posterita/posterita/web/jsp/pos/completedCreditOrder.jsp deleted file mode 100644 index fe0940f92c..0000000000 --- a/posterita/posterita/web/jsp/pos/completedCreditOrder.jsp +++ /dev/null @@ -1,88 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -
    - - -
    - -<%@ include file="/jsp/pos/orderHeader.jsp" %> -<% String orderlines = Constants.POS_ORDER_LINES; %> -<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> - -
    - - - - - - - - - - -
     
    - -
    - - -
    - -<%@ include file="/jsp/include/printOrderApplet.jsp" %> -<%@ include file="/jsp/include/posFooter.jsp" %> - - diff --git a/posterita/posterita/web/jsp/pos/completedCustomerReturnOrder.jsp b/posterita/posterita/web/jsp/pos/completedCustomerReturnOrder.jsp deleted file mode 100644 index 109f0804b8..0000000000 --- a/posterita/posterita/web/jsp/pos/completedCustomerReturnOrder.jsp +++ /dev/null @@ -1,102 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="java.util.ArrayList" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -
    - - - - -
    - - - -
    - -
    - <%@ include file="/jsp/pos/orderHeader.jsp" %> - <% String orderlines = Constants.CUSTOMER_RETURN_ORDER_LINES; %> - <%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> -
    - - -
    - - -<%@ include file="/jsp/include/printOrderApplet.jsp" %> -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/completedGoodsReceiveNote.jsp b/posterita/posterita/web/jsp/pos/completedGoodsReceiveNote.jsp deleted file mode 100644 index 3809a39235..0000000000 --- a/posterita/posterita/web/jsp/pos/completedGoodsReceiveNote.jsp +++ /dev/null @@ -1,88 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="java.util.ArrayList" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -
    - <%@ include file="/jsp/pos/orderHeader.jsp" %> - <% String orderlines = Constants.GOODS_RECEIVE_NOTE_LINES; %> - <%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> -
    -
    - - - - - - - -
    -   -
    - - - - - - -
    - -<%@ include file="/jsp/include/printOrderApplet.jsp" %> -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/completedGoodsReturnNote.jsp b/posterita/posterita/web/jsp/pos/completedGoodsReturnNote.jsp deleted file mode 100644 index 28d88572ee..0000000000 --- a/posterita/posterita/web/jsp/pos/completedGoodsReturnNote.jsp +++ /dev/null @@ -1,89 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="java.util.ArrayList" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> -<% String orderlines = Constants.GOODS_RETURN_NOTE_LINES; %> -<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> - - - - - - - - -
    -

    -
    - -
    -
    - - - - - - -
    - - -<%@ include file="/jsp/include/printOrderApplet.jsp" %> -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createAPPayment.jsp b/posterita/posterita/web/jsp/pos/createAPPayment.jsp deleted file mode 100644 index c9c8f4b6e3..0000000000 --- a/posterita/posterita/web/jsp/pos/createAPPayment.jsp +++ /dev/null @@ -1,82 +0,0 @@ - -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.struts.pos.PaymentAction" %> -<%@ page import="org.compiere.model.MProduct" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - -
    -
    - - -
    -
    - <%@ include file="/jsp/include/vendorInfoPanel.jsp" %> - - <%@ include file="/jsp/include/tenderPanel.jsp" %> -
    - -   - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createBlackListCheque.jsp b/posterita/posterita/web/jsp/pos/createBlackListCheque.jsp deleted file mode 100644 index 003f91ff27..0000000000 --- a/posterita/posterita/web/jsp/pos/createBlackListCheque.jsp +++ /dev/null @@ -1,81 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - * - - -
    - * - - -
    - -   - -
    - -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createCreditOrder.jsp b/posterita/posterita/web/jsp/pos/createCreditOrder.jsp deleted file mode 100644 index 35d514632a..0000000000 --- a/posterita/posterita/web/jsp/pos/createCreditOrder.jsp +++ /dev/null @@ -1,114 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - -
    - "> - Create New - -
    -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - <%@ include file="/jsp/include/creditOrderWithAdvanced.jsp" %> - <%@ include file="/jsp/include/pinPanel.jsp" %> - - -<%@ include file="/js/createPOSOrder.js" %> - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/createCreditOrder2.jsp b/posterita/posterita/web/jsp/pos/createCreditOrder2.jsp deleted file mode 100644 index 010c61f1de..0000000000 --- a/posterita/posterita/web/jsp/pos/createCreditOrder2.jsp +++ /dev/null @@ -1,347 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - -
    - - - - - - - - - - -   - -
    - - - <%@ include file="/jsp/include/searchProductPanel.jsp" %> -  
    -
    -
    - <%@ include file="/jsp/pos/customerReturnShoppingCart.jsp" %> -
    -
    - - - - - -
    -
    - : -
    -
    - -
    - - -
    -
    -
    -   -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/createMultipleAPInvoicePayment.jsp b/posterita/posterita/web/jsp/pos/createMultipleAPInvoicePayment.jsp deleted file mode 100644 index 01b5d1849e..0000000000 --- a/posterita/posterita/web/jsp/pos/createMultipleAPInvoicePayment.jsp +++ /dev/null @@ -1,218 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.struts.pos.PaymentAction" %> -<%@ page import="org.compiere.model.MProduct" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.form.PaymentForm" %> -<%@ page import="java.math.BigDecimal" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - <% - double openAmtTotal = 0.0d; - double paidAmtTotal = 0.0d; - double discountAmtTotal = 0.0d; - double invoiceGrandTotal = 0.0d; - %> - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - <% - String defaultAllocateAmount = "0"; - - - PaymentForm form = (PaymentForm)request.getAttribute("PaymentForm"); - - if(form!=null) - { - String[] allocateAmount = form.getAllocateAmount(); - - - if(allocateAmount!= null) - if(allocateAmount.length!=0) - defaultAllocateAmount = allocateAmount[count.intValue()]; - } - %> - - - - - - <% - openAmtTotal += element.getOpenAmt().doubleValue(); - paidAmtTotal += element.getPaidAmt().doubleValue(); - discountAmtTotal += element.getDiscountAmt().doubleValue(); - invoiceGrandTotal += element.getInvoiceGrandTotal().doubleValue(); - %> - - - - - - - - - - - - - - -
    -
    - - -
    -
    - - - - - - - - - - - - - - - -
    > - - - - > - - > - - > - - > - - > - - > - - - > - -
    Total<%=invoiceGrandTotal%><%=discountAmtTotal%><%=paidAmtTotal%><%=openAmtTotal%> 
    - <%@ include file="/jsp/include/tenderPanel2.jsp" %> -
    - -   - -
    -
    -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/createMultipleIAPnvoicePayment.jsp b/posterita/posterita/web/jsp/pos/createMultipleIAPnvoicePayment.jsp deleted file mode 100644 index 91da6ca9c8..0000000000 --- a/posterita/posterita/web/jsp/pos/createMultipleIAPnvoicePayment.jsp +++ /dev/null @@ -1,218 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.struts.pos.PaymentAction" %> -<%@ page import="org.compiere.model.MProduct" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.form.PaymentForm" %> -<%@ page import="java.math.BigDecimal" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - <% - double openAmtTotal = 0.0d; - double paidAmtTotal = 0.0d; - double discountAmtTotal = 0.0d; - double invoiceGrandTotal = 0.0d; - %> - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - <% - String defaultAllocateAmount = "0"; - - - PaymentForm form = (PaymentForm)request.getAttribute("PaymentForm"); - - if(form!=null) - { - String[] allocateAmount = form.getAllocateAmount(); - - - if(allocateAmount!= null) - if(allocateAmount.length!=0) - defaultAllocateAmount = allocateAmount[count.intValue()]; - } - %> - - - - - - <% - openAmtTotal += element.getOpenAmt().doubleValue(); - paidAmtTotal += element.getPaidAmt().doubleValue(); - discountAmtTotal += element.getDiscountAmt().doubleValue(); - invoiceGrandTotal += element.getInvoiceGrandTotal().doubleValue(); - %> - - - - - - - - - - - - - - -
    -
    - - -
    -
    - - - - - - - - - - - - - - - -
    > - - - - > - - > - - > - - > - - > - - > - - - > - -
    Total<%=invoiceGrandTotal%><%=discountAmtTotal%><%=paidAmtTotal%><%=openAmtTotal%> 
    - <%@ include file="/jsp/include/tenderPanel.jsp" %> -
    - -   - -
    -
    -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/createMultipleInvoicePayment.jsp b/posterita/posterita/web/jsp/pos/createMultipleInvoicePayment.jsp deleted file mode 100644 index 0a172be1d4..0000000000 --- a/posterita/posterita/web/jsp/pos/createMultipleInvoicePayment.jsp +++ /dev/null @@ -1,218 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.struts.pos.PaymentAction" %> -<%@ page import="org.compiere.model.MProduct" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.form.PaymentForm" %> -<%@ page import="java.math.BigDecimal" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - <% - double openAmtTotal = 0.0d; - double paidAmtTotal = 0.0d; - double discountAmtTotal = 0.0d; - double invoiceGrandTotal = 0.0d; - %> - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - <% - String defaultAllocateAmount = "0"; - - - PaymentForm form = (PaymentForm)request.getAttribute("PaymentForm"); - - if(form!=null) - { - String[] allocateAmount = form.getAllocateAmount(); - - - if(allocateAmount!= null) - if(allocateAmount.length!=0) - defaultAllocateAmount = allocateAmount[count.intValue()]; - } - %> - - - - - - <% - openAmtTotal += element.getOpenAmt().doubleValue(); - paidAmtTotal += element.getPaidAmt().doubleValue(); - discountAmtTotal += element.getDiscountAmt().doubleValue(); - invoiceGrandTotal += element.getInvoiceGrandTotal().doubleValue(); - %> - - - - - - - - - - - - - - -
    -
    - - -
    -
    - - - - - - - - - - - - - - - -
    > - - - - > - - > - - > - - > - - > - - > - - - > - -
    Total<%=invoiceGrandTotal%><%=discountAmtTotal%><%=paidAmtTotal%><%=openAmtTotal%> 
    - <%@ include file="/jsp/include/tenderPanel.jsp" %> -
    - -   - -
    -
    -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/createOrUpdatePriceList.jsp b/posterita/posterita/web/jsp/pos/createOrUpdatePriceList.jsp deleted file mode 100644 index fe6c49ca2b..0000000000 --- a/posterita/posterita/web/jsp/pos/createOrUpdatePriceList.jsp +++ /dev/null @@ -1,169 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.Constants"%> -<%@page import="org.posterita.struts.pos.PriceListAction"%> -Price List -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - Previous - - "> - Next - - "> - Create PriceList - -
    - - - -
    - - - - - - - -
    - - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - -
    - - - - - - - - - - - - - - -
    -   -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createOrUpdateProduct.jsp b/posterita/posterita/web/jsp/pos/createOrUpdateProduct.jsp deleted file mode 100644 index 9d820ad81f..0000000000 --- a/posterita/posterita/web/jsp/pos/createOrUpdateProduct.jsp +++ /dev/null @@ -1,586 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.struts.pos.POSProductAction"%> -<%@page import="org.posterita.Constants"%> -<%@page import="org.compiere.model.MProduct"%> -<%@page import="java.math.BigDecimal"%> -<%@page import="org.posterita.beans.ProductBean"%> -Product -<%@ include file="/jsp/include/posHeaderAdministration.jsp" %> -<%@ include file="/jsp/include/errorMsg.jsp" %> - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - -
    - - Image Upload - - - - -
    -
    - - - - * - - - - - -
    - - - - * - - - - -
    - - - - * - - - - - - -
    - - - - * - - - - - - -
    - - - - * - - - - - - -
    - - - - - -
    - - - - * - - - - -
    - - - - - -
    - - - - - - - - -
    - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - <% - String styleClass = "oddRow"; - - if(index.intValue()%2 == 0) - { - styleClass = "evenRow"; - } - - %> - - " class="<%=styleClass%>" onMouseOver="this.className='highlight'" onMouseOut="this.className='oddRow'""> - - - - - - - - - - - - - - - - - - -
    - - - - -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    - -
    - -
    -
    -
    - -
    -
    - -
    - -
    -
    - - - - * - - - - - - - - - - - - - - - - - - - - - -     
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - Stock Qty: -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Sales Figures
    - Period - - Sales - - Total Amt -
    - Today - - - - -
    - Current Week - - - - -
    - Current Month - - - - -
    - 6 Months - - - - -
    - Current Year - - - - -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    - Save Changes -
    -
    -
    -
    - Ctrl-N New Product | Ctrl-I Import Products | Ctrl+M Menu | - Ctrl-D Open Drawer | Ctrl-Left Previous Product | Ctrl-Right Next Product | F4 Save -
    -
    -
    - - diff --git a/posterita/posterita/web/jsp/pos/createOrUpdateProduct2.jsp b/posterita/posterita/web/jsp/pos/createOrUpdateProduct2.jsp deleted file mode 100644 index 7c67705395..0000000000 --- a/posterita/posterita/web/jsp/pos/createOrUpdateProduct2.jsp +++ /dev/null @@ -1,270 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.struts.pos.POSProductAction"%> -<%@page import="org.posterita.Constants"%> -<%@page import="org.compiere.model.MProduct"%> -<%@page import="java.math.BigDecimal"%> -<%@page import="org.posterita.beans.ProductBean"%> -Product - -<%@ include file="/jsp/include/posHeader2.jsp" %> - - -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - "> - Create Product - -
    - - - -
    - * - - - -
    - * - - -
    - * - - - - -
    - * - - - - - -
    - * - - - - -
    - * - - -
    -
    - - - -
    - - - - -
    - - -
    - - - -
    - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - "> - - - - - - - - - - - - - - - - - - -
      
    - - * - - - - - - - - - - - - - - - - - - - - -     
    -
    -
    - - - - -
    - Save - Close -
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createPOSGarmentProducts.jsp b/posterita/posterita/web/jsp/pos/createPOSGarmentProducts.jsp deleted file mode 100644 index 75f1f8b116..0000000000 --- a/posterita/posterita/web/jsp/pos/createPOSGarmentProducts.jsp +++ /dev/null @@ -1,551 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - -<%@ page import="org.posterita.struts.pos.POSProductAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -
    -
    -Garment Details - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    * - -
    * - - -
    -
    * - - -
    -
    * - - -
    -
    * - - -
    -
    * - - -
    -
    - - - - - -
    - - - -
    - - - -
    -
    - - - - - - - - - - - - -
    - * - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - * - - - - - - -
    - * - - - - - - -
    - * - - - - - - -
    -
    -
    -
    - - - - -
    -
    - * - - - - - - - - - -
    -
    - Select: - All - None - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    -
    -
    -
    - Select: - All - None - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    - - - - - - - -
    - - - - - - - -
    - - - - - - - -
    - - - -
    - - - -
    -
    -
    -
    - Select: - All - None - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    -
    -
    - -
    -
    -
    -
    -   -
    -
    - -
    - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/createPOSOrder.jsp b/posterita/posterita/web/jsp/pos/createPOSOrder.jsp deleted file mode 100644 index 3ee9bed300..0000000000 --- a/posterita/posterita/web/jsp/pos/createPOSOrder.jsp +++ /dev/null @@ -1,122 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - <%@ include file="/jsp/include/posOrderWithAdvanced.jsp" %> - - -<%@ include file="/js/createPOSOrder.js" %> - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/createPOSOrder2.jsp b/posterita/posterita/web/jsp/pos/createPOSOrder2.jsp deleted file mode 100644 index c9a49452ea..0000000000 --- a/posterita/posterita/web/jsp/pos/createPOSOrder2.jsp +++ /dev/null @@ -1,100 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.compiere.model.MOrder" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - <%@ include file="/jsp/include/posOrderWithAdvancedFocusSearch.jsp" %> - - -<%@ include file="/js/createPOSOrder.js" %> - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/createPOSOrder3.jsp b/posterita/posterita/web/jsp/pos/createPOSOrder3.jsp deleted file mode 100644 index 67e5092646..0000000000 --- a/posterita/posterita/web/jsp/pos/createPOSOrder3.jsp +++ /dev/null @@ -1,89 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - <%@ include file="/jsp/include/posOrder.jsp" %> - - -<%@ include file="/js/createPOSOrder.js" %> - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/createPOSOrderWithoutAdvance.jsp b/posterita/posterita/web/jsp/pos/createPOSOrderWithoutAdvance.jsp deleted file mode 100644 index 10b5ea0bb8..0000000000 --- a/posterita/posterita/web/jsp/pos/createPOSOrderWithoutAdvance.jsp +++ /dev/null @@ -1,86 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.compiere.model.MOrder" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - <%@ include file="/jsp/include/posOrder.jsp" %> - - -<%@ include file="/js/createPOSOrder.js" %> - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createPOSProduct.jsp b/posterita/posterita/web/jsp/pos/createPOSProduct.jsp deleted file mode 100644 index e3354590b0..0000000000 --- a/posterita/posterita/web/jsp/pos/createPOSProduct.jsp +++ /dev/null @@ -1,310 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok, Preveen ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.compiere.model.MProduct" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - -<%@ page import="org.posterita.struts.pos.POSProductAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -
    -
    Barcode already exists!
    -
    Product name already exists!
    -
    - - - - -
    -
    - - - - - - - - - - - - - - - - -
    - - - -
    - * - - - -
    - * - - -
    -
    -
    - - - - - - -
    -
    - - - - - - - - - - - - -
    - * - - - - - - -
    -
    -
    - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - * - - - - - - -
    - * - - - - - - -
    - * - - - - - - -
    -
    -
    - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - * - - - - -
    - * - - - - -
    - * - - - - -
    - * - - - -
    -
    - - - -
    - - - -
    - - - - -
    - - -
    - - - -
    - - - -
    -
    -
    - - - - - - - -   - - -   - - -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createPOSUser.jsp b/posterita/posterita/web/jsp/pos/createPOSUser.jsp deleted file mode 100644 index c8a0b6f683..0000000000 --- a/posterita/posterita/web/jsp/pos/createPOSUser.jsp +++ /dev/null @@ -1,281 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> -<%@ page import="org.compiere.model.MCommission" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - -
    - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    * - - - -
    - * - - - - -
    *
    - -
    * - - -
    * - -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    - -
    - -
    - -
    -
    -
    -
    - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - - Invoice - Order - Payment Receipts - - -
    - - - -
    - - - -
    - - - - Weekly - Monthly - Quarterly - Yearly - - -
    -
    -
    -
    - -   - - -
    - - - - - - - -
    -
    -
    - - - -
    -
    -
    -
    - -
    - - - - - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createPartialPOSOrder.jsp b/posterita/posterita/web/jsp/pos/createPartialPOSOrder.jsp deleted file mode 100644 index 08d9c99542..0000000000 --- a/posterita/posterita/web/jsp/pos/createPartialPOSOrder.jsp +++ /dev/null @@ -1,467 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.compiere.model.MOrder" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - -
    - - - - - - - - - -   -
    - - -
    - <%@ include file="/jsp/include/searchProductPanel.jsp" %> -
    -
     
    -
    -
    - <%@ include file="/jsp/pos/partialPOSOrderShoppingCart.jsp" %> -
    -
    - - - - - - -
    - <%@ include file="/jsp/include/tenderPanel.jsp" %> - - <%@ include file="/jsp/include/customerInfoPanel.jsp" %> - - - - - - - - -
    -   -
    -   -
    -
    -
     
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/createPayment.jsp b/posterita/posterita/web/jsp/pos/createPayment.jsp deleted file mode 100644 index 3c3d2da6a8..0000000000 --- a/posterita/posterita/web/jsp/pos/createPayment.jsp +++ /dev/null @@ -1,81 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.struts.pos.PaymentAction" %> -<%@ page import="org.compiere.model.MProduct" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - -
    -
    - - -
    -
    - <%@ include file="/jsp/include/customerInfoPanel2.jsp" %> - - <%@ include file="/jsp/include/tenderPanel.jsp" %> -
    - -   - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createPaymentTerm.jsp b/posterita/posterita/web/jsp/pos/createPaymentTerm.jsp deleted file mode 100644 index 0d5e306386..0000000000 --- a/posterita/posterita/web/jsp/pos/createPaymentTerm.jsp +++ /dev/null @@ -1,84 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.struts.pos.PaymentTermAction" %> -<%@ page import="org.compiere.model.MProduct" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - <%@ include file="/jsp/include/paymentTermsDetails.jsp" %> - - - - - -
      - -   - -  
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createProductForm.jsp b/posterita/posterita/web/jsp/pos/createProductForm.jsp deleted file mode 100644 index 05b02add9a..0000000000 --- a/posterita/posterita/web/jsp/pos/createProductForm.jsp +++ /dev/null @@ -1,272 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.struts.pos.POSProductAction"%> -<%@page import="org.posterita.Constants"%> -<%@page import="org.compiere.model.MProduct"%> -<%@page import="java.math.BigDecimal"%> -<%@page import="org.posterita.beans.ProductBean"%> - - - - - - - Ashish - - - - - - - - - - - - - - - - -
    - - - Create Product - - - Update Product - - -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - "> - Create Product - -
    - - - -
    - * - - - -
    - * - - -
    - * - - - - -
    - * - - - - - -
    - * - - - - -
    - * - - -
    - - - -
    - - - - -
    - - -
    - - - -
    - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - "> - - - - - - - - - - - - - - - - - - -
      
    - - * - - - - - - - - - - - - - - - - - - - - -     
    -
    - - - - - -
    -   -  
    - -
    - -
    - - - -
    - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createRole.jsp b/posterita/posterita/web/jsp/pos/createRole.jsp deleted file mode 100644 index 3da849aa03..0000000000 --- a/posterita/posterita/web/jsp/pos/createRole.jsp +++ /dev/null @@ -1,228 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> -<%@ page import="org.posterita.core.MenuItem" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    - * - - - - -
    - - - -
    - - - -
    - - - -
    - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - <%-- --%> - - - -
    - -
    - - - - -
    -
    - - Clear All - - - Select All - - - - -
    - -
    -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createTax.jsp b/posterita/posterita/web/jsp/pos/createTax.jsp deleted file mode 100644 index bedba677c8..0000000000 --- a/posterita/posterita/web/jsp/pos/createTax.jsp +++ /dev/null @@ -1,50 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.struts.pos.TaxAction" %> -<%@ page import="org.compiere.model.MProduct" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -<%@ include file="/jsp/include/taxDetails.jsp" %> - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createVendor.jsp b/posterita/posterita/web/jsp/pos/createVendor.jsp deleted file mode 100644 index 1c4664c5b9..0000000000 --- a/posterita/posterita/web/jsp/pos/createVendor.jsp +++ /dev/null @@ -1,119 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> -<%@ page import="org.posterita.core.MenuItem" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - -
    -
    - - - - - - - - - -
    - * - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - -
     
    -
    -
    - - -   - - - - -
    -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/createdCashPayment.jsp b/posterita/posterita/web/jsp/pos/createdCashPayment.jsp deleted file mode 100644 index e47fd99779..0000000000 --- a/posterita/posterita/web/jsp/pos/createdCashPayment.jsp +++ /dev/null @@ -1,105 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.compiere.model.MInOut" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.compiere.process.DocAction" %> -<%@ page import="org.posterita.struts.pos.CashBookAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - <%@ include file="/jsp/pos/webDocumentHeader.jsp" %> - - - - - - - - - - -
    - - Payment By: -
    -
    - :
    - -
    - -
    -
    - - - - - - - - - - - -
    ::
    - - - - - -
    -
    - -
    -
    -
    - -
    -
    -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/createdProducts.jsp b/posterita/posterita/web/jsp/pos/createdProducts.jsp deleted file mode 100644 index 2404e4a53f..0000000000 --- a/posterita/posterita/web/jsp/pos/createdProducts.jsp +++ /dev/null @@ -1,63 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSStockAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - -<% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; -%> - - - - -
     
    >
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/creditOrderPayment.jsp b/posterita/posterita/web/jsp/pos/creditOrderPayment.jsp deleted file mode 100644 index e90f30baa7..0000000000 --- a/posterita/posterita/web/jsp/pos/creditOrderPayment.jsp +++ /dev/null @@ -1,277 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.posterita.core.UDIPair" %> -<%@ page import="org.compiere.model.MInvoice" %> -<%@ page import="org.compiere.model.MPayment" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -  
    - - - -  
    - - - -  
    - - - -  
    - - - - - - - -
    - - - - - - - - -
    - -
    - -
    - - - - - - - - - - - - <%-- - - - - --%> -
    -   - -   - -   -
    - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - Cash - Card - Cheque - - - -
    - -
    -
    - - -
    -
    - - -
    -
    -
    -
    -
    -
    - -   - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/creditOrderShoppingCart.jsp b/posterita/posterita/web/jsp/pos/creditOrderShoppingCart.jsp deleted file mode 100644 index 7f21f6d2ed..0000000000 --- a/posterita/posterita/web/jsp/pos/creditOrderShoppingCart.jsp +++ /dev/null @@ -1,24 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<% String items = Constants.CREDIT_ORDER_SHOPPING_CART_ITEMS; %> -<%@ include file="/jsp/pos/posShoppingCart.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/creditScreen.jsp b/posterita/posterita/web/jsp/pos/creditScreen.jsp deleted file mode 100644 index 416fb4663d..0000000000 --- a/posterita/posterita/web/jsp/pos/creditScreen.jsp +++ /dev/null @@ -1,246 +0,0 @@ -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - -<% - String path = request.getContextPath(); - String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; - //String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); - Properties ctx = TmkJSPEnv.getCtx(request); - String posName = POSTerminalManager.getTerminalName(ctx); - String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); - String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); - int m_pricelist_id = POSTerminalManager.getSOPriceListId(ctx); - MPriceList priceList = MPriceList.get(ctx, m_pricelist_id, null); - String priceListName = priceList.getName(); - String orderType = UDIOrderTypes.CREDIT_ORDER.getOrderType(); - request.getSession().setAttribute(Constants.ORDER_TYPE, orderType); - - Object bPId = request.getSession().getAttribute(Constants.BPARTNER_ID); - Object bPName = request.getSession().getAttribute(Constants.BPARTNER_NAME); - Object bPCredit = request.getSession().getAttribute(Constants.BPARTNER_CREDIT); - String bPartnerId = bPId == null? "":bPId.toString(); - String bPartnerName = bPName == null? "": bPName.toString(); - String bPartnerCredit = bPCredit == null? "": bPCredit.toString(); - //set configuration - Configuration configuration = Configuration.getConfiguration(request); - String paymentRule = configuration.getPaymentRule(); - String searchProductBy = configuration.getSearchProductBy(); - boolean isCustomerCompulsory = configuration.isCustomerCompulsory(); -%> - -<%@page import="java.util.Properties"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.compiere.model.MPriceList"%> -<%@page import="org.compiere.model.MOrg"%> -<%@page import="org.compiere.model.MRole"%> -<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> -<%@page import="org.posterita.core.Configuration"%> -<%@page import="org.posterita.user.WebUserInfo"%> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> -<%@page import="org.posterita.order.UDIOrderTypes.CreditOrder"%> -<%@page import="org.posterita.order.UDIOrderTypes"%> -<%@page import="org.posterita.Constants"%> - - - - - - - - - - - - - - - - - - - -<%@ include file="/jsp/include/showErrors.jsp" %> -
    Please wait...
    - - - - -
    - -
    - -
    - - - - - - -
    - - - - -
    -
    - -
    -
    -
    - - - - - " styleId="priceListId"/> - - - - - - - - - - - - -
    -
    - <%= ShoppingcartManager.getShoppingcartAsHTML(request)%> -
    - -
    - -
    - -
    CLEAR
    -
    SHORTCUTS
    - -
    CHECKOUT
    -
    DISCOUNT
    -
    -
    -
    -
    - F1 Barcode | F2 Name | F3 Description | F4 Qty | F5 Customer | - Ctrl+Up MoveUp | Ctrl+Down MoveDown | Ctrl+Left Increment | Ctrl-Right Decrement | Ctrl-Backspace Remove | Ctrl-Esc Menu | - Ctrl-Delete Clear | Ctrl-Space Checkout | Ctrl-Esc Menu
    - - - - - - -
    -
    $0.00
    -
    - -
    - <%=priceListName%> -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - -
    -
    -
    -
    -
    - -
    -
    -
    - - - - - - - - -
    - -    
    -
    - -
    - -
    -
    - <%=bPartnerId%>
    - <%=bPartnerName%>
    -
    - <%=bPartnerCredit%>
    -
    -
    - -

    - - - -
    - - diff --git a/posterita/posterita/web/jsp/pos/creditorHistory.jsp b/posterita/posterita/web/jsp/pos/creditorHistory.jsp deleted file mode 100644 index a6c386192f..0000000000 --- a/posterita/posterita/web/jsp/pos/creditorHistory.jsp +++ /dev/null @@ -1,89 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.compiere.model.MBPartner"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="java.util.Properties"%> - -<%@ include file="/jsp/include/posHeader.jsp" %> - - -<%@page import="org.posterita.businesslogic.administration.BPartnerManager"%> -<%@page import="java.util.ArrayList"%> -<%@page import="java.util.Iterator"%> -<%@page import="org.posterita.Constants"%> -<% -BPartnerBean bean = (BPartnerBean)request.getSession().getAttribute(Constants.BPARTNER); -int c_bpartner_id = bean.getBpartnerId().intValue(); -MBPartner partner = MBPartner.get(ctx, c_bpartner_id); -String bpName = partner.getName(); - -if(partner.getName2() != null) -{ - bpName = bpName + " " + partner.getName2(); - bpName = bpName.trim(); -} -%> - -<%@page import="org.posterita.beans.BPartnerBean"%> -
    -

    - : <%=bpName.toUpperCase()%> -

    - - - - - - - - - - - - - - - - - - - - - -
    - - "> - - - - "> - - - - "> - -
    -
    -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/custRetShoppingCart.jsp b/posterita/posterita/web/jsp/pos/custRetShoppingCart.jsp deleted file mode 100644 index b35d0295e0..0000000000 --- a/posterita/posterita/web/jsp/pos/custRetShoppingCart.jsp +++ /dev/null @@ -1,120 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.user.*"%> -<%@ page import="org.posterita.Constants"%> -<%@ page import="org.posterita.struts.stock.StockAction"%> - -<%@ page import="org.posterita.struts.pos.POSOrderAction"%> -<%@ page import="org.posterita.beans.ProductBean"%> -<%@ page import="org.posterita.user.WebUserInfo"%> -<%@ page import="org.posterita.lib.UdiConstants"%> -<%@ page import="org.posterita.struts.pos.POSGoodsAction"%> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - - - - - - - - - - - - -<% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; -%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    DescriptionQuantityPriceVATTotal   -   -
    - - - - - - - - - - - - - - - "> - - "> - - ">X -
    Grand Total - - - - - -    
    diff --git a/posterita/posterita/web/jsp/pos/customFastMovingItemReport.jsp b/posterita/posterita/web/jsp/pos/customFastMovingItemReport.jsp deleted file mode 100644 index c26e0688f8..0000000000 --- a/posterita/posterita/web/jsp/pos/customFastMovingItemReport.jsp +++ /dev/null @@ -1,51 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -<%@ include file="/jsp/pos/customReportTable.jsp" %> - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/customPOSInfoReport.jsp b/posterita/posterita/web/jsp/pos/customPOSInfoReport.jsp deleted file mode 100644 index 1a804d2d59..0000000000 --- a/posterita/posterita/web/jsp/pos/customPOSInfoReport.jsp +++ /dev/null @@ -1,79 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -<% String data = (String) request.getSession().getAttribute(Constants.TABULAR_REPORT_DATA) ;%> - -<%@ include file="/jsp/pos/customReportTable.jsp" %> - - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/customReportTable.jsp b/posterita/posterita/web/jsp/pos/customReportTable.jsp deleted file mode 100644 index 8d75d2e171..0000000000 --- a/posterita/posterita/web/jsp/pos/customReportTable.jsp +++ /dev/null @@ -1,173 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - -
    -
    - - - -
    - -   -

    -
    - - - - - - <%=reportData%> -
    -

    - - - - - - -

    - <%-- -

    - - -   - -

    - --%> - <% request.getSession().removeAttribute(Constants.TABULAR_REPORT_DATA); %> -
    -
    -
    - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/customSalesByPeriodReport.jsp b/posterita/posterita/web/jsp/pos/customSalesByPeriodReport.jsp deleted file mode 100644 index a7a0ced048..0000000000 --- a/posterita/posterita/web/jsp/pos/customSalesByPeriodReport.jsp +++ /dev/null @@ -1,55 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> -
    - :
    - " styleClass="submenu">
    - " styleClass="submenu">
    - " styleClass="submenu">
    - " styleClass="submenu">
    - " styleClass="submenu">
    - " styleClass="submenu">
    - " styleClass="submenu">
    - " styleClass="submenu">
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/customSalesReport.jsp b/posterita/posterita/web/jsp/pos/customSalesReport.jsp deleted file mode 100644 index a9c1a3098c..0000000000 --- a/posterita/posterita/web/jsp/pos/customSalesReport.jsp +++ /dev/null @@ -1,29 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<% -String actionPath = "/POSSalesReportAction"; -String action = "initCustomReport"; -String title = "Sales Report"; -%> - -<%@ include file="/jsp/pos/reportCalendar.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/customSlowMovingItemReport.jsp b/posterita/posterita/web/jsp/pos/customSlowMovingItemReport.jsp deleted file mode 100644 index c69f5f5edd..0000000000 --- a/posterita/posterita/web/jsp/pos/customSlowMovingItemReport.jsp +++ /dev/null @@ -1,51 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -<%@ include file="/jsp/pos/customReportTable.jsp" %> - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/customStockMovementReport.jsp b/posterita/posterita/web/jsp/pos/customStockMovementReport.jsp deleted file mode 100644 index bb82d1483e..0000000000 --- a/posterita/posterita/web/jsp/pos/customStockMovementReport.jsp +++ /dev/null @@ -1,50 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -<%@ include file="/jsp/pos/customReportTable.jsp" %> - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/customerDetails.jsp b/posterita/posterita/web/jsp/pos/customerDetails.jsp deleted file mode 100644 index f4c7a90f6d..0000000000 --- a/posterita/posterita/web/jsp/pos/customerDetails.jsp +++ /dev/null @@ -1,245 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    *
    *
    - - <%@ include file="/jsp/include/dayList.jsp" %> - - - <%@ include file="/jsp/include/monthList.jsp" %> - - - <%@ include file="/jsp/include/year.jsp" %> - - - - - -
    - * - - - - -
    - * - - - - - -
    -
    -
    - -
    - Credit Details - - - - - - - - - - - - - - -
    * - - <%=Constants.NO_CREDIT_CHECK%> - <%=Constants.CREDIT_OK%> - <%=Constants.CREDIT_STOP%> - - -
    - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - -
    *
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - Save - -
    - - - - - - - diff --git a/posterita/posterita/web/jsp/pos/customerReturnOrder.jsp b/posterita/posterita/web/jsp/pos/customerReturnOrder.jsp deleted file mode 100644 index 467b5b5afa..0000000000 --- a/posterita/posterita/web/jsp/pos/customerReturnOrder.jsp +++ /dev/null @@ -1,376 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - -
    - "> - Create New - -
    -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - -
    - - - - - - - - - - -   - -
    - - - <%@ include file="/jsp/include/searchProductPanel.jsp" %> -  
    -
    -
    - <%@ include file="/jsp/pos/customerReturnShoppingCart.jsp" %> -
    -
    - - - - - - -
    -
    - -
    -
    - - - - - - - - - - - - -
    -
    -
    - <%@ include file="/jsp/include/customerInfoPanel.jsp" %> - -   -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/customerReturnOrder3.jsp b/posterita/posterita/web/jsp/pos/customerReturnOrder3.jsp deleted file mode 100644 index 1ec4a4f029..0000000000 --- a/posterita/posterita/web/jsp/pos/customerReturnOrder3.jsp +++ /dev/null @@ -1,367 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - -
    - - - - - - - - - - -   - -
    - - - <%@ include file="/jsp/include/searchProductPanel.jsp" %> -  
    -
    -
    - <%@ include file="/jsp/pos/customerReturnShoppingCart.jsp" %> -
    -
    - - - - - - -
    -
    - Reason -
    -
    - - - - - - - - - - - - -
    -
    -
    -
    - : -
    -
    - -
    - - -
    -
    -
    -   -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/customerReturnShoppingCart.jsp b/posterita/posterita/web/jsp/pos/customerReturnShoppingCart.jsp deleted file mode 100644 index aa0ed8b8db..0000000000 --- a/posterita/posterita/web/jsp/pos/customerReturnShoppingCart.jsp +++ /dev/null @@ -1,26 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - -<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> -
    - <%= ShoppingcartManager.getShoppingcartAsHTML(request, null)%> -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/debtor.jsp b/posterita/posterita/web/jsp/pos/debtor.jsp deleted file mode 100644 index 7afe245e6f..0000000000 --- a/posterita/posterita/web/jsp/pos/debtor.jsp +++ /dev/null @@ -1,78 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.compiere.model.MBPartner"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="java.util.Properties"%> - -<%@ include file="/jsp/include/posHeader.jsp" %> - - - - - - - -
    -
    -

    - -
    - -
    -
    -
    -   -
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/debtorHistory.jsp b/posterita/posterita/web/jsp/pos/debtorHistory.jsp deleted file mode 100644 index 9527c28e69..0000000000 --- a/posterita/posterita/web/jsp/pos/debtorHistory.jsp +++ /dev/null @@ -1,89 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.compiere.model.MBPartner"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="java.util.Properties"%> - -<%@ include file="/jsp/include/posHeader.jsp" %> - - -<%@page import="org.posterita.businesslogic.administration.BPartnerManager"%> -<%@page import="java.util.ArrayList"%> -<%@page import="java.util.Iterator"%> -<%@page import="org.posterita.Constants"%> -<% -BPartnerBean bean = (BPartnerBean)request.getSession().getAttribute(Constants.BPARTNER); -int c_bpartner_id = bean.getBpartnerId().intValue(); -MBPartner partner = MBPartner.get(ctx, c_bpartner_id); -String bpName = partner.getName(); - -if(partner.getName2() != null) -{ - bpName = bpName + " " + partner.getName2(); - bpName = bpName.trim(); -} -%> - -<%@page import="org.posterita.beans.BPartnerBean"%> -
    -

    - : <%=bpName.toUpperCase()%> -

    - - - - - - - - - - - - - - - - - - - - - -
    - - "> - - - - "> - - - - "> - -
    -
    -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/detailedSalesReport.jsp b/posterita/posterita/web/jsp/pos/detailedSalesReport.jsp deleted file mode 100644 index 5c079305c5..0000000000 --- a/posterita/posterita/web/jsp/pos/detailedSalesReport.jsp +++ /dev/null @@ -1,237 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.compiere.process.DocAction" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -<% - String url = "DetailedSalesReport.do"; - String collection = Constants.DETAILED_SALES_REPORT; - boolean isFullDetails = false; - - if(request.getParameter("isFullDetails") != null) - { - isFullDetails = Boolean.parseBoolean(request.getParameter("isFullDetails")); - } - -%> - - - - - - -
    - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
    > - - - - - -
    - - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - -
    - - -
    - - - -
    - -
    -
    -
    > - - - > - - <% - String partnerId= element.getBpartnerId() + ""; - %> - - - "> - - - - - - - "> - - - - - > - - - - - - - - - - - - - - - - - - Credit - - > - - - > - - > - - - > - - - - - - - - - "> - - - - - - - "> - - - - -
    -
    - - - -<%@ include file="/jsp/include/pager.jsp" %> -<%@ include file="/jsp/include/printOrderApplet2.jsp" %> -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/downloadUploadCSVfile.jsp b/posterita/posterita/web/jsp/pos/downloadUploadCSVfile.jsp deleted file mode 100644 index 5b46396922..0000000000 --- a/posterita/posterita/web/jsp/pos/downloadUploadCSVfile.jsp +++ /dev/null @@ -1,90 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.EditBulkProductFromFileAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -All products -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -
    - - - - - - -
    - -
    - - Import - -
    - - - - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedCreditOrder.jsp b/posterita/posterita/web/jsp/pos/draftedCreditOrder.jsp deleted file mode 100644 index de7636907a..0000000000 --- a/posterita/posterita/web/jsp/pos/draftedCreditOrder.jsp +++ /dev/null @@ -1,65 +0,0 @@ - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - <%@ include file="/jsp/include/draftedCreditOrder.jsp" %> - - - -<%@ include file="/js/draftedPOSOrder.js" %> - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder.jsp b/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder.jsp deleted file mode 100644 index 67b2066b63..0000000000 --- a/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder.jsp +++ /dev/null @@ -1,107 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - -<% String orderlines = Constants.CUSTOMER_RETURN_ORDER_LINES; %> -<%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> - -
    -
      -
    -
    -
    -
    - - - -   - -   -   - -
    -
    -
    - - - - -
    - - - -
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder2.jsp b/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder2.jsp deleted file mode 100644 index ab188821b9..0000000000 --- a/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder2.jsp +++ /dev/null @@ -1,114 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - -<% String orderlines = Constants.CUSTOMER_RETURN_ORDER_LINES; %> -<%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> - -
    -
      -
    -
    -
    -
    - - - - - - - -   - - -   -   - -
    -
    - - - - - -
    - - - -
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder3.jsp b/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder3.jsp deleted file mode 100644 index af0d6db094..0000000000 --- a/posterita/posterita/web/jsp/pos/draftedCustomerReturnOrder3.jsp +++ /dev/null @@ -1,114 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - -<% String orderlines = Constants.CUSTOMER_RETURN_ORDER_LINES; %> -<%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> - -
    -
      -
    -
    -
    -
    - - - - - - - -   - - -   -   - -
    -
    - - - - - -
    - - - -
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedGoodsReceiveNote.jsp b/posterita/posterita/web/jsp/pos/draftedGoodsReceiveNote.jsp deleted file mode 100644 index e90388f296..0000000000 --- a/posterita/posterita/web/jsp/pos/draftedGoodsReceiveNote.jsp +++ /dev/null @@ -1,116 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - -<% String orderlines = Constants.GOODS_RECEIVE_NOTE_LINES; %> -<%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> - -
    -
    -   -
    -
    -
    - - - -   -   - -   - -
    -
    -
    - - - - - - - - - - - - - - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedGoodsReturnNote.jsp b/posterita/posterita/web/jsp/pos/draftedGoodsReturnNote.jsp deleted file mode 100644 index 6274778854..0000000000 --- a/posterita/posterita/web/jsp/pos/draftedGoodsReturnNote.jsp +++ /dev/null @@ -1,141 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*"%> -<%@ page import="org.posterita.Constants"%> -<%@ page import="org.posterita.struts.stock.StockAction"%> -<%@ page import="org.posterita.struts.pos.POSOrderAction"%> -<%@ page import="org.posterita.struts.pos.POSGoodsAction"%> -<%@ page import="org.posterita.beans.ProductBean"%> -<%@ page import="org.posterita.user.WebUserInfo"%> -<%@ page import="org.posterita.lib.UdiConstants"%> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> -<% String orderlines = Constants.GOODS_RETURN_NOTE_LINES; %> -<%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> - - - - - - - - - - - - - - - - - - - - - - -
    - -   - -
    - -   -   - -   -
     
    - - - - - - - - - - - - - - -
    - -<%@ include file="/jsp/include/posFooter.jsp"%> diff --git a/posterita/posterita/web/jsp/pos/draftedPOSOrder.jsp b/posterita/posterita/web/jsp/pos/draftedPOSOrder.jsp deleted file mode 100644 index dbc3af1761..0000000000 --- a/posterita/posterita/web/jsp/pos/draftedPOSOrder.jsp +++ /dev/null @@ -1,98 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - <%@ include file="/jsp/include/draftedPOSOrder.jsp" %> - - - -<%@ include file="/js/draftedPOSOrder.js" %> - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedPOSOrder2.jsp b/posterita/posterita/web/jsp/pos/draftedPOSOrder2.jsp deleted file mode 100644 index ea78da74ad..0000000000 --- a/posterita/posterita/web/jsp/pos/draftedPOSOrder2.jsp +++ /dev/null @@ -1,96 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -
    - - - - <%@ include file="/jsp/include/draftedPOSOrder.jsp" %> - - -<%@ include file="/js/draftedPOSOrder.js" %> - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedPOSShoppingCart.jsp b/posterita/posterita/web/jsp/pos/draftedPOSShoppingCart.jsp deleted file mode 100644 index dd600b84bf..0000000000 --- a/posterita/posterita/web/jsp/pos/draftedPOSShoppingCart.jsp +++ /dev/null @@ -1,95 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - <%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -
    - - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    > align="center"> align="center"> align="right"> align="right"> align="right"> align="right"> align="right">
    - - - -   - -   - - - - -   - - - - - - -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/draftedPartialPOSOrder.jsp b/posterita/posterita/web/jsp/pos/draftedPartialPOSOrder.jsp deleted file mode 100644 index 66c04ce5dd..0000000000 --- a/posterita/posterita/web/jsp/pos/draftedPartialPOSOrder.jsp +++ /dev/null @@ -1,198 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - <%-- - - - ---%> - - - - - - - - - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/draftedposOrderWA.jsp b/posterita/posterita/web/jsp/pos/draftedposOrderWA.jsp deleted file mode 100644 index c4756c3eb5..0000000000 --- a/posterita/posterita/web/jsp/pos/draftedposOrderWA.jsp +++ /dev/null @@ -1,197 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -
    - - - -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - - - - - - - - - - - - - - - - - - -<%@ include file="/js/draftedPOSOrder.js" %> - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/dunningLettersPrinted.jsp b/posterita/posterita/web/jsp/pos/dunningLettersPrinted.jsp deleted file mode 100644 index 637c2e0d54..0000000000 --- a/posterita/posterita/web/jsp/pos/dunningLettersPrinted.jsp +++ /dev/null @@ -1,56 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CashBookAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -
    -
    - -
    - - - - - - - -
    - - - - - - - - -
    -
    -
    -
    - - <% String orderlines = Constants.PARTIAL_POS_ORDER_LINES; %> - <%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> - - > -
    -
    -
    -   -
    -
    -
    -   -   -   -
    -
    -
    - - - - - - - -
    - - - - - - - -
    -
    - -
     
    -
    - - - - - - - -
    - - - - - - - - -
    -
    -
    - <% String orderlines = Constants.POS_ORDER_LINES; %> - <%@ include file="/jsp/pos/draftedPOSShoppingCart.jsp" %> - - > -
    -
    -
    -   -
    -
    -
    - - - - -   - - - - - - - - "> -   - - - - - -   -
    -
    - - - - - - - -
    - - - - - - - -
    -
    -
    - - - - - -
    - -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editBlackListCheque.jsp b/posterita/posterita/web/jsp/pos/editBlackListCheque.jsp deleted file mode 100644 index 30ceb12469..0000000000 --- a/posterita/posterita/web/jsp/pos/editBlackListCheque.jsp +++ /dev/null @@ -1,79 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - - -<%@ page import="org.posterita.struts.customer.CustomerAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - * - - -
    - - -
    - -   - -
    - -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editBulkProductPrice.jsp b/posterita/posterita/web/jsp/pos/editBulkProductPrice.jsp deleted file mode 100644 index 365631086e..0000000000 --- a/posterita/posterita/web/jsp/pos/editBulkProductPrice.jsp +++ /dev/null @@ -1,199 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.compiere.model.MProduct" %> -<%@ page import="org.posterita.struts.pos.POSProductAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - -
    - * - - -
    - * - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - -
    - * - - - - - - -
    - * - - - - - - -
    - * - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - * - - - Select a TAX category - - -
    - * - - - -
    -
    - - - -
    - - - -
    - - - -
    -
    -
    - -   - -
    -
    - -<%@include file="/jsp/include/posFooter.jsp"%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editPOSCustomer.jsp b/posterita/posterita/web/jsp/pos/editPOSCustomer.jsp deleted file mode 100644 index c3fdfae100..0000000000 --- a/posterita/posterita/web/jsp/pos/editPOSCustomer.jsp +++ /dev/null @@ -1,53 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.struts.customer.CustomerAction" %> -<%@ page import="org.compiere.model.MBPartner" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -<%@ include file="/jsp/pos/customerDetails.jsp" %> - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editPOSUser.jsp b/posterita/posterita/web/jsp/pos/editPOSUser.jsp deleted file mode 100644 index f9583dab3e..0000000000 --- a/posterita/posterita/web/jsp/pos/editPOSUser.jsp +++ /dev/null @@ -1,284 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> -<%@ page import="org.compiere.model.MCommission" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> - -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    * - - - -
    - * - - - - -
    * -           - - -
    * - -
    * - - -
    * - -
    -
    -
    - -
    - Address - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    - - -
    - -
    - -
    -
    -
    - - - - - - -
    -
    - User's Details - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - - Invoice - Order - Payment Receipts - - -
    - - - -
    - - - -
    - - - - Weekly - Monthly - Quarterly - Yearly - - -
    -   -
    -
    -
    - - - - - - - - - -   - - - - - - - - - - - - -
    -
    -
    - Information - - -
    -
    -
    - - - - - -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editPaymentTerm.jsp b/posterita/posterita/web/jsp/pos/editPaymentTerm.jsp deleted file mode 100644 index 08f4e95fc1..0000000000 --- a/posterita/posterita/web/jsp/pos/editPaymentTerm.jsp +++ /dev/null @@ -1,68 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.struts.pos.PaymentTermAction" %> -<%@ page import="org.compiere.model.MProduct" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - <%@ include file="/jsp/include/paymentTermsDetails.jsp" %> - - - - - - -
      - -   - -  
    - -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/editRole.jsp b/posterita/posterita/web/jsp/pos/editRole.jsp deleted file mode 100644 index 52d852d55a..0000000000 --- a/posterita/posterita/web/jsp/pos/editRole.jsp +++ /dev/null @@ -1,254 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> -<%@ page import="org.posterita.core.MenuItem" %> -<%@ page import="org.posterita.beans.RoleBean" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -<% - RoleBean roleBean = (RoleBean)request.getSession().getAttribute(Constants.ROLE); - String role = roleBean.getName(); - String roleId = String.valueOf(roleBean.getRoleId().intValue()); - - boolean isAccAllOrgs = roleBean.getIsAccessAllOrgs().booleanValue(); - String accAllOrgs = ""; - if(isAccAllOrgs) - accAllOrgs = "checked=\"checked\""; - - boolean isDiscountUptoLimitPrice = roleBean.getIsDiscountUptoLimitPrice().booleanValue(); - String discountUptoLimitPrice = ""; - if(isDiscountUptoLimitPrice) - discountUptoLimitPrice = "checked=\"checked\""; - - boolean isDiscountOnTotal = roleBean.getIsDiscountAllowedOnTotal().booleanValue(); - String discountOnTotal = ""; - if(isDiscountOnTotal) - discountOnTotal = "checked=\"checked\"";; - - -%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - * - - - - -
    - - - -
    - - - -
    - - - -
    - - - - - - - - - -
    - - - - - - - - - - <% - String checked = ""; - if(((MenuItem)ele).isAvailable()) - checked = "checked=\"checked\""; - %> - - - - - - - - - - - - - - - - - -
    - -
    - - - /> -
    - -
    - - - - -
    -
    - - Clear All - - - Select All - - - - -
    - -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editRoleOrgAccess.jsp b/posterita/posterita/web/jsp/pos/editRoleOrgAccess.jsp deleted file mode 100644 index f34bac4e6c..0000000000 --- a/posterita/posterita/web/jsp/pos/editRoleOrgAccess.jsp +++ /dev/null @@ -1,110 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> -<%@ page import="org.posterita.core.MenuItem" %> -<%@ page import="org.posterita.beans.RoleBean" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -<% - RoleBean roleBean = (RoleBean)request.getSession().getAttribute(Constants.ROLE); - String role = roleBean.getName(); -%> - - - - - - - -
    - -
    - - - - - - - - - - -
    - - - - - - - <% - String checked1 = ""; - if(((RoleBean)roleOrgAccessIndexed).getIsChecked().booleanValue()) - checked1 = "checked"; - %> - - - - - - - -
    - - - - - - - - -
    -
    - - Clear All - - - Select All - - - - -
    - -
    -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editTax.jsp b/posterita/posterita/web/jsp/pos/editTax.jsp deleted file mode 100644 index f361a10f40..0000000000 --- a/posterita/posterita/web/jsp/pos/editTax.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.struts.pos.TaxAction" %> -<%@ page import="org.compiere.model.MProduct" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -<%@ include file="/jsp/include/taxDetails.jsp" %> - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/editVendor.jsp b/posterita/posterita/web/jsp/pos/editVendor.jsp deleted file mode 100644 index c4c9f9a7f8..0000000000 --- a/posterita/posterita/web/jsp/pos/editVendor.jsp +++ /dev/null @@ -1,122 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> -<%@ page import="org.posterita.core.MenuItem" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - -
    -
    - - Contact - - - - - - - - -
    - * - - - -
    -
    -
    -
    - Address - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - Phone - - - - - - - - - - - - - - -
     
    -
    -
    -   -
    -
    -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editattribute.jsp b/posterita/posterita/web/jsp/pos/editattribute.jsp deleted file mode 100644 index 87995dd590..0000000000 --- a/posterita/posterita/web/jsp/pos/editattribute.jsp +++ /dev/null @@ -1,71 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -
    - - - - - - - - - - - - - - -
    -
    -
    -   -
    -
    -
    -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/editpriceList.jsp b/posterita/posterita/web/jsp/pos/editpriceList.jsp deleted file mode 100644 index ab05160e68..0000000000 --- a/posterita/posterita/web/jsp/pos/editpriceList.jsp +++ /dev/null @@ -1,57 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - -
    -   -
    -<%@include file="/jsp/include/posFooter.jsp"%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/filter.jsp b/posterita/posterita/web/jsp/pos/filter.jsp deleted file mode 100644 index df59c401e7..0000000000 --- a/posterita/posterita/web/jsp/pos/filter.jsp +++ /dev/null @@ -1,109 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   - - - - - - <%@include file="/jsp/include/month.jsp"%> - - - - - - - <% - int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR); - %> - <%= currentYear %> - <%= currentYear - 1 %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/posterita/web/jsp/pos/generateCommission.jsp b/posterita/posterita/web/jsp/pos/generateCommission.jsp deleted file mode 100644 index 97f4d7122f..0000000000 --- a/posterita/posterita/web/jsp/pos/generateCommission.jsp +++ /dev/null @@ -1,69 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.compiere.process.DocAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - <%@ include file="/jsp/include/posFooter.jsp" %> -
    - <%@ include file="/jsp/include/startCalendar.jsp" %> -
    -   -
    - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/genericReport.jsp b/posterita/posterita/web/jsp/pos/genericReport.jsp deleted file mode 100644 index 9d663c3aee..0000000000 --- a/posterita/posterita/web/jsp/pos/genericReport.jsp +++ /dev/null @@ -1,72 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.Constants"%> -<%@page import="org.posterita.struts.pos.POSReportAction"%> -<%@page import="org.posterita.Constants"%> - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -
     
    -
    <%=reportName%>
    -
     
    - - - -
    <%=reportComment%>
    -
     
    - - - -
    - - <%=componentList %> -
    - -
     
    - - - - -
    - Report As: - - Generate -
    - -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/getCreditOrderDiscDetails.jsp b/posterita/posterita/web/jsp/pos/getCreditOrderDiscDetails.jsp deleted file mode 100644 index bd18fec8dc..0000000000 --- a/posterita/posterita/web/jsp/pos/getCreditOrderDiscDetails.jsp +++ /dev/null @@ -1,210 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.form.OrderLineForm" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="java.math.BigDecimal" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -
    - - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - <% - String defaultDiscount = "0"; - String defaultPrice = element.getPrice().toString(); - - OrderLineForm form = (OrderLineForm)request.getAttribute("OrderLineForm"); - - if(form!=null) - { - String[] discountPercentage = form.getDiscountPercent(); - String[] actualPrice = form.getActualPrice(); - - if(discountPercentage!= null) - if(discountPercentage.length!=0) - defaultDiscount = discountPercentage[count.intValue()]; - - if(actualPrice!=null) - if(actualPrice.length!=0) - defaultPrice = actualPrice[count.intValue()]; - } - %> - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - "/> - - - - - -
    - - - - - - - -   - -
    - -
    -
    - - -
    - -   - - - - -   - - -   - - - - - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/getCurrentTillAmount.jsp b/posterita/posterita/web/jsp/pos/getCurrentTillAmount.jsp deleted file mode 100644 index 0c7f29baff..0000000000 --- a/posterita/posterita/web/jsp/pos/getCurrentTillAmount.jsp +++ /dev/null @@ -1,117 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CashBookAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    -
    -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/getCustomerReturnFormPOSOrder.jsp b/posterita/posterita/web/jsp/pos/getCustomerReturnFormPOSOrder.jsp deleted file mode 100644 index 741cff5ced..0000000000 --- a/posterita/posterita/web/jsp/pos/getCustomerReturnFormPOSOrder.jsp +++ /dev/null @@ -1,96 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.compiere.model.MOrder" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - -
    - - - - - - - - -
    - - - -
    - -
    -
    -
    - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/getPOSCustomers.jsp b/posterita/posterita/web/jsp/pos/getPOSCustomers.jsp deleted file mode 100644 index d188d003e3..0000000000 --- a/posterita/posterita/web/jsp/pos/getPOSCustomers.jsp +++ /dev/null @@ -1,139 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - -
    - - - - <%@ include file="/jsp/include/searchCustomerPanel.jsp" %> -
    - - - -
    - - - - -   - - - - <%@ include file="/jsp/pos/shoppingCart.jsp" %> - - - - -   - - - - - - - - - - -   - - - - - - - - - - -
    - - Alt-N - - - Alt-S - - - Alt-C -
    - - -
    - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/getPOSPaymentDetails.jsp b/posterita/posterita/web/jsp/pos/getPOSPaymentDetails.jsp deleted file mode 100644 index fdfbda1816..0000000000 --- a/posterita/posterita/web/jsp/pos/getPOSPaymentDetails.jsp +++ /dev/null @@ -1,66 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.form.OrderLineForm" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="java.math.BigDecimal" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> -
    - - - <%@ include file="/jsp/include/posPaymentDetails.jsp" %> - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/getPOSPaymentDetails2.jsp b/posterita/posterita/web/jsp/pos/getPOSPaymentDetails2.jsp deleted file mode 100644 index 01c110c5b6..0000000000 --- a/posterita/posterita/web/jsp/pos/getPOSPaymentDetails2.jsp +++ /dev/null @@ -1,67 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.form.OrderLineForm" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="java.math.BigDecimal" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - <%@ include file="/jsp/include/posPaymentDetails2.jsp" %> - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - - - diff --git a/posterita/posterita/web/jsp/pos/getPOSPaymentDetails_1.jsp b/posterita/posterita/web/jsp/pos/getPOSPaymentDetails_1.jsp deleted file mode 100644 index 5126e18d29..0000000000 --- a/posterita/posterita/web/jsp/pos/getPOSPaymentDetails_1.jsp +++ /dev/null @@ -1,218 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -
    - - - -   - - - - - - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - -
    - - - - - - - - - -
    - - - - - - " id="price<%= count%>"/> - - - - " id="actualPrice<%= count%>" onchange="setDiscountValue('discountPercent<%= count%>', 'price<%= count%>','actualPrice<%= count%>')"/> -
    - - - - -   - - - -   - - - - - - - - - - - -
    - - - - - - - -
    -
    - - -
    - -
    - - - - - -
    - - - -
    - - - -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/getPOSStock.jsp b/posterita/posterita/web/jsp/pos/getPOSStock.jsp deleted file mode 100644 index 18a3a76df3..0000000000 --- a/posterita/posterita/web/jsp/pos/getPOSStock.jsp +++ /dev/null @@ -1,172 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSStockAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.posterita.core.UDIPair" %> -<%@ page import="java.math.RoundingMode" %> -<%@ page import= "java.math.BigDecimal"%> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - <% - String url = "GetPOSStock.do"; - String collection = Constants.PRODUCTS; - %> - - - - -
    - - - - - - - - - -   - - -    - - - - - > 0 - < 0 - = 0 - > 25 - > 50 - > 100 - -
    - - - - - - - -
    - - - - - - - - - - -
    -
    - <% - org.displaytag.decorator.TotalTableDecorator totals = new org.displaytag.decorator.TotalTableDecorator(); - totals.setTotalLabel("Total"); - pageContext.setAttribute("totals", totals); - %> - - - - - - - - - - - - - - - - - -
    -
    - - -   - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/getPartialPOSPaymentDetails.jsp b/posterita/posterita/web/jsp/pos/getPartialPOSPaymentDetails.jsp deleted file mode 100644 index 03b6b257c1..0000000000 --- a/posterita/posterita/web/jsp/pos/getPartialPOSPaymentDetails.jsp +++ /dev/null @@ -1,816 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.form.OrderLineForm" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="java.math.BigDecimal" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - -
    - - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - <% - String defaultDiscount = "0"; - String defaultPrice = element.getPrice().toString(); - - OrderLineForm form = (OrderLineForm)request.getAttribute("OrderLineForm"); - - if(form!=null) - { - String[] discountPercentage = form.getDiscountPercent(); - String[] actualPrice = form.getActualPrice(); - - if(discountPercentage!= null) - if(discountPercentage.length!=0) - defaultDiscount = discountPercentage[count.intValue()]; - - if(actualPrice!=null) - if(actualPrice.length!=0) - defaultPrice = actualPrice[count.intValue()]; - } - %> - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - "/> - - - - - -
    - - - - - -   - -
    - -
    -
     
    - - - - - -   - - - - - - - - - - - - - - -
    - -   - - - -   - - - -   - - - -   - -
    - - - - -   - - - - - - - - - -
    - - - - -
    - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - -   - - - - -   - - - - -   - - - - - - - - - - - -
    - - - - - - - - - -
    - - -
    - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/goodsReceiveNote.jsp b/posterita/posterita/web/jsp/pos/goodsReceiveNote.jsp deleted file mode 100644 index 1c9088d0ff..0000000000 --- a/posterita/posterita/web/jsp/pos/goodsReceiveNote.jsp +++ /dev/null @@ -1,324 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.user.*"%> -<%@ page import="org.posterita.Constants"%> -<%@ page import="org.posterita.struts.stock.StockAction"%> - -<%@ page import="org.posterita.struts.pos.POSOrderAction"%> -<%@ page import="org.posterita.beans.ProductBean"%> -<%@ page import="org.posterita.user.WebUserInfo"%> -<%@ page import="org.posterita.lib.UdiConstants"%> -<%@ page import="org.posterita.struts.pos.POSGoodsAction"%> -<%@ page import="org.posterita.order.UDIOrderTypes" %> - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - -
    - - - - - - - - - -   -
    - - - <%@ include file="/jsp/include/searchProductPanel.jsp" %> -
    -
    -
    -
    - <%@ include file="/jsp/pos/goodsReceiveShoppingCart.jsp" %> -
    -
     
    -   -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -<%@ include file="/jsp/include/posFooter.jsp"%> diff --git a/posterita/posterita/web/jsp/pos/goodsReceiveShoppingCart.jsp b/posterita/posterita/web/jsp/pos/goodsReceiveShoppingCart.jsp deleted file mode 100644 index d8e002aa1b..0000000000 --- a/posterita/posterita/web/jsp/pos/goodsReceiveShoppingCart.jsp +++ /dev/null @@ -1,25 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<% String items = Constants.GOODS_RECEIVE_NOTE_SHOPPING_CART_ITEMS; %> -<%@ include file="/jsp/pos/posShoppingCart.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/goodsReturnNote.jsp b/posterita/posterita/web/jsp/pos/goodsReturnNote.jsp deleted file mode 100644 index f32098f0c4..0000000000 --- a/posterita/posterita/web/jsp/pos/goodsReturnNote.jsp +++ /dev/null @@ -1,321 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.user.*"%> -<%@ page import="org.posterita.Constants"%> -<%@ page import="org.posterita.struts.stock.StockAction"%> - -<%@ page import="org.posterita.struts.pos.POSOrderAction"%> -<%@ page import="org.posterita.beans.ProductBean"%> -<%@ page import="org.posterita.user.WebUserInfo"%> -<%@ page import="org.posterita.lib.UdiConstants"%> -<%@ page import="org.posterita.struts.pos.POSGoodsAction"%> -<%@ page import="org.posterita.order.UDIOrderTypes" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - -
    - "> - Create New - -
    -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - -   -
    - - - <%@ include file="/jsp/include/searchProductPanel.jsp" %> -
    - -
    -
    - <%@ include file="/jsp/pos/posShoppingCart.jsp" %> -
    -
     
    -   -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -<%@ include file="/jsp/include/posFooter.jsp"%> diff --git a/posterita/posterita/web/jsp/pos/goodsReturnShoppingCart.jsp b/posterita/posterita/web/jsp/pos/goodsReturnShoppingCart.jsp deleted file mode 100644 index f37f6e467b..0000000000 --- a/posterita/posterita/web/jsp/pos/goodsReturnShoppingCart.jsp +++ /dev/null @@ -1,25 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<% String items = Constants.GOODS_RETURN_NOTE_SHOPPING_CART_ITEMS; %> -<%@ include file="/jsp/pos/posShoppingCart.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/grnShoppingCart.jsp b/posterita/posterita/web/jsp/pos/grnShoppingCart.jsp deleted file mode 100644 index c5ba5272ad..0000000000 --- a/posterita/posterita/web/jsp/pos/grnShoppingCart.jsp +++ /dev/null @@ -1,25 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<% String items = Constants.SHOPPING_GRN_CART_ITEMS; %> -<%@ include file="/jsp/pos/posShoppingCart.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/importBlackList.jsp b/posterita/posterita/web/jsp/pos/importBlackList.jsp deleted file mode 100644 index 1e3013f654..0000000000 --- a/posterita/posterita/web/jsp/pos/importBlackList.jsp +++ /dev/null @@ -1,97 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.ImportPOSProductAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - -
    - -
    - - - -
    -
    - -
    -<% - String cvsURL = request.getContextPath() + "/jsp/pos/importTemplate.csv"; -%> - - - - -
    -
    - - - - - - - - - - - - - - - - - - -
    MCB6090018000250
    MCB7714739680121
    - -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/importCustomer.jsp b/posterita/posterita/web/jsp/pos/importCustomer.jsp deleted file mode 100644 index 026b4130c8..0000000000 --- a/posterita/posterita/web/jsp/pos/importCustomer.jsp +++ /dev/null @@ -1,248 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.ImportPOSProductAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="org.posterita.struts.pos.ImportCustomerAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - -Import Customer -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - -
    - -
    - - Import - -
    -
    - -
    -<% - String cvsURL = request.getContextPath() + "/jsp/pos/importTemplate.csv"; - String csvURL1=request.getContextPath() + "/jsp/pos/importGarmentTemplate.csv"; -%> -
    - - This utility is to import a list of Customers from a csv file into the system, the csv file should look like the one shown below including the header: - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Account NoNameAddress1Address2Address3Postal CodeStr Address1Str Address2Str Address3ContactPhoneFax
    -   -
    Payment TermCredit LmtBF BalanceTotal OweSales RepPriceListTax NoBankBranchBank Acc NoEmailMobile
    -
    - - - - - -
    -
    View Remaining Details



    - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - - %> - - - - - - - - - - - - - - -
    Account NoNameAddress1Address2Postal CodeStr Address1Str Address2Address3ContactPhoneFax
    -
    View Remaining Details



    - -
    - - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/importPOSProducts.jsp b/posterita/posterita/web/jsp/pos/importPOSProducts.jsp deleted file mode 100644 index 8070ccfd77..0000000000 --- a/posterita/posterita/web/jsp/pos/importPOSProducts.jsp +++ /dev/null @@ -1,155 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.ImportPOSProductAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -
    -

    - -   - -

    -
    - - - - - - - - - - - - - - - - -
    - -
    - - - - - - -
    - - - - - - -
    - - - -
    -
    - -
    -<% - String cvsURL = request.getContextPath() + "/import/importTemplate.csv"; - String csvURL1=request.getContextPath() + "/import/importGarmentTemplate.csv"; -%> - -: - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Tshirt6090018000250Tshirt Red XLTshirt Red XLOne300400380350025
    Trousers7714739680121black cotton Lblack cotton LEach3504504304101520
    - - - Garment Template -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/importPOSStock.jsp b/posterita/posterita/web/jsp/pos/importPOSStock.jsp deleted file mode 100644 index 75e79523ed..0000000000 --- a/posterita/posterita/web/jsp/pos/importPOSStock.jsp +++ /dev/null @@ -1,62 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author shameem ---%> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - -
    - -
    - - IMPORT - -
    -
    - - - - - - - - - - - - - - -
    609001800025025
    771473968012120
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/index.jsp b/posterita/posterita/web/jsp/pos/index.jsp deleted file mode 100644 index 3c9c1dc11d..0000000000 --- a/posterita/posterita/web/jsp/pos/index.jsp +++ /dev/null @@ -1,45 +0,0 @@ -<% -String path = request.getContextPath(); -String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; -%> - - - - - Tamak POS - - - - - - - - -
    - - - - -
    - - -
    -
    - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/initMaxItem.jsp b/posterita/posterita/web/jsp/pos/initMaxItem.jsp deleted file mode 100644 index 60eec97c2c..0000000000 --- a/posterita/posterita/web/jsp/pos/initMaxItem.jsp +++ /dev/null @@ -1,37 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<% -String actionPath = "/CustomFastMovingItemReportAction"; -String action = "getCustomReport"; -String title = "Most Sold Items"; -%> - -<%@ include file="/jsp/pos/reportCalendar.jsp" %> - - - -<%--<%@ include file="/jsp/pos/reportParameters.jsp" %>--%> - - - diff --git a/posterita/posterita/web/jsp/pos/initMinItem.jsp b/posterita/posterita/web/jsp/pos/initMinItem.jsp deleted file mode 100644 index 7faf373c2e..0000000000 --- a/posterita/posterita/web/jsp/pos/initMinItem.jsp +++ /dev/null @@ -1,38 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<% -String actionPath = "/CustomSlowMovingItemReportAction"; -String action = "getCustomReport"; -String title = "Least Sold Items"; -%> - -<%@ include file="/jsp/pos/reportCalendar.jsp" %> - - - -<%--<%@ include file="/jsp/pos/reportParameters.jsp" %>--%> - - - diff --git a/posterita/posterita/web/jsp/pos/initViewPOSInfo2.jsp b/posterita/posterita/web/jsp/pos/initViewPOSInfo2.jsp deleted file mode 100644 index 63a0bd6743..0000000000 --- a/posterita/posterita/web/jsp/pos/initViewPOSInfo2.jsp +++ /dev/null @@ -1,31 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<% -String actionPath = "/CustomPOSInfoAction"; -String action = "getCustomReport"; -String title = "POS INFO"; -%> - -<%@ include file="/jsp/pos/reportCalendar.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/initViewSalesAnalysisReport.jsp b/posterita/posterita/web/jsp/pos/initViewSalesAnalysisReport.jsp deleted file mode 100644 index 7c4d430b62..0000000000 --- a/posterita/posterita/web/jsp/pos/initViewSalesAnalysisReport.jsp +++ /dev/null @@ -1,35 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<% -String actionPath = "/CustomSalesAnalysisReportAction"; -String action = "getCustomReport"; -String title = "Sales Analysis Report"; -%> - -<%@ include file="/jsp/pos/reportCalendar.jsp" %> - - - -<%--<%@ include file="/jsp/pos/reportParameters.jsp" %>--%> diff --git a/posterita/posterita/web/jsp/pos/initViewStockMovement.jsp b/posterita/posterita/web/jsp/pos/initViewStockMovement.jsp deleted file mode 100644 index 27253e0f8e..0000000000 --- a/posterita/posterita/web/jsp/pos/initViewStockMovement.jsp +++ /dev/null @@ -1,38 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<% -String actionPath = "/CustomStockMovementReportAction"; -String action = "getCustomReport"; -String title = "Stock Movement Report"; -%> - -<%@ include file="/jsp/pos/reportCalendar.jsp" %> - - - -<%--<%@ include file="/jsp/pos/reportParameters.jsp" %>--%> - - - diff --git a/posterita/posterita/web/jsp/pos/inventoryImportErrors.jsp b/posterita/posterita/web/jsp/pos/inventoryImportErrors.jsp deleted file mode 100644 index 78792caed5..0000000000 --- a/posterita/posterita/web/jsp/pos/inventoryImportErrors.jsp +++ /dev/null @@ -1,56 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.ImportPOSProductAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> -

    - - Back to Inventory Cart - - - - - Save as CSV - -

    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/invokeCreditOrder.jsp b/posterita/posterita/web/jsp/pos/invokeCreditOrder.jsp deleted file mode 100644 index ac5c61f634..0000000000 --- a/posterita/posterita/web/jsp/pos/invokeCreditOrder.jsp +++ /dev/null @@ -1,97 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.compiere.model.MOrder" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - -
    - - - - - - - - -
    - - - -
    - -
    -
    -
    - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/invokePartialPOSOrder.jsp b/posterita/posterita/web/jsp/pos/invokePartialPOSOrder.jsp deleted file mode 100644 index aa73d9efbb..0000000000 --- a/posterita/posterita/web/jsp/pos/invokePartialPOSOrder.jsp +++ /dev/null @@ -1,97 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.compiere.model.MOrder" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - -
    - - - - - - - - -
    - - - -
    - -
    -
    -
    - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/listCashBooks.jsp b/posterita/posterita/web/jsp/pos/listCashBooks.jsp deleted file mode 100644 index 0f6077f530..0000000000 --- a/posterita/posterita/web/jsp/pos/listCashBooks.jsp +++ /dev/null @@ -1,98 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> - -<%@page import="org.posterita.struts.pos.CashBookAction"%> - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> -
    - - - - - - - -
    - - - - -   - - - - <pos:message textOnly="true" key="add"/> - -
    -
    - - - - - - - - - Journals - - - - - Edit - - - - View - - - - - Deactivate - - - - - - Activate - - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/listCurrencies.jsp b/posterita/posterita/web/jsp/pos/listCurrencies.jsp deleted file mode 100644 index 8ba6893712..0000000000 --- a/posterita/posterita/web/jsp/pos/listCurrencies.jsp +++ /dev/null @@ -1,93 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Servansingh ---%> - - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.struts.pos.CurrencyAction"%> -<%@page import="org.posterita.Constants"%> -Currency -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - -
    - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - "> - - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/listPOSUsers.jsp b/posterita/posterita/web/jsp/pos/listPOSUsers.jsp deleted file mode 100644 index c172f9d48e..0000000000 --- a/posterita/posterita/web/jsp/pos/listPOSUsers.jsp +++ /dev/null @@ -1,144 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> - - -
    - - - - - - - - -
    - - - - - -   - - - - - Add Customer - -
    -
    - -. - - - - - - - - - - - - - - - - <% - String url = "ListPOSUsers.do"; - String collection = Constants.ALL_USERS; - %> - - - <% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - -
     
    - - - - - - - - - "> - Edit Customer - - - - "> - View Customer - - - - "> - User Customer - - - - - "> - Activate User - - -
    -<%@ include file="/jsp/include/pager.jsp" %> - -
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/listPriceLists.jsp b/posterita/posterita/web/jsp/pos/listPriceLists.jsp deleted file mode 100644 index fb5ffafb1f..0000000000 --- a/posterita/posterita/web/jsp/pos/listPriceLists.jsp +++ /dev/null @@ -1,140 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> - - - -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.struts.pos.PriceListAction"%> -<%@page import="org.posterita.Constants"%> -<%@page import="org.posterita.struts.pos.POSProductAction"%> -Price Lists -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - -
    - - - - - - - - - - - - "> - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - "> - - - - - - "> - - - - - - - - - "> - - - - - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/listRoles.jsp b/posterita/posterita/web/jsp/pos/listRoles.jsp deleted file mode 100644 index d4330dc5f1..0000000000 --- a/posterita/posterita/web/jsp/pos/listRoles.jsp +++ /dev/null @@ -1,124 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -
    - - - - - - - - -
    - - - - - -   - - - - - Add Customer - -
    -
    - - - - - - - - - - - - - - - -<% - String url = "ListPOSRoles.do"; - String collection = Constants.ALL_ROLES; -%> - - <% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - -
     
    - - - - - "> - Edit Role - - - "> - View Role - - - - Edit Organisation Access - - - <%--">Delete--%> -
    - -<%@ include file="/jsp/include/pager.jsp" %> - -
    -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/listTerminals.jsp b/posterita/posterita/web/jsp/pos/listTerminals.jsp deleted file mode 100644 index b0404ae9b6..0000000000 --- a/posterita/posterita/web/jsp/pos/listTerminals.jsp +++ /dev/null @@ -1,120 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> - -<%@page import="org.posterita.struts.pos.TerminalAction"%> - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> -
    - - - - - - - - -
    - - - - -   - - - - <pos:message textOnly="true" key="add"/> - - - - <pos:message textOnly="true" key="ResetCurrentPOSTerminal"/> - -
    -
    - - - - - - - - - - - - Edit - - - - View - - - <% - String activateDisplay = "none"; - String deactivateDispay = "none"; - if (((TerminalBean)row).getIsActive().booleanValue()) - { - deactivateDispay = "inline"; - } - else - { - activateDisplay = "inline"; - } - %> - - - - Deactivate - - - - - - Activate - - - - - <pos:message textOnly="true" key="UpdateCurrentPOSTerminal"/> - - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/monthlySalesReport.jsp b/posterita/posterita/web/jsp/pos/monthlySalesReport.jsp deleted file mode 100644 index ae00109316..0000000000 --- a/posterita/posterita/web/jsp/pos/monthlySalesReport.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.Constants"%> - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - <%=salesReportData%> - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/orderDetailsPerProduct.jsp b/posterita/posterita/web/jsp/pos/orderDetailsPerProduct.jsp deleted file mode 100644 index 4fc4ff3c69..0000000000 --- a/posterita/posterita/web/jsp/pos/orderDetailsPerProduct.jsp +++ /dev/null @@ -1,113 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.compiere.process.DocAction" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> -<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> - -<% - String url = "ViewPOSHistory.do?orderType=" + orderType; - String collection = Constants.POS_HISTORY; -%> - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    -<%@ include file="/jsp/include/printOrderApplet2.jsp" %> -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/orderHeader.jsp b/posterita/posterita/web/jsp/pos/orderHeader.jsp deleted file mode 100644 index 52389c3385..0000000000 --- a/posterita/posterita/web/jsp/pos/orderHeader.jsp +++ /dev/null @@ -1,129 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.compiere.model.MBPartner" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.beans.POSHistoryBean" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - -
    -
    - - -
    - - -
    - -
    -
    - -
    - : - - - -
    - -
    - - : - - - ( - - : - - - - , : - - - - , : - - ) -
    - - -
    - -
    -
    - -
    -
    - - - <% - String url = ""; - String partnerId = partner.get_ID() + ""; - %> - - <%url = "POSCustomerAction.do?action=viewPOSCustomer&bpartnerId=" + partnerId; %> - - - <%url = "POSVendorAction.do?action=viewVendorDetails1&bpartnerId=" + partnerId; %> - - - - - -
    - -
    - - - -
    - -
    - - : - -
    - -
    - - -
    - - -
    - : -
    -
    - -
    - -
    - -
    -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/orderScreen.jsp b/posterita/posterita/web/jsp/pos/orderScreen.jsp deleted file mode 100644 index 5337e599e6..0000000000 --- a/posterita/posterita/web/jsp/pos/orderScreen.jsp +++ /dev/null @@ -1,727 +0,0 @@ - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - -<% - String path = request.getContextPath(); - String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; - String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); - Properties ctx = TmkJSPEnv.getCtx(request); - String posName = POSTerminalManager.getTerminalName(ctx); - String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); - String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); - - Object bPId = request.getSession().getAttribute(Constants.BPARTNER_ID); - Object bPName = request.getSession().getAttribute(Constants.BPARTNER_NAME); - Object bPCredit = request.getSession().getAttribute(Constants.BPARTNER_CREDIT); - String bPartnerId = bPId == null? "":bPId.toString(); - String bPartnerName = bPName == null? "": bPName.toString(); - String bPartnerCredit = bPCredit == null? "": bPCredit.toString(); - - //set configuration - Configuration configuration = Configuration.getConfiguration(request); - String orderType = configuration.getOrderType(); - boolean isSOTrx = configuration.getIsSOTrx(); - String paymentRule = configuration.getPaymentRule(); - String searchProductBy = configuration.getSearchProductBy(); - boolean isCustomerCompulsory = configuration.isCustomerCompulsory(); - boolean isTerminalLocked = POSTerminalManager.isTerminalLocked(ctx); - - Integer priceListId = PriceListManager.getDefaultPriceListId(ctx, isSOTrx); - Object plId = request.getSession().getAttribute(Constants.ORDER_PRICE_LIST); - if (plId != null) - { - try - { - priceListId = Integer.valueOf(String.valueOf(plId)); - } - catch (NumberFormatException e){} - } - MPriceList priceList = MPriceList.get(ctx, priceListId.intValue(), null); - String priceListName = priceList.getName(); - MCurrency currency = MCurrency.get(ctx, priceList.getC_Currency_ID()); - BigDecimal roundOffFactor = currency.getRoundOffFactor(); - - if (isTerminalLocked) - { - posName += " (Locked)"; - } - - String bpartnerType = "Customer"; - if (!isSOTrx) - { - bpartnerType = "Vendor"; - } - - String showComponent = ""; - - if(orderType.equals(UDIOrderTypes.CUSTOMER_RETURN_ORDER.getOrderType()) || - orderType.equals(UDIOrderTypes.POS_GOODS_RETURN_NOTE.getOrderType()) - ) - { - showComponent = "style='display:none'"; - } - - String advancedAction = "/LoadAdvancedOrderScreen.do?action=loadAdvancedOrderScreen&isSOTrx="+isSOTrx; - - int roleId = Env.getAD_Role_ID(ctx); - float discountAllowed = RoleManager.getDiscountAllowed(ctx, roleId, null).floatValue(); - boolean isAllowedOverridePriceLimit = RoleManager.isOverridePriceLimitAllowed(ctx, roleId, null); - boolean isDiscountUptoLimitPrice = RoleManager.isDiscountUptoPriceLimit(ctx, roleId, null); - boolean isDiscountAllowedOnTotal = RoleManager.isDiscountAllowedOnTotal(ctx, roleId, null); - - int menuId = MenuManager.getMenuId(ctx, "pmenu.cash.sales"); -%> - -<%@page import="org.posterita.Constants"%> -<%@page import="java.util.Properties"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.compiere.model.MPriceList"%> -<%@page import="org.compiere.model.MOrg"%> -<%@page import="org.compiere.model.MRole"%> -<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> -<%@page import="org.posterita.core.Configuration"%> -<%@page import="java.math.BigDecimal"%> -<%@page import="org.compiere.model.MCurrency"%> -<%@page import="org.compiere.util.WebSessionCtx"%> -<%@page import="org.posterita.user.WebUserInfo"%> -<%@page import="org.posterita.order.UDIOrderTypes.POSOrder"%> -<%@page import="org.posterita.order.UDIOrderTypes"%> -<%@page import="org.posterita.businesslogic.administration.PriceListManager"%> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> - -<%@page import="org.posterita.businesslogic.administration.RoleManager"%> -<%@page import="org.posterita.businesslogic.MenuManager"%> - - - - - <%=appName%> - - - - - - - - - - - - - - - - - -<%@ include file="/jsp/include/showErrors.jsp" %> -
    Please wait...
    - - - - - - - - - - - - - - - - - - - - - - - - " styleId="roundOffFactor"/> - - - - - - - - - - - - - - - " id="isCustomerCompulsory"/> - - - - - - - - - - - -
    -
    - - -
    - <%= orderType %> -
    -
    -
    -
    - : - <%=orgName%> -
    -
    - : - <%=posName%> -
    -
    -
    -
    - : - -
    -
    - : - <%=roleName%> -
    -
    -
    -
    -
    -
    -
    -
    -
    0.00
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - -
    - BARCODE: - - - NAME: -
    -
    - DESC: -
    -
    -
    -
    -
    -
    -
    -
    - <%=priceListName%> -
    -
    -
    -
    -
    -
    - <%= ShoppingcartManager.getShoppingcartAsHTML(request, orderType)%> -
    -
    -
    -
    -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Barcode - - -
    - Name - - -
    - Description - - -
    - Tax Cat - - -
    - Stock Qty - - -
    - Price List - - -
    - Price Std - - -
    - Price Limit - - -
    -
    -
    - - Increase item quantity - Decrease item quantity - Remove item -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - <%=bpartnerType%> - - -
    -
    - Code - - <%=bPartnerId%> -
    - Name - - <%=bPartnerName%> -
    - Credit Available - - <%=bPartnerCredit%> -
    - Credit Limit - - -
    - Open Balance - - -
    -
    -
    -
    -
    -

    Payment Method

    - Cash Payment - Card Payment - Cheque Payment -
    Mix Payment - On Credit Payment -
    -
    -
    - - -
    -
    -
    -
    - "/>')" src="images/newUI/butn-discount.gif" alt="Discount" width="95px" height="23px" border="0px"/> - Quick Discount - Open Drawer - Clear all items -
    -
    -
    -
    -
    - Change PIN - Reset USER - Proceed to Checkout -
    -
    -
    -
    -
    - F1 Barcode | F2 Name | F3 Description | F4 Qty | F5 Customer | F6 Discount | F8 Toggle Quick Discount | F9 Cash | F10 Card | F11 Check | F12 Mix | - Ctrl+C Credit | Ctrl+Up MoveUp | Ctrl+Down MoveDown | Ctrl+Left Decrement | Ctrl-Right Increment | Ctrl-Backspace Remove | Ctrl+M Menu | - Ctrl-D Open Drawer | Ctrl-Delete Clear | Ctrl+Space Checkout | Ctrl+P Change PIN | Ctrl+R Reset User -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Total:

    Amount Tendered:
    Write Off Amount:
    Payment Amount:
    Amount Refunded:
     
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - -

    Total:

    Card - -
    Card No:
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - -

    Total:

    Cheque No:
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - -

    Total:

    Card No:
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Total:

    Cash Amt:
    Cheque Amt:
    Cheque No:
    Card Amt:
    Card No:
    - - -
    -
    -
    - -
    -
    -
    - - - - - - - - - - -
    - -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    - -
    - " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> -
    - -
    -
    -
    -
    - - diff --git a/posterita/posterita/web/jsp/pos/partialPOSOrderShoppingCart.jsp b/posterita/posterita/web/jsp/pos/partialPOSOrderShoppingCart.jsp deleted file mode 100644 index 059dc27a9e..0000000000 --- a/posterita/posterita/web/jsp/pos/partialPOSOrderShoppingCart.jsp +++ /dev/null @@ -1,27 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<% String items = Constants.PARTIAL_ORDER_SHOPPING_CART_ITEMS; %> -<%@ include file="/jsp/pos/posShoppingCart.jsp" %> - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posLogin.jsp b/posterita/posterita/web/jsp/pos/posLogin.jsp deleted file mode 100644 index e35255195a..0000000000 --- a/posterita/posterita/web/jsp/pos/posLogin.jsp +++ /dev/null @@ -1,308 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - - -<% -String path = request.getContextPath(); -String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; -%> - - -<%@ page import="org.posterita.Constants" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<% -String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); - -if(appName == null) -{ - appName = "POSterita"; -} - -%> - - - - - -Welcome to <%=appName%> - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - -
    POS Login
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - <%@ include file="/jsp/include/errors.jsp"%> -
    -
    -
    - -
    - - - -
    - - - -
    - -
    - - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - -
    - -
    - -
    - -
    -
    -
    -
    - 7 -
    -
    -
    -
    - 8 -
    -
    -
    -
    - 9 -
    -
    -
    -
    - 4 -
    -
    -
    -
    - 5 -
    -
    -
    -
    - 6 -
    -
    -
    -
    - 1 -
    -
    -
    -
    - 2 -
    -
    -
    -
    - 3 -
    -
    -
    -
    - C -
    -
    -
    -
    - 0 -
    -
    -
    -
    - OK -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posPINLogin.jsp b/posterita/posterita/web/jsp/pos/posPINLogin.jsp deleted file mode 100644 index cb158e42e1..0000000000 --- a/posterita/posterita/web/jsp/pos/posPINLogin.jsp +++ /dev/null @@ -1,141 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - -<title><pos:message textOnly="true" key="posPassowrd.welcome"/> - - - - - - - - - - - - -
    - - - - - - - - - - - -
    -
    - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posPassword.jsp b/posterita/posterita/web/jsp/pos/posPassword.jsp deleted file mode 100644 index 22c85c444a..0000000000 --- a/posterita/posterita/web/jsp/pos/posPassword.jsp +++ /dev/null @@ -1,79 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ page import="org.posterita.Constants" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - -<pos:message textOnly="true" key="posPassowrd.welcome"/> - - - - - - - - - - -
    - - - - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posReport.jsp b/posterita/posterita/web/jsp/pos/posReport.jsp deleted file mode 100644 index e9a9d8a432..0000000000 --- a/posterita/posterita/web/jsp/pos/posReport.jsp +++ /dev/null @@ -1,312 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -"/> -"/> - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - -
    -
    - - - - - -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    -
    - - - - - -
    -
    - - - -
    -   -
    -   -   -   -   -
    -
    - - - - - <% request.getSession().removeAttribute(Constants.REPORT_URL); %> - - - - - - -
    - - <%=reportData%> -
    -

    - -   - -

    -
    - <% request.getSession().removeAttribute(Constants.TABULAR_REPORT_DATA); %> -
    - - - - - - - - - <% request.getSession().removeAttribute(Constants.TABULAR_REPORT_DATA2); %> - -
    -
    - - -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posReport1.jsp b/posterita/posterita/web/jsp/pos/posReport1.jsp deleted file mode 100644 index c9ed27f20e..0000000000 --- a/posterita/posterita/web/jsp/pos/posReport1.jsp +++ /dev/null @@ -1,292 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -"/> -"/> - - - - - - - - - - - - - - -
    - :
    - - - -
    -
    - - - - - -
    -
    -
    -
    - - - - - - - - - - - - -
    -
    - -
    -
    - - - - - - - - - - -
    - - - - - - - - - -
    - - - - <%@ include file="/jsp/include/dayList.jsp" %> - - - - <%@ include file="/jsp/include/monthList.jsp" %> - - - - <%@ include file="/jsp/include/yearList.jsp" %> - - - - - - <%@ include file="/jsp/include/hourList.jsp" %> - - h - - <%@ include file="/jsp/include/minuteList.jsp" %> - -
    -
    - - - - - - - - - - -
    - - - - <%@ include file="/jsp/include/dayList.jsp" %> - - - - <%@ include file="/jsp/include/monthList.jsp" %> - - - - <%@ include file="/jsp/include/yearList.jsp" %> - - - - - - <%@ include file="/jsp/include/hourList.jsp" %> - - h - - <%@ include file="/jsp/include/minuteList.jsp" %> - -
    -
    -
    -
    -
    - :
    - - - -
     
    -
    - - - - - - - - - - - - - -
    -   - -
    -   - -
    -   - -
    -   - -
    -
    - -
    - - - - <% request.getSession().removeAttribute(Constants.REPORT_URL); %> - - - - - - <%=reportData%> -
    -

    - - <% request.getSession().removeAttribute(Constants.TABULAR_REPORT_DATA); %> -

    -
    -
    -
    - -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posShoppingCart.jsp b/posterita/posterita/web/jsp/pos/posShoppingCart.jsp deleted file mode 100644 index 6707962fda..0000000000 --- a/posterita/posterita/web/jsp/pos/posShoppingCart.jsp +++ /dev/null @@ -1,101 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - -<% -String styleClass = "label"; -if ((count.intValue()%2) != 0) - styleClass = "contentname"; -%> - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - -
       -
    - -
    -
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posShoppingCartFirstPage.jsp b/posterita/posterita/web/jsp/pos/posShoppingCartFirstPage.jsp deleted file mode 100644 index a0900ab35b..0000000000 --- a/posterita/posterita/web/jsp/pos/posShoppingCartFirstPage.jsp +++ /dev/null @@ -1,27 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> -<% String items = Constants.SHOPPING_ORDER_CART_ITEMS; %> -<%@ include file="/jsp/pos/posShoppingCart.jsp" %> - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/posSubMenu.jsp b/posterita/posterita/web/jsp/pos/posSubMenu.jsp deleted file mode 100644 index 39d60ec138..0000000000 --- a/posterita/posterita/web/jsp/pos/posSubMenu.jsp +++ /dev/null @@ -1,79 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.core.MenuItem" %> - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="java.util.Properties"%> -<%@ page import="org.compiere.model.MWebMenu" %> -<%@ page import="java.util.HashMap" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.posterita.core.MenuItem" %> -<%@ page import="java.util.Map.Entry"%> -<%@ page import="java.util.Iterator"%> -<%@ page import="org.posterita.core.businesslogic.ElementManager" %> -<%@ page import="org.posterita.core.bean.ElementBean" %> -<%@ page import="org.posterita.core.TmkJSPEnv" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - -<%@page import="org.posterita.businesslogic.MenuManager"%> - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> - -
    - - - - - - -
    - - - - -
    -
    -

    POS MAIN MENU

    -
    -
    - <%= MenuManager.getMainMenus(ctx, request) %> -
    -
    -
    - - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/postingSuccess.jsp b/posterita/posterita/web/jsp/pos/postingSuccess.jsp deleted file mode 100644 index ec867296a0..0000000000 --- a/posterita/posterita/web/jsp/pos/postingSuccess.jsp +++ /dev/null @@ -1,55 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author shameem ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CashBookAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - -Resubmit Posting -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -
    - All the documents/invoice have heen sucessfully resubmitted. -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/priceCheck.jsp b/posterita/posterita/web/jsp/pos/priceCheck.jsp deleted file mode 100644 index 301d5bd2fd..0000000000 --- a/posterita/posterita/web/jsp/pos/priceCheck.jsp +++ /dev/null @@ -1,80 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.compiere.model.MOrder" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - -
    - - - -
    - -
    - - - -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/priceList.jsp b/posterita/posterita/web/jsp/pos/priceList.jsp deleted file mode 100644 index 6eba32bc88..0000000000 --- a/posterita/posterita/web/jsp/pos/priceList.jsp +++ /dev/null @@ -1,109 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - -
    - : - -   -
    - - -
    - - - - - - - - - - - - <% - String style = "label"; - if((count.intValue() % 2) == 0) - style = "contentname"; - %> - - - - - - - -
    - - - - -   -
    > - - > - - > - - - - -
    - - - - -
    - -
    -
    -<%@include file="/jsp/include/posFooter.jsp"%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/printPOSOrder.jsp b/posterita/posterita/web/jsp/pos/printPOSOrder.jsp deleted file mode 100644 index 0884db3dc2..0000000000 --- a/posterita/posterita/web/jsp/pos/printPOSOrder.jsp +++ /dev/null @@ -1,157 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - <pos:message textOnly="true" key="print.order"/> - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    -
    - <%-- Caters for previously sold vehicles where sales rep was not available --%> - - Sales Representative: - -
    - - - -
    - - - -
    - - -
    - : -
    - - - - - -
    - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - -
    >>>>>>
    - - - - - - - -
    -
    - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/productBarcodeCart.jsp b/posterita/posterita/web/jsp/pos/productBarcodeCart.jsp deleted file mode 100644 index 9064932e9e..0000000000 --- a/posterita/posterita/web/jsp/pos/productBarcodeCart.jsp +++ /dev/null @@ -1,387 +0,0 @@ - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<% - String path = request.getContextPath(); - String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; - Properties ctx = TmkJSPEnv.getCtx(request); - String posName = POSTerminalManager.getTerminalName(ctx); - int menu_id = MenuManager.getMenuId(ctx, "pmenu.administration"); - String orderType = "Barcode Printing"; - String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); - String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); - int m_pricelist_id = Env.getContextAsInt(ctx, UdiConstants.PRICELIST_CTX_PARAM); - MPriceList priceList = MPriceList.get(ctx, m_pricelist_id, null); - String priceListName = priceList.getName(); - String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); - - //set configuration - Configuration configuration = Configuration.getConfiguration(request); - String searchProductBy = configuration.getSearchProductBy(); -%> - - -<%@page import="org.posterita.Constants"%> -<%@page import="java.util.Properties"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.compiere.model.MPriceList"%> -<%@page import="org.compiere.model.MOrg"%> -<%@page import="org.compiere.model.MRole"%> -<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> -<%@page import="org.posterita.TangoColors"%> -<%@page import="org.posterita.businesslogic.MenuManager"%> -<%@page import="org.posterita.core.Configuration"%> - - - - - <%=appName%> - - - - - - - - - - - - - - - - -
    Please wait...
    - - - - - - - - - - - - - - " styleId="priceListId"/> - - - - - - - - - - - - - -
    -
    - - -
    - <%= orderType %> -
    -
    -
    -
    - : - <%=orgName%> -
    -
    - : - <%=posName%> -
    -
    -
    -
    - : - -
    -
    - : - <%=roleName%> -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - -
    - BARCODE: - - - NAME: -
    -
    - DESC: -
    -
    -
    -
    -
    -
    -
    -
    - <%=priceListName%> -
    -
    -
    -
    -
    -
    - <%= ShoppingcartManager.getBarcodecartAsHTML(request)%> -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Barcode - - -
    - Name - - -
    - Description - - -
    - Tax Cat - - -
    - Stock Qty - - -
    - Price List - - -
    - Price Std - - -
    - Price Limit - - -
    - -
    -
    - - Increase item quantity - Decrease item quantity - Remove item -
    -
    -
    - - - - -
    - Do you want to print labels with: -
     Product Name
    -
     Product Description
    -
     Product Prices
    -
    -
    -
    -
    - - - - - -
    - <%=priceListName%> - -
    CHANGE
    -
    -
    -
    -
    -
    -
    -
    - Open Drawer - Clear all items -
    -
    -
    -
    -
    PRINT
    -
    -
    -
    - F1 Barcode | F2 Name | F3 Description | F4 Qty | Ctrl+Up MoveUp | Ctrl+Down MoveDown | Ctrl+Left - Increment | Ctrl-Right Decrement | Ctrl-Backspace Remove | Ctrl-Space Open Drawer | Ctrl-Delete Clear | Ctrl-P - Print Barcode | Ctrl+M Menu -
    -
    -
    - " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> -
    - - - - - - - - - - - - - - - - - - - - - diff --git a/posterita/posterita/web/jsp/pos/productDetails.jsp b/posterita/posterita/web/jsp/pos/productDetails.jsp deleted file mode 100644 index 2b6fb1014c..0000000000 --- a/posterita/posterita/web/jsp/pos/productDetails.jsp +++ /dev/null @@ -1,74 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductDetailsBean" %> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/productDetailsError.jsp b/posterita/posterita/web/jsp/pos/productDetailsError.jsp deleted file mode 100644 index d824f96b9b..0000000000 --- a/posterita/posterita/web/jsp/pos/productDetailsError.jsp +++ /dev/null @@ -1,25 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -
    Could not retrieve product details
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/productsUpdated.jsp b/posterita/posterita/web/jsp/pos/productsUpdated.jsp deleted file mode 100644 index bd1ce006cb..0000000000 --- a/posterita/posterita/web/jsp/pos/productsUpdated.jsp +++ /dev/null @@ -1,71 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.EditBulkProductFromFileAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -
    - - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/reportCalendar.jsp b/posterita/posterita/web/jsp/pos/reportCalendar.jsp deleted file mode 100644 index 9fa31a649b..0000000000 --- a/posterita/posterita/web/jsp/pos/reportCalendar.jsp +++ /dev/null @@ -1,156 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> -<%@ page import="java.util.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - -
    - - - - - - - - - -
    - : - - - <%@ include file="/jsp/include/dayList.jsp" %> - - - - <%@ include file="/jsp/include/monthList.jsp" %> - - - - <%@ include file="/jsp/include/yearList.jsp" %> - - - - - - <%@ include file="/jsp/include/hourList.jsp" %> - - h - - <%@ include file="/jsp/include/minuteList.jsp" %> - -
    -
    - - - - - - - - - - -
    - : - - - <%@ include file="/jsp/include/dayList.jsp" %> - - - - <%@ include file="/jsp/include/monthList.jsp" %> - - - - <%@ include file="/jsp/include/yearList.jsp" %> - - - - - - <%@ include file="/jsp/include/hourList.jsp" %> - - h - - <%@ include file="/jsp/include/minuteList.jsp" %> - -
    -
    - - - - - -   -
    - - <%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/reportFilter.jsp b/posterita/posterita/web/jsp/pos/reportFilter.jsp deleted file mode 100644 index f16f2f9d67..0000000000 --- a/posterita/posterita/web/jsp/pos/reportFilter.jsp +++ /dev/null @@ -1,230 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - -
    - - - - - - - - - - -
    - -
    -
    - : - -
    -
    - : -
    -
    - - -
    -
    - -
    -
    - Custom - - - - - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - -
    - - - - - - - - - -
    - : - - - <%@ include file="/jsp/include/dayList.jsp" %> - - - - <%@ include file="/jsp/include/monthList.jsp" %> - - - - <%@ include file="/jsp/include/yearList.jsp" %> - - - - - - <%@ include file="/jsp/include/hourList.jsp" %> - - h - - <%@ include file="/jsp/include/minuteList.jsp" %> - -
    -
    - - - - - - - - - - -
    - : - - - <%@ include file="/jsp/include/dayList.jsp" %> - - - - <%@ include file="/jsp/include/monthList.jsp" %> - - - - <%@ include file="/jsp/include/yearList.jsp" %> - - - - - - <%@ include file="/jsp/include/hourList.jsp" %> - - h - - <%@ include file="/jsp/include/minuteList.jsp" %> - -
    -
    -
    -
    -
    -
    - - - - -
    - -
    -
    -
    - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/retShoppingCart.jsp b/posterita/posterita/web/jsp/pos/retShoppingCart.jsp deleted file mode 100644 index 972b5b144f..0000000000 --- a/posterita/posterita/web/jsp/pos/retShoppingCart.jsp +++ /dev/null @@ -1,150 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - - - - - - - - - - -<% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; -%> - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - -   - -   - -   -
    - - - - - - - - - - - - - - - - - - - - - "/> - - - - - - - - - "/> - - - - - ">X -
    - - - - - -    
    \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/salesReport.jsp b/posterita/posterita/web/jsp/pos/salesReport.jsp deleted file mode 100644 index db30679097..0000000000 --- a/posterita/posterita/web/jsp/pos/salesReport.jsp +++ /dev/null @@ -1,76 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> -<% - String isSalesReport = request.getParameter("isSalesReport"); - String pageTitle = "smenu.sales.report"; - String reportDetailsStyle = "display: block"; - - boolean isSalesRPT = Boolean.parseBoolean(isSalesReport); - - if(!(isSalesRPT)) - { - pageTitle = "smenu.purchase.report"; - reportDetailsStyle = "display:none"; - } -%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - -
    -
    - - - - - -
    -
    -<%@ include file="/jsp/pos/customReportTable.jsp" %> - -
    -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/saveVendor.jsp b/posterita/posterita/web/jsp/pos/saveVendor.jsp deleted file mode 100644 index c50d51b632..0000000000 --- a/posterita/posterita/web/jsp/pos/saveVendor.jsp +++ /dev/null @@ -1,144 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> -<%@ page import="org.posterita.core.MenuItem" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - - - - - -
    - * - - -
    - * - - - - -
    - * - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - -
     
    -
    -
    -
    -   -
    - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/searchCustomer.jsp b/posterita/posterita/web/jsp/pos/searchCustomer.jsp deleted file mode 100644 index 8a7fe6e881..0000000000 --- a/posterita/posterita/web/jsp/pos/searchCustomer.jsp +++ /dev/null @@ -1,98 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.businesslogic.CustomerManager" %> -<%@ page import="org.posterita.core.TmkJSPEnv" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.posterita.beans.CustomerBean" %> -<%@ page import="java.util.Properties" %> -<%@ page import="org.posterita.core.businesslogic.ElementManager" %> -<%@ page import="org.posterita.core.bean.ElementBean" %> -<% - Properties ctx = TmkJSPEnv.getCtx(request); - - String customerName = request.getParameter("customerQuery"); - ElementBean elementBean = null; - elementBean = ElementManager.getMsg(ctx, "not.found"); - - ArrayList customerList = CustomerManager.searchCustomers(ctx,customerName,false); - - CustomerBean bean = null; - - if (customerList == null || customerList.size() == 0) - { - //out.print("
      "); - //out.print("
    • "); - //out.print("
    "); - out.print("
    "); - } - else - { - int size = 15; - size = (size > customerList.size())? customerList.size() : size; - - out.print("
      "); - - for(int i=0;i"); - out.print(name); - out.print(""); - } - - out.print("
    "); - - elementBean = ElementManager.getMsg(ctx, "search.result.displaying"); - String msg = elementBean.getName(); - - out.print("
    "); - - } -%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/searchPOSGarmentAttributes.jsp b/posterita/posterita/web/jsp/pos/searchPOSGarmentAttributes.jsp deleted file mode 100644 index 542a80aac8..0000000000 --- a/posterita/posterita/web/jsp/pos/searchPOSGarmentAttributes.jsp +++ /dev/null @@ -1,56 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.businesslogic.POSProductManager" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.posterita.core.businesslogic.ElementManager" %> -<%@ page import="org.posterita.core.bean.ElementBean" %> -<%@ page import="java.util.Properties" %> -<%@ page import="org.posterita.core.TmkJSPEnv" %> -<% - ArrayList results = POSProductManager.searchPOSGarmentAttributes(request); - Properties ctx = TmkJSPEnv.getCtx(request); - int max = 10; - - ElementBean elementBean = null; - elementBean = ElementManager.getMsg(ctx, "not.found"); - - if (results == null || results.size() == 0) - { - out.print(elementBean.getName()); - } - else - { - out.print("
      "); - - max = (max > results.size()) ? results.size() : max; - - for(int i=0;i" + results.get(i) + ""); - } - - out.print("
        "); - } -%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/searchPOSProducts.jsp b/posterita/posterita/web/jsp/pos/searchPOSProducts.jsp deleted file mode 100644 index f8d9b1ddbe..0000000000 --- a/posterita/posterita/web/jsp/pos/searchPOSProducts.jsp +++ /dev/null @@ -1,299 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSProductAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -
        - - - - -   - - -
        -
        - - - - - - - - - - - - - - - - - - - -
        - - -
        - -<% - String url = "SearchPOSProducts.do"; - String collection = Constants.VIEW_POS_PRODUCTS; -%> - -
        - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - -
         
        width="100px"> - - width="400px"> - - > - - > - -   -
        -<%@ include file="/jsp/include/pager.jsp" %> - - -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/searchVendor.jsp b/posterita/posterita/web/jsp/pos/searchVendor.jsp deleted file mode 100644 index 4cc6401b05..0000000000 --- a/posterita/posterita/web/jsp/pos/searchVendor.jsp +++ /dev/null @@ -1,97 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - - - -<%@ page import="org.posterita.businesslogic.CustomerManager" %> -<%@ page import="org.posterita.core.TmkJSPEnv" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.posterita.beans.CustomerBean" %> -<%@ page import="org.posterita.businesslogic.BPartnerManager" %> -<%@ page import="org.posterita.businesslogic.VendorManager" %> -<%@ page import="org.posterita.core.businesslogic.ElementManager" %> -<%@ page import="org.posterita.core.bean.ElementBean" %> -<% - Properties ctx = TmkJSPEnv.getCtx(request); - String customerName = request.getParameter("customerQuery"); - - ArrayList customerList = VendorManager.searchVendors(TmkJSPEnv.getCtx(request),customerName,true); - CustomerBean bean = null; - - ElementBean elementBean = null; - elementBean = ElementManager.getMsg(ctx, "not.found"); - - if (customerList == null || customerList.size() == 0) - { - out.print("
          "); - out.print("
        • "); - out.print("
        "); - out.print("
        "); - } - else - { - int size = 15; - size = (size > customerList.size())? customerList.size() : size; - - out.print("
          "); - - for(int i=0;i"); - out.print(vendorName); - out.print(""); - } - - out.print("
        "); - - elementBean = ElementManager.getMsg(ctx, "search.result.displaying"); - String msg = elementBean.getName(); - - out.print("
        "); - - } -%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/settleAPPayment.jsp b/posterita/posterita/web/jsp/pos/settleAPPayment.jsp deleted file mode 100644 index 958e919408..0000000000 --- a/posterita/posterita/web/jsp/pos/settleAPPayment.jsp +++ /dev/null @@ -1,592 +0,0 @@ - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.posterita.core.UDIPair" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> - - - - - - - - -
        -
        - -
        -
        - -
        - -
        - -
        - - <%@ include file="/jsp/include/searchVendorPanel.jsp" %> -
        - -
        -
        -
        -
        -
        - - - - - - - - - -
        - UnPaid - - Partially Paid - - Paid - - Over Paid -
        - -<%-- - - - ---%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<%@ include file="/jsp/include/errors.jsp" %> - -
        - - - - - -
        - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - <% - String styleClass = ""; - %> - - <% - styleClass = "green"; - %> - - - - <% - styleClass = "red"; - %> - - - - - <% - styleClass = "yellow"; - %> - - - - - - - - <% - styleClass = "blue"; - %> - - - - <% - styleClass = "blue"; - %> - - - - - - - - - - - - - - - - - - - - - - - -
        - Pay - - - - - - - - - - - - - - - - - - - - - - - -   -
        > - - - - - Pay - - - - - > - "> - - - > - "> - - - > - - - > - - - > - - > - - > - - > - - > - - - > - - "> - - - > - - - > - - - - - -
        - - Pay - - - - - - Match - - -
        -
        - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - -   -
        - "> - - - - - - - - - - - - - - - - - - -
        -
        - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - - - - -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - - -
        -
        -<%@ include file="/jsp/include/posFooter.jsp" %> - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/settlePayment.jsp b/posterita/posterita/web/jsp/pos/settlePayment.jsp deleted file mode 100644 index 06ca5c6dc8..0000000000 --- a/posterita/posterita/web/jsp/pos/settlePayment.jsp +++ /dev/null @@ -1,610 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.posterita.core.UDIPair" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> - - - - - - - - -
        -
        - -
        -
        - -
        - -
        - -
        - - <%@ include file="/jsp/include/searchCustomerPanel2.jsp" %> -
        - -
        -
        -
        -
        -
        - - - - - - - - - -
        - UnPaid - - Partially Paid - - Paid - - Over Paid -
        - -<%-- - - - ---%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<%@ include file="/jsp/include/errors.jsp" %> - -
        - - - - - -
        - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - <% - String styleClass = ""; - %> - - <% - styleClass = "green"; - %> - - - - <% - styleClass = "red"; - %> - - - - - <% - styleClass = "yellow"; - %> - - - - - - - - <% - styleClass = "blue"; - %> - - - - <% - styleClass = "blue"; - %> - - - - - - - - - - - - - - - - - - - - - - - -
        - Pay - - - - - - - - - - - - - - - - - - - - - - - -   -
        > - - - - - Pay - - - - - > - "> - - - > - "> - - - > - - - > - - - > - - > - - > - - > - - > - - - > - - "> - - - > - - - > - - - - - -
        - - Pay - - - - - - Match - - -
        -
        - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - -   -
        - "> - - - - - - - - - - - - - - - - - - -
        -
        - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - - - - -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - - -
        -
        -<%@ include file="/jsp/include/posFooter.jsp" %> - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/shoppingCart.jsp b/posterita/posterita/web/jsp/pos/shoppingCart.jsp deleted file mode 100644 index 087c739aa4..0000000000 --- a/posterita/posterita/web/jsp/pos/shoppingCart.jsp +++ /dev/null @@ -1,139 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - --%> - -
        - - - - - - - - - - -   - -   - -   -
        - - - - - - - - - - - - - - - - -
          - - - - - -    - -
        -
        - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/stockAdjustments.jsp b/posterita/posterita/web/jsp/pos/stockAdjustments.jsp deleted file mode 100644 index b3dc1a3ed5..0000000000 --- a/posterita/posterita/web/jsp/pos/stockAdjustments.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.Constants"%> - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - <%=stockReportData%> - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/terminal.jsp b/posterita/posterita/web/jsp/pos/terminal.jsp deleted file mode 100644 index d8f6a4754b..0000000000 --- a/posterita/posterita/web/jsp/pos/terminal.jsp +++ /dev/null @@ -1,421 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - -<%@page import="org.posterita.struts.pos.TerminalAction"%> - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - <% - boolean readonly = new Boolean((String)strReadOnly).booleanValue(); - boolean orgReadOnly = true; - - if (terminalId != null) - { - try - { - orgReadOnly = (Integer.parseInt((String)terminalId) > 0); - } - catch (Exception ex) - {} - } - %> - - - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - -
        - * - - -
        - * - - - - -
        - - - - - - - - -
        -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - - - - - - - -
        - - - - - - - - - - - -
        - - - - - - - - - - - -
        - - - - - - - - -
        -
        -
        -
        - - - - - - - - - - - - - - - - - -
        - * - - - - - - - - - - - -
        - - - - - - - - - - - - -
        - - - - - - - - - - - - -
        -
        -
        -
        - - - - - - - - - - - -
        - - - - - - - - -   - - - - - - - - - - -
        - - - - - - - - - -   - -
        -
        -
        - - - Copy As - - - - - Edit - - - - - Save - - - - - Cancel - - -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/testShoppingCart.jsp b/posterita/posterita/web/jsp/pos/testShoppingCart.jsp deleted file mode 100644 index 9b15dec9b5..0000000000 --- a/posterita/posterita/web/jsp/pos/testShoppingCart.jsp +++ /dev/null @@ -1,152 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - --%> - -
        - Description - - Quantity - - Price - - VAT - - Total - -   - -   - -   -
        - - - - - - - - - - - - - - - - - - "> - - "> - - "> -
        Grand Total - - - - - - - - -    - -
        -
        - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/updateCurrency.jsp b/posterita/posterita/web/jsp/pos/updateCurrency.jsp deleted file mode 100644 index 88fb1fafaa..0000000000 --- a/posterita/posterita/web/jsp/pos/updateCurrency.jsp +++ /dev/null @@ -1,115 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Servansingh ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.Constants"%> -<%@page import="org.posterita.beans.CurrencyBean"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.posterita.struts.pos.CurrencyAction"%> -Currency -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - Previous - - "> - Next - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        -   -
        -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/updatePOSProduct.jsp b/posterita/posterita/web/jsp/pos/updatePOSProduct.jsp deleted file mode 100644 index d98a1d1c84..0000000000 --- a/posterita/posterita/web/jsp/pos/updatePOSProduct.jsp +++ /dev/null @@ -1,285 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.compiere.model.MProduct" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - -<%@ page import="org.posterita.struts.pos.POSProductAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -
        -
        -
        -
        - - - - - - - - - - - - - - - - -
        -
        - - - - - - -
        - - - - - - - - - - - - - -
        - - - -
        - * - - - -
        - * - - -
        -
        - - - <% - ProductBean bean = (ProductBean)ProductForm.getBean(); - if(bean.getImageInfo() != null) - if(bean.getImageInfo().getHasAttachment() != null) - if(bean.getImageInfo().getHasAttachment().booleanValue()){%> - "> - <%}%> - - -   - -
        -
        -
        -
        - - - - - - - - - - - -
        - * - - - - - - -
        -
        -
        -
        - - - - - - - - - - - - - - - - - - - - -
        - * - - - - - - -
        - * - - - - - - -
        - * - - - - - - -
        -
        -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - * - - - - -
        - * - - - -
        -
        - - - -
        - - - -
        - - - - - Select Product Type - - - - - - - - -
        - - - -
        - - - -
        -
        -
        - -   - -
        -
        - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/updatedProduct.jsp b/posterita/posterita/web/jsp/pos/updatedProduct.jsp deleted file mode 100644 index 7a4ff5c8f9..0000000000 --- a/posterita/posterita/web/jsp/pos/updatedProduct.jsp +++ /dev/null @@ -1,136 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - - -<%@ page import="org.posterita.struts.pos.POSProductAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewAPPaymentAllocation.jsp b/posterita/posterita/web/jsp/pos/viewAPPaymentAllocation.jsp deleted file mode 100644 index 9be514abd9..0000000000 --- a/posterita/posterita/web/jsp/pos/viewAPPaymentAllocation.jsp +++ /dev/null @@ -1,153 +0,0 @@ - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.BPartnerInfoBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> -<%@ page import="org.posterita.struts.pos.DunningAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - -
        - -
        - : - -   - - : - -   - - -   - -
        - -
        - - - - - -<% - String url = "ViewPaymentAllocation.do"; - String collection = Constants.PAYMENT_ALLOCATIONS; -%> - - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - - - - - - -
        memo
        > - - "> - - - - > - "> - - - > - "> - - - - > - "> - - - - > - "> - - - > - "> - - - > - - > - - > - - > - -
        -<%@ include file="/jsp/include/pager.jsp" %> -
        -
        -
        -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewAllPOSProducts.jsp b/posterita/posterita/web/jsp/pos/viewAllPOSProducts.jsp deleted file mode 100644 index b6172f8dc1..0000000000 --- a/posterita/posterita/web/jsp/pos/viewAllPOSProducts.jsp +++ /dev/null @@ -1,503 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSProductAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - - -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - -<%@ include file="/jsp/include/posHeaderAdministration.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        -
        -
        - - - - - - - - - - - -
        - - - - - - - DESC: - - - -   - -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        - - -
        - Are you sure you want to delete the prices for the following products? - - Delete -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - <% - String url = "ViewAllPOSProduct.do"; - String collection = Constants.VIEW_POS_PRODUCTS; - %> - - - - - - <% - String styleClass = "oddRow"; - if ((count.intValue()%2) != 0) - styleClass = "evenRow"; - %> - - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - - - - - - - -
        - "> - - - - - - - - - - - - - - - - - - - - - - -
        -
        - - - <%@ include file="/jsp/include/pager.jsp" %> - - -
        -
        -
        -
        -
        - - -
        - Stock Qty: -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        Sales Figures
        - Period - - Sales - - Total Amt -
        - Today - - - - -
        - Current Week - - - - -
        - Current Month - - - - -
        - 6 Months - - - - -
        - Current Year - - - - -
        -
        -
        -
        - -
        -
        -
        -
        - - - - -
        - No products were found for : -
        -
        -
        - - - - - - - -
        -
        -
        -
        -
        -
        - Clear all items -
        -
        -
        -
        -
        -
        -
        - F1 Barcode | F2 Name | F3 Description | Ctrl+Up MoveUp | Ctrl+Down MoveDown - | Ctrl-N New Product | Ctrl-E Edit Product | Ctrl-I Import Products | Ctrl+M Menu | - Ctrl-D Open Drawer | Ctrl-Delete Clear -
        -
        - - diff --git a/posterita/posterita/web/jsp/pos/viewAllPOSProductsForUpdate.jsp b/posterita/posterita/web/jsp/pos/viewAllPOSProductsForUpdate.jsp deleted file mode 100644 index 2353a2bdea..0000000000 --- a/posterita/posterita/web/jsp/pos/viewAllPOSProductsForUpdate.jsp +++ /dev/null @@ -1,281 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.EditBulkProductFromFileAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - -
        - - -   - -
        -
        - - - - - - - - - - - - - - - - -
        - -
        -
        -
        - - - -
        - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - -
         
        width="400px"> - - > - - - > - - - > - -   -
        -
        -
        -
        -<%-- - - - - Create CSV - - ---%> - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewAllPaymentTerm.jsp b/posterita/posterita/web/jsp/pos/viewAllPaymentTerm.jsp deleted file mode 100644 index 56c7ee6161..0000000000 --- a/posterita/posterita/web/jsp/pos/viewAllPaymentTerm.jsp +++ /dev/null @@ -1,123 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.posterita.struts.pos.PaymentTermAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -
        - - Add Payment Term - -
        - - - - - - - - - - - - - - - <% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - -
         
        - - - - - - - - - - - - - - - - - "> - Edit - -   - - - "> - Deactivate - - - - - "> - Activate - - -
        - - -<%@ include file="/jsp/include/posFooter.jsp" %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewAllTax.jsp b/posterita/posterita/web/jsp/pos/viewAllTax.jsp deleted file mode 100644 index 450b732b1f..0000000000 --- a/posterita/posterita/web/jsp/pos/viewAllTax.jsp +++ /dev/null @@ -1,109 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.posterita.struts.pos.TaxAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -
        - - Add Payment Term - -
        - - - - - - - - - - - - <% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - -
         
        - - - - - - - - - - - "> - Edit - -   - - - "> - Deactivate - - - - - "> - Activate - - -
        - - -<%@ include file="/jsp/include/posFooter.jsp" %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewBPartnerTrxDetails.jsp b/posterita/posterita/web/jsp/pos/viewBPartnerTrxDetails.jsp deleted file mode 100644 index 95d8ab4be2..0000000000 --- a/posterita/posterita/web/jsp/pos/viewBPartnerTrxDetails.jsp +++ /dev/null @@ -1,183 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.BPartnerInfoBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -
        - - "> - - - - - - "> - - - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - : -
        - : -
        - : -
        - : -
        - Revenue: -
        - : -
        - : -
        -
        -
        - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - -
        Product Info
        > - - > - - > - -
        - -
        -
        - - - - - - - - - - - - - - <% - String styleClass1 = "label"; - if ((count.intValue()%2) != 0) - styleClass1 = "contentname"; - %> - - - - - - - - -
        Order Info
        > - "> - - - > - - - > - - > - - > - -
        -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewBarcode.jsp b/posterita/posterita/web/jsp/pos/viewBarcode.jsp deleted file mode 100644 index 868e047c1f..0000000000 --- a/posterita/posterita/web/jsp/pos/viewBarcode.jsp +++ /dev/null @@ -1,65 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSProductAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - diff --git a/posterita/posterita/web/jsp/pos/viewBestSellingItems.jsp b/posterita/posterita/web/jsp/pos/viewBestSellingItems.jsp deleted file mode 100644 index a379ea81c8..0000000000 --- a/posterita/posterita/web/jsp/pos/viewBestSellingItems.jsp +++ /dev/null @@ -1,50 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -<%@ include file="/jsp/pos/customReportTable.jsp" %> - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewBlackListCheques.jsp b/posterita/posterita/web/jsp/pos/viewBlackListCheques.jsp deleted file mode 100644 index 5e2f8854a6..0000000000 --- a/posterita/posterita/web/jsp/pos/viewBlackListCheques.jsp +++ /dev/null @@ -1,59 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - - -<%@ page import="org.posterita.struts.customer.CustomerAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -
        - test -
        - - - - - - - - - -
        -
        - - - -
        - - - -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> - diff --git a/posterita/posterita/web/jsp/pos/viewCommission.jsp b/posterita/posterita/web/jsp/pos/viewCommission.jsp deleted file mode 100644 index fcdf0c85e0..0000000000 --- a/posterita/posterita/web/jsp/pos/viewCommission.jsp +++ /dev/null @@ -1,128 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.CommissionAction" %> - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -
        - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - -
        %
        > - - > - - - "> - - - - > - - - > - - - > - - > - - > - - > - -
        -
        -
        -
        - - -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCommissionDetails.jsp b/posterita/posterita/web/jsp/pos/viewCommissionDetails.jsp deleted file mode 100644 index 3e8541bbd7..0000000000 --- a/posterita/posterita/web/jsp/pos/viewCommissionDetails.jsp +++ /dev/null @@ -1,114 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.CommissionAction" %> - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - -
        - "> - - - -
        - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - -
        > - "> - - - > - "> - - - - - > - - > - -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletePOSOrder.jsp b/posterita/posterita/web/jsp/pos/viewCompletePOSOrder.jsp deleted file mode 100644 index a727b55cff..0000000000 --- a/posterita/posterita/web/jsp/pos/viewCompletePOSOrder.jsp +++ /dev/null @@ -1,103 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.compiere.model.MInOut" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.compiere.process.DocAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - -<% - String orderlines = Constants.POS_ORDER_LINES; -%> -<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> - -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        -
        -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletedCreditOrder.jsp b/posterita/posterita/web/jsp/pos/viewCompletedCreditOrder.jsp deleted file mode 100644 index 024cc8a59e..0000000000 --- a/posterita/posterita/web/jsp/pos/viewCompletedCreditOrder.jsp +++ /dev/null @@ -1,64 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.compiere.model.MInOut" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.compiere.process.DocAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - -<% String orderlines = Constants.POS_ORDER_LINES; %> -<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> - -
        -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletedCustomerReturnOrder.jsp b/posterita/posterita/web/jsp/pos/viewCompletedCustomerReturnOrder.jsp deleted file mode 100644 index cc11e78200..0000000000 --- a/posterita/posterita/web/jsp/pos/viewCompletedCustomerReturnOrder.jsp +++ /dev/null @@ -1,85 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.compiere.process.DocAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - <% - MOrder order = (MOrder) request.getSession().getAttribute(Constants.CUSTOMER_RETURN_ORDER); - %> - - - - -
        - - - - -
        - - - -
        - - <%@ include file="/jsp/pos/orderHeader.jsp" %> - <% String orderlines = Constants.CUSTOMER_RETURN_ORDER_LINES; %> - <%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> - -
        - - - "/> -   - -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletedGoodsReceiveNote.jsp b/posterita/posterita/web/jsp/pos/viewCompletedGoodsReceiveNote.jsp deleted file mode 100644 index e2a1d8527a..0000000000 --- a/posterita/posterita/web/jsp/pos/viewCompletedGoodsReceiveNote.jsp +++ /dev/null @@ -1,79 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.compiere.process.DocAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -
        - -<%@ include file="/jsp/pos/orderHeader.jsp" %> -<% String orderlines = Constants.GOODS_RECEIVE_NOTE_LINES; %> -<%@ include file="/jsp/pos/completePOSShoppingCart.jsp" %> - - - -<% - MOrder order = (MOrder) request.getSession().getAttribute(Constants.GOODS_RECEIVE_NOTE); -%> - - - - -
        - - - "/> -   - -
        -
        -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletedGoodsReturnNote.jsp b/posterita/posterita/web/jsp/pos/viewCompletedGoodsReturnNote.jsp deleted file mode 100644 index 6a70a662f8..0000000000 --- a/posterita/posterita/web/jsp/pos/viewCompletedGoodsReturnNote.jsp +++ /dev/null @@ -1,158 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.compiere.process.DocAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - - - - - - - - - - - - - - -<% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; -%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <% - MOrder order = (MOrder) request.getSession().getAttribute(Constants.GOODS_RETURN_NOTE); - %> - - - - - -
        Total
        colspan="2"> - - align="center"> - - align="center"> - - > - - - > - - - > - - - > - - -
        - - -   - -   - - - - - - - - -
        - - - "/> -   - -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCompletedPOSOrder.jsp b/posterita/posterita/web/jsp/pos/viewCompletedPOSOrder.jsp deleted file mode 100644 index f0f0f378e5..0000000000 --- a/posterita/posterita/web/jsp/pos/viewCompletedPOSOrder.jsp +++ /dev/null @@ -1,145 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> - - - - - -POS Order -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -<%@ include file="/jsp/pos/orderHeader.jsp" %> - - - - - -
        - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - - - - - - -
        - - - - - - - - - - - - - -
        colspan="2"> align="center"> align="center"> align="right"> align="right"> align="right"> align="right">
        - - -   - -   - - - - - - - - -
        -
        -
        -
        - -
        - -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCreditors.jsp b/posterita/posterita/web/jsp/pos/viewCreditors.jsp deleted file mode 100644 index 7ff324c40c..0000000000 --- a/posterita/posterita/web/jsp/pos/viewCreditors.jsp +++ /dev/null @@ -1,115 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.BPartnerInfoBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> -<%@ page import="org.posterita.struts.pos.DunningAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -

        - -
        - - - - - - - - - - - -<% - String collection = Constants.CREDITORS; - String url = "/jsp/pos/viewCreditors.jsp"; -%> - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - -
        > - "> - - - > - - > - - > - - > - - > - - > - -
        - -<%@ include file="/jsp/include/pager.jsp" %> - -
        - -
        -
        - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewCurrency.jsp b/posterita/posterita/web/jsp/pos/viewCurrency.jsp deleted file mode 100644 index 5e81541926..0000000000 --- a/posterita/posterita/web/jsp/pos/viewCurrency.jsp +++ /dev/null @@ -1,78 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Servansingh ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.CurrencyBean" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp"%> - - - - - - - - - - - - - - - - - - - -
        - - - - - - -
        - -
        - -
        - -
        - -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewDebtors.jsp b/posterita/posterita/web/jsp/pos/viewDebtors.jsp deleted file mode 100644 index e2044edb28..0000000000 --- a/posterita/posterita/web/jsp/pos/viewDebtors.jsp +++ /dev/null @@ -1,116 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.BPartnerInfoBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> -<%@ page import="org.posterita.struts.pos.DunningAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -

        - -
        - - - - - - - - - - - -<% - String collection = Constants.DEBTORS; - String url = "/jsp/pos/viewDebtors.jsp"; -%> - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - -
        > - - "> - - - > - - > - - > - - > - - > - - > - -
        - -<%@ include file="/jsp/include/pager.jsp" %> - -
        - -
        -
        - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewDocumentHistory.jsp b/posterita/posterita/web/jsp/pos/viewDocumentHistory.jsp deleted file mode 100644 index a7d1755730..0000000000 --- a/posterita/posterita/web/jsp/pos/viewDocumentHistory.jsp +++ /dev/null @@ -1,155 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ page import="java.util.Calendar" %> -<%@ page import="org.posterita.beans.OrderHistoryBean" %> -<%@ page import="java.util.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - -<% - String url = "ViewDocumentHistory.do"; - String collection = Constants.DOCUMENT_HISTORY; -%> - -<%@ include file="/jsp/include/posHeader.jsp" %> - - - - - - - - - - - - - - - -
        - - <%@ include file="/jsp/pos/filter.jsp" %> -
        -
        - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - - - - - -
        - <% - String partnerId= element.getBpartnerId() + ""; - %> - - - "> - - - - - - - "> - - - - - - - - - - "> - - - - "> - - - - "> - - - - "> - Create Shipment - - - "> - - -
        -
        - <%@ include file="/jsp/include/pager.jsp" %> - <%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewDocumentPDF.jsp b/posterita/posterita/web/jsp/pos/viewDocumentPDF.jsp deleted file mode 100644 index 9f46aac15f..0000000000 --- a/posterita/posterita/web/jsp/pos/viewDocumentPDF.jsp +++ /dev/null @@ -1,46 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.Constants" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> - - - Document PDF - - -

        Document PDF

        - <%@ include file="/jsp/include/errors.jsp" %> - - <% - String strPath = (String)request.getAttribute(Constants.DOCUMENT_PDF); - strPath = "\"" + strPath + "\""; - %> - - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewDraftedOrder.jsp b/posterita/posterita/web/jsp/pos/viewDraftedOrder.jsp deleted file mode 100644 index a3ab78528f..0000000000 --- a/posterita/posterita/web/jsp/pos/viewDraftedOrder.jsp +++ /dev/null @@ -1,153 +0,0 @@ -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<% - String path = request.getContextPath(); - String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; - //String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); - Properties ctx = TmkJSPEnv.getCtx(request); - String posName = POSTerminalManager.getTerminalName(ctx); - String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); - String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); - int m_pricelist_id = POSTerminalManager.getSOPriceListId(ctx); - MPriceList priceList = MPriceList.get(ctx, m_pricelist_id, null); - String priceListName = priceList.getName(); -%> - -<%@page import="java.util.Properties"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.compiere.model.MPriceList"%> -<%@page import="org.compiere.model.MOrg"%> -<%@page import="org.compiere.model.MRole"%> -<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> -<%@page import="org.posterita.util.HtmlOrderPrintFormatter"%> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> - - - - - - - - - - - - - - - - - - - - - - - - -
        - -
        -
        -
        - <%= ShoppingcartManager.getShoppingCartFromOrder(ctx, Integer.parseInt(orderId), null) %> -
        - -
        - -
        - - <%if(orderType.equalsIgnoreCase("POS Order")){%> -
        NEW ORDER
        - <% }else{ %> -
        NEW ORDER
        - <%}%> -
        REPRINT
        -
        -
        -
        - Ctrl+P Reprint | Ctrl+Enter New Order | Ctrl-Esc Menu
        - - - -
        -
        $0.00
        -
        - -
        - <%=priceListName%> -
        - - -
        - <% - String args = "showFooter=true;lineLength=40;priceWithVat=true;showDiscount=true;showLogo=false;showBarcode=false;"; - - HtmlOrderPrintFormatter formatter = new HtmlOrderPrintFormatter(args); - String data = formatter.format(ctx, Integer.parseInt(orderId), null); - out.print("
        ");
        -			out.print(data);
        -			out.print("
        "); - %> -
        - -
        - -
        - " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> -
        - - - diff --git a/posterita/posterita/web/jsp/pos/viewInventoryHistory.jsp b/posterita/posterita/web/jsp/pos/viewInventoryHistory.jsp deleted file mode 100644 index b1f0173f6c..0000000000 --- a/posterita/posterita/web/jsp/pos/viewInventoryHistory.jsp +++ /dev/null @@ -1,239 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="org.posterita.struts.pos.InventoryAction" %> -<%@ page import="org.compiere.process.DocAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> -<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> - -<%@page import="org.posterita.core.Configuration"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.compiere.model.MPriceListVersion"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="java.util.Properties"%> -<%@page import="org.posterita.businesslogic.administration.PriceListManager"%> - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> -<% - Integer priceListId = PriceListManager.getDefaultPriceListId(ctx, false); - Configuration configuration = Configuration.getConfiguration(request); - String searchProductBy = configuration.getSearchProductBy(); -%> - - - - - - - - - - - - -
        - - - - - - - -
        -
        - -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - <%@ include file="/jsp/include/historyMonthYearFilter.jsp"%> - - - - - - -
        - - - - - - - - - -
        -   - - - - - - - - - - - - - - - <%@include file="/jsp/include/paymentRuleFilter.jsp"%> - - -
        -
        -
        - - - - - - - - - - - - -

        - - Merge - -

        -
        -
        -
        -

         

        - -<%@ include file="/jsp/include/posFooter.jsp" %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewMaxSoldItems.jsp b/posterita/posterita/web/jsp/pos/viewMaxSoldItems.jsp deleted file mode 100644 index 1356131544..0000000000 --- a/posterita/posterita/web/jsp/pos/viewMaxSoldItems.jsp +++ /dev/null @@ -1,68 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -<% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; -%> - - - - - -
        > - - > - -
        -
        -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewMinOut.jsp b/posterita/posterita/web/jsp/pos/viewMinOut.jsp deleted file mode 100644 index 3295740778..0000000000 --- a/posterita/posterita/web/jsp/pos/viewMinOut.jsp +++ /dev/null @@ -1,145 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> - - -Shipment - -<%@ include file="/jsp/include/posHeader.jsp" %> - - - - - - - <%@ include file="/jsp/include/errors.jsp" %> - -
        - - - -
        - - <%@ include file="/jsp/pos/webDocumentHeader.jsp" %> - - - - - - - - - - - - - - - -
        - - - - - - - - -
        - Shipment Ref No: -
        - Doc Status: -
        -
        - Tracking No: - - - - - - -
        -
        - - - - - - - - - - - - - - - - -
        NameQty
        - - - -
        -
        - - - - -
        - - - - - - - - - - - - - - - - -
        - - - -
        -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewMinSoldItems.jsp b/posterita/posterita/web/jsp/pos/viewMinSoldItems.jsp deleted file mode 100644 index da9390e7be..0000000000 --- a/posterita/posterita/web/jsp/pos/viewMinSoldItems.jsp +++ /dev/null @@ -1,70 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -<% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; -%> - - - - - -
        nowrap="nowrap"> - - > - -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewOrder.jsp b/posterita/posterita/web/jsp/pos/viewOrder.jsp deleted file mode 100644 index 7d371ad107..0000000000 --- a/posterita/posterita/web/jsp/pos/viewOrder.jsp +++ /dev/null @@ -1,317 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.compiere.model.MInOut" %> -<%@ page import="org.posterita.businesslogic.CurrencyManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ page import="org.posterita.beans.WebstoreUserBean" %> - - - - <%@page import="org.posterita.businesslogic.CurrencyManager"%> - - - - - - - - - - - - - - -
        -
        Sales Order
        - - - - - - - -<% - MOrder order = (MOrder) request.getSession().getAttribute(Constants.MORDER); - WebstoreUserBean userbean = (WebstoreUserBean) request.getSession().getAttribute(Constants.WEBSTORE_USER_BEAN); - String isPaid = (String) request.getSession().getAttribute(Constants.IS_PAID); - - - String currSymbole = CurrencyManager.getCurrencySymbol(order.getC_Currency_ID()); - - if (isPaid == null) - isPaid = "N"; -%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - <%@ include file="/jsp/include/errors.jsp" %> -
        -

        Sales Order

        - -
        -
        - - - - - - -
        - - - - -
        - To: -
        -
        - - - - -
        - From: -
        -
        -
        - - - - - - -
        - - - - - - - - - - - - - - - - -
        -   - -
        - -
        - -
        - -
        -
        - - - - - - - - - - - - - - - -
        - -
        - -
        - -
        - -
        -
        -
        - Ref SO No: -
        - Date Ordered: -
        - Status: -
        - - Is Paid: - -
        - - - - - - - - - - - - <% - String styleClass = "lightColour"; - if ((count.intValue()%2) != 0) - styleClass = "darkColour"; - %> - - - - - - - - - - - - - - - - - - - -
        DescriptionQtyUnit PriceTotal Price
        - - - - - <%=currSymbole%> - - - <%=currSymbole%> - -
        -   - - - - <%=currSymbole%> - - -
        -
        - <%-- - if ((order.getDeliveryViaRule().equals(MInOut.DELIVERYVIARULE_Shipper)) && (isPaid.equals(Constants.NO_CHAR))) - { - - -
        - - - - - - - - - "> - "> - - - - - - - - - - - - - - <%int counter = ((Integer)count).intValue()+1;%> - - " value=""> - " value=""> - " value="Quantity"> - " value=""> - " value="Unit Price"> - " value=""> - - -
        - - } - --%> -
        - - - - <%@ include file="/jsp/include/tshirtFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSBPartnerForDunning.jsp b/posterita/posterita/web/jsp/pos/viewPOSBPartnerForDunning.jsp deleted file mode 100644 index 0f9a951e20..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSBPartnerForDunning.jsp +++ /dev/null @@ -1,168 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.BPartnerInfoBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> -<%@ page import="org.posterita.struts.pos.DunningAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -
        - - - - - - - - - - -<% - String url = "ViewBPartnersForDunning.do"; - String collection = Constants.DEBTORS; -%> - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - -
        > - - "> - - - > - - "/> - > - - > - <% - String styleClass1 = "nomalcolor"; - if(element.getCreditUsed().intValue()> element.getCreditLimit().intValue()) - styleClass1= "negativecolor"; - %> -
        - -
        -
        > - <% - String styleClass2 = "nomalcolor"; - if(element.getOpenAmt().intValue()> 0) - styleClass2= "negativecolor"; - %> -
        - -
        -
        > - - -
        - -<%@ include file="/jsp/include/pager.jsp" %> - -
        - -
        -
        - - - - - -
        -
        - - -
        -
        -
        - - Print - -
        -
        - - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSBPartnerInfo.jsp b/posterita/posterita/web/jsp/pos/viewPOSBPartnerInfo.jsp deleted file mode 100644 index 0e3e9adf66..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSBPartnerInfo.jsp +++ /dev/null @@ -1,135 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.BPartnerInfoBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -
        :
        -
        -
        -
        - - - - - - - - -
        - - -   - - - - - - -
        -
        - - -<% - String url = "ViewPOSBPartnerInfo.do"; - String collection = Constants.BUSINESSPARTNER; -%> - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - -
        > - - "> - - - - > - - > - - > - - > - - > - - > - -
        -<%@ include file="/jsp/include/pager.jsp" %> -
        -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSCustomer.jsp b/posterita/posterita/web/jsp/pos/viewPOSCustomer.jsp deleted file mode 100644 index 23fabf4050..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSCustomer.jsp +++ /dev/null @@ -1,230 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="org.posterita.struts.customer.CustomerAction" %> -<%@ page import="org.compiere.model.MBPartner" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - -
        -
        - - - - - - - - - - - - - - -
        - -
        - -
        - -
        -
        -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - -
        - - - - - - - - - -
        - -
        -
        -
        -
        - - - - - - - - - - - - - - - - - - - - -
        - -
        - -
        - -
        - -
        -
        -
        -
        - - - - - - - - - - - - - - - - - -
        - -
        - -
        -
        -
        - - - - - - - -
        - -
        - - - - - - - - -
        - - - - - - - -
        - "> - - -
        -
        - -
        -
        - - ">Edit - Add New - Back -
        - - -<%@ include file="/jsp/include/posFooter.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewPOSCustomerCart.jsp b/posterita/posterita/web/jsp/pos/viewPOSCustomerCart.jsp deleted file mode 100644 index 7f0a50947b..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSCustomerCart.jsp +++ /dev/null @@ -1,193 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> -
        -<%@ include file="/jsp/include/errors.jsp" %> - - - -
        -
        -
        - -
        -
        - - -
        - - - - - - - - - - - - - -
        -
        -
        - - -
        - - - - - - - - - - - - - <% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - -
         
        - - - - -
        - -
        - - - - - - - - Y - - - N - - - "> -
        -
        -
        -
        -
        PRINT FIDELITY
        -
        -
        -
        -
        - " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> -
        - - - - - - - - - - - - - - - - - - - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewPOSHistory.jsp b/posterita/posterita/web/jsp/pos/viewPOSHistory.jsp deleted file mode 100644 index 89ab8d8949..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSHistory.jsp +++ /dev/null @@ -1,127 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.compiere.process.DocAction" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> -<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -<% - String url = "ViewPOSHistory.do?orderType=" + orderType; - String collection = Constants.POS_HISTORY; -%> - - - - -
        - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - <%@ include file="/jsp/include/posHistoryFilter2.jsp" %> -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        -
        -<%@ include file="/jsp/include/printOrderApplet2.jsp" %> -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSHistoryForAll.jsp b/posterita/posterita/web/jsp/pos/viewPOSHistoryForAll.jsp deleted file mode 100644 index 264ab24dad..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSHistoryForAll.jsp +++ /dev/null @@ -1,211 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.compiere.process.DocAction" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - <% - String url = "ViewPOSHistoryForAll.do"; - String collection = Constants.POS_HISTORY; - %> - - - - -
        - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - <%@ include file="/jsp/include/posHistoryFilter.jsp" %> -
        - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - -
         
        > - "> - - - - -
        - - -
        -
        - - -
        - -
        -
        - - -
        - -
        -
        - -
        - - -
        - - - -
        - -
        -
        -
        > - - - > - - <% - String partnerId= element.getBpartnerId() + ""; - %> - - - "> - - - - - - - "> - - - - - > - - - - - - - - - - - - - - - - - - Credit - - > - - - > - - - - - - - - - "> - - - - - - - "> - - - - -
        -
        -
        -<%@ include file="/jsp/include/pager.jsp" %> -<%@ include file="/jsp/include/printOrderApplet2.jsp" %> -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSHistory_displaytag.jsp b/posterita/posterita/web/jsp/pos/viewPOSHistory_displaytag.jsp deleted file mode 100644 index 648a3a7c3e..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSHistory_displaytag.jsp +++ /dev/null @@ -1,122 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> -<%@ page import="org.compiere.process.DocAction" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> -<%@ page import="org.displaytag.decorator.TableDecorator" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> -<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> - -<%@page import="org.posterita.beans.POSHistoryBean"%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -<% - String url = "ViewPOSHistory.do?orderType=" + orderType; - String collection = Constants.POS_HISTORY; - - Integer display = new Integer("10"); - if (displayCookie.getValue() != null || !displayCookie.getValue().equals("")) - display = new Integer(displayCookie.getValue()); -%> - - - - -
        - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - <%@ include file="/jsp/include/posHistoryFilter2.jsp" %> -
        - - - - - - - - - - - - - - -
        -
        - -<%@ include file="/jsp/include/printOrderApplet2.jsp" %> -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSInfo.jsp b/posterita/posterita/web/jsp/pos/viewPOSInfo.jsp deleted file mode 100644 index 8c90744540..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSInfo.jsp +++ /dev/null @@ -1,82 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - -
        - - - - - -
        - - - - - - -
        -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSOrder.jsp b/posterita/posterita/web/jsp/pos/viewPOSOrder.jsp deleted file mode 100644 index 6f583b539b..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSOrder.jsp +++ /dev/null @@ -1,223 +0,0 @@ -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<% - String path = request.getContextPath(); - String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); - String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; - Properties ctx = TmkJSPEnv.getCtx(request); - String posName = POSTerminalManager.getTerminalName(ctx); - String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); - String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); - -%> - -<%@page import="org.posterita.Constants"%> -<%@page import="java.util.Properties"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.compiere.model.MPriceList"%> -<%@page import="org.compiere.model.MOrg"%> -<%@page import="org.compiere.model.MRole"%> -<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> -<%@page import="org.posterita.util.HtmlOrderPrintFormatter"%> -<%@page import="org.compiere.model.MOrder"%> -<%@page import="org.posterita.businesslogic.POSManager"%> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> -<%@page import="org.compiere.model.MPayment"%> -<%@page import="java.math.BigDecimal"%> -<%@page import="org.compiere.model.I_M_PriceList"%> -<%@page import="org.posterita.order.UDIOrderTypes"%> -<%@page import="org.posterita.TangoColors"%> - - - - - <%=appName%> - - - - - - - - - - - - - - - - -<% -MOrder order = new MOrder(ctx, Integer.valueOf(orderId).intValue(), null); -String orderType = order.getOrderType(); -MPriceList priceList = MPriceList.get(ctx, order.getM_PriceList_ID(), null); -String priceListName = priceList.getName(); -%> - - - - - - - - - - - - - - - - - - - - -
        -
        - - -
        - <%= orderType %> -
        -
        -
        -
        - : - <%=orgName%> -
        -
        - : - <%=posName%> -
        -
        -
        -
        - : - -
        -
        - : - <%=roleName%> -
        -
        -
        -
        -
        -
        -
        -
        -
        - <% String currency = order.getC_Currency().getCurSymbol(); - - String paymentRule = order.getPaymentRule(); - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) - { - out.print("Amt Refunded: " + currency + order.getAmountRefunded()); - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) - { - out.print("Card: " + currency + order.getGrandTotal()); - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) - { - out.print("Cheque: " + currency + order.getGrandTotal()); - } - - if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) - { - out.print("Total: " + currency + order.getGrandTotal()); - } - %> -
        -
        -
        -
        -
        -   - -
        -
        - <%=priceListName%> -
        -
        -
        -
        -
        -
        - <%= ShoppingcartManager.getShoppingCartFromOrder(ctx, Integer.valueOf(orderId).intValue(), null) %> -
        -
        -
        -
        -
        - <% - String args = "showFooter=true;lineLength=40;priceWithVat=true;showDiscount=false;showLogo=false;showBarcode=false;"; - - HtmlOrderPrintFormatter formatter = new HtmlOrderPrintFormatter(args); - String data = formatter.format(ctx, Integer.valueOf(orderId).intValue(), null); - out.print("
        ");
        -				out.print(data);
        -				out.print("
        "); - %> -
        -
        -
        - -
        -
        -
        - <%String newOrderAction = "/CreatePOSOrderScreen.do?orderType="+orderType; %> -
        NEW ORDER
        -
        -
        -
        - Ctrl+Space New Order | Ctrl-M Menu
        -
        - <%@ include file="/jsp/include/printOrderApplet2.jsp" %> - - - diff --git a/posterita/posterita/web/jsp/pos/viewPOSProduct.jsp b/posterita/posterita/web/jsp/pos/viewPOSProduct.jsp deleted file mode 100644 index 916051a229..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSProduct.jsp +++ /dev/null @@ -1,276 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> - -<%@ page import="org.compiere.model.MProduct" %> - - -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> - -<%@ page import="org.posterita.struts.pos.POSProductAction" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - -
        -
        - - - - - - -
        - - - - - - - - - - - - - - - - - -
        - - - - -   - -   -
        - * - - - -   - -   -
        - * - - -
        -
        - - - <% - ProductBean bean = (ProductBean)POSProductForm.getBean(); - if(bean.getImageInfo() != null) - if(bean.getImageInfo().getHasAttachment() != null) - if(bean.getImageInfo().getHasAttachment().booleanValue()){%> - "> - <%}%> - - -   - -
        -
        -
        -
        - - - - - - - - - - - -
        - * - - - -   - -   -
        -
        -
        -
        - - - - - - - - - - - - - - - - - - - - - -
        - * - - - -   - -   -
        - * - - - -   - -   -
        - * - - - -   - -   -
        -
        -
        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - * - - - - -
        - * - - -
        - - - -
        - - - -
        - - - -
        - - - -
        -
        -
        -
        - - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPOSProducts.jsp b/posterita/posterita/web/jsp/pos/viewPOSProducts.jsp deleted file mode 100644 index 2a2fb17be3..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSProducts.jsp +++ /dev/null @@ -1,71 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - -<%@ page import="java.util.ArrayList" %> -<%@ page import="java.util.Properties" %> -<%@ page import="org.posterita.core.TmkJSPEnv" %> -<%@ page import="org.posterita.businesslogic.ProductManager" %> -<%@ page import="org.posterita.beans.ProductStatusBean" %> -<% - -String productName = request.getParameter("productName"); -Properties ctx = TmkJSPEnv.getCtx(request); - -ArrayList productList =ProductManager.searchProductsByName(ctx,productName); -ProductStatusBean bean = null; - -if(productList == null || productList.size() == 0) -{ - - //out.print("
          "); - //out.print("
        • "); - //out.print("
        "); - out.print("
        "); -} -else -{ - int size = 15; - - size = (size > productList.size())? productList.size() : size; - - if(size > 0) - { - out.print("
          "); - - for(int i=0;i< size;i++) - { - bean = (ProductStatusBean)productList.get(i); - - out.print("
        • "); - out.print(bean.getProductName()); - out.print("
        • "); - } - - out.print("
        "); - } - - out.print("
        "); - -} -%> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewPOSUser.jsp b/posterita/posterita/web/jsp/pos/viewPOSUser.jsp deleted file mode 100644 index fc33b31f02..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPOSUser.jsp +++ /dev/null @@ -1,201 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok Pathak ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - -<%@ include file="/jsp/include/posHeader.jsp" %> - - - - - - -
        -
        - Contact - - - - - - - - - - - - - - - - - - - - - -
        - - - -
        - - - -
        -   -
        -   -
        -   -
        -
        -
        - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        -
        -
        - - - - - - -
        -
        - - - - - - - - - - -
        - - - -
        - - - -
        -
        -
        - - - - - - - - <%@ include file="/jsp/include/posFooter.jsp" %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewPartialPOSOrderHistory.jsp b/posterita/posterita/web/jsp/pos/viewPartialPOSOrderHistory.jsp deleted file mode 100644 index c274c9a6b0..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPartialPOSOrderHistory.jsp +++ /dev/null @@ -1,108 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -
        - <%@ include file="/jsp/include/errors.jsp" %> - - - - <%@ include file="/jsp/include/historyfilter.jsp" %> - - <% - String url = "ViewPartialPOSOrderHistory.do"; - String collection = Constants.POS_HISTORY; - %> - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - -
         
        > - "> - - - > - - > - - > - - -
        - <%@ include file="/jsp/include/pager.jsp" %> -
        -
        -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPayment.jsp b/posterita/posterita/web/jsp/pos/viewPayment.jsp deleted file mode 100644 index db612a2235..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPayment.jsp +++ /dev/null @@ -1,96 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> -<%@ page import="org.compiere.model.MPayment" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> - - -Payment - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - -<%-- -@TODO by Alok - ---%> - - - <%@ include file="/jsp/pos/webDocumentHeader.jsp" %> - - - - - - - - - - -
        - - Payment By: -
        -
        - Ref Payment No: -
        - Status: -
        -
        - - - - - - - - - - - -
        Payment DateAmount
        - - - - -
        -
        - - - - <%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPaymentAllocation.jsp b/posterita/posterita/web/jsp/pos/viewPaymentAllocation.jsp deleted file mode 100644 index 142c8eac42..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPaymentAllocation.jsp +++ /dev/null @@ -1,153 +0,0 @@ - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.BPartnerInfoBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> -<%@ page import="org.posterita.struts.pos.DunningAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - -
        - -
        - : - -   - - : - -   - - -   - -
        - -
        - - - - - -<% - String url = "ViewPaymentAllocation.do"; - String collection = Constants.PAYMENT_ALLOCATIONS; -%> - - - - - - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - - - - - - - - - - - -
        memo
        > - - "> - - - - > - "> - - - > - "> - - - - > - "> - - - - > - "> - - - > - "> - - - > - - > - - > - - > - -
        -<%@ include file="/jsp/include/pager.jsp" %> -
        -
        -
        -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPaymentDetails.jsp b/posterita/posterita/web/jsp/pos/viewPaymentDetails.jsp deleted file mode 100644 index 858cf85071..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPaymentDetails.jsp +++ /dev/null @@ -1,181 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.CreditOrderAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="org.posterita.core.UDIPair" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - - - - - . - - - - - - - - -
        - - - "> - - - - - - - - - - - - - - - - -
        - - - "> - - - - - - - - - - - - - - - -
        - Total: - - -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewPreferences.jsp b/posterita/posterita/web/jsp/pos/viewPreferences.jsp deleted file mode 100644 index 9cc1c948ca..0000000000 --- a/posterita/posterita/web/jsp/pos/viewPreferences.jsp +++ /dev/null @@ -1,278 +0,0 @@ -<%@ page import="org.posterita.util.TmkPrinterConstants" %> -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen Beekoo ---%> - - - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> - - - -
        -
        -
        -
        -
        - - - -
        - - - . - -
        -
        - -
        - Minimum characters before searching starts - -
        - -
        -
        - -
        -
        -
        - - : - -
        -
        -
        -
        -
        - - -
        - - - - - - - - - - - - - - -
        -
        - -
        - - - - - - - - - - - - - - - -
        -
        - : - " code="org.posterita.core.PrintOrderApplet.class" width="0" height="0"> - -
        - - -
        -
        -
        -
        - -
        -
        -
        -<%@ include file="/jsp/include/posFooter.jsp" %> - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewProductCart.jsp b/posterita/posterita/web/jsp/pos/viewProductCart.jsp deleted file mode 100644 index 23617175f3..0000000000 --- a/posterita/posterita/web/jsp/pos/viewProductCart.jsp +++ /dev/null @@ -1,134 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen Beekoo ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSProductAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - -
        -
        -
        - -
        -
        - - -
        - - - - - - - - - - - - - -
        -
        -
        - - - - - - - - - <% - String url = "ViewProductCart.do"; - String collection = Constants.PRODUCT_DETAILS; - %> - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - -
         
        > - - > - - > - - > - - > - ">Remove -
        -
        -
        -
        - - - - -
        -<%@ include file="/jsp/include/pager.jsp" %> -
        -
        -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewProductCartForUpdate.jsp b/posterita/posterita/web/jsp/pos/viewProductCartForUpdate.jsp deleted file mode 100644 index f34f5314ed..0000000000 --- a/posterita/posterita/web/jsp/pos/viewProductCartForUpdate.jsp +++ /dev/null @@ -1,134 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen Beekoo ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.EditBulkProductFromFileAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -
        -
        -
        - -
        -
        - -
        -
        - - - - - - - - - - - - - -
        -
        -
        - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - -
         
        width="400px"> - - > - - - > - - - align="center"> - "> - - -
        -
        - - - - - - - -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewProductSalesDetails.jsp b/posterita/posterita/web/jsp/pos/viewProductSalesDetails.jsp deleted file mode 100644 index 160287e418..0000000000 --- a/posterita/posterita/web/jsp/pos/viewProductSalesDetails.jsp +++ /dev/null @@ -1,154 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen Beekoo ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.BPartnerInfoBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.BpartnerInfoAction" %> -<%@ page import="org.posterita.struts.pos.POSGoodsAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - -
        - "> - - -
        - - - - - - - - - - - - - - - -
        - - - - - - - - - -
        -
        -
        - - - - - - - - - - - - - - - - - -
        - : - -
        - : - - - -
        -
        -
        - - - - - - - - - - - - - - <% - String styleClass1 = "label"; - if ((count.intValue()%2) != 0) - styleClass1 = "contentname"; - %> - - - - - - - - - -
        > - "> - - - > - - > - - > - - align="right"> - - align="right"> - - - -
        -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewProductsSalesInfo.jsp b/posterita/posterita/web/jsp/pos/viewProductsSalesInfo.jsp deleted file mode 100644 index a8432c8d0c..0000000000 --- a/posterita/posterita/web/jsp/pos/viewProductsSalesInfo.jsp +++ /dev/null @@ -1,127 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen Beekoo ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSProductAction" %> -<%@ page import="org.compiere.process.DocumentEngine" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - -<%@ page import="org.compiere.model.MOrder" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="java.util.ArrayList" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - -
        - - -   - -
        - -
        - - - - - - - - - - - - - <% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - -
        width="400px"> - "> - - - width="100px"> - - width="150px"> - - > - - > - - - > - - - > - -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewRole.jsp b/posterita/posterita/web/jsp/pos/viewRole.jsp deleted file mode 100644 index 193fb2d1be..0000000000 --- a/posterita/posterita/web/jsp/pos/viewRole.jsp +++ /dev/null @@ -1,92 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen Beekoo ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - -
        :
        :
        :
        :
        :

        - - - - - - - - - - - - - - - - -
        - -
                - -
        -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> - - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewStockEnquiry.jsp b/posterita/posterita/web/jsp/pos/viewStockEnquiry.jsp deleted file mode 100644 index de5d1f975a..0000000000 --- a/posterita/posterita/web/jsp/pos/viewStockEnquiry.jsp +++ /dev/null @@ -1,73 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Praveen ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> -<%@ page import="org.posterita.struts.pos.POSOrderAction" %> -<%@ page import="org.posterita.businesslogic.performanceanalysis.ReportDateManager" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -
         
        - - - - - - - - - -
        - - - -
        - - - -
        - - - - -
        -   -
        -
        -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewStockMovement.jsp b/posterita/posterita/web/jsp/pos/viewStockMovement.jsp deleted file mode 100644 index cd806570d0..0000000000 --- a/posterita/posterita/web/jsp/pos/viewStockMovement.jsp +++ /dev/null @@ -1,92 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Alok Pathak ---%> - - - -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.beans.ProductBean" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.lib.UdiConstants" %> -<%@ page import="org.posterita.struts.pos.POSReportAction" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - -<% - String styleClass = "label"; - if ((count.intValue()%2) != 0) - styleClass = "contentname"; -%> - - - - - - - - - - -
        > - "> - - - > - - > - - > - - > - - > - - > - -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewStockSalesReport.jsp b/posterita/posterita/web/jsp/pos/viewStockSalesReport.jsp deleted file mode 100644 index fd34148bea..0000000000 --- a/posterita/posterita/web/jsp/pos/viewStockSalesReport.jsp +++ /dev/null @@ -1,112 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2008 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author sendy ---%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<%@page import="org.posterita.Constants"%> - -<%@page import="org.posterita.struts.pos.POSReportAction"%> -Stock Sales Report -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -
        - - - - -
        - -
        - - <%@ include file="/jsp/include/searchProductPanel3.jsp" %> - -
        -
         
        -
        - - -
        -
         
        -
        - - -
        -
         
        -
        - - -
        -
         
        - - - - -
        - - - - - - - -
        - <%@ include file="/jsp/include/startCalendar.jsp" %> -
        - <%@ include file="/jsp/include/endCalendar.jsp" %> -
        -
        -
        - - - - - -
        - -   - - - - -
        -
        - - - - - <%=stockReportData%> - -
        -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewStockTransfer.jsp b/posterita/posterita/web/jsp/pos/viewStockTransfer.jsp deleted file mode 100644 index d3bdf7e994..0000000000 --- a/posterita/posterita/web/jsp/pos/viewStockTransfer.jsp +++ /dev/null @@ -1,223 +0,0 @@ -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> -<% - String path = request.getContextPath(); - String appName = (String) request.getSession().getAttribute(Constants.APP_NAME); - String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; - Properties ctx = TmkJSPEnv.getCtx(request); - String posName = POSTerminalManager.getTerminalName(ctx); - String orgName = MOrg.get(ctx, Env.getContextAsInt(ctx, UdiConstants.ORG_ID_CTX_PARAM)).getName(); - String roleName = MRole.get(ctx, Env.getContextAsInt(ctx, UdiConstants.AD_ROLE_ID)).getName(); - -%> - -<%@page import="org.posterita.Constants"%> -<%@page import="java.util.Properties"%> -<%@page import="org.posterita.core.TmkJSPEnv"%> -<%@page import="org.compiere.util.Env"%> -<%@page import="org.posterita.lib.UdiConstants"%> -<%@page import="org.compiere.model.MPriceList"%> -<%@page import="org.compiere.model.MOrg"%> -<%@page import="org.compiere.model.MRole"%> -<%@page import="org.posterita.businesslogic.ShoppingcartManager"%> -<%@page import="org.posterita.util.HtmlOrderPrintFormatter"%> -<%@page import="org.compiere.model.MOrder"%> -<%@page import="org.posterita.businesslogic.POSManager"%> -<%@page import="org.posterita.businesslogic.POSTerminalManager"%> -<%@page import="org.compiere.model.MPayment"%> -<%@page import="java.math.BigDecimal"%> -<%@page import="org.compiere.model.I_M_PriceList"%> -<%@page import="org.posterita.order.UDIOrderTypes"%> -<%@page import="org.posterita.TangoColors"%> - - - - - <%=appName%> - - - - - - - - - - - - - - - - -<% -MOrder order = new MOrder(ctx, Integer.valueOf(orderId).intValue(), null); -String orderType = order.getOrderType(); -MPriceList priceList = MPriceList.get(ctx, order.getM_PriceList_ID(), null); -String priceListName = priceList.getName(); -%> - - - - - - - - - - - - - - - - - - - - -
        -
        - - -
        - <%= orderType %> -
        -
        -
        -
        - : - <%=orgName%> -
        -
        - : - <%=posName%> -
        -
        -
        -
        - : - -
        -
        - : - <%=roleName%> -
        -
        -
        -
        -
        -
        -
        -
        -
        - <% String currency = order.getC_Currency().getCurSymbol(); - - String paymentRule = order.getPaymentRule(); - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Cash)) - { - out.print("Amt Refunded: " + currency + order.getAmountRefunded()); - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_CreditCard)) - { - out.print("Card: " + currency + order.getGrandTotal()); - } - - if(paymentRule.equalsIgnoreCase(MOrder.PAYMENTRULE_Check)) - { - out.print("Cheque: " + currency + order.getGrandTotal()); - } - - if(paymentRule.equalsIgnoreCase(UdiConstants.PAYMENTRULE_MIXED)) - { - out.print("Total: " + currency + order.getGrandTotal()); - } - %> -
        -
        -
        -
        -
        -   - -
        -
        - <%=priceListName%> -
        -
        -
        -
        -
        -
        - <%= ShoppingcartManager.getShoppingCartFromOrder(ctx, Integer.valueOf(orderId).intValue(), null) %> -
        -
        -
        -
        -
        - <% - String args = "showFooter=true;lineLength=40;priceWithVat=true;showDiscount=false;showLogo=false;showBarcode=false;"; - - HtmlOrderPrintFormatter formatter = new HtmlOrderPrintFormatter(args); - String data = formatter.format(ctx, Integer.valueOf(orderId).intValue(), null); - out.print("
        ");
        -				out.print(data);
        -				out.print("
        "); - %> -
        -
        -
        - -
        -
        -
        - <%String newOrderAction = "/CreatePOSOrderScreen.do?orderType="+orderType; %> -
        NEW ORDER
        -
        -
        -
        - Ctrl+Space New Order | Ctrl-M Menu
        -
        - <%@ include file="/jsp/include/printOrderApplet2.jsp" %> - - - diff --git a/posterita/posterita/web/jsp/pos/viewVendorDetails.jsp b/posterita/posterita/web/jsp/pos/viewVendorDetails.jsp deleted file mode 100644 index a6643142e3..0000000000 --- a/posterita/posterita/web/jsp/pos/viewVendorDetails.jsp +++ /dev/null @@ -1,106 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Martine ---%> - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> -<%@ page import="org.posterita.core.MenuItem" %> - - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos"%> - - -<%@ include file="/jsp/include/posHeader.jsp" %> - - - - - - - - - - - - -
        -
        - - - - - - -
        -
        -
        -
        - - - - - - - - - - - - - - - - - - - -
        -
        -
        -
        - - - - - - - - - - - - - - - - -
         
        -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/viewWebstorePayment.jsp b/posterita/posterita/web/jsp/pos/viewWebstorePayment.jsp deleted file mode 100644 index f42137c1cb..0000000000 --- a/posterita/posterita/web/jsp/pos/viewWebstorePayment.jsp +++ /dev/null @@ -1,121 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.WebUserInfo" %> -<%@ page import="org.posterita.order.UDIOrderTypes" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="/WEB-INF/dcs.tld" prefix="dcs" %> - - - - - - - - - - - - - - - - - <%@ include file="/jsp/webstore/documentHeader.jsp" %> - - - - - - - - - - - -
        - <%@ include file="/jsp/include/errors.jsp" %> -
        - Doc Status: -
        - - - - - - - - - - - - <% - String styleClass = "lightColour"; - if ((count.intValue()%2) != 0) - styleClass = "darkColour"; - %> - - - - - - - - - - - - - - - - - - - - -
        DescriptionQtyUnit PriceTotal Price
        - - - - - - - -
        -   - - -
        -
        - - - - <%@ include file="/jsp/include/tshirtFooter.jsp" %> diff --git a/posterita/posterita/web/jsp/pos/viewattributevalues.jsp b/posterita/posterita/web/jsp/pos/viewattributevalues.jsp deleted file mode 100644 index dd7013b2a7..0000000000 --- a/posterita/posterita/web/jsp/pos/viewattributevalues.jsp +++ /dev/null @@ -1,87 +0,0 @@ - -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/pos.tld" prefix="pos" %> - - - - - - -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - -
        - - - - <%=element.getName()%> - - - -
        -
        -
        -
        - - - - <% - String style = "label"; - if((count.intValue() % 2) == 0) - style = "contentname"; - %> - - - - - - - -
        - - - - <% - String editLink = "EditPOSAttributeValueAction.do?action=initEditAttributeValue"; - editLink += "&attributeValueId=" + element.getKey() + "&name=" + element.getName()+ "&attributeId="; - %> - -
        -
        - -
        -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/webDocumentHeader.jsp b/posterita/posterita/web/jsp/pos/webDocumentHeader.jsp deleted file mode 100644 index e2009fa2d3..0000000000 --- a/posterita/posterita/web/jsp/pos/webDocumentHeader.jsp +++ /dev/null @@ -1,81 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - - - - - - - - - - - -
        - - - - - -
        - - - -
        - -
        - -
        - -
        -
        - - - - - -
        - - - - <% String partnerId = partner.get_ID() + ""; %> - - - - - "> - - - - -
        - -
        - -
        - - -
        - -
        - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/wstoreeditattribute.jsp b/posterita/posterita/web/jsp/pos/wstoreeditattribute.jsp deleted file mode 100644 index f99418802d..0000000000 --- a/posterita/posterita/web/jsp/pos/wstoreeditattribute.jsp +++ /dev/null @@ -1,72 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley G Ramdass ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - -Edit Attributes -<%@ include file="/jsp/include/posHeader.jsp" %> - - - - - - - - - - -
        - <%@ include file="/jsp/include/errors.jsp" %> -
        - - - - - - - - - - - - - - -
        Old Attribute Value: -
        New Attribute Value: -
        - Save -
        -
        -
        - -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/pos/wstoreviewattributevalues.jsp b/posterita/posterita/web/jsp/pos/wstoreviewattributevalues.jsp deleted file mode 100644 index 2da0c656d5..0000000000 --- a/posterita/posterita/web/jsp/pos/wstoreviewattributevalues.jsp +++ /dev/null @@ -1,81 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Ashley G Ramdass ---%> - - - - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.*" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - -View Attributes -<%@ include file="/jsp/include/posHeader.jsp" %> -<%@ include file="/jsp/include/errors.jsp" %> - - - - - -
        - - - - <%=element.getName()%> - - - -
        -
        -
        -
        - - - - <% - String style = "label"; - if((count.intValue() % 2) == 0) - style = "contentname"; - %> - - - - - - -
        - - - - <% - String editLink = "EditPOSAttributeValueAction.do?action=initEditAttributeValue"; - editLink += "&attributeValueId=" + element.getKey() + "&name=" + element.getName()+ "&attributeId="; - %> - Edit -
        -
        -
        -<%@ include file="/jsp/include/posFooter.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/product/viewProductInfo.jsp b/posterita/posterita/web/jsp/product/viewProductInfo.jsp deleted file mode 100644 index c8f41d94a3..0000000000 --- a/posterita/posterita/web/jsp/product/viewProductInfo.jsp +++ /dev/null @@ -1,18 +0,0 @@ -<%@ page language="java"%> -<%@ page import="java.util.Properties" %> -<%@ page import="org.posterita.core.TmkJSPEnv" %> -<%@ page import="org.posterita.core.ImageServer" %> -<%@ page import="org.posterita.businesslogic.ProductManager" %> -<% - Properties ctx = TmkJSPEnv.getCtx(request); - - Integer product_id = new Integer(request.getParameter("productId")); - String size = request.getParameter("size"); - - int attachment_id = ProductManager.getAttachment(ctx,product_id.intValue(), null).get_ID(); - - boolean sent = ImageServer.sendImage(ctx,attachment_id,size,response); - - if(!sent) - ImageServer.sendDefaultImage(response); -%> diff --git a/posterita/posterita/web/jsp/user/createUser.jsp b/posterita/posterita/web/jsp/user/createUser.jsp deleted file mode 100644 index 27cad9e918..0000000000 --- a/posterita/posterita/web/jsp/user/createUser.jsp +++ /dev/null @@ -1,173 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - - - - - - - - - - - - - - - - - - - - -
        - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> -
        - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        Role - - - -
        -
        - -
        - -
        - -
        - -
        - -
        - - - -
        - -
        - -
        - - - -
        - - - -
        - - - - - -
        - -
        -
        - - - -<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/user/editUser.jsp b/posterita/posterita/web/jsp/user/editUser.jsp deleted file mode 100644 index eea667066f..0000000000 --- a/posterita/posterita/web/jsp/user/editUser.jsp +++ /dev/null @@ -1,174 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.posterita.beans.UDIBean" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> - - - - - - - Edit User - - - - - - - - - - - - - -
        - <%@ include file="/jsp/include/tabTop.jsp" %>Edit User<%@ include file="/jsp/include/tabBottom.jsp" %> -
        - <%@ include file="/jsp/include/errors.jsp" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        Role - - - -
        - -
        - -
        - -
        - -
        - -
        - - -
        - - -
        - -
        - -
        - - - -
        - - - -
        - - - - - -
        - -
        -
        - - - -<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/user/listUsers.jsp b/posterita/posterita/web/jsp/user/listUsers.jsp deleted file mode 100644 index 5f5c0f8ea0..0000000000 --- a/posterita/posterita/web/jsp/user/listUsers.jsp +++ /dev/null @@ -1,103 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - - - - - - - - - - - -
        - <%@ include file="/jsp/include/tabTop.jsp" %>All Users<%@ include file="/jsp/include/tabBottom.jsp" %> -
        - - - - - - - - - - - - - <% - String styleClass = "label"; - - if ((count.intValue()%2) != 0) - styleClass = "contentname"; - %> - - - - - - - - - - - - - -
        Add Record
        UsernameRoleIs Sale RepresentativeIs Active 
        - - - - - - - - - ">Edit -   - ">View -   - - ">Deactivate - - - ">Activate - -
        -
        - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> - - \ No newline at end of file diff --git a/posterita/posterita/web/jsp/user/registerUser.jsp b/posterita/posterita/web/jsp/user/registerUser.jsp deleted file mode 100644 index 4f9f6ac748..0000000000 --- a/posterita/posterita/web/jsp/user/registerUser.jsp +++ /dev/null @@ -1,153 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS and Adempiere Plugin - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Servansingh ---%> - - -<%String path = request.getContextPath(); -String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> - -<%@ page import="org.posterita.Constants" %> - -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - POSterita:. User Registration - - - - - - - -
        - - - - - - - -
        - -
        -
        - User Registration Form -
        - - - - - - - - - -
        - - - <%@ include file="/jsp/include/errors.jsp" %> - -
        -
        - -
        -
        - User Details - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        First Name
        Last Name
        Address
        City
        Country - - - -
        Company
        Industry
        Email
        Remarks
        - - - - - - - -
        -
        -
        -
        - - - - - diff --git a/posterita/posterita/web/jsp/user/userCreated.jsp b/posterita/posterita/web/jsp/user/userCreated.jsp deleted file mode 100644 index 221fb4c608..0000000000 --- a/posterita/posterita/web/jsp/user/userCreated.jsp +++ /dev/null @@ -1,143 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/posterita.tld" prefix="posterita"%> - - - - - - - - - - - - - - - -
        - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - Yes - - - No - -
        - - Yes - - - No - -
        -
        - -<%@ include file="/jsp/include/footerTableBottom.jsp" %> \ No newline at end of file diff --git a/posterita/posterita/web/jsp/user/viewUser.jsp b/posterita/posterita/web/jsp/user/viewUser.jsp deleted file mode 100644 index 19e1025218..0000000000 --- a/posterita/posterita/web/jsp/user/viewUser.jsp +++ /dev/null @@ -1,153 +0,0 @@ -<%-- - * Product: Posterita Web-Based POS (an Adempiere Plugin) - * Copyright (C) 2007 Posterita Ltd - * This file is part of POSterita - * - * POSterita is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * @author Vishee ---%> - -<%@ page import="org.posterita.Constants" %> -<%@ page import="org.posterita.user.*" %> -<%@ page import="org.compiere.model.MOrg" %> - -<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> -<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> -<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> -<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> - - - - - - - - - - - - - - -
        - <%@ include file="/jsp/include/tabTop.jsp" %><%@ include file="/jsp/include/tabBottom.jsp" %> -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - -
        - - - - Yes - - - No - -
        - - - - Yes - - - No - -
        -
        - - - <%@ include file="/jsp/include/footerTableBottom.jsp" %> - - \ No newline at end of file diff --git a/posterita/properties.xml b/posterita/properties.xml deleted file mode 100644 index be1e2401c9..0000000000 --- a/posterita/properties.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - This project file sets all properties needed during build and - installation. This file is imported in all other build.xml - files. This file provides a central place for managing - properties. - - - - - - - - - - diff --git a/serverApps/src/main/servlet/org/compiere/www/DisplayTable.java b/serverApps/src/main/servlet/org/compiere/www/DisplayTable.java deleted file mode 100644 index 06488026f8..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/DisplayTable.java +++ /dev/null @@ -1,35 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; -public class DisplayTable -{ - public DisplayTable (String tableName, String columnName) - { - } - public String[] getQueryLabels() - { - return null; - } - public String[] getQueryFields() - { - return null; - } - public String[] getResultLabels() - { - return null; - } -} \ No newline at end of file diff --git a/serverApps/src/main/servlet/org/compiere/www/Test.java b/serverApps/src/main/servlet/org/compiere/www/Test.java deleted file mode 100644 index f070cd8780..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/Test.java +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebUtil; -public class Test extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -8474219907861637179L; - - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("Test.init"); - } - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebDoc doc = WebDoc.create ("Get Request Test"); - WebUtil.createResponse(request, response, this, null, doc, true); - } - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebDoc doc = WebDoc.create ("Post Request Test"); - WebUtil.createResponse(request, response, this, null, doc, true); - } -} \ No newline at end of file diff --git a/serverApps/src/main/servlet/org/compiere/www/Test2.java b/serverApps/src/main/servlet/org/compiere/www/Test2.java deleted file mode 100644 index 53b6bdf690..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/Test2.java +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebUtil; - -public class Test2 extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -6839830507472511719L; - - public void init(ServletConfig config) throws ServletException - { - super.init(config); - WebEnv.initWeb(config); - } - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - RequestDispatcher dispatcher = request.getRequestDispatcher("/Test"); - dispatcher.forward(request, response); - } - public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - WebDoc doc = WebDoc.create ("Get Request Test2"); - // - WebUtil.createResponse(request, response, this, null, doc, true); - } - -} diff --git a/serverApps/src/main/servlet/org/compiere/www/WAccount.java b/serverApps/src/main/servlet/org/compiere/www/WAccount.java deleted file mode 100644 index efcb9d5344..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WAccount.java +++ /dev/null @@ -1,141 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.ecs.AlignType; -import org.apache.ecs.xhtml.body; -import org.apache.ecs.xhtml.button; -import org.apache.ecs.xhtml.p; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.th; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.GridField; -import org.compiere.model.Lookup; -import org.compiere.util.CLogger; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Msg; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - -public class WAccount extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 7932467581955114222L; - - private static final String FIELD_NAME = "FieldName"; - private static final String FIELD_VALUE = "FieldValue"; - private static final String P_Command = "PCommand"; - private static final String P_FORM_NAME = "PForm"; - - public void init(ServletConfig config) throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WAccount.init"); - } - private static CLogger log = CLogger.getCLogger(WAccount.class); - public void doGet (HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.config( "WAccount.doGet"); - WebSessionCtx wsc = WebSessionCtx.get(request); - WWindowStatus ws = WWindowStatus.get(request); - if (wsc == null || ws == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - String columnName = WebUtil.getParameter (request, "ColumnName"); - GridField mField = ws.curTab.getField(columnName); - log.config(" ColumnName=" + columnName + ", MField=" + mField.toString()); - if (mField == null || columnName == null || columnName.equals("")) - { - WebUtil.createTimeoutPage(request, response, this, - Msg.getMsg(wsc.ctx, "ParameterMissing")); - return; - } - String target = "opener.document.WForm." + columnName; - - WebDoc doc = WebDoc.create (mField.getHeader()); - body body = doc.getBody(); - body.setOnBlur("self.focus();"); - body.addElement(fillTable(ws, mField, target)); - - button reset = new button(); - reset.addElement("Reset"); - reset.setOnClick(target + "D.value='';" + target + "F.value='';window.close();"); - button cancel = new button(); - cancel.addElement("Cancel"); - cancel.setOnClick("window.close();"); - body.addElement(new p(AlignType.RIGHT) - .addElement(reset) - .addElement(" ") - .addElement(cancel)); - WebUtil.createResponse (request, response, this, null, doc, true); - } - public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - log.config( "WAccount.doPost"); - doGet(request, response); - } - private table fillTable (WWindowStatus ws, GridField mField, String target) - { - table table = new table("1"); - tr line = new tr(); - line.addElement(new th(" ")).addElement(new th(Msg.translate(ws.ctx, "Name"))); - table.addElement(line); - - Lookup lookup = mField.getLookup(); - lookup.fillComboBox(mField.isMandatory(false), true, true, true); - int size = lookup.getSize(); - for (int i = 0; i < size; i++) - { - Object lValue = lookup.getElementAt(i); - if (!(lValue != null && lValue instanceof KeyNamePair)) - continue; - KeyNamePair np = (KeyNamePair)lValue; - button button = new button(); - button.addElement(">"); - StringBuffer script = new StringBuffer(target); - script.append("D.value='").append(np.getKey()).append("';") - .append(target).append("F.value='").append(np.getName()).append("';window.close();"); - button.setOnClick(script.toString()); - line = new tr(); - line.addElement(new td(button)); - String name = np.getName(); - if (name == null || name.length() == 0) - name = " "; - line.addElement(new td(name)); - table.addElement(line); - } - lookup.fillComboBox(true); - return table; - } -} \ No newline at end of file diff --git a/serverApps/src/main/servlet/org/compiere/www/WAttachment.java b/serverApps/src/main/servlet/org/compiere/www/WAttachment.java deleted file mode 100644 index 551bba48dd..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WAttachment.java +++ /dev/null @@ -1,353 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; -import java.util.Properties; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.ecs.AlignType; -import org.apache.ecs.xhtml.a; -import org.apache.ecs.xhtml.br; -import org.apache.ecs.xhtml.form; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.label; -import org.apache.ecs.xhtml.p; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.textarea; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.MAttachment; -import org.compiere.model.MAttachmentEntry; -import org.compiere.util.CLogger; -import org.compiere.util.FileUpload; -import org.compiere.util.Msg; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebUtil; - - -/** - * HTML UI Attachment - * - * @author Jorg Janke - * @version $Id: WAttachment.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WAttachment extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -5720154824503276682L; - - /** Logger */ - private static CLogger log = CLogger.getCLogger(WAttachment.class); - - /** - * Initialize global variables - */ - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WAttachment.init"); - } // init - - public static final String P_Attachment_ID = "AD_Attachment_ID"; - public static final String P_ATTACHMENT_INDEX = "AttachmentIndex"; - public static final String P_TEXTMSG = "TextMsg"; - - private String m_error; - - /** - * Process the HTTP Get request. - * Initial display and streaming - * @param request request - * @param response response - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.info("From " + request.getRemoteHost() + " - " + request.getRemoteAddr()); - HttpSession session = request.getSession(false); - WWindowStatus ws = WWindowStatus.get(request); - WebDoc doc = null; - if (session == null || ws == null) - { - doc = WebDoc.createPopup ("No Context"); - //Modified by Rob Klein 4/29/07 - doc.addPopupClose(ws.ctx); - } - else - { - m_error = null; - int AD_Attachment_ID = WebUtil.getParameterAsInt(request, P_Attachment_ID); - if (AD_Attachment_ID != 0) - { - int attachmentIndex = WebUtil.getParameterAsInt(request, P_ATTACHMENT_INDEX); - if (attachmentIndex != 0) - { - m_error = streamAttachment (AD_Attachment_ID, attachmentIndex, response, ws); - if (m_error == null) - return; - } - } - - MAttachment attachment = null; - if (AD_Attachment_ID != 0) - attachment = new MAttachment(ws.ctx, ws.curTab.getAD_AttachmentID(), null); - else - attachment = new MAttachment (ws.ctx, ws.curTab.getAD_Table_ID(), ws.curTab.getRecord_ID(), null); - - doc = createPage (ws.ctx, attachment, m_error); - } - // - WebUtil.createResponse(request, response, this, null, doc, false); - } // doGet - - - /** - * Process the HTTP Post request. - * Update Attachment - * @param request request - * @parem response response - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.info("From " + request.getRemoteHost() + " - " + request.getRemoteAddr()); - HttpSession sess = request.getSession(false); - WWindowStatus ws = WWindowStatus.get(request); - // - WebDoc doc = null; - if (ws == null) - doc = WebDoc.create ("Help - No Context"); - else - { - MAttachment attachment = processPost (request, response, ws); - doc = createPage (ws.ctx, attachment, m_error); - } - // - WebUtil.createResponse(request, response, this, null, doc, false); - } // doPost - - /** - * Create Attachment Page - * @param ctx context - * @param AD_Attachment_ID id for existing attachment - * @param AD_Table_ID table for new attachment - * @param Record_ID record for new attachment - * @param m_error optional m_error message - * @return WebDoc - */ - private WebDoc createPage (Properties ctx, MAttachment attachment, String error) - { - WebDoc doc = WebDoc.createPopup (Msg.translate(ctx, "AD_Attachment_ID")); - table table = doc.getTable(); - // - if (error != null) - { - table.addElement(new tr() - .addElement(new td ("popupHeader", AlignType.RIGHT, AlignType.TOP, false, null)) - .addElement(new td ("popupHeader", AlignType.LEFT, AlignType.TOP, false, - new p(error, AlignType.LEFT).setClass("Cerror")))); // window.css - } - - // - tr tr = new tr(); - td left = new td("popupCenter", AlignType.LEFT, AlignType.TOP, false, - new label("TextMsg", "T", Msg.translate(ctx, "TextMsg"))); - // - td right = new td("popupCenter", AlignType.LEFT, AlignType.TOP, false); - - // Text Message Update - form textMsg = new form("WAttachment"); - textMsg.addElement(new input (input.TYPE_HIDDEN, P_Attachment_ID, attachment.getAD_Attachment_ID())); - textMsg.addElement(new input (input.TYPE_HIDDEN, "AD_Table_ID", attachment.getAD_Table_ID())); - textMsg.addElement(new input (input.TYPE_HIDDEN, "Record_ID", attachment.getRecord_ID())); - textarea msg = new textarea(P_TEXTMSG, 5, 40); - msg.addElement(attachment.getTextMsg()); - textMsg.addElement(msg); - textMsg.addElement(new br()); - - //textMsg.addElement(new input (input.TYPE_SUBMIT, "submit", "Submit")); - //Submit Button - //String textbtn = "Submit"; - //String text = null; - //if (ctx != null) - //text = Msg.getMsg (ctx, "Submit"); - //input submitbtn = new input(input.TYPE_SUBMIT, textbtn, " "+text); - //submitbtn.setID(text); - //submitbtn.setClass("submitbtn"); - //textMsg.addElement(submitbtn); - right.addElement(textMsg); - - - // Existing Links - p p = new p(); - MAttachmentEntry[] entries = attachment.getEntries(); - for (int i = 0; i < entries.length; i++) - { - MAttachmentEntry entry = entries[i]; - if (i > 0) - p.addElement(" - "); - String url = "WAttachment?" + P_Attachment_ID + "=" + attachment.getAD_Attachment_ID() - + "&" + P_ATTACHMENT_INDEX + "=" + entry.getIndex(); - p.addElement(new a(url, null, a.TARGET_BLANK, entry.getName())); - } - right.addElement(p); - - // Upload - form upload = FileUpload.createForm("WAttachment"); - upload.addElement(new input (input.TYPE_HIDDEN, P_Attachment_ID, attachment.getAD_Attachment_ID())); - upload.addElement(new input (input.TYPE_HIDDEN, "AD_Table_ID", attachment.getAD_Table_ID())); - upload.addElement(new input (input.TYPE_HIDDEN, "Record_ID", attachment.getRecord_ID())); - right.addElement(upload); - // - tr.addElement(left); - tr.addElement(right); - table.addElement(tr); - - // Footer - //Modified by Rob Klein 4/29/07 - doc.addPopupClose(ctx); - // - // System.out.println(doc); - return doc; - } // createPage - - /** - * Stream Attachment Entry - * @param AD_Attachment_ID attachment - * @param attachmentIndex index - * @param response response - * @param ws status - * @return m_error message - */ - private String streamAttachment (int AD_Attachment_ID, int attachmentIndex, - HttpServletResponse response, WWindowStatus ws) - { - log.info("AD_Attachment_ID=" + AD_Attachment_ID - + ", AttachmentIndex=" + attachmentIndex); - - MAttachment attachment = new MAttachment(ws.ctx, AD_Attachment_ID, null); - if (attachment.get_ID() == 0) - { - log.fine("No Attachment AD_Attachment_ID=" + AD_Attachment_ID); - return "Attachment not found"; - } - - // Make sure it's the right attachment - if (ws.curTab.getAD_AttachmentID() != AD_Attachment_ID) - { - log.warning ("Tab AD_Attachment_ID=" - + ws.curTab.getAD_AttachmentID() + " <> " + AD_Attachment_ID); - return "Your Attachment not found"; - } - // Stream it - return WebUtil.streamAttachment (response, attachment, attachmentIndex); - } // streamAttachment - - /** - * Process Post. - * Update / Create Attachment - * Upload Attachment Entry - * @param request request - * @param response response - * @return m_error message - */ - private MAttachment processPost (HttpServletRequest request, - HttpServletResponse response, WWindowStatus ws) - { - int AD_Attachment_ID = 0; - int AD_Table_ID = 0; - int Record_ID = 0; - String textMsg = null; - FileUpload upload = null; - - // URL Encrypted - if (request.getContentType().equals(form.ENC_DEFAULT)) - { - AD_Attachment_ID = WebUtil.getParameterAsInt(request, P_Attachment_ID); - AD_Table_ID = WebUtil.getParameterAsInt(request, "AD_Table_ID"); - Record_ID = WebUtil.getParameterAsInt(request, "Record_ID"); - textMsg = WebUtil.getParameter (request, P_TEXTMSG); - } - else - { - upload = new FileUpload(request); - m_error = upload.getError(); - if (m_error != null) - { - log.warning("pocessPost - " + m_error); - return null; - } - AD_Attachment_ID = upload.getParameterAsInt(P_Attachment_ID); - AD_Table_ID = upload.getParameterAsInt("AD_Table_ID"); - Record_ID = upload.getParameterAsInt("Record_ID"); - } - // WebEnv.dump(request); - log.info("processPost - AD_Attachment_ID=" + AD_Attachment_ID - + ", AD_Table_ID=" + AD_Table_ID + ", Record_ID=" + Record_ID - + " - Upload=" + upload); - - // Check if you own the attachment - if (ws.curTab.getAD_AttachmentID() != AD_Attachment_ID) { - m_error = "Your Attachment not found"; - return null; - } - // Check if we can save - if (AD_Attachment_ID != 0 && Record_ID == 0) { - m_error = "Need to save record first"; - return null; - } - - MAttachment attachment = null; - if (AD_Attachment_ID == 0) - attachment = new MAttachment (ws.ctx, AD_Table_ID, Record_ID, null); - else - attachment = new MAttachment (ws.ctx, AD_Attachment_ID, null); - - // Update Attachment Text - if (textMsg != null) - attachment.setTextMsg(textMsg); - - // Create Attachment - if (upload != null) - attachment.addEntry(upload.getFileName(), upload.getData()); - - // Save and update - if (attachment.save()) - ws.curTab.loadAttachments(); // update Tab - else { - m_error = "Attachment not saved"; - return null; - } - - return attachment; - - } // processPost - - -} // WAttachment diff --git a/serverApps/src/main/servlet/org/compiere/www/WChat.java b/serverApps/src/main/servlet/org/compiere/www/WChat.java deleted file mode 100644 index 6ea80f9d60..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WChat.java +++ /dev/null @@ -1,292 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.ecs.AlignType; -import org.apache.ecs.Element; -import org.apache.ecs.xhtml.form; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.textarea; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.GridField; -import org.compiere.model.MChat; -import org.compiere.model.MChatEntry; -import org.compiere.util.CLogger; -import org.compiere.util.Msg; -import org.compiere.util.Util; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - - -/** - * Web (window) Chat - * - * @author Jorg Janke - * @version $Id: WChat.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WChat extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 6826855534161342772L; - - /** Logger */ - protected CLogger log = CLogger.getCLogger(getClass()); - private MChat m_chat; - private boolean m_readOnly; - private boolean m_hasDependents; - private boolean m_hasCallout; - private int m_displayLength; - private String m_columnName; - - /** - * Initialize global variables - */ - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WChat.init"); - } // init - - /** - * Process the HTTP Get request - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.fine("doGet"); - WebSessionCtx wsc = WebSessionCtx.get(request); - WWindowStatus ws = WWindowStatus.get(request); - // - WebDoc doc = null; - if (ws == null) - { - doc = WebDoc.createPopup("No Context"); - doc.addPopupClose(wsc.ctx); - } - else - { - doc = CreateChatPage (ws, wsc, doc, 0 ); - } - // - WebUtil.createResponse(request, response, this, null, doc, false); - } // doGet - - - /** - * Process the HTTP Post request - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebDoc doc = null; - - WebSessionCtx wsc = WebSessionCtx.get(request); - WWindowStatus ws = WWindowStatus.get(request); - - String data = WebUtil.getParameter(request, "chatinput"); - int CM_ChatID = WebUtil.getParameterAsInt(request, "CM_ChatID"); - int AD_Table_ID = WebUtil.getParameterAsInt(request, "AD_Table_ID"); - int record_ID = WebUtil.getParameterAsInt(request, "record_ID"); - String description = WebUtil.getParameter(request, "description"); - - if (data != null && data.length() > 0) - { - if (CM_ChatID == 0){ - m_chat = new MChat (wsc.ctx, AD_Table_ID, record_ID, description, null); - m_chat.save(); - } - MChatEntry entry = new MChatEntry(m_chat, data); - entry.save(); - - } // data to be saved - - doc = CreateChatPage (ws, wsc, doc, m_chat.getCM_Chat_ID()); - WebUtil.createResponse(request, response, this, null, doc, false); - } // doPost - /** - * Create Text Field - * @param data initial value - * @param rows no of rows - * @return td - */ - private td getTextField (String data, int rows) - { - textarea text = new textarea (m_columnName, rows, m_displayLength) - .addElement(Util.maskHTML(data)); - text.setID(m_columnName + "F"); - text.setName(m_columnName); - text.setDisabled(m_readOnly); - // - if (m_hasDependents || m_hasCallout) - text.setOnChange("startUpdate(this);"); - - return createTD(text); - } - - /** - * Create Left Top aligned TD - * @param element element - * @return td table data - */ - private td createTD (Element element) - { - td td = new td() - .addElement(element) - .setAlign(AlignType.LEFT) - .setVAlign(AlignType.TOP); - td.setColSpan(3); - return td; - } // createTD - - /** - * Create Left Top aligned TD - * @param element element - * @return td table data - */ - private WebDoc CreateChatPage (WWindowStatus ws, WebSessionCtx wsc, WebDoc doc, int CM_Chat_ID) - - { - doc = WebDoc.createPopup ("Chat "); - - td center = doc.addWindowCenter(false); - int record_ID = ws.curTab.getRecord_ID(); - log.info("Record_ID=" + record_ID); - if (record_ID == -1) // No Key - { - log.info("Record does not exist"); - return doc; - } - // Find display - String infoName = null; - String infoDisplay = null; - for (int i = 0; i < ws.curTab.getFieldCount(); i++) - { - GridField field = ws.curTab.getField(i); - if (field.isKey()) - infoName = field.getHeader(); - if ((field.getColumnName().equals("Name") || field.getColumnName().equals("DocumentNo") ) - && field.getValue() != null) - infoDisplay = field.getValue().toString(); - if (infoName != null && infoDisplay != null) - break; - } - String description = infoName + ": " + infoDisplay; - // - - - if (ws.curTab.getCM_ChatID() > 0) - m_chat = new MChat (wsc.ctx, ws.curTab.getCM_ChatID(), null); - else if (CM_Chat_ID > 0) - m_chat = new MChat (wsc.ctx, CM_Chat_ID, null); - else - m_chat = new MChat (wsc.ctx, ws.curTab.getAD_Table_ID(), record_ID, description, null); - - String text = m_chat.getHistory(MChat.CONFIDENTIALTYPE_Internal).toString(); - - - form myForm = new form ("WChat") - .setName("chat"); - myForm.setOnSubmit("this.Submit.disabled=true;return true;"); - if (CM_Chat_ID==0) - myForm.addElement(new input(input.TYPE_HIDDEN, "CM_ChatID", ws.curTab.getCM_ChatID())); - else - myForm.addElement(new input(input.TYPE_HIDDEN, "CM_ChatID", CM_Chat_ID)); - myForm.addElement(new input(input.TYPE_HIDDEN, "AD_Table_ID", ws.curTab.getAD_Table_ID())); - myForm.addElement(new input(input.TYPE_HIDDEN, "record_ID", record_ID)); - myForm.addElement(new input(input.TYPE_HIDDEN, "description", description)); - - table myTable = new table("0", "0", "5", "100%", null); - myTable.setID("WChatParameter"); - m_displayLength = 80; - - //history field - myTable.addElement(new tr() - .addElement( new td("History"))); - m_readOnly = true; - table HistoryTable = new table("1", "0", "5", "100%", null); - HistoryTable.addElement(new tr() - .addElement( new td(text) - .setRowSpan(10) - .setAlign(AlignType.LEFT) - .setVAlign(AlignType.TOP) - .setColSpan(4))); - myTable.addElement(HistoryTable); - - //input field - myTable.addElement(new tr() - .addElement( new td("Input"))); - m_readOnly = false; - m_columnName = "chatinput"; - myTable.addElement(new tr() - .addElement(getTextField ("", 10))); - -// Reset - String textbtn = "Reset"; - if (wsc.ctx != null) - text = Msg.getMsg (wsc.ctx, "Reset"); - input restbtn = new input(input.TYPE_RESET, textbtn, " "+text); - restbtn.setID(text); - restbtn.setClass("resetbtn"); - - // Submit - textbtn = "Submit"; - if (wsc.ctx != null) - text = Msg.getMsg (wsc.ctx, "Submit"); - input submitbtn = new input(input.TYPE_SUBMIT, textbtn, " "+text); - submitbtn.setID(text); - submitbtn.setClass("submitbtn"); - - // Close - textbtn = "Close"; - if (wsc.ctx != null) - text = Msg.getMsg (wsc.ctx, "Close"); - input closebtn = new input(input.TYPE_SUBMIT, textbtn, " "+text); - closebtn.setID(text); - closebtn.setClass("closebtn"); - closebtn.setOnClick ("self.close();return false;"); - - - myTable.addElement(new tr() - .addElement(new td(null, AlignType.RIGHT, AlignType.MIDDLE, false, - restbtn)) - .addElement(new td(null, AlignType.CENTER, AlignType.MIDDLE, false, - submitbtn )) - .addElement(new td(null, AlignType.LEFT, AlignType.MIDDLE, false, - closebtn))); - myForm.addElement(myTable); - center.addElement(myForm); - - return doc; -} - -} // WReport diff --git a/serverApps/src/main/servlet/org/compiere/www/WError.java b/serverApps/src/main/servlet/org/compiere/www/WError.java deleted file mode 100644 index d08ae9a72e..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WError.java +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class WError extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 7940367932646085428L; - - static final private String CONTENT_TYPE = "text/html"; - static final private String DOC_TYPE = ""; - public void init(ServletConfig config) throws ServletException - { - super.init(config); - } - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - response.setContentType(CONTENT_TYPE); - PrintWriter out = response.getWriter(); - out.println(""); - out.println(DOC_TYPE); - out.println(""); - out.println("WError"); - out.println(""); - out.println("

        The servlet has received a GET. This is the reply.

        "); - out.println(""); - } - public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - response.setContentType(CONTENT_TYPE); - PrintWriter out = response.getWriter(); - out.println(""); - out.println(DOC_TYPE); - out.println(""); - out.println("WError"); - out.println(""); - out.println("

        The servlet has received a POST. This is the reply.

        "); - out.println(""); - } - public void destroy() - { - } -} \ No newline at end of file diff --git a/serverApps/src/main/servlet/org/compiere/www/WFieldUpdate.java b/serverApps/src/main/servlet/org/compiere/www/WFieldUpdate.java deleted file mode 100644 index 79bbac70f2..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WFieldUpdate.java +++ /dev/null @@ -1,414 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; -import java.util.Properties; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.ecs.xhtml.body; -import org.apache.ecs.xhtml.form; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.p; -import org.apache.ecs.xhtml.script; -import org.compiere.util.CLogger; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Login; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - -/** - * Dynamic Field Updates. - * - * - * @author Jorg Janke - * @version $Id: WFieldUpdate.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WFieldUpdate extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -1576213475379404148L; - - /** Static Logger */ - private static CLogger log = CLogger.getCLogger (WFieldUpdate.class); - - /** - * Initialize global variables - * @param config - * @throws ServletException - */ - public void init(ServletConfig config) throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WFieldUpdate.init"); - } // init - - /** - * Clean up resources - */ - public void destroy() - { - } // destroy - - private static final String FORM_NAME = "fieldUpdate"; - // - private static final String FIELD_FORM = "formName"; - private static final String FIELD_NAME = "fieldName"; - private static final String FIELD_VALUE = "fieldValue"; - private static final String LOCATION_VALUE = "location"; - - /** - * Process the HTTP Get request - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - doPost(request, response); - } // doPost - - - /** - * Process the HTTP Post request - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - // Get Session Info - WebSessionCtx wsc = WebSessionCtx.get(request); - WWindowStatus ws = WWindowStatus.get(request); - - if (wsc == null || ws == null) // ws can be null for Login - ; - - // Get Parameter - String formName = WebUtil.getParameter (request, FIELD_FORM); - String fieldName = WebUtil.getParameter (request, FIELD_NAME); - String fieldValue = WebUtil.getParameter (request, FIELD_VALUE); - String locationValue = WebUtil.getParameter (request, LOCATION_VALUE); - - log.info("doPost - Form=" + formName + " - Field=" + fieldName + " - Value=" + fieldValue+ " - Location=" + locationValue); - - // Document - WebDoc doc = createPage (wsc, ws, formName, fieldName, fieldValue, locationValue); - - // The Form - form fu = new form(request.getRequestURI()); - fu.setName(FORM_NAME); - fu.addElement(new input(input.TYPE_HIDDEN, FIELD_FORM, "y")); - fu.addElement(new input(input.TYPE_HIDDEN, FIELD_NAME, "y")); - fu.addElement(new input(input.TYPE_HIDDEN, FIELD_VALUE, "y")); - fu.addElement(new input(input.TYPE_HIDDEN, LOCATION_VALUE, locationValue)); - doc.getBody().addElement(fu); - - // log.trace(log.l1_User, "WFieldUpdate=" + doc.toString()); - - // Answer - WebUtil.createResponse (request, response, this, null, doc, false); - } // doPost - - /** - * Create Reply. - *

        - * Including special handling of login pages - * @param wsc web session context - * @param ws window status - * @param formName - * @param fieldName - * @param fieldValue - */ - private static WebDoc createPage (WebSessionCtx wsc, WWindowStatus ws, - String formName, String fieldName, String fieldValue, String locationValue) - { - WebDoc doc = WebDoc.create (true); // plain - body body = doc.getBody(); - log.info("Location-createpage: "+locationValue); - // Info - StringBuffer sb = new StringBuffer("FieldUpdate - ") - .append(FIELD_FORM).append("=").append(formName).append(", ") - .append(FIELD_NAME).append("=").append(fieldName).append(", ") - .append(FIELD_VALUE).append("=").append(fieldValue) - .append(LOCATION_VALUE).append("=").append(locationValue); - body.addElement(new p() - .addElement(sb.toString())); - - // Called manually - do nothing - if (formName == null || fieldName == null) - ; - // - else if (formName.equals("Login2") && fieldName.equals(WLogin.P_ROLE)) - reply_Login2_Role (body, wsc, formName, fieldValue, locationValue); - // - else if (formName.equals("Login2") && fieldName.equals(WLogin.P_CLIENT)) - reply_Login2_Client (body, wsc, formName, fieldValue, locationValue); - // - else if (formName.equals("Login2") && fieldName.equals(WLogin.P_ORG)) - reply_Login2_Org (body, wsc, ws, formName, fieldValue, locationValue); - // - return doc; - } // getReply - - /** - * Login 2nd page Response - Field Role. - *

        - * fill Client, Org, Warehouse - * @param body document body - * @param wsc web session context - * @param formName - * @param fieldValue - */ - private static void reply_Login2_Role (body body, WebSessionCtx wsc, - String formName, String fieldValue, String locationValue) - { - // Formname - String form = null; - log.info("Location-Role: "+locationValue); - - //if (locationValue!=null) - form = locationValue + WebEnv.TARGET_WINDOW + ".document.forms." + formName + "."; - //else - //form = "top." + WebEnv.TARGET_WINDOW + ".document.forms." + formName + "."; - //log.info("form_role->"+form); - - Login login = new Login(wsc.ctx); - // Get Data - KeyNamePair[] clients = login.getClients ( - new KeyNamePair(Integer.parseInt(fieldValue) , fieldValue)); - - // Set Client ---- - StringBuffer script = new StringBuffer (); - // var A=top.WWindow.document.formName.selectName.options; - script.append("var A=").append(form).append(WLogin.P_CLIENT).append(".options; "); - // A.length=0; // resets options - script.append("A.length=0; "); - // A[0]=new Option('text','value'); // add new oprtion - - for (int i = 0; i < clients.length; i++) - { - KeyNamePair p = clients[i]; - script.append("A[").append(i).append("]=new Option('"); - script.append(p.getName()); // text - script.append("','"); - script.append(p.getKey()); // value - script.append("'); "); - } - script.append("\n"); - - // Set Organization ---- - - if (clients.length > 0) - { - // var A=top.WWindow.document.formName.selectName.options; - script.append("var B=").append(form).append(WLogin.P_ORG).append(".options; "); - // A.length=0; // resets options - script.append("B.length=0; "); - // A[0]=new Option('text','value'); // add new oprtion - - KeyNamePair[] orgs = login.getOrgs (clients[0]); - for (int i = 0; i < orgs.length; i++) - { - KeyNamePair p = orgs[i]; - script.append("B[").append(i).append("]=new Option('"); - script.append(p.getName()); // text - script.append("','"); - script.append(p.getKey()); // value - script.append("'); "); - } - script.append("\n"); - - // Set Warehouse ---- - - if (orgs.length > 0) - { - // var A=top.WWindow.document.formName.selectName.options; - script.append("var C=").append(form).append(WLogin.P_WAREHOUSE).append(".options; "); - // A.length=0; // resets options - script.append("C.length=0; "); - // A[0]=new Option('text','value'); // add new oprtion - - KeyNamePair[] whs = login.getWarehouses (orgs[0]); - if (whs != null) - { - for (int i = 0; i < whs.length; i++) - { - KeyNamePair p = whs[i]; - script.append("C[").append(i).append("]=new Option('"); - script.append(p.getName()); // text - script.append("','"); - script.append(p.getKey()); // value - script.append("'); "); - } - } - } // we have a org - } // we have a client - - // add script - body.addElement(new p().addElement(WLogin.P_CLIENT + "=")); - body.addElement(new script(script.toString())); - // log.trace(log.l6_Database, "reply_Login2_Role - Script=" + script.toString()); - } // reply_Login2_Role - - /** - * Login 2nd page Response - Field Client. - *

        - * fill Org & Warehouse - - * @param body body - * @param wsc context - * @param formName form name - * @param fieldValue value - */ - private static void reply_Login2_Client (body body, WebSessionCtx wsc, - String formName, String fieldValue, String locationValue) - { - log.info("Location-Client: "+locationValue); - // Formname - String form = null; - //if (locationValue!=null) - form = locationValue + WebEnv.TARGET_WINDOW + ".document." + formName + "."; - //else - //form = "top." + WebEnv.TARGET_WINDOW + ".document." + formName + "."; - StringBuffer script = new StringBuffer (); - //log.info("form_client->"+form); - - // Set Organization ---- - - // var A=top.WWindow.document.formName.selectName.options; - script.append("var B=").append(form).append(WLogin.P_ORG).append(".options; "); - // A.length=0; // resets options - script.append("B.length=0; "); - // A[0]=new Option('text','value'); // add new oprtion - - KeyNamePair client = new KeyNamePair(Integer.parseInt(fieldValue), fieldValue); - Login login = new Login(wsc.ctx); - KeyNamePair[] orgs = login.getOrgs (client); - for (int i = 0; i < orgs.length; i++) - { - KeyNamePair p = orgs[i]; - script.append("B[").append(i).append("]=new Option('"); - script.append(p.getName()); // text - script.append("','"); - script.append(p.getKey()); // value - script.append("'); "); - } - script.append("\n"); - - // Set Warehouse ---- - - // var A=top.WWindow.document.formName.selectName.options; - script.append("var C=").append(form).append(WLogin.P_WAREHOUSE).append(".options; "); - // A.length=0; // resets options - script.append("C.length=0; "); - // A[0]=new Option('text','value'); // add new oprtion - - KeyNamePair[] whs = login.getWarehouses (orgs[0]); - if (whs != null) - { - for (int i = 0; i < whs.length; i++) - { - KeyNamePair p = whs[i]; - script.append("C[").append(i).append("]=new Option('"); - script.append(p.getName()); // text - script.append("','"); - script.append(p.getKey()); // value - script.append("'); "); - } - } - - // add script - body.addElement(new p().addElement(WLogin.P_WAREHOUSE + "=")); - body.addElement(new script(script.toString())); - // log.trace(log.l6_Database, "Login2-Client - Script=" + script.toString()); - } // reply_Login2_Client - - /** - * Login 2nd page Response - Field Org. - *

        - * fill Warehouse - * @param body document body - * @param wsc web session context - * @param formName - * @param fieldValue - */ - private static void reply_Login2_Org (body body, WebSessionCtx wsc, WWindowStatus ws, - String formName, String fieldValue, String locationValue) - { - // Formname - String form = null; - log.info("Location-Org: "+locationValue); - //if (locationValue!=null) - form = locationValue + WebEnv.TARGET_WINDOW + ".document." + formName + "."; - //else - //form = "top." + WebEnv.TARGET_WINDOW + ".document." + formName + "."; - - //log.info("form_org->"+form); - StringBuffer script = new StringBuffer (); - - // Set Warehouse ---- - - // var A=top.WWindow.document.formName.selectName.options; - script.append("var C=").append(form).append(WLogin.P_WAREHOUSE).append(".options; "); - // A.length=0; // resets options - script.append("C.length=0; "); - // A[0]=new Option('text','value'); // add new oprtion - - KeyNamePair org = new KeyNamePair(Integer.parseInt(fieldValue), fieldValue); - Login login = new Login(wsc.ctx); - String error = login.validateLogin(org); - if (error != null && error.length() > 0) - { - log.severe(error); //todo graceful dead - ws.mWindow = null; - wsc.ctx = new Properties(); - return; - } - KeyNamePair[] whs = login.getWarehouses (org); - if (whs != null) - { - for (int i = 0; i < whs.length; i++) - { - KeyNamePair p = whs[i]; - script.append("C[").append(i).append("]=new Option('"); - script.append(p.getName()); // text - script.append("','"); - script.append(p.getKey()); // value - script.append("'); "); - } - } - - // add script - body.addElement(new p().addElement(WLogin.P_WAREHOUSE + "=")); - body.addElement(new script(script.toString())); - // log.trace(log.l6_Database, "Login2-Org - Script=" + script.toString()); - } // reply_Login2_Org - -} // WFieldUpdate diff --git a/serverApps/src/main/servlet/org/compiere/www/WFilter.java b/serverApps/src/main/servlet/org/compiere/www/WFilter.java deleted file mode 100644 index 45c48c8a81..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WFilter.java +++ /dev/null @@ -1,240 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.*; -import java.util.*; -import java.util.logging.*; -import javax.servlet.*; -import javax.servlet.http.*; -import org.compiere.util.*; - -/** - * HTML UI Filter to do timing and list parameters - * @author Jorg Janke - * @version $Id: WFilter.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ - -public final class WFilter implements javax.servlet.Filter -{ - /** The filter configuration object we are associated with. - * If this value is null, this filter instance is not currently configured */ - private FilterConfig m_filterConfig = null; - - /** Timing indicator */ - private boolean m_timing = false; - /** Logging */ - private static CLogger log = null; - - /** - * Place this filter into service. - * - * @param filterConfig The filter configuration object - * @throws ServletException - */ - public void init (FilterConfig filterConfig) throws ServletException - { - m_filterConfig = filterConfig; - WebEnv.initWeb(filterConfig.getServletContext()); - if (log == null) - log = CLogger.getCLogger(WFilter.class); - - // List all Parameters - log.info(filterConfig.getFilterName()); - Enumeration en = filterConfig.getInitParameterNames(); - while (en.hasMoreElements()) - { - String name = en.nextElement().toString(); - String value = filterConfig.getInitParameter(name); - log.config(name + "=" + value); - if (name.equals("Timing") && value.equals("Y")) - m_timing = true; - } - } // init - - /** - * Take this filter out of service. - */ - public void destroy() - { - m_filterConfig = null; - } // destroy - - /** - * Time the processing that is performed by all subsequent filters in the - * current filter stack, including the ultimately invoked servlet. - * - * @param request The servlet request we are processing - * @param response response - * @param chain The filter chain we are processing - * - * @exception IOException if an input/output error occurs - * @exception ServletException if a servlet error occurs - */ - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) - throws IOException, ServletException - { - WebSessionCtx wctx = WebSessionCtx.get((HttpServletRequest)request); - /**if (wctx == null) { - if (m_filterConfig != null) { - String login_page = m_filterConfig.getInitParameter("LoginServlet"); - if (login_page != null && !"".equals(login_page)) { - m_filterConfig.getServletContext().getRequestDispatcher("/WLogin").forward(request, response); - return; - } - } - throw new ServletException("Unauthorized access, unable to forward to login page"); - } - - String sessionID = wctx.ctx.getProperty("#AD_Session_ID"); - if (sessionID == null) { - if (m_filterConfig != null) { - String login_page = m_filterConfig.getInitParameter("LoginServlet"); - if (login_page != null && !"".equals(login_page)) { - RequestDispatcher rd=request.getRequestDispatcher("/WLogin"); - rd.forward(request, response); - return; - } - } - throw new ServletException("Unauthorized access, unable to forward to login page"); - } **/ - - String sessionID = wctx.ctx.getProperty("#AD_Session_ID"); - - if (sessionID == null) { - //log.info("Still no session id"); - } - - // Get URI - String uri = ""; - if (request instanceof HttpServletRequest) - { - HttpServletRequest req = (HttpServletRequest)request; - uri = req.getRequestURI(); - } - - - boolean pass = true; - // Ignore static content - boolean check = true; - if (sessionID == null) - if(uri.endsWith("index.html") - || uri.endsWith("cmd.html") - || uri.endsWith("menu.html") - || uri.endsWith("menu.js") - || uri.endsWith("window.html") - || uri.endsWith("Logo.gif") - || uri.endsWith("standard.js") - || uri.endsWith("standard.css") - || uri.endsWith("calendar-blue.css") - || uri.endsWith("table.css") - || uri.endsWith("table.js") - || uri.endsWith("calendar.js") - //|| uri.endsWith("calendar-setup.js") - || uri.endsWith("calendar-en.js") - || uri.endsWith("window.css") - || uri.endsWith("window.js") - || uri.endsWith("WLogin")) - ; - else - pass = false; - else if (!uri.startsWith(WebEnv.DIR_BASE) // not requesting /adempiere/... - || uri.endsWith(".gif") || uri.endsWith(".jpg") || uri.endsWith(".png") - || uri.endsWith(".html") || uri.endsWith(".css") - || uri.endsWith(".js")) - check = false; - else - ; - - // We need to check - StringBuffer sb = new StringBuffer ("| Parameters"); - if (check) - { - try - { - String enc = request.getCharacterEncoding(); - if (enc == null) - request.setCharacterEncoding(WebEnv.ENCODING); - } - catch (Exception e) - { - log.log(Level.SEVERE, "Set CharacterEndocung=" + WebEnv.ENCODING, e); - } - // print parameter - Enumeration en = request.getParameterNames(); - while (en.hasMoreElements()) - { - String name = (String)en.nextElement(); - sb.append(" - ").append(name).append("=").append(request.getParameter(name)); - } - if (uri.endsWith("WWindowStatus")) - pass = false; - } - if (pass && check) - log.info("Start " + uri + sb.toString()); - - // Timing - long myTime = 0l; - if (pass && check && m_timing) - myTime = System.currentTimeMillis(); - - // ** Start ** - if (pass) - chain.doFilter(request, response); - else - { - //log.warning("Rejected " + uri); - //String msg = "Error: Access Rejected"; - //WebDoc doc = WebDoc.create (msg); - // Body - //body b = doc.getBody(); - //b.addElement(new p(uri, AlignType.CENTER)); - // fini - //response.setContentType("text/html"); - //PrintWriter out = new PrintWriter (response.getOutputStream()); - //doc.output(out); - //out.close(); - RequestDispatcher rd=request.getRequestDispatcher("/index.html"); - rd.forward(request, response); - } - - // Post - if (check && pass) - { - if (m_timing) - myTime = System.currentTimeMillis() - myTime; - log.info("End " + uri + "| " + (m_timing ? String.valueOf(myTime) : null)); - } - - } // doFilter - - - /** - * Return a String representation of this object. - * @return String info - */ - public String toString() - { - if (m_filterConfig == null) - return ("WFilter[]"); - StringBuffer sb = new StringBuffer("WFilter["); - sb.append(m_filterConfig); - sb.append("]"); - return (sb.toString()); - } // toString - -} // Filter diff --git a/serverApps/src/main/servlet/org/compiere/www/WFindAdv.java b/serverApps/src/main/servlet/org/compiere/www/WFindAdv.java deleted file mode 100644 index 608a4842ae..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WFindAdv.java +++ /dev/null @@ -1,361 +0,0 @@ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.ecs.AlignType; -import org.apache.ecs.xhtml.a; -import org.apache.ecs.xhtml.body; -import org.apache.ecs.xhtml.br; -import org.apache.ecs.xhtml.form; -import org.apache.ecs.xhtml.h2; -import org.apache.ecs.xhtml.head; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.label; -import org.apache.ecs.xhtml.link; -import org.apache.ecs.xhtml.option; -import org.apache.ecs.xhtml.script; -import org.apache.ecs.xhtml.select; -import org.apache.ecs.xhtml.span; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.textarea; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.GridField; -import org.compiere.util.Msg; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - -public class WFindAdv extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -763641668438890217L; - - public static final String EQUAL = "="; - public static final String NOT_EQUAL = "!="; - public static final String LIKE = "LIKE"; - public static final String NOT_LIKE = "NOT LIKE"; - public static final String GREATER = ">"; - public static final String GREATER_EQUAL = ">="; - public static final String LESS = "<"; - public static final String LESS_EQUAL = "<="; - public static final String BETWEEN = "BETWEEN"; - private static final String P_Tab = "PTab"; - -public void init(ServletConfig config) throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WFindAdv.init"); - } - -public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - HttpSession sess = request.getSession(false); - WWindowStatus ws = null; - WebSessionCtx wsc = WebSessionCtx.get(request); - - if (sess != null) - ws = WWindowStatus.get(request); - - - if (wsc == null ) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - WebDoc doc = preparePage(); - body body = doc.getBody(); - - String pTab = request.getParameter(P_Tab); - - if (pTab!=null && pTab.equals("FindAdv")) { - body.addElement(createPageFindAdv(request, response, ws)); - } else { - body.addElement(createPageFind(request, response, ws)); - } - - WebUtil.createResponse (request, response, this, null, doc, true); - } -public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - HttpSession sess = request.getSession(false); - WWindowStatus ws = null; - WebSessionCtx wsc = WebSessionCtx.get(request); - - if (sess != null) - ws = WWindowStatus.get(request); - if (wsc == null ) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - String pTab = request.getParameter(P_Tab); - WebDoc doc = preparePage(); - body body = doc.getBody(); - - if (pTab!=null && pTab.equals("FindAdv")) { - body.addElement(createPageFindAdv(request, response, ws)); - } else { - body.addElement(createPageFind(request, response, ws)); - } - WebUtil.createResponse (request, response, this, null, doc, true); -} - -/** - * Prepare a layout for Find functionality - * create appropriate fields for inputing searching keys - * - * @param request - * @param response - @paam es - * @throws ServletException - * @throws IOException - * - * @return WebDoc - */ - -private table createTabs(String selTab){ -// Tabs - td tabbar = new td("windowCenter", AlignType.LEFT, AlignType.MIDDLE, false); - a tab = new a("#",new span("Find")); - if (selTab.equals("Find")){ - tab.setID("tabSelected"); - } else { - tab.setID("tab"); - tab.setHref("/adempiere/WFindAdv?PTab=Find"); - } - - tab.setOnMouseOver("status='Find';return true;"); - tabbar.addElement(tab); - - tab = new a("#",new span("FindAdv")); - if (selTab.equals("FindAdv")){ - tab.setID("tabSelected"); - } else { - tab.setID("tab"); - tab.setHref("/adempiere/WFindAdv?PTab=FindAdv"); - } - - tab.setOnMouseOver("status='FindAdv';return true;"); - tabbar.addElement(tab); - - table topTable = new table ("0", "0", "0", "100%", null); - topTable.setID("WFindAdv.topTable"); - topTable.addElement(new tr(tabbar)); - - return topTable; -} - -private form createPageFind(HttpServletRequest request, HttpServletResponse response, WWindowStatus ws) throws ServletException, IOException -{ - - boolean hasValue = false; - boolean hasName = false; - boolean hasDocNo = false; - boolean hasDescription = false; - - //Get Info from target Tab - int size = ws.curTab.getFieldCount(); - for (int i = 0; i < size; i++) - { - GridField mField = ws.curTab.getField(i); - String columnName = mField.getColumnName(); - - if (mField.isDisplayed()) { - if (columnName.equals("Value")) - hasValue = true; - else if (columnName.equals("Name")) - hasName = true; - else if (columnName.equals("DocumentNo")) - hasDocNo = true; - else if (columnName.equals("Description")) - hasDescription = true; - } - } - - form myForm = new form("/adempiere/WWindow", form.METHOD_POST, form.ENC_DEFAULT); - myForm.setName("WForm"); - - myForm.setOnSubmit("this.target=window.opener.name"); - - myForm.addElement(createTabs("Find")); - - table table = new table(); - //table.setClass("centerTable"); - - tr line=null; - - if(hasValue) { - line = new tr(); - line.addElement(new td().addElement(new label().addElement(Msg.translate(ws.ctx,"Value"))).setAlign("right")); - line.addElement(new td().addElement(new input("text","txtValue",""))); - table.addElement(line); - } - - if(hasDocNo) { - line = new tr(); - line.addElement(new td().addElement(new label().addElement(Msg.translate(ws.ctx,"DocumentNo"))).setAlign("right")); - line.addElement(new td().addElement(new input("text","txtDocumentNo",""))); - table.addElement(line); - } - - if(hasName) { - line = new tr(); - line.addElement(new td().addElement(new label().addElement(Msg.translate(ws.ctx,"Name"))).setAlign("right")); - line.addElement(new td().addElement(new input("text","txtName",""))); - table.addElement(line); - } - - if(hasDescription) { - line = new tr(); - line.addElement(new td().addElement(new label().addElement(Msg.translate(ws.ctx,"Description"))).setAlign("right")); - line.addElement(new td().addElement(new input("text","txtDescription",""))); - table.addElement(line); - } - - if (!hasDescription && !hasDocNo && !hasName && !hasValue){ - line= new tr(); - line.addElement(new td().addElement(new h2("N/A!"))); - table.addElement(line); - } - - myForm.addElement(table); - - myForm.addElement(new input("hidden","txtSQL","FIND")); - - myForm.addElement(new br()); - myForm.addElement(new input("hidden","PCommand","FindAdv")); - myForm.addElement("  "); - myForm.addElement(new input("Reset",""," Reset").setClass("resetbtn")); - myForm.addElement(" "); - - input cmd=new input("Submit",""," Submit"); - cmd.setClass("submitbtn"); - myForm.addElement(cmd); - - myForm.addElement(" "); - cmd=new input("button",""," Close"); - cmd.setClass("closebtn"); - cmd.setOnClick("window.close()"); - myForm.addElement(cmd); - - return myForm; -} // createFields - -private form createPageFindAdv (HttpServletRequest request, HttpServletResponse response, WWindowStatus ws) throws ServletException, IOException -{ - form myForm = new form("/adempiere/WWindow", form.METHOD_POST, form.ENC_DEFAULT); - myForm.setName("WForm"); - - myForm.setOnSubmit("this.target=window.opener.name"); - - myForm.addElement(createTabs("FindAdv")); - - table table = new table(); - //table.setClass("centerTable"); - - tr line=new tr(); - - line.addElement(new td().addElement("Field")); - line.addElement(new td().addElement("Operator")); - line.addElement(new td().addElement("Value")); - line.addElement(new td().addElement("To Value")); - table.addElement(line); - - select select=new select("cboField"); - int size = ws.curTab.getFieldCount(); - for (int i = 0; i < size; i++) - { - GridField mField = ws.curTab.getField(i); - if (mField.isDisplayed()) { - select.addElement(new option(mField.getColumnSQL(false)).addElement(mField.getColumnSQL(false))); - } - } - - line=new tr(); - line.addElement(new td().addElement(select)); - - select=new select("cboOperator",new option[]{ - new option(LIKE).addElement(LIKE), - new option(NOT_LIKE).addElement(NOT_LIKE), - new option(EQUAL).addElement(EQUAL), - new option(NOT_EQUAL).addElement(NOT_EQUAL), - new option(GREATER).addElement(GREATER), - new option(GREATER_EQUAL).addElement(GREATER_EQUAL), - new option(LESS).addElement(LESS), - new option(LESS_EQUAL).addElement(LESS_EQUAL), - new option(BETWEEN).addElement(BETWEEN), - }); - line.addElement(new td().addElement(select)); - line.addElement(new td().addElement(new input("text","txtValue","%"))); - line.addElement(new td().addElement(new input("text","txtToValue",""))); - table.addElement(line); - - line=new tr(); - input cmd=new input("button","cmdAdd","Add Clause"); - cmd.setOnClick("txtSQL.value+=cboField.value + ' ' + cboOperator.value + ' \\'' + txtValue.value + '\\'\\n'"); - line.addElement(new td().addElement(cmd)); - - cmd=new input("button","cmdAnd","AND"); - cmd.setOnClick("txtSQL.value+='AND' + '\\n'"); - line.addElement(new td().addElement(cmd)); - table.addElement(line); - - cmd=new input("button","cmdOr","OR"); - cmd.setOnClick("txtSQL.value+='OR' + '\\n'"); - line.addElement(new td().addElement(cmd)); - table.addElement(line); - - line=new tr(); - line.addElement(new td().addElement("SQL Clause")); - table.addElement(line); - - line=new tr(); - line.addElement(new td().addElement(new textarea().setName("txtSQL").setStyle("width:100%")).setColSpan(4)); - table.addElement(line); - - myForm.addElement(table); - - myForm.addElement(new br()); - - myForm.addElement(new input("hidden","PCommand","FindAdv")); - myForm.addElement("  "); - myForm.addElement(new input("Reset",""," Reset").setClass("resetbtn")); - myForm.addElement(" "); - - cmd=new input("Submit",""," Submit"); - cmd.setClass("submitbtn"); - cmd.setOnClick("if (txtSQL.value.length==0) {alert('Input SQL clause before submit');return false}"); - myForm.addElement(cmd); - - - myForm.addElement(" "); - cmd=new input("button",""," Close"); - cmd.setClass("closebtn"); - cmd.setOnClick("window.close()"); - myForm.addElement(cmd); - - return myForm; -} - -private WebDoc preparePage() -{ - WebDoc doc = WebDoc.create ("Find Advance"); - head header = doc.getHead(); - header.addElement(new script("", WebEnv.getBaseDirectory("js/window.js"))); - header.addElement(new script("", WebEnv.getBaseDirectory("/js/check.js"))); - header.addElement(new link().setRel("stylesheet").setHref(WebEnv.getBaseDirectory("css/window.css"))); - return doc; -} -} \ No newline at end of file diff --git a/serverApps/src/main/servlet/org/compiere/www/WForm.java b/serverApps/src/main/servlet/org/compiere/www/WForm.java deleted file mode 100644 index 763c4ad353..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WForm.java +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebUtil; - -public class WForm extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -3168260837305771442L; - - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WForm.init"); - } - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebDoc doc = WebDoc.create ("WForm - Get - Not Implemented Yet"); - WebUtil.createResponse(request, response, this, null, doc, false); - } - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebDoc doc = WebDoc.create ("WForm - Post - Not Implemented Yet"); - WebUtil.createResponse(request, response, this, null, doc, false); - } -} \ No newline at end of file diff --git a/serverApps/src/main/servlet/org/compiere/www/WHelp.java b/serverApps/src/main/servlet/org/compiere/www/WHelp.java deleted file mode 100644 index 448454d369..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WHelp.java +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebUtil; - - -public class WHelp extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 2586562865823315494L; - - protected CLogger log = CLogger.getCLogger(getClass()); - - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WHelp.init"); - } - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.fine("doGet"); - WWindowStatus ws = WWindowStatus.get(request); - WebDoc doc = null; - if (ws == null) { - doc = WebDoc.createPopup("No Context"); - doc.addPopupClose(Env.getCtx()); - } else - doc = ws.mWindow.getHelpDoc(false); - WebUtil.createResponse(request, response, this, null, doc, false); - } - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebDoc doc = WebDoc.create ("Help - Post - Not Implemented"); - WebUtil.createResponse(request, response, this, null, doc, false); - } -} \ No newline at end of file diff --git a/serverApps/src/main/servlet/org/compiere/www/WLocation.java b/serverApps/src/main/servlet/org/compiere/www/WLocation.java deleted file mode 100644 index d3320f6eab..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WLocation.java +++ /dev/null @@ -1,414 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.ecs.AlignType; -import org.apache.ecs.xhtml.b; -import org.apache.ecs.xhtml.button; -import org.apache.ecs.xhtml.form; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.option; -import org.apache.ecs.xhtml.p; -import org.apache.ecs.xhtml.script; -import org.apache.ecs.xhtml.select; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.GridField; -import org.compiere.model.MCountry; -import org.compiere.model.MLocation; -import org.compiere.model.MRegion; -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebUtil; - -/** - * WLocation Servlet. - *

        - * The servlet is invoked by a parent window via - * - * WLocation?FormName=formName%ColumnName=columnName - * - * and assumes that in the opening window/form there are two fields - * - * opener.document.formName.columnName - The (hidden) field for the ID - * opener.document.formName.columnName_D - The display field for the value - * - * When selecting an entry, the window is closed and the value of the two fields set. - * - * @author Jorg Janke - * @version $Id: WLocation.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WLocation extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 285780594700749274L; - - /** Logger */ - protected static CLogger log = CLogger.getCLogger(WLocation.class); - - /** - * Initialize global variables - * - * @param config config - * @throws ServletException - */ - public void init(ServletConfig config) throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WLocation.init"); - } // init - - /** Parameter */ - private static final String P_TARGET = "TARGET"; - private static final String P_C_LOCATION_ID = "C_LOCATION_ID"; - private static final String P_ADDRESS1 = "ADDRESS1"; - private static final String P_ADDRESS2 = "ADDRESS2"; - private static final String P_ADDRESS3= "ADDRESS3"; - private static final String P_ADDRESS4= "ADDRESS4"; - private static final String P_CITY = "CITY"; - private static final String P_POSTAL = "POSTAL"; - private static final String P_C_COUNTRY_ID = "C_COUNTRY_ID"; - private static final String P_C_REGION_ID = "C_REGION_ID"; - - /** - * Process the HTTP Get request - initial Start - * Needs to have parameters FormName and ColumnName - * - * @param request request - * @param response response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - log.fine(""); - HttpSession sess = request.getSession(); - WWindowStatus ws = WWindowStatus.get(request); - if (ws == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - // Get Mandatory Parameters - String columnName = WebUtil.getParameter (request, "ColumnName"); - log.info ("ColumnName=" + columnName + " - " + ws.toString()); - // - GridField mField = ws.curTab.getField(columnName); - log.config("ColumnName=" + columnName - + ", MField=" + mField); - if (mField == null || columnName == null - || columnName.equals("")) - { - WebUtil.createErrorPage(request, response, this, - Msg.getMsg(ws.ctx, "ParameterMissing")); - return; - } - MLocation location = null; - Object value = mField.getValue(); - if (value != null && value instanceof Integer) - location = new MLocation(ws.ctx, ((Integer)value).intValue(),null); - else - location = new MLocation(ws.ctx, 0,null); - - //String targetBase = "parent.WWindow." + WWindow.FORM_NAME + "." + columnName; - String targetBase = "opener.WWindow." + WWindow.FORM_NAME + "." + columnName; - String action = request.getRequestURI(); - // Create Document - WebDoc doc = WebDoc.createPopup (mField.getHeader()); - doc.addPopupClose(ws.ctx); - boolean hasDependents = ws.curTab.hasDependants(columnName); - boolean hasCallout = mField.getCallout().length() > 0; - - // Reset - button reset = new button(); - reset.addElement("Reset"); // translate - String script = targetBase + "D.value='';" + targetBase + "F.value='';closePopup();"; - if (hasDependents || hasCallout) - script += "startUpdate(" + targetBase + "F);"; - reset.setOnClick(script); - // - doc.getTable().addElement(new tr() - .addElement(fillForm(ws, action, location, targetBase, hasDependents || hasCallout)) - .addElement(reset)); - // - doc.addPopupClose(ws.ctx); - // log.trace(log.l6_Database, doc.toString()); - WebUtil.createResponse (request, response, this, null, doc, true); - } // doGet - - - /** - * Process the HTTP Post request (update Address) - * - * @param request request - * @param response response - * @throws ServletException - * @throws IOException - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.fine(""); - HttpSession sess = request.getSession(); - WWindowStatus ws = WWindowStatus.get(request); - if (ws == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - int C_Location_ID = WebUtil.getParameterAsInt(request, P_C_LOCATION_ID); - String targetBase = "opener.WWindow." + WWindow.FORM_NAME + ".C_Location_ID"; - - // Create Location - MLocation location = new MLocation(ws.ctx, C_Location_ID,null); - log.fine("doPost updating C_Location_ID=" + C_Location_ID + " - " + targetBase); - - location.setAddress1 (WebUtil.getParameter(request, P_ADDRESS1)); - location.setAddress2 (WebUtil.getParameter(request, P_ADDRESS2)); - location.setAddress3(WebUtil.getParameter(request, P_ADDRESS3)); - location.setAddress4(WebUtil.getParameter(request, P_ADDRESS4)); - location.setCity (WebUtil.getParameter(request, P_CITY)); - location.setPostal (WebUtil.getParameter(request, P_POSTAL)); - location.setC_Country_ID (WebUtil.getParameterAsInt(request, P_C_COUNTRY_ID)); - location.setC_Region_ID (WebUtil.getParameterAsInt(request, P_C_REGION_ID)); - System.out.println("location =========== "+location); - // Document - WebDoc doc = WebDoc.createPopup ("WLocation"); - doc.addPopupClose(ws.ctx); - - // Save Location - location.save(); - C_Location_ID = location.getC_Location_ID(); - - td center = doc.addPopupCenter(false); - if (C_Location_ID == 0) - center.addElement(new p(new b("ERROR - Location=0"))); - center.addElement(new p().addElement(location.toString())); - - // Update Target - script script = new script(new StringBuffer() - .append(targetBase).append("D.value='").append(C_Location_ID).append("';") - .append(targetBase).append("F.value='").append(location.toString()) - .append("';closePopup();").toString()); - doc.getBody().addElement(script); - log.fine("script=" + script.toString()); - // - form myForm = null; - myForm = new form (); - table table = new table(); - table.setID("WLocation"); - button button = new button(); - button.addElement("ok"); - StringBuffer script2 = new StringBuffer(); - String targetBase2 = "opener.document.WForm.C_Location_ID"; - script2.append(targetBase2).append("D.value='").append(C_Location_ID).append("';") - //script.append(targetBase).append("D.value='").append("';") - .append(targetBase2).append("F.value='").append(location.toString()) - //.append(targetBase).append("F.value='") - .append("';submit();window.close();"); - button.setOnClick(script2.toString()); - table.addElement(button); - myForm.addElement(table); - doc.getTable().addElement(myForm); - - WebUtil.createResponse(request, response, this, null, doc, true); - } // doPost - - /** - * Fill Address Form - * @param ws WindowStatus - * @param location location - * @param targetBase target field string - add field Type - * @param addStart add startUpdate - * @return Table with selection - */ - private form fillForm (WWindowStatus ws, String action, MLocation location, - String targetBase, boolean addStart) - { - form myForm = null; - myForm = new form (action); - myForm.addElement(new input(input.TYPE_HIDDEN, P_TARGET, targetBase)); - myForm.addElement(new input(input.TYPE_HIDDEN, P_C_LOCATION_ID, location.getC_Location_ID())); - // - table table = new table(); - table.setID("WLocation"); - // -- Line 1 - tr line = new tr(); - line.addElement(new td(Msg.getMsg(ws.ctx, "Address")+ " 1").setAlign(AlignType.RIGHT)); - input myInput = null; - myInput = new input (input.TYPE_TEXT, P_ADDRESS1, location.getAddress1()); - myInput.setMaxlength(50).setSize(50); - line.addElement(new td(myInput).setAlign(AlignType.LEFT).setColSpan(5)); - table.addElement(line); - // -- Line 2 - line = new tr(); - line.addElement(new td(Msg.getMsg(ws.ctx, "Address")+ " 2").setAlign(AlignType.RIGHT)); - myInput = new input (input.TYPE_TEXT, P_ADDRESS2, location.getAddress2()); - myInput.setMaxlength(50).setSize(50); - line.addElement(new td(myInput).setAlign(AlignType.LEFT).setColSpan(5)); - table.addElement(line); - - //-- add by Dan - line = new tr(); - line.addElement(new td(Msg.getMsg(ws.ctx, "Address")+ " 3").setAlign(AlignType.RIGHT)); - myInput = new input (input.TYPE_TEXT, P_ADDRESS3, location.getAddress3()); - myInput.setMaxlength(50).setSize(50); - line.addElement(new td(myInput).setAlign(AlignType.LEFT).setColSpan(5)); - table.addElement(line); - -// -- add by Dan - line = new tr(); - line.addElement(new td(Msg.getMsg(ws.ctx, "Address")+ " 4").setAlign(AlignType.RIGHT)); - myInput = new input (input.TYPE_TEXT, P_ADDRESS4, location.getAddress4()); - myInput.setMaxlength(50).setSize(50); - line.addElement(new td(myInput).setAlign(AlignType.LEFT).setColSpan(5)); - table.addElement(line); - - // -- Line 3 - line = new tr(); - line.addElement(new td(Msg.getMsg(ws.ctx, "City")).setAlign(AlignType.RIGHT)); // 1 - myInput = new input (input.TYPE_TEXT, P_CITY, location.getCity()); - myInput.setMaxlength(30).setSize(30); - line.addElement(new td(myInput).setAlign(AlignType.LEFT)); // 2 - // - if (location.getCountry().isHasRegion()) - { - line.addElement(new td(Msg.getMsg(ws.ctx, "Region")).setAlign(AlignType.RIGHT)); // 3 - line.addElement(new td(getRegion(location, ws)).setAlign(AlignType.LEFT)); // 4 - } - // - line.addElement(new td(Msg.getMsg(ws.ctx, "Postal")).setAlign(AlignType.RIGHT)); // 5 - myInput = new input (input.TYPE_TEXT, P_POSTAL, location.getPostal()); - myInput.setMaxlength(10).setSize(6); - line.addElement(new td(myInput).setAlign(AlignType.LEFT)); // 6 - // - // input = new input (input.TYPE_TEXT, "PostalAdd", mLocation.PostalAdd ); - // line.addElement(new td(input).setAlign(AlignType.LEFT)); - table.addElement(line); - // -- Line 4 - line = new tr(); - line.addElement(new td(Msg.getMsg(ws.ctx, "Country")).setAlign(AlignType.RIGHT)); - line.addElement(new td(this.getCountry(location, ws)).setAlign(AlignType.LEFT).setColSpan(5)); - table.addElement(line); - - - // -- Line 5 - line = new tr(); - // Submit - StringBuffer script = new StringBuffer(); - script.append(targetBase).append("D.value='").append("temp").append("';") - //script.append(targetBase).append("D.value='").append("';") - .append(targetBase).append("F.value='").append("temp") - //.append(targetBase).append("F.value='") - .append("';submit();closePopup();"); - - - line.addElement(new td(" ")); - input submit = new input(input.TYPE_SUBMIT, "Submit", "Submit"); // translate - submit.setOnClick(script.toString()); - line.addElement(new td(submit).setAlign(AlignType.RIGHT).setColSpan(5)); - table.addElement(line); - - - /*button button = new button(); - button.addElement(">"); - StringBuffer script = new StringBuffer(); - script.append(targetBase).append("D.value='").append("temp").append("';") - //script.append(targetBase).append("D.value='").append("';") - .append(targetBase).append("F.value='").append("temp") - //.append(targetBase).append("F.value='") - .append("';closePopup();"); - if (addStart) - script.append("startUpdate(").append(targetBase).append("F);"); - button.setOnClick(script.toString()); - table.addElement(button);*/ - myForm.addElement(table); - // - return myForm; - } // fillform - - - /** - * Get Country Pick-List - * - * @param location location model - * @param ws window status - * @return Select Field with Countries - */ - private select getCountry (MLocation location, WWindowStatus ws) - { - MCountry[] countries = MCountry.getCountries (location.getCtx()); - int comp = location.getC_Country_ID(); - if (comp == 0) - comp = Env.getContextAsInt(ws.ctx, "C_Country_ID"); - option[] options = new option[countries.length]; - for (int i = 0; i < countries.length; i++) - { - options[i] = new option (String.valueOf(countries[i].getC_Country_ID())); - options[i].addElement(countries[i].getName()); - if (comp == countries[i].getC_Country_ID()) - options[i].setSelected(true); - } - - select select = new select (P_C_COUNTRY_ID, options); - return select; - } // getRegion - - /** - * Get Region Pick-List - * - * @param location localion model - * @param ws window status - * @return Select field with Region - */ - private select getRegion (MLocation location, WWindowStatus ws) - { - MRegion[] regions = MRegion.getRegions (location.getCtx(), location.getC_Country_ID()); - int comp = location.getC_Region_ID(); - if (comp == 0) - comp = Env.getContextAsInt(ws.ctx, "C_Region_ID"); - option[] options = new option[regions.length]; - for (int i = 0; i < regions.length; i++) - { - options[i] = new option (String.valueOf(regions[i].getC_Region_ID())); - options[i].addElement(regions[i].getName()); - if (comp == regions[i].getC_Region_ID()) - options[i].setSelected(true); - } - - select select = new select (P_C_REGION_ID, options); - return select; - } // getRegion - -} // WLocation - diff --git a/serverApps/src/main/servlet/org/compiere/www/WLogin.java b/serverApps/src/main/servlet/org/compiere/www/WLogin.java deleted file mode 100644 index a11736ab53..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WLogin.java +++ /dev/null @@ -1,506 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; -import java.security.Principal; -import java.util.Properties; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.ecs.AlignType; -import org.apache.ecs.HtmlColor; -import org.apache.ecs.xhtml.b; -import org.apache.ecs.xhtml.font; -import org.apache.ecs.xhtml.form; -import org.apache.ecs.xhtml.img; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.label; -import org.apache.ecs.xhtml.option; -import org.apache.ecs.xhtml.p; -import org.apache.ecs.xhtml.script; -import org.apache.ecs.xhtml.select; -import org.apache.ecs.xhtml.strong; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.MSession; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Language; -import org.compiere.util.Login; -import org.compiere.util.Msg; -import org.compiere.util.Util; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - -/** - * Web Login Page. - *

        - * Page request: - *

        - *  - Check database connection
        - *  - LoginInfo from request?
        - *      - Yes: DoLogin success ?
        - *          - Yes: return (second) preferences page
        - *          - No: return (first) user/password page
        - *      - No: User Principal ?
        - *          - Yes: DoLogin success ?
        - *              - Yes: return (second) preferences page
        - *              - No: return (first) user/password page
        - *          - No: return (first) user/password page
        - *  
        - * - * @author Jorg Janke - * @version $Id: WLogin.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WLogin extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -407753489095758837L; - - /** Logger */ - protected CLogger log = CLogger.getCLogger(getClass()); - - /** - * Initialize - * @param config confif - * @throws ServletException - */ - public void init(ServletConfig config) throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WLogin.init"); - } // init - - /** - * Get Servlet information - * @return servlet info - */ - public String getServletInfo() - { - return "adempiere Web Login"; - } // getServletInfo - - /** - * Clean up - */ - public void destroy() - { - log.info("destroy"); - super.destroy(); - } // destroy - - - /** - * Process the HTTP Get request - forward to Post - * @param request request - * @param response response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.info(""); - doPost (request, response); - } // doGet - - - /** - * Process the HTTP Post request. - *
        -	 *  - Optionally create Session
        -	 *  - Check database connection
        -	 *  - LoginInfo from request?
        -	 *      - Yes: DoLogin success ?
        -	 *          - Yes: return (second) preferences page
        -	 *          - No: return (first) user/password page
        -	 *      - No: User Principal ?
        -	 *          - Yes: DoLogin success ?
        -	 *              - Yes: return (second) preferences page
        -	 *              - No: return (first) user/password page
        -	 *          - No: return (first) user/password page
        -	 *  
        - * @param request request - * @param response response - * @throws ServletException - * @throws IOException - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.info(""); - // Create New Session - HttpSession sess = request.getSession(true); - sess.setMaxInactiveInterval(WebEnv.TIMEOUT); - - // Get Cookie Properties - Properties cProp = WebUtil.getCookieProprties(request); - - // Create Context - WebSessionCtx wsc = WebSessionCtx.get (request); - - // Page - WebDoc doc = null; - - // Check DB connection - if (!DB.isConnected()) - { - String msg = Msg.getMsg(wsc.ctx, "WLoginNoDB"); - if (msg.equals("WLoginNoDB")) - msg = "No Database Connection"; - doc = WebDoc.createWindow (msg); - } - - // Login Info from request? - else - { - // Get Parameters: UserName/Password - String usr = WebUtil.getParameter (request, P_USERNAME); - String pwd = WebUtil.getParameter (request, P_PASSWORD); - // Get Principle - Principal userPrincipal = request.getUserPrincipal(); - log.info("Principal=" + userPrincipal + "; User=" + usr); - - // Login info not from request and not pre-authorized - if (userPrincipal == null && (usr == null || pwd == null)) - doc = createFirstPage (cProp, request, ""); - // Login info from request or authorized - else - { - KeyNamePair[] roles = null; - Login login = new Login(wsc.ctx); - // Pre-authorized - if (userPrincipal != null) - { - roles = login.getRoles(userPrincipal); - usr = userPrincipal.getName(); - } - else - roles = login.getRoles(usr, pwd); - // - if (roles == null) - doc = createFirstPage(cProp, request, Msg.getMsg(wsc.ctx, "UserPwdError")); - else - { - doc = createSecondPage(request, WebUtil.convertToOption(roles, null), ""); - // Create adempiere Session - user id in ctx - MSession.get (wsc.ctx, request.getRemoteAddr(), - request.getRemoteHost(), sess.getId() ); - } - // Can we save Cookie ? - if (WebUtil.getParameter (request, P_STORE) == null) - { - cProp.clear(); // erase all - } - else // Save Cookie Parameter - { - cProp.setProperty(P_USERNAME, usr); - cProp.setProperty(P_STORE, "Y"); - cProp.setProperty(P_PASSWORD, pwd); // For test only - } - } - } - WebUtil.createResponse (request, response, this, cProp, doc, false); - } // doPost - - // Variable Names - private static final String P_USERNAME = "User"; - private static final String P_PASSWORD = "Password"; - private static final String P_SUBMIT = "Submit"; - // WMenu picks it up - protected static final String P_ROLE = "AD_Role_ID"; - protected static final String P_CLIENT = "AD_Client_ID"; - protected static final String P_ORG = "AD_Org_ID"; - protected static final String P_DATE = "Date"; - protected static final String P_WAREHOUSE = "M_Warehouse_ID"; - protected static final String P_ERRORMSG = "ErrorMessage"; - protected static final String P_STORE = "SaveCookie"; - - - /************************************************************************** - * First Login Page - * @param cProp Login Cookie information for defaults - * @param request request - * @param errorMessage error message - * @return WDoc page - */ - private WebDoc createFirstPage(Properties cProp, HttpServletRequest request, - String errorMessage) - { - log.info (" - " + errorMessage); - String AD_Language = (cProp.getProperty(Env.LANGUAGE, Language.getAD_Language(request.getLocale()))); - // - String windowTitle = Msg.getMsg(AD_Language, "Login"); - String usrText = Msg.getMsg(AD_Language, "User"); - String pwdText = Msg.getMsg(AD_Language, "Password"); - String lngText = Msg.translate(AD_Language, "AD_Language"); - String okText = Msg.getMsg(AD_Language, "OK"); - String cancelText = Msg.getMsg(AD_Language, "Cancel"); - String storeTxt = Msg.getMsg(AD_Language, "SaveCookie"); - - // Form - post to same URL - String action = request.getRequestURI(); - form myForm = null; - myForm = new form(action).setName("Login1"); - table table = new table().setAlign(AlignType.CENTER).setWidth("25%"); - //Modified by Rob Klein 4/29/07 - // Blank Line - tr line = new tr(); - line.addElement(new td().addElement(" ")); - - // Username - String userData = cProp.getProperty(P_USERNAME, ""); - line = new tr(); - label usrLabel = new label().setFor(P_USERNAME + "F").addElement(usrText); - usrLabel.setID(P_USERNAME + "L"); - line.addElement(new td().addElement(usrLabel).setAlign(AlignType.RIGHT)); - input usr = new input(input.TYPE_TEXT, P_USERNAME, userData).setSize(20).setMaxlength(30); - usr.setID(P_USERNAME + "F"); - line.addElement(new td().addElement(usr).setAlign(AlignType.LEFT)); - table.addElement(line); - - // Password - String pwdData = cProp.getProperty(P_PASSWORD, ""); - line = new tr(); - label pwdLabel = new label().setFor(P_PASSWORD + "F").addElement(pwdText); - pwdLabel.setID(P_PASSWORD + "L"); - line.addElement(new td().addElement(pwdLabel).setAlign(AlignType.RIGHT)); - input pwd = new input(input.TYPE_PASSWORD, P_PASSWORD, pwdData).setSize(20).setMaxlength(30); - pwd.setID(P_PASSWORD + "F"); - line.addElement(new td().addElement(pwd).setAlign(AlignType.LEFT)); - table.addElement(line); - - // Language Pick - String langData = cProp.getProperty(AD_Language); - line = new tr(); - label langLabel = new label().setFor(Env.LANGUAGE + "F").addElement(lngText); - langLabel.setID(Env.LANGUAGE + "L"); - line.addElement(new td().addElement(langLabel).setAlign(AlignType.RIGHT)); - option options[] = new option[Language.getLanguageCount()]; - for (int i = 0; i < Language.getLanguageCount(); i++) - { - Language language = Language.getLanguage(i); - options[i] = new option(language.getAD_Language()) - .addElement(Util.maskHTML(language.getName())); - if (language.getAD_Language().equals(langData)) - options[i].setSelected(true); - else - options[i].setSelected(false); - } - line.addElement(new td().addElement(new select(Env.LANGUAGE, options) - .setID(Env.LANGUAGE + "F"))); - table.addElement(line); - - // Store Cookie - String storeData = cProp.getProperty(P_STORE, "N"); - line = new tr(); - line.addElement(new td()); - input store = new input(input.TYPE_CHECKBOX, P_STORE, "Y").addElement(storeTxt).setChecked(storeData.equals("Y")); - store.setID(P_STORE + "F"); - line.addElement(new td().addElement(store).setAlign(AlignType.LEFT)); - table.addElement(line); - - // ErrorMessage - if (errorMessage != null && errorMessage.length() > 0) - { - line = new tr(); - // line.addElement(new td()); - line.addElement(new td().setColSpan(2) - .addElement(new font(HtmlColor.red, 4).addElement(new b(errorMessage)))); // color, size - table.addElement(line); - } - - // Finish - line = new tr(); - //Modified by Rob Klein 4/29/07 - table tablebutton = new table().setAlign(AlignType.CENTER).setWidth("25%"); - input cancel = new input(input.TYPE_RESET, "Reset", " "+"Cancel"); - cancel.setClass("cancelbtn"); - line.addElement(new td().addElement(cancel).setWidth("50%")).setAlign(AlignType.CENTER); - input submit = new input(input.TYPE_SUBMIT, P_SUBMIT, " "+"OK"); - submit.setClass("loginbtn"); - line.addElement(new td().addElement(submit).setWidth("50%").setAlign(AlignType.CENTER)); - tablebutton.addElement(line); - table.addElement(tablebutton); - // - myForm.addElement(table); - - // Document - WebDoc doc = WebDoc.createWindow (windowTitle); - //Modified by Rob Klein 4/29/07 - img img = new img (WebEnv.getImageDirectory("Logo.gif"), "logo"); - doc.addWindowCenter(true) - .addElement(img) - .addElement(new p()) - .addElement(new p()) - //.addElement(new h3("The HTML UI is Beta Functionality!")) - //.addElement(myForm) - .addElement(myForm) - .addElement(new p()) - .addElement(new p()); - // Clear Menu Frame - doc.getBody() - .addElement(WebUtil.getClearFrame(WebEnv.TARGET_MENU)) - .setTitle(windowTitle); - - return doc; - } // createFirstPage - - - /** - * Create Second Page - * @param request request - * @param roleOptions role options - * @param errorMessage error message - * @return WDoc page - */ - private WebDoc createSecondPage(HttpServletRequest request, - option[] roleOptions, String errorMessage) - { - log.info(" - " + errorMessage); - WebSessionCtx wsc = WebSessionCtx.get(request); - String windowTitle = Msg.getMsg(wsc.language, "LoginSuccess"); - - // Form - Get Menu - String action = WebEnv.getBaseDirectory("WMenu"); - form myForm = null; - myForm = new form(action).setName("Login2"); - myForm.setTarget(WebEnv.TARGET_MENU); - table table = new table().setAlign(AlignType.CENTER); - - // Role Pick - tr line = new tr(); - //Modified by Rob Klein 4/29/07 - line.addElement(new td().addElement(" ")); - table.addElement(line); - line = new tr(); - label roleLabel = new label().setFor(P_ROLE + "F").addElement(Msg.translate(wsc.language, "AD_Role_ID")); - roleLabel.setID(P_ROLE + "L"); - line.addElement(new td().addElement(roleLabel).setAlign(AlignType.RIGHT)); - select role = new select(P_ROLE, roleOptions); - role.setID(P_ROLE + "F"); - role.setOnClick("fieldUpdate(this);"); // WFieldUpdate sets Client & Org - line.addElement(new td().addElement(role)); - table.addElement(line); - - // Client Pick - line = new tr(); - label clientLabel = new label().setFor(P_CLIENT + "F").addElement(Msg.translate(wsc.language, "AD_Client_ID")); - clientLabel.setID(P_CLIENT + "L"); - line.addElement(new td().addElement(clientLabel).setAlign(AlignType.RIGHT)); - select client = new select(P_CLIENT); - client.setID(P_CLIENT + "F"); - client.setOnClick("fieldUpdate(this);"); // WFieldUpdate sets Org - line.addElement(new td().addElement(client)); - table.addElement(line); - - // Org Pick - line = new tr(); - label orgLabel = new label().setFor(P_ORG + "F").addElement(Msg.translate(wsc.language, "AD_Org_ID")); - orgLabel.setID(P_ORG + "L"); - line.addElement(new td().addElement(orgLabel).setAlign(AlignType.RIGHT)); - select org = new select(P_ORG); - org.setID(P_ORG + "F"); - org.setOnClick("fieldUpdate(this);"); // WFieldUpdate sets Org - line.addElement(new td().addElement(org)); - table.addElement(line); - - // Warehouse - line = new tr(); - label whLabel = new label().setFor(P_WAREHOUSE + "F").addElement(Msg.translate(wsc.language, "M_Warehouse_ID")); - whLabel.setID(P_WAREHOUSE + "L"); - line.addElement(new td().addElement(whLabel).setAlign(AlignType.RIGHT)); - select wh = new select(P_WAREHOUSE); - wh.setID(P_WAREHOUSE + "F"); - line.addElement(new td().addElement(wh )); - table.addElement(line); - - // Date - String dateData = wsc.dateFormat.format(new java.util.Date()); - line = new tr(); - label dateLabel = new label().setFor(P_DATE + "F").addElement(Msg.getMsg(wsc.language, "Date")); - dateLabel.setID(P_DATE + "L"); - line.addElement(new td().addElement(dateLabel).setAlign(AlignType.RIGHT)); - input date = new input(input.TYPE_TEXT, P_DATE, dateData).setSize(10).setMaxlength(10); - date.setID(P_DATE + "F"); - line.addElement(new td().addElement(date).setAlign(AlignType.LEFT)); - table.addElement(line); - - // ErrorMessage - if (errorMessage != null && errorMessage.length() > 0) - { - line = new tr(); - line.addElement(new td().addElement(new strong(errorMessage)).setColSpan(2).setAlign(AlignType.CENTER)); - table.addElement(line); - } - //Modified by Rob Klein 4/29/07 - // Finish - table tablebutton = new table().setAlign(AlignType.CENTER).setWidth("25%"); - line = new tr(); - //Modified by Rob Klein 4/29/07 - //input cancel = new input(input.TYPE_RESET, "Reset", Msg.getMsg(wsc.language, "Cancel")); - input cancel = new input(input.TYPE_RESET, "Reset", " "+ "Cancel"); - cancel.setOnClick("window.top.location.replace('/adempiere/index.html');"); - cancel.setClass("cancelbtn"); - line.addElement(new td().addElement(cancel).setWidth("50%").setAlign(AlignType.CENTER)); - input submit = new input(input.TYPE_SUBMIT, "Submit", " "+ "OK"); - submit.setOnClick("showLoadingMenu('" + WebEnv.getBaseDirectory("") + "');"); - //Modified by Rob Klein 4/29/07 - submit.setClass("loginbtn"); - line.addElement(new td().addElement(submit).setWidth("50%").setAlign(AlignType.CENTER)); - tablebutton.addElement(line); - table.addElement(tablebutton); - // - myForm.addElement(table); - - // Create Document - WebDoc doc = WebDoc.createWindow (windowTitle); - //Modified by Rob Klein 4/29/07 - img img = new img (WebEnv.getImageDirectory("Logo.gif"), "logo"); - doc.addWindowCenter(true) - .addElement(img) - .addElement(new p()) - //.addElement(new h3("The HTML UI is Beta Functionality!")) - .addElement(myForm) - .addElement(new p()) - .addElement(new p()); - // - String script = "fieldUpdate(document.Login2." + P_ROLE + ");"; // init dependency updates - doc.getBody() - .addElement(new script(script)); - // Note - doc.addWindowFooter() - .addElement(new p(Msg.getMsg(wsc.language, "WLoginBrowserNote"), AlignType.CENTER)); - - return doc; - } // createSecondPage - -} // WLogin diff --git a/serverApps/src/main/servlet/org/compiere/www/WLookup.java b/serverApps/src/main/servlet/org/compiere/www/WLookup.java deleted file mode 100644 index da4b012c1f..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WLookup.java +++ /dev/null @@ -1,596 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.ecs.xhtml.button; -import org.apache.ecs.xhtml.div; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.th; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.GridField; -import org.compiere.model.MProcess; -import org.compiere.model.MProcessPara; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - -/** - * WLookup Servlet. - *

        - * The servlet is invoked by a parent window via - * - * WLookup?FormName=formName%ColumnName=columnName - * - * and assumes that in the opening window/form there are two fields - * - * opener.document.formName.columnName - The (hidden) field for thcoe ID - * opener.document.formName.columnName_D - The display field for the value - * - * When selecting an entry, the window is closed and the value of the two fields set. - * - * @author Jorg Janke - * @version $Id: WLookup.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WLookup extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 4835226093865297019L; - - /** Logger */ - protected static CLogger log = CLogger.getCLogger(WLookup.class); - - /** The Data List */ - protected volatile ArrayList p_data = new ArrayList(); - - private static final int MAX_LINES = 99999; - private int m_recordCount; - private int m_colCount; - - private StringBuffer m_HeaderSelect = null; - - /** - * Initialize global variables - * - * @param config - * @throws ServletException - */ - public void init(ServletConfig config) throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WLookup.init"); - } // init - - /** - * Process the HTTP Get request - initial Start - * Needs to have parameters FormName and ColumnName - * - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebEnv.dump(request); - WebEnv.dump(request.getSession()); - //Modified by Rob Klein 4/29/07 - // - WebSessionCtx wsc = WebSessionCtx.get(request); - WWindowStatus ws = WWindowStatus.get(request); - - if (wsc == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - - // Get Mandatory Parameters - String columnName = WebUtil.getParameter (request, "ColumnName"); - //Lookup called from a process - //Modified by Rob Klein 4/29/07 - int AD_Process_ID = WebUtil.getParameterAsInt(request, "AD_Process_ID"); - //Lookup modified to include paging - //Modified by Rob Klein 07/07/07 - int page = WebUtil.getParameterAsInt(request, "page"); - log.info("This is the page on original call"+page); - - - if (AD_Process_ID > 0) - { - - if (AD_Process_ID < 1 || columnName == null - || columnName.equals("")) - { - WebUtil.createErrorPage(request, response, this, - Msg.getMsg(wsc.ctx, "ParameterMissing")); - return; - } - String targetBase = "'" + columnName; - - MProcess process = MProcess.get(wsc.ctx, AD_Process_ID); - - MProcessPara para = null; - - MProcessPara[] parameter = process.getParameters(); - - for (int i = 0; i < parameter.length; i++) - { - para = parameter[i]; - - if (para.getColumnName().equals(columnName)) - i=parameter.length; - } - - // Create Document - WebDoc doc = WebDoc.createPopup (para.getColumnName()); - - div panel=new div(); - panel.setStyle("height: 330px;overflow: scroll;overflow: auto;"); - panel.addElement(fillTable(wsc, para.getColumnName(), para.getAD_Reference_Value_ID(), request.getRequestURI(),targetBase,false, page)); - - //tr tr = new tr().addElement(panel); - - // Reset - String text = "Reset"; - //if (wsc.ctx != null) - // text = Msg.getMsg (wsc.ctx, "Reset"); - - input resetbtn = new input("button", text, " "+text); - resetbtn.setID(text); - resetbtn.setClass("resetbtn"); - String script = targetBase + "F.value='';" + targetBase + "D.value='';closePopup();"; - resetbtn.setOnClick(script); - // -// - //First Page - text = "First"; - //if (wsc.ctx != null) - // text = Msg.getMsg (wsc.ctx, "Next Page"); - input firstpgbtn = new input(input.TYPE_BUTTON, text, " "+text); - - firstpgbtn.setOnClick("startLookup('" + columnName + "', "+AD_Process_ID+", 1);return false;"); - firstpgbtn.setID(text); - firstpgbtn.setClass("firstpgbtn"); - - //Previous Page - text = "Prior"; - //if (wsc.ctx != null) - // text = Msg.getMsg (wsc.ctx, "Prior Page"); - input prevpgbtn = new input(input.TYPE_BUTTON, text, " "+text); - int prevpage = (page == 1) ? 1 : page-1; - prevpgbtn.setOnClick("startLookup('" + columnName + "', "+AD_Process_ID+", "+prevpage+");return false;"); - prevpgbtn.setID(text); - prevpgbtn.setClass("prevpgbtn"); - - //Next Page - text = "Next"; - //if (wsc.ctx != null) - // text = Msg.getMsg (wsc.ctx, "Next Page"); - input nextpgbtn = new input(input.TYPE_BUTTON, text, " "+text); - int nextpage = (page+1); - nextpgbtn.setOnClick("startLookup('" + columnName + "', "+AD_Process_ID+", "+nextpage+");return false;"); - nextpgbtn.setID(text); - nextpgbtn.setClass("nextpgbtn"); - - //Last Page - text = "Next"; - //if (wsc.ctx != null) - // text = Msg.getMsg (wsc.ctx, "Next Page"); - input lastpgbtn = new input(input.TYPE_BUTTON, text, " "+text); - int lastpage = m_recordCount/MAX_LINES + 1; - lastpgbtn.setOnClick("startLookup('" + columnName + "', "+AD_Process_ID+", "+lastpage+");return false;"); - lastpgbtn.setID(text); - lastpgbtn.setClass("lastpgbtn"); - - int index1=(page-1)*MAX_LINES+1; - int index2=(page)*MAX_LINES 0; - - div panel=new div(); - panel.setStyle("height: 330px;overflow: scroll;overflow: auto;"); - panel.addElement(fillTable(wsc, mField.getColumnName(), mField.getAD_Reference_Value_ID(), request.getRequestURI(),targetBase, hasDependents || hasCallout, page)); - - //tr tr = new tr().addElement(panel); - - // Reset - String text = "Reset"; - //if (wsc.ctx != null) - // text = Msg.getMsg (wsc.ctx, "Reset"); - input resetbtn = new input(input.TYPE_RESET, text, " "+text); - resetbtn.setID(text); - resetbtn.setClass("resetbtn"); - - String script = targetBase + "F.value='';" + targetBase + "D.value='';self.close();"; - if (hasDependents || hasCallout) - script += "startUpdate(" + targetBase + "F);"; - resetbtn.setOnClick(script); - - //First Page - text = "First"; - //if (wsc.ctx != null) - // text = Msg.getMsg (wsc.ctx, "First"); - input firstpgbtn = new input(input.TYPE_BUTTON, text, " "+text); - firstpgbtn.setOnClick("startLookup('" + columnName + "', "+AD_Process_ID+", 1);return false;"); - firstpgbtn.setID(text); - firstpgbtn.setClass("firstpgbtn"); - - //Previous Page - text = "Prior"; - //if (wsc.ctx != null) - // text = Msg.getMsg (wsc.ctx, "Prior"); - input prevpgbtn = new input(input.TYPE_BUTTON, text, " "+text); - int prevpage = (page == 1) ? 1 : page-1; - prevpgbtn.setOnClick("startLookup('" + columnName + "', "+AD_Process_ID+", "+prevpage+");return false;"); - prevpgbtn.setID(text); - prevpgbtn.setClass("prevpgbtn"); - - //Next Page - text = "Next"; - //if (wsc.ctx != null) - // text = Msg.getMsg (wsc.ctx, "Next"); - input nextpgbtn = new input(input.TYPE_BUTTON, text, " "+text); - int nextpage = (page+1); - nextpgbtn.setOnClick("startLookup('" + columnName + "', "+AD_Process_ID+", "+nextpage+");return false;"); - nextpgbtn.setID(text); - nextpgbtn.setClass("nextpgbtn"); - - //Last Page - text = "Last"; - //if (wsc.ctx != null) - // text = Msg.getMsg (wsc.ctx, "Last"); - input lastpgbtn = new input(input.TYPE_BUTTON, text, " "+text); - int lastpage=m_recordCount/MAX_LINES + 1; - lastpgbtn.setOnClick("startLookup('" + columnName + "', "+AD_Process_ID+", "+ lastpage +");return false;"); - lastpgbtn.setID(text); - lastpgbtn.setClass("lastpgbtn"); - - int index1=(page-1)*MAX_LINES+1; - int index2=(page)*MAX_LINES"); - tr line = new tr(); - - - // Set Headers - //line.addElement(new th(" ")). - // addElement(new th(Msg.translate(wsc.ctx, "Key Name")).setClass("table-filterable table-filtered table-sortable:default")); - line = fillTable_Lookup_Headers(columnName, fieldRefId, line, targetBase, true, true, true, false, true); - - tr line2 = new tr(); - //line2.addElement(new th(" ")).addElement(new th(" ")); - line2 = fillTable_Lookup_Headers( columnName, fieldRefId, line2, targetBase, true, true, true, false, false); - table.addElement(line2); - table.addElement(line); - table.addElement(""); - table.addElement(""); - - // Fillout rows - table = fillTable_Lookup_Rows(wsc, columnName, fieldRefId, table, targetBase, true, true, true, false, page); - - table.addElement(""); - // Restore - return table; - } // fillTable - - //Modified by Rob Klein 4/29/07 - /************************************************************************** - * Fill Table Lookup - * - * @param ws WindowStatus - * @param mField the Field - * @param targetBase target field string - * @return Lookup Rows in List Format - */ - private table fillTable_Lookup_Rows (WebSessionCtx wsc, String columnName, int fieldRefId, - table table1, String targetBase, boolean mandatory, boolean onlyValidated, boolean onlyActive, - boolean temporary, int page) - { - StringBuffer sqlSelect = null; - StringBuffer sqlCount = null; - String sql=null; - String colKey=null; - String colDisplay=null; - - if (fieldRefId > 0){ - sql = "SELECT AD_Table_ID, AD_Key, AD_Display, WhereClause, OrderByClause FROM AD_Ref_Table WHERE AD_Reference_ID = " + fieldRefId; - - int tableID = 0; - - String whereClause = null; - String orderBy = null; - - try - { - PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); - ResultSet rs = pstmt.executeQuery(); - - if (rs.next()){ - tableID = rs.getInt(1); - - whereClause = rs.getString(4); - orderBy = rs.getString(5); - sql="Select ColumnName FROM AD_Column Where AD_Column_ID = ? AND AD_Table_ID = ?"; - colKey = DB.getSQLValueString(null, sql, rs.getInt(2), tableID); - colDisplay = DB.getSQLValueString(null, sql, rs.getInt(3), tableID); - } - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql.toString(), e); - } - - sql = "Select TableName FROM AD_Table Where AD_Table_ID = ?"; - String tableName = DB.getSQLValueString(null, sql , tableID); - sqlSelect=new StringBuffer ( "SELECT " + m_HeaderSelect + " FROM " + tableName + " WHERE AD_Client_ID=?"); - sqlCount=new StringBuffer ( "SELECT count(*) FROM " + tableName + " WHERE AD_Client_ID=?"); - - if (whereClause != null){ - sqlSelect.append(" AND " + whereClause); - sqlCount.append(" AND " + whereClause); - } - if (orderBy != null) - sqlSelect.append(" ORDER BY " + orderBy); - - } - else{ - sqlSelect=new StringBuffer("SELECT " + m_HeaderSelect + " FROM " + columnName.replace("_ID", "") + " WHERE AD_Client_ID=?"); - sqlCount=new StringBuffer("SELECT count(*) FROM " + columnName.replace("_ID", "") + " WHERE AD_Client_ID=?"); - colKey=columnName; - if (m_HeaderSelect.toString().contains("Name")) - colDisplay="Name"; - else - colDisplay="Description"; - } - try - { - PreparedStatement pstmt = DB.prepareStatement(sqlSelect.toString(), - ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY, null); - - pstmt.setInt(1, Env.getAD_Client_ID(wsc.ctx)); - ResultSet rs = pstmt.executeQuery(); - log.info("This is the page number "+page); - log.info("This is the MAX_LINES "+MAX_LINES); - //rs.absolute(((page-1)*MAX_LINES)+1); - - //for (int j= 1; j<= MAX_LINES; j++){ - while(rs.next()){ - button button = new button(); - button.addElement(">"); - StringBuffer script = new StringBuffer(); - script - .append("startLookUpdate(").append(targetBase).append("F',") - .append(targetBase).append("D','").append(rs.getString(colKey)).append("',") - .append(targetBase).append("F','").append(rs.getString(colDisplay)) - .append("');startUpdate(").append(targetBase).append("');return false;"); - button.setOnClick(script.toString()); - // - tr line = new tr(); - line.addElement(new td(button)); - //line.addElement(new td(rs.getString(i))); - - for (int i = 1; i <=m_colCount; i++) - { - line.addElement(new td(rs.getString(i))); - } - - table1.addElement(line); - } - //} - - - //count - m_recordCount = DB.getSQLValue(null, sqlCount.toString(),Env.getAD_Client_ID(wsc.ctx)); - - - rs.close(); - pstmt.close(); - - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql.toString(), e); - } - return table1; - } // fillTable_Lookup_Rows - - /** - * Fill Table Product - * - * @param ws WindowStatus - * @param mField the Field - * @param targetBase target field string - * @return Table with selection - */ - private tr fillTable_Lookup_Headers ( String columnName, int fieldRefId, - tr line, String targetBase, boolean mandatory, boolean onlyValidated, boolean onlyActive, - boolean temporary, boolean firstHeaderLine) - { - - String sqlSelect = null; - input filter = null; - if (fieldRefId > 0) - sqlSelect = "SELECT ColumnName, Name FROM AD_Column WHERE AD_Table_ID IN (SELECT AD_Table_ID FROM AD_Ref_Table WHERE AD_Reference_ID = " + fieldRefId + ") ORDER BY SEQNO"; - else - sqlSelect = "SELECT ColumnName, Name FROM AD_Column WHERE AD_Table_ID IN (SELECT AD_Table_ID FROM AD_Table WHERE TableName = '" + columnName.replace("_ID", "") + "') ORDER BY SEQNO"; - - - - if(firstHeaderLine) { - line.addElement(new th()); - m_HeaderSelect = new StringBuffer(columnName); - line.addElement(new th(columnName).setClass("table-filterable table-filtered table-sortable:default")); - m_colCount=1; - } else { - line.addElement(new th("Find")); - filter = new input (input.TYPE_TEXT, columnName+"filter", ""); - filter.setOnKeyUp("Table.filter(this,this)"); - line.addElement(new th().addElement(filter)); - } - - try - { - PreparedStatement pstmt = DB.prepareStatement(sqlSelect.toString(), null); - ResultSet rs = pstmt.executeQuery(); - - - String col; - while (rs.next()){ - col=rs.getString(1); - if(col.equals("Value")||col.equals("DocumentNo")||col.equals("Name")||col.equals("Description")){ - if(firstHeaderLine){ - line.addElement(new th(rs.getString(2)).setClass("table-filterable table-filtered table-sortable:default")); - m_HeaderSelect.append(",").append(col); - m_colCount++; - } - else{ - filter = new input (input.TYPE_TEXT, rs.getString(2)+"filter", ""); - filter.setOnKeyUp("Table.filter(this,this)"); - line.addElement(new th().addElement(filter)); - } - } - } - - rs.close(); - pstmt.close(); - - } - catch (SQLException e) - { - log.log(Level.SEVERE, sqlSelect.toString(), e); - } - return line; - - } // fillTable_Product - -} // WLookup diff --git a/serverApps/src/main/servlet/org/compiere/www/WMenu.java b/serverApps/src/main/servlet/org/compiere/www/WMenu.java deleted file mode 100644 index 8057a1d5e3..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WMenu.java +++ /dev/null @@ -1,620 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.Enumeration; -import java.util.Properties; -import java.util.logging.Level; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.ecs.Element; -import org.apache.ecs.xhtml.a; -import org.apache.ecs.xhtml.base; -import org.apache.ecs.xhtml.body; -import org.apache.ecs.xhtml.head; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.link; -import org.apache.ecs.xhtml.script; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.MForm; -import org.compiere.model.MTree; -import org.compiere.model.MTreeNode; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Login; -import org.compiere.util.Msg; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - -/** - * Web Menu - * - * @author Jorg Janke - * @version $Id: WMenu.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WMenu extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -6357775290362135602L; - - /** Logger */ - protected CLogger log = CLogger.getCLogger (getClass ()); - - /** - * Initialize global variables - * - * @param config - * config - * @throws ServletException - */ - public void init (ServletConfig config) - throws ServletException - { - super.init (config); - if (!WebEnv.initWeb (config)) - throw new ServletException ("WMenu.init"); - } // init - - /** - * Get Servlet information - * - * @return servlet info - */ - public String getServletInfo () - { - return "adempiere Web Menu"; - } // getServletInfo - - /** - * Clean up resources - */ - public void destroy () - { - log.fine("destroy"); - super.destroy (); - } // destroy - - /** */ - private PreparedStatement m_pstmt; - - /*************************************************************************** - * Process the HTTP Get request. - Exit (Logout) - AD_Window_ID Forward to - * Window - * - * @param request - * request - * @param response - * response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.fine("Process Menu Request"); - // Get Parameter: Exit - if (WebUtil.getParameter (request, "Exit") != null) - { - WebUtil.createLoginPage (request, response, this, null, "Exit"); - return; - } - - // Get Session attributes - WebSessionCtx wsc = WebSessionCtx.get(request); - if (wsc.ctx == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - - // Window - int AD_Window_ID = WebUtil.getParameterAsInt(request, "AD_Window_ID"); - - // Forward to WWindow - if (AD_Window_ID != 0) - { - log.fine("AD_Window_ID=" + AD_Window_ID); - // - String url = WebEnv.getBaseDirectory("WWindow?AD_Window_ID=" + AD_Window_ID); - log.fine("Forward to=" + url); - // - RequestDispatcher rd = getServletContext().getRequestDispatcher(url); - rd.forward(request, response); - return; - } - - // Request not serviceable - WebUtil.createErrorPage(request, response, this, "NotImplemented"); - } // doGet - - - /************************************************************************** - * Process the HTTP Post request - Verify Input & Create Menu - * - * @param request request - * @param response response - * @throws ServletException - * @throws IOException - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.fine("doPost - Create Menu"); - - // Get Session attributes - WebSessionCtx wsc = WebSessionCtx.get(request); - if (wsc == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - //Added by Rob Klein 4/29/07 - - //Reset WWindow - WebUtil.getClearFrame(WebEnv.TARGET_WINDOW); - - // Get Parameters: Role, Client, Org, Warehouse, Date - String role = WebUtil.getParameter (request, WLogin.P_ROLE); - String client = WebUtil.getParameter (request, WLogin.P_CLIENT); - String org = WebUtil.getParameter (request, WLogin.P_ORG); - String wh = WebUtil.getParameter (request, WLogin.P_WAREHOUSE); - if (wh == null) - wh = ""; - - // Get context - if (role == null || client == null || org == null) - { - WebUtil.createTimeoutPage(request, response, this, - Msg.getMsg(wsc.ctx, "ParameterMissing")); - return; - } - - // Get Info from Context - User, Role, Client - int AD_User_ID = Env.getAD_User_ID(wsc.ctx); - int AD_Role_ID = Env.getAD_Role_ID(wsc.ctx); - int AD_Client_ID = Env.getAD_Client_ID(wsc.ctx); - // Not available in context yet - Org, Warehouse - int AD_Org_ID = -1; - int M_Warehouse_ID = -1; - - // Get latest info from context - try - { - int req_role = Integer.parseInt(role); - if (req_role != AD_Role_ID) - { - log.fine("AD_Role_ID - changed from " + AD_Role_ID); - AD_Role_ID = req_role; - Env.setContext(wsc.ctx, "#AD_Role_ID", AD_Role_ID); - } - log.fine("AD_Role_ID = " + AD_Role_ID); - // - int req_client = Integer.parseInt(client); - if (req_client != AD_Client_ID) - { - log.fine("AD_Client_ID - changed from " + AD_Client_ID); - AD_Client_ID = req_client; - Env.setContext(wsc.ctx, "#AD_Client_ID", AD_Client_ID); - } - log.fine("AD_Client_ID = " + AD_Client_ID); - // - AD_Org_ID = Integer.parseInt(org); - log.fine("AD_Org_ID = " + AD_Org_ID); - // - if (wh.length() > 0) - { - M_Warehouse_ID = Integer.parseInt(wh); - log.fine("M_Warehouse_ID = " + M_Warehouse_ID); - } - } - catch (Exception e) - { - log.log(Level.SEVERE, "Parameter", e); - WebUtil.createTimeoutPage(request, response, this, - Msg.getMsg(wsc.ctx, "ParameterMissing")); - return; - } - - // Check Login info and set environment - wsc.loginInfo = checkLogin (wsc.ctx, AD_User_ID, AD_Role_ID, - AD_Client_ID, AD_Org_ID, M_Warehouse_ID); - if (wsc.loginInfo == null) - { - WebUtil.createErrorPage (request, response, this, - Msg.getMsg(wsc.ctx, "RoleInconsistent")); - return; - } - - // Set cookie for future defaults - Properties cProp = WebUtil.getCookieProprties (request); - cProp.setProperty(WLogin.P_ROLE, String.valueOf(AD_Role_ID)); - cProp.setProperty(WLogin.P_CLIENT, String.valueOf(AD_Client_ID)); - cProp.setProperty(WLogin.P_ORG, String.valueOf(AD_Org_ID)); - if (M_Warehouse_ID == -1) - cProp.setProperty(WLogin.P_WAREHOUSE, ""); - else - cProp.setProperty(WLogin.P_WAREHOUSE, String.valueOf(M_Warehouse_ID)); - - // Set Date - Timestamp ts = WebUtil.getParameterAsDate (request, WLogin.P_DATE); - if (ts == null) - ts = new Timestamp(System.currentTimeMillis()); - Env.setContext(wsc.ctx, "#Date", ts); // JDBC format - - - // log.printProperties(System.getProperties(), "System"); - // log.printProperties(cProp, "Cookie"); - // log.printProperties(ctx, "Servlet Context"); - // log.printProperties(Env.getCtx(), "Apps Env Context"); - - - // Can we store Cookie ? - if (!cProp.getProperty(WLogin.P_STORE, "N").equals("Y")) - cProp.clear(); - - WebDoc doc = createPage (request, wsc, AD_Role_ID, AD_User_ID, AD_Client_ID, AD_Org_ID); - //Added by Rob Klein 4/29/07 - doc.getBody() - .addElement(WebUtil.getClearFrame(WebEnv.TARGET_WINDOW)); - WebUtil.createResponse (request, response, this, cProp, doc, false); - //WebUtil.createResponse (request, response, this, cProp, doc, true); - } // doPost - - /** - * Check Login information and set context. - * @return true if login info are OK - * @param ctx context - * @param AD_User_ID user - * @param AD_Role_ID role - * @param AD_Client_ID client - * @param AD_Org_ID org - * @param M_Warehouse_ID warehouse - */ - private String checkLogin (Properties ctx, int AD_User_ID, int AD_Role_ID, int AD_Client_ID, int AD_Org_ID, int M_Warehouse_ID) - { - // Get Login Info - String loginInfo = null; - // Verify existance of User/Client/Org/Role and User's acces to Client & Org - String sql = "SELECT u.Name || '@' || c.Name || '.' || o.Name || ' [' || INITCAP(USER) || ']' AS Text " - + "FROM AD_User u, AD_Client c, AD_Org o, AD_User_Roles ur " - + "WHERE u.AD_User_ID=?" // #1 - + " AND c.AD_Client_ID=?" // #2 - + " AND o.AD_Org_ID=?" // #3 - + " AND ur.AD_Role_ID=?" // #4 - + " AND ur.AD_User_ID=u.AD_User_ID" - + " AND (o.AD_Client_ID = 0 OR o.AD_Client_ID=c.AD_Client_ID)" - + " AND c.AD_Client_ID IN (SELECT AD_Client_ID FROM AD_Role_OrgAccess ca WHERE ca.AD_Role_ID=ur.AD_Role_ID)" - + " AND o.AD_Org_ID IN (SELECT AD_Org_ID FROM AD_Role_OrgAccess ca WHERE ca.AD_Role_ID=ur.AD_Role_ID)"; - try - { - PreparedStatement pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, AD_User_ID); - pstmt.setInt(2, AD_Client_ID); - pstmt.setInt(3, AD_Org_ID); - pstmt.setInt(4, AD_Role_ID); - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) - loginInfo = rs.getString(1); - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - - // not verified - if (loginInfo == null) - return null; - - // Set Preferences - KeyNamePair org = new KeyNamePair(AD_Org_ID, String.valueOf(AD_Org_ID)); - KeyNamePair wh = null; - if (M_Warehouse_ID > 0) - wh = new KeyNamePair(M_Warehouse_ID, String.valueOf(M_Warehouse_ID)); - // - Timestamp date = null; - String printer = null; - Login login = new Login(ctx); - login.loadPreferences(org, wh, date, printer); - //Modified by Rob Klein to Show Accounting Tabs 04/29/2007 - // Don't Show Acct/Trl Tabs on HTML UI - //Env.setContext(ctx, "#ShowAcct", "N"); - //Env.setContext(ctx, "#ShowTrl", "N"); - //Env.setContext(ctx, "#ShowAcct", "Y"); - //Env.setContext(ctx, "#ShowTrl", "Y"); - // - return loginInfo; - } // checkLogin - - /** - * Create Menu Page - * @param request request - * @param wsc context - * @param AD_Role_ID role - * @return document - */ - private WebDoc createPage (HttpServletRequest request, - WebSessionCtx wsc, int AD_Role_ID, int AD_User_ID, int AD_Client_ID, int AD_Org_ID) - { - // Document - //Modified by Rob Klein 4/29/07 - //String windowTitle = Msg.getMsg(wsc.ctx, "Menu"); - String windowTitle = "Menu"; - WebDoc doc = WebDoc.create (windowTitle); - head head = doc.getHead(); - // Target - head.addElement(new base().setTarget(WebEnv.TARGET_WINDOW)); - // Specific Menu Script/Stylesheet - head.addElement(new link(WebEnv.getBaseDirectory("/css/menu.css"), link.REL_STYLESHEET, link.TYPE_CSS)); - head.addElement(new script((Element)null, WebEnv.getBaseDirectory("/js/menu.js"))); - head.addElement(new script((Element)null, WebEnv.getBaseDirectory("/js/window.js"))); - //Modified by Rob Klein 4/29/07 - //head.addElement(new script((Element)null, WebEnv.getBaseDirectory("/js/mktree.js"))); - //head.addElement(new link(WebEnv.getBaseDirectory("/css/mktree.css"), link.REL_STYLESHEET, link.TYPE_CSS)); - // Scripts - String statusMessage = Msg.getMsg(wsc.ctx, "SelectMenuItem"); - String scriptTxt = "top.document.title='" + windowTitle + " - " + wsc.loginInfo + "'; " - + "var defaultStatus='" + statusMessage + "';"; - //Rob 12-16-2006 head.addElement(new script(scriptTxt)); - - // Body - - body body = doc.getBody(); - body.setTitle(statusMessage); - // Clear Window Frame - //Rob 12-16-2006 body.addElement(WebUtil.getClearFrame(WebEnv.TARGET_WINDOW)); - - // Header - table table = doc.getTable(); - - doc.setClasses ("menuTable", "menuHeader"); - //Rob 12-16-2006 doc.getTopLeft().addElement(new cite(wsc.loginInfo)); - input txtSearch = new input(input.TYPE_TEXT, "txtSearch", ""); - txtSearch.setOnKeyDown("searchMenu('main',this.value,event,'" + WebEnv.TARGET_WINDOW + "')"); - doc.getTopLeft().addElement("Find: "); - doc.getTopLeft().addElement(txtSearch); - - // Load Menu Structure ---------------------- - int AD_Tree_ID = DB.getSQLValue(null, - "SELECT COALESCE(r.AD_Tree_Menu_ID, ci.AD_Tree_Menu_ID)" - + "FROM AD_ClientInfo ci" - + " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) " - + "WHERE AD_Role_ID=?", AD_Role_ID); - if (AD_Tree_ID <= 0) - AD_Tree_ID = 10; // Menu - log.fine("doPost - AD_Tree_ID=" + AD_Tree_ID + " - " + Env.getAD_Language(wsc.ctx)); - MTree tree = new MTree (wsc.ctx, AD_Tree_ID, false, false, null); // Language set in WLogin - // Trim tree - MTreeNode root = tree.getRoot(); - Enumeration en = root.preorderEnumeration(); - /*while (en.hasMoreElements()) - { - MTreeNode nd = (MTreeNode)en.nextElement(); - if (nd.isTask() - || nd.isWorkbench() - || nd.isWorkFlow() - || nd.getNode_ID() == 383 // Reset Cache - kills the server - ) - { - MTreeNode parent = (MTreeNode)nd.getParent(); - parent.remove(nd); - } - }*/ - tree.trimTree(); - - // Print tree - StringBuffer buf = new StringBuffer(); - StringBuffer buffav = new StringBuffer(); - en = root.preorderEnumeration(); - int oldLevel = 0; - while (en.hasMoreElements()) - { - MTreeNode nd = (MTreeNode)en.nextElement(); - - // Level - int level = nd.getLevel(); // 0 == root - if (level == 0) - continue; - // - while (oldLevel < level) - { - if (level == 1) - buf.append("
          \n"); // start first level - else - buf.append("
            \n");// start next level - oldLevel++; - } - while (oldLevel > level) - { - oldLevel--; - if (oldLevel == 1) - buf.append("
          \n"); // finish last level - else - buf.append("
        \n"); // finish next level - } - - // Print Node - buf.append(printNode(nd, wsc.ctx)); - //Modified by Rob Klein 4/29/07 - if (nd.isOnBar()) - buffav.append(printNode(nd, wsc.ctx)); - } - // Final - while (oldLevel > 0) - { - oldLevel--; - if (oldLevel == 1) - buf.append("\n"); // finish last level - else - buf.append("\n"); // finish next level - } - - //Modified by Rob Klein 4/29/07 - // Set Favorites - buf.append("
        • Favorites
            \n"); - buf.append(buffav); - buf.append("
        \n"); - - - - td td = new td().setColSpan(2).setNoWrap(true); - td.setClass("menuCenter"); - td.addElement(buf.toString()); - table.addElement(new tr().addElement(td)); - - // Expand/Collapse Info - td = new td().setColSpan(2); - td.setClass("menuFooter"); - // Modified by Rob Klein 4/29/07 - /**td.addElement(new a("javascript:expandTree('main');", "Expand Menu")); - td.addElement(" | "); - td.addElement( new a("javascript:collapseTree('main');", "Contract Menu")); - table.addElement(new tr().addElement(td)); - **/ - - // Exit Info - td = new td().setColSpan(2); - td.setClass("menuFooter"); - String url = request.getRequestURI() + "?Exit=true"; - td.addElement(new a(url, Msg.getMsg(wsc.ctx, "Exit"))); - table.addElement(new tr().addElement(td)); - // - // System.out.println(doc); - return doc; - } // createPage - - - /** - * Print Menu Item - * @param node node - * @param ctx context - * @return string with node - */ - private StringBuffer printNode (MTreeNode node, Properties ctx) - { - StringBuffer sb = new StringBuffer(); - - // Leaf - if (!node.isSummary()) - { - /** - * - */ - String cssClassName = ""; - String servletName = ""; - if (node.isWindow()) - { - cssClassName = "menuWindow"; - servletName = "WWindow"; - } - else if (node.isForm()) - { - cssClassName = "menuWindow"; - servletName = "WForm"; - } - else if (node.isReport()) - { - cssClassName = "menuReport"; - servletName = "WProcess"; - } - else if (node.isProcess()) - { - cssClassName = "menuProcess"; - servletName = "WProcess"; - } - else if (node.isWorkFlow()) - { - cssClassName = "menuWorkflow"; - servletName = "WWorkflow"; - } - else if (node.isTask()) - { - cssClassName = "menuProcess"; - servletName = "WTask"; - } - else - servletName = "WError"; - - String name = node.getName().replace('\'',' ').replace('"',' '); - String description = node.getDescription().replace('\'',' ').replace('"',' '); - // - sb.append("
      • 0) - { - sb.append(form.getJSPURL()); - standardURL = false; - } - } - if (standardURL) // url = /appl/servletName?AD_Menu_ID=x - { - sb.append(WebEnv.getBaseDirectory(servletName)) - .append("?AD_Menu_ID=") - .append(node.getNode_ID()); - } - // remaining a tag - sb.append("\" title=\"" + description - + "\" onClick=\"showLoadingWindow('" + WebEnv.getBaseDirectory("") + "')\">") - .append(name) // language set in MTree.getNodeDetails based on ctx - .append("
      • \n"); - } - else - { - /** - *
      • MenuEntry - *
          - * .... - *
      • - */ - String name = node.getName().replace('\'',' ').replace('"',' '); - sb.append("\n
      • ") // summary node - .append(name) - .append("\n"); - } - return sb; - } // printNode - - -} // WMenu diff --git a/serverApps/src/main/servlet/org/compiere/www/WProcess.java b/serverApps/src/main/servlet/org/compiere/www/WProcess.java deleted file mode 100644 index db50c5e220..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WProcess.java +++ /dev/null @@ -1,1089 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.File; -import java.io.IOException; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.ecs.AlignType; -import org.apache.ecs.Element; -import org.apache.ecs.xhtml.form; -import org.apache.ecs.xhtml.i; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.option; -import org.apache.ecs.xhtml.p; -import org.apache.ecs.xhtml.select; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.GridTab; -import org.compiere.model.MAllocationHdr; -import org.compiere.model.MBankStatement; -import org.compiere.model.MInOut; -import org.compiere.model.MInventory; -import org.compiere.model.MInvoice; -import org.compiere.model.MJournal; -import org.compiere.model.MJournalBatch; -import org.compiere.model.MMovement; -import org.compiere.model.MOrder; -import org.compiere.model.MPInstance; -import org.compiere.model.MPInstancePara; -import org.compiere.model.MPayment; -import org.compiere.model.MProcess; -import org.compiere.model.MProcessPara; -import org.compiere.print.ReportEngine; -import org.compiere.process.DocumentEngine; -import org.compiere.process.ProcessInfo; -import org.compiere.util.ASyncProcess; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Trx; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; -import org.compiere.wf.MWFActivity; - - -/** - * HTML Process and Report UI - * - * @author Jorg Janke - * @version $Id: WProcess.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WProcess extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 3937980012432969521L; - - /** Logger */ - protected CLogger log = CLogger.getCLogger(getClass()); - //Modified by Rob Klein 4/29/07 - private String errorMessage = null; - private static String[] s_value = null; - private static String[] s_name; - private static String[] s_description; - - /** - * Initialize global variables - * @param config - * @throws ServletException - */ - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WProcess.init"); - } // init - - /** - * Process the HTTP Get request. - * Initial Call - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - // Get Session attributes - - WebSessionCtx wsc = WebSessionCtx.get(request); - //Modified by Rob Klein 4/29/07 - WWindowStatus ws = WWindowStatus.get(request); - if (wsc == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - - WebDoc doc = null; - // Get Parameter: Menu_ID - //Modified by Rob Klein 4/29/07 - int AD_Menu_ID = WebUtil.getParameterAsInt(request, "AD_Menu_ID"); - String fileName = WebUtil.getParameter(request, "File"); - if (AD_Menu_ID > 0) - { - - doc = createParameterPage(wsc, AD_Menu_ID,0,0,0,0,null,null); - } - //else if (fileName!=null) - //{ - // int AD_PInstance_ID = WebUtil.getParameterAsInt(request, "AD_PInstance_ID"); - // - // String error = streamResult (request, response, AD_PInstance_ID, fileName); - // if (error == null) - // return; - // doc = WebDoc.createWindow(error); - //} - else - { - int AD_Process_ID = WebUtil.getParameterAsInt(request, "AD_Process_ID"); - int AD_Window_ID = WebUtil.getParameterAsInt(request, "AD_Window_ID"); - int AD_Table_ID = WebUtil.getParameterAsInt(request, "AD_Table_ID"); - int AD_Record_ID = WebUtil.getParameterAsInt(request, "AD_Record_ID"); - String columnName = WebUtil.getParameter(request, "columnName"); - int AD_Tab_ID = WebUtil.getParameterAsInt(request, "AD_Tab_ID"); - if (AD_Process_ID == 0) - { - WebUtil.createErrorPage(request, response, this, "No Process"); - return; - } - - doc = createParameterPage(wsc, AD_Process_ID,AD_Window_ID,AD_Table_ID,AD_Record_ID,1, - columnName,ws.curTab); - - } - if (doc == null) - doc = WebDoc.createWindow("Process Not Found"); - - // - WebUtil.createResponse(request, response, this, null, doc, true); - } // doGet - - - /** - * Process the HTTP Post request. - * Get Parameters and Process - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - // Get Session attributes - WebSessionCtx wsc = WebSessionCtx.get(request); - if (wsc == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - int AD_Process_ID = WebUtil.getParameterAsInt(request, "AD_Process_ID"); - //Modified by Rob Klein 4/29/07 - int AD_Window_ID = WebUtil.getParameterAsInt(request, "AD_Window_ID"); - int AD_Table_ID = WebUtil.getParameterAsInt(request, "AD_Table_ID"); - int AD_Record_ID = WebUtil.getParameterAsInt(request, "AD_Record_ID"); - - - if (AD_Process_ID == 0) - { - WebUtil.createErrorPage(request, response, this, "No Process"); - return; - } - //Modified by Rob Klein 6/01/07 - //WebDoc doc = createProcessPage(request, AD_Process_ID, AD_Window_ID); - createProcessPage(request, response, AD_Process_ID, AD_Window_ID); - // - - } // doPost - - //Modified by Rob Klein 4/29/07 - /************************************************************************** - * Create Parameter Page - * @param wsc web session context - * @param AD_Menu_ID Menu - * @return Page - */ - private WebDoc createParameterPage (WebSessionCtx wsc, int processId, int windowID,int tableID,int recordID,int Type, - String columnName, GridTab mTab) - { - MProcess process = null; - if (Type == 0) - process = MProcess.getFromMenu (wsc.ctx, processId); - else - process = MProcess.get(wsc.ctx, processId); - - // need to check if Role can access - if (process == null) - { - WebDoc doc = WebDoc.createWindow("Process Not Found"); - return doc; - } - //Modified by Rob Klein 4/29/07 - WebDoc doc = WebDoc.createWindow(process.getName()); - if (process.isWorkflow()) - { - //Modified by Rob Klein 7/01/07 - if (mTab == null) - { - doc = WebDoc.createWindow("No Tab found"); - return doc; - } - - // Pop up Document Action (Workflow) - if (columnName.toString().equals("DocAction")) { - - readReference(); - - option[] Options = dynInit( windowID, tableID, recordID, - columnName, mTab); - - td center = doc.addWindowCenter(false); - - WebField wField = new WebField (wsc, - columnName, columnName, columnName, - // no display length - 17, 22, 22, false, - // not r/o, ., not error, not dependent - false, false, false, false, false, processId, - 0, 0, 0, 0, null, null, null, null, null); - - if (process.getDescription() != null) - center.addElement(new p(new i(process.getDescription()))); - if (process.getHelp() != null) - center.addElement(new p(process.getHelp(), AlignType.LEFT)); - form myForm = new form ("WProcess") - .setName("process" + process.getAD_Process_ID()); - - myForm.setTarget("WPopup"); - //myForm.setOnSubmit("this.Submit.disabled=true;return true;"); - myForm.addElement(new input(input.TYPE_HIDDEN, "AD_Process_ID", process.getAD_Process_ID())); - myForm.addElement(new input(input.TYPE_HIDDEN, "AD_Window_ID", windowID)); - myForm.addElement(new input(input.TYPE_HIDDEN, "AD_Table_ID", tableID)); - myForm.addElement(new input(input.TYPE_HIDDEN, "AD_Record_ID", recordID)); - table myTable = new table("0", "0", "5", "100%", null); - myTable.setID("WProcessParameter"); - - myTable.addElement(new tr() - .addElement(wField.getLabel()) - .addElement(createSelectField(columnName,Options))); - - - // Reset - String text = "Reset"; - if (wsc.ctx != null) - text = Msg.getMsg (wsc.ctx, "Reset"); - input restbtn = new input(input.TYPE_RESET, text, " "+text); - restbtn.setID(text); - restbtn.setClass("resetbtn"); - - // Submit - text = "Submit"; - if (wsc.ctx != null) - text = Msg.getMsg (wsc.ctx, "Submit"); - input submitbtn = new input(input.TYPE_SUBMIT, text, " "+text); - submitbtn.setID(text); - submitbtn.setClass("submitbtn"); - - myTable.addElement(new tr() - .addElement(new td(null, AlignType.RIGHT, AlignType.MIDDLE, false, - restbtn)) - .addElement(new td(null, AlignType.LEFT, AlignType.MIDDLE, false, - submitbtn )) - .addElement(new td(null, AlignType.RIGHT, AlignType.MIDDLE, false, - null))); - myForm.addElement(myTable); - center.addElement(myForm); - - } // DocAction - - } - else{ - - td center = doc.addWindowCenter(false); - if (process.getDescription() != null) - center.addElement(new p(new i(process.getDescription()))); - if (process.getHelp() != null) - center.addElement(new p(process.getHelp(), AlignType.LEFT)); - // - form myForm = new form ("WProcess") - .setName("process" + process.getAD_Process_ID()); - myForm.setTarget("WPopup"); - //myForm.setOnSubmit("this.Submit.disabled=true;return true;"); - myForm.addElement(new input(input.TYPE_HIDDEN, "AD_Process_ID", process.getAD_Process_ID())); - myForm.addElement(new input(input.TYPE_HIDDEN, "AD_Window_ID", windowID)); - myForm.addElement(new input(input.TYPE_HIDDEN, "AD_Table_ID", tableID)); - myForm.addElement(new input(input.TYPE_HIDDEN, "AD_Record_ID", recordID)); - table myTable = new table("0", "0", "5", "100%", null); - myTable.setID("WProcessParameter"); - MProcessPara[] parameter = process.getParameters(); - - for (int i = 0; i < parameter.length; i++) - { - MProcessPara para = parameter[i]; - WebField wField = new WebField (wsc, - para.getColumnName(), para.getName(), para.getDescription(), - // no display length - para.getAD_Reference_ID(), para.getFieldLength(), para.getFieldLength(), false, - // not r/o, ., not error, not dependent - false, para.isMandatory(), false, false, false, para.getAD_Process_ID(), - 0,0,0,i, null,null, null,null, null); - - WebField wFieldforRange = null; - - if(para.isRange()) - wFieldforRange = new WebField (wsc, - para.getColumnName(), para.getName(), para.getDescription(), - // no display length - para.getAD_Reference_ID(), para.getFieldLength(), para.getFieldLength(), false, - // not r/o, ., not error, not dependent - false, para.isMandatory(), false, false, false, para.getAD_Process_ID(),0,0,0,i+1, - null,null, null,null, null); - - td toField = para.isRange() - ? wFieldforRange.getField(para.getLookup(), para.getDefaultValue2()) - : new td(WebEnv.NBSP); - - // Add to Table - myTable.addElement(new tr() - .addElement(wField.getLabel()) - .addElement(wField.getField(para.getLookup(), para.getDefaultValue())) - .addElement(toField)); - } - - // Reset - String text = "Reset"; - if (wsc.ctx != null) - text = Msg.getMsg (wsc.ctx, "Reset"); - input restbtn = new input(input.TYPE_RESET, text, " "+text); - restbtn.setID(text); - restbtn.setClass("resetbtn"); - - // Submit - text = "Submit"; - if (wsc.ctx != null) - text = Msg.getMsg (wsc.ctx, "Submit"); - input submitbtn = new input(input.TYPE_SUBMIT, text, " "+text); - submitbtn.setID(text); - submitbtn.setClass("submitbtn"); - submitbtn.setOnClick("popUp('WProcess','WPopup')"); - - myTable.addElement(new tr() - .addElement(new td(null, AlignType.RIGHT, AlignType.MIDDLE, false, - restbtn)) - .addElement(new td(null, AlignType.LEFT, AlignType.MIDDLE, false, - submitbtn )) - .addElement(new td(null, AlignType.RIGHT, AlignType.MIDDLE, false, - null))); - myForm.addElement(myTable); - center.addElement(myForm); - } - return doc; - } // createParameterPage - -//Modified by Rob klein 4/29/07 - /************************************************************************** - * Create Parocess Page - * @param request request - * @param AD_Process_ID Process - * @return Page - */ - public void createProcessPage (HttpServletRequest request, HttpServletResponse response, int AD_Process_ID, int AD_Window_ID) - { - WebSessionCtx wsc = WebSessionCtx.get (request); - MProcess process = MProcess.get (wsc.ctx, AD_Process_ID); - log.info("PI table id "+process.get_Table_ID()); - log.info("PI table name id "+process.get_TableName()); - log.info("PI table client id "+process.getAD_Client_ID()); - log.info("PI table process id "+process.getAD_Process_ID()); - log.info("PI process class name "+process.getClassname()); - - // need to check if Role can access - WebDoc doc = null; - if (process == null) - { - doc = WebDoc.createWindow("Process Not Found"); - - } - else{ - doc = WebDoc.createWindow(process.getName()); - td center = doc.addWindowCenter(false); - if (process.getDescription() != null) - center.addElement(new p(new i(process.getDescription()))); - if (process.getHelp() != null) - center.addElement(new p(process.getHelp(), AlignType.LEFT)); - - // Create Process Instance - MPInstance pInstance = fillParameter (request, process); - // - - int AD_Table_ID = WebUtil.getParameterAsInt(request, "AD_Table_ID"); - int AD_Record_ID = WebUtil.getParameterAsInt(request, "AD_Record_ID"); - - - ProcessInfo pi = new ProcessInfo (process.getName(), process.getAD_Process_ID(), AD_Table_ID, AD_Record_ID); - pi.setAD_User_ID(Env.getAD_User_ID(wsc.ctx)); - pi.setAD_Client_ID(Env.getAD_Client_ID(wsc.ctx)); - pi.setClassName(process.getClassname()); - log.info("PI client id "+pi.getAD_Client_ID()); - pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID()); - - // Info - p p = new p(); - p.addElement(Msg.translate(wsc.ctx, "AD_PInstance_ID") + ": " + pInstance.getAD_PInstance_ID()); - center.addElement(p); - - // Start - boolean processOK = false; - if (process.isWorkflow()) - { - Trx trx = Trx.get(Trx.createTrxName("WebPrc"), true); - try - { - WProcessCtl.process(this, AD_Window_ID, pi, trx, request); - //processOK = process.processIt(pi, trx); - trx.commit(); - trx.close(); - } - catch (Throwable t) - { - trx.rollback(); - trx.close(); - } - if ( pi.isError()) - { - center.addElement(new p("Error:" + pi.getSummary(), - AlignType.LEFT).setClass("Cerror")); - processOK = false; - } - else - { - center.addElement(new p("OK: Workflow Started", - AlignType.LEFT)); - processOK = true; - } - center.addElement(new p().addElement(pi.getSummary())); - center.addElement(pi.getLogInfo(true)); - } - - String jasper=process.getJasperReport(); - if (process.isJavaProcess()) - { - if (jasper!=null) { - pi.setPrintPreview (false); - pi.setIsBatch(true); - } - Trx trx = Trx.get(Trx.createTrxName("WebPrc"), true); - try - { - processOK = process.processIt(pi, trx); - trx.commit(); - trx.close(); - } - catch (Throwable t) - { - trx.rollback(); - trx.close(); - } - if (!processOK || pi.isError()) - { - center.addElement(new p("Error:" + pi.getSummary(), - AlignType.LEFT).setClass("Cerror")); - processOK = false; - } else { - if(jasper!=null) { - String error = WebUtil.streamFile(response, pi.getPDFReport()); - //String error = streamResult (request, response, pInstance.getAD_PInstance_ID(), file); - if (error == null) - return; - doc = WebDoc.create(error); - wsc.ctx.put("AD_PInstance_ID=" + pInstance.getAD_PInstance_ID(), "ok"); - } else { - center.addElement(new p().addElement(pi.getSummary())); - center.addElement(pi.getLogInfo(true)); - } - } - } - - // Report - if (process.isReport()) - //if (processOK && process.isReport()) - { - //doc = null; - - - - if(jasper==null) { - log.info(response.toString()); - ReportEngine re = ReportEngine.get(wsc.ctx, pi); - if (re == null) - { - center.addElement(new p("Could not start ReportEngine", - AlignType.LEFT).setClass("Cerror")); - } - else - { - try - { - File file = File.createTempFile("WProcess", ".pdf"); - boolean ok = re.createPDF(file); - if (ok) - { - String error = WebUtil.streamFile(response, file); - //String error = streamResult (request, response, pInstance.getAD_PInstance_ID(), file); - if (error == null) - return; - doc = WebDoc.create(error); - - //Modified by Rob Klein 6/1/07 - /** - String url = "WProcess?AD_PInstance_ID=" - + pInstance.getAD_PInstance_ID() - + "&File=" - + URLEncoder.encode(file.getAbsolutePath(), WebEnv.ENCODING); - a link = new a (url, null, a.TARGET_BLANK, process.getName()); - center - .addElement(new p() - .addElement("Report created: ") - .addElement(link)); - // Marker that Process is OK - * */ - wsc.ctx.put("AD_PInstance_ID=" + pInstance.getAD_PInstance_ID(), "ok"); - - } - else - center.addElement(new p("Could not create Report", - AlignType.LEFT).setClass("Cerror")); - } - catch (Exception e) - { - center.addElement(new p("Could not create Report:", - AlignType.LEFT).setClass("Cerror")); - center.addElement(e.toString()); - } - } - } - } - } - doc.addPopupClose(wsc.ctx); - - try { - WebUtil.createResponse(request, response, this, null, doc, false); - } catch (IOException e) { - log.info(e.toString()); - } - } // createProcessPage - - private ASyncProcess ASyncProcess(WProcess process) { - // TODO Auto-generated method stub - return null; - } - - /** - * Fill Parameter - * @param request request - * @param process process - * @return process instance - */ - private MPInstance fillParameter(HttpServletRequest request, MProcess process) - { - MPInstance pInstance = new MPInstance (process, 0); - // - MPInstancePara[] iParams = pInstance.getParameters(); - for (int pi = 0; pi < iParams.length; pi++) - { - MPInstancePara iPara = iParams[pi]; - String key = iPara.getParameterName(); - MProcessPara pPara = process.getParameter(key); - if (pPara == null) - { - log.log(Level.SEVERE, "Parameter not found: " + key); - continue; - } - - String valueString = WebUtil.getParameter (request, key); - log.fine("fillParameter - " + key + " = " + valueString); - Object value = valueString; - if (valueString != null && valueString.length() == 0) - value = null; - // No Value - if (value == null) - { - // if (pPara.isMandatory()) - // log.log(Level.WARNING,"fillParameter - " + key - // + " - empty - mandatory!"); - } - else - { - // Convert to Type - try - { - if (DisplayType.isNumeric(pPara.getAD_Reference_ID()) - || DisplayType.isID(pPara.getAD_Reference_ID())) - { - BigDecimal bd = null; - if (value instanceof BigDecimal) - bd = (BigDecimal)value; - else if (value instanceof Integer) - bd = new BigDecimal (((Integer)value).intValue()); - else - bd = new BigDecimal (value.toString()); - iPara.setP_Number(bd); - log.fine("fillParameter - " + key - + " = " + valueString + " (=" + bd + "=)"); - } - else if (DisplayType.isDate(pPara.getAD_Reference_ID())) - { - Timestamp ts = null; - if (value instanceof Timestamp) - ts = (Timestamp)value; - else - ts = Timestamp.valueOf(value.toString()); - iPara.setP_Date(ts); - log.fine("fillParameter - " + key - + " = " + valueString + " (=" + ts + "=)"); - } - else - { - iPara.setP_String(value.toString()); - } - // - iPara.save(); - } - catch (Exception e) - { - log.warning("fillParameter - " + key - + " = " + valueString + " (" + value - + ") " + value.getClass().getName() - + " - " + e.getLocalizedMessage()); - } - } // not null - } // instance parameter loop - - return pInstance; - } // fillParameter - - /** - * Stream Result - * @param request request - * @param response response - * @param AD_PInstance_ID instance id - * @param fileName file to stream - * @return message - */ - private String streamResult (HttpServletRequest request, HttpServletResponse response, - int AD_PInstance_ID, File file) - { - if (AD_PInstance_ID == 0) - return "Your process not found"; - WebSessionCtx wsc = WebSessionCtx.get (request); - Object value = wsc.ctx.get("AD_PInstance_ID=" + AD_PInstance_ID); - if (value == null || !value.equals("ok")) - return "Process Instance not found"; - // - if (file == null || file.length() == 0) - return "No Process Result"; - //File file = new File (fileName); - if (!file.exists()) - return "Process Result not found: " + file; - // OK - return WebUtil.streamFile(response, file); - } // streamResult - -//Modidifed by Rob Klein 4/29/07 - - /** - * Dynamic Init - determine valid DocActions based on DocStatus for the different documents. - *
        -	 *  DocStatus (131)
        -			??                         Unknown
        -			AP *                       Approved
        -			CH                         Changed
        -			CL *                       Closed
        -			CO *                       Completed
        -			DR                         Drafted
        -			IN                         Inactive
        -			NA                         Not Approved
        -			PE                         Posting Error
        -			PO *                       Posted
        -			PR *                       Printed
        -			RE                         Reversed
        -			TE                         Transfer Error
        -			TR *                       Transferred
        -			VO *                       Voided
        -			XX                         Being Processed
        -	 *
        -	 *   DocAction (135)
        -			--                         
        -			AP *                       Approve
        -			CL *                       Close
        -			CO *                       Complete
        -			PO *                       Post
        -			PR *                       Print
        -			RA                         Reverse - Accrual
        -			RC                         Reverse - Correction
        -			RE                         RE-activate
        -			RJ                         Reject
        -			TR *                       Transfer
        -			VO *                       Void
        -			XL                         Unlock
        -	 *  
        - * @param Record_ID id - */ - private option[] dynInit(int m_WindowNo,int m_AD_Table_ID,int Record_ID, - String columnName, GridTab m_mTab) - { - String DocStatus = (String)m_mTab.getValue("DocStatus"); - String DocAction = (String)m_mTab.getValue("DocAction"); - // - Object Processing = m_mTab.getValue("Processing"); - String OrderType = Env.getContext(Env.getCtx(), m_WindowNo, "OrderType"); - String IsSOTrx = Env.getContext(Env.getCtx(), m_WindowNo, "IsSOTrx"); - - option[] optionsret = new option[0]; - String[] list = new String [s_value.length]; - - - if (DocStatus == null) - { - errorMessage = "Document Status is Null"; - return optionsret; - } - - log.fine("DocStatus=" + DocStatus - + ", DocAction=" + DocAction + ", OrderType=" + OrderType - + ", IsSOTrx=" + IsSOTrx + ", Processing=" + Processing - + ", AD_Table_ID=" + m_AD_Table_ID + ", Record_ID=" + Record_ID); - // - - int index = 0; - - /** - * Check Existence of Workflow Acrivities - */ - String wfStatus = MWFActivity.getActiveInfo(Env.getCtx(), m_AD_Table_ID, Record_ID); - if (wfStatus != null) - { - errorMessage = wfStatus; - return optionsret; - } - - // Status Change - if (!checkStatus(m_mTab.getTableName(), Record_ID, DocStatus)) - { - errorMessage = "DocumentStatusChanged"; - return optionsret; - } - - /******************* - * General Actions - */ - - // Locked - if (Processing != null) - { - boolean locked = "Y".equals(Processing); - if (!locked && Processing instanceof Boolean) - locked = ((Boolean)Processing).booleanValue(); - if (locked) - list[index++]= DocumentEngine.ACTION_Unlock; - } - - // Approval required .. NA - if (DocStatus.equals(DocumentEngine.STATUS_NotApproved)) - { - list[index++]= (DocumentEngine.ACTION_Prepare); - list[index++]= (DocumentEngine.ACTION_Void); - } - // Draft/Invalid .. DR/IN - else if (DocStatus.equals(DocumentEngine.STATUS_Drafted) - || DocStatus.equals(DocumentEngine.STATUS_Invalid)) - { - list[index++]= (DocumentEngine.ACTION_Complete); - // options[index++] = (DocumentEngine.ACTION_Prepare); - list[index++]= (DocumentEngine.ACTION_Void); - } - // In Process .. IP - else if (DocStatus.equals(DocumentEngine.STATUS_InProgress) - || DocStatus.equals(DocumentEngine.STATUS_Approved)) - { - list[index++]= (DocumentEngine.ACTION_Complete); - list[index++]= (DocumentEngine.ACTION_Void); - } - // Complete .. CO - else if (DocStatus.equals(DocumentEngine.STATUS_Completed)) - { - list[index++]= (DocumentEngine.ACTION_Close); - } - // Waiting Payment - else if (DocStatus.equals(DocumentEngine.STATUS_WaitingPayment) - || DocStatus.equals(DocumentEngine.STATUS_WaitingConfirmation)) - { - list[index++]= (DocumentEngine.ACTION_Void); - list[index++]= (DocumentEngine.ACTION_Prepare); - } - // Closed, Voided, REversed .. CL/VO/RE - else if (DocStatus.equals(DocumentEngine.STATUS_Closed) - || DocStatus.equals(DocumentEngine.STATUS_Voided) - || DocStatus.equals(DocumentEngine.STATUS_Reversed)) - return optionsret; - - /******************** - * Order - */ - if (m_AD_Table_ID == MOrder.Table_ID) - { - // Draft .. DR/IP/IN - if (DocStatus.equals(DocumentEngine.STATUS_Drafted) - || DocStatus.equals(DocumentEngine.STATUS_InProgress) - || DocStatus.equals(DocumentEngine.STATUS_Invalid)) - { - list[index++]= (DocumentEngine.ACTION_Prepare); - list[index++]= (DocumentEngine.ACTION_Close); - // Draft Sales Order Quote/Proposal - Process - if ("Y".equals(IsSOTrx) - && ("OB".equals(OrderType) || "ON".equals(OrderType))) - DocAction = DocumentEngine.ACTION_Prepare; - } - // Complete .. CO - else if (DocStatus.equals(DocumentEngine.STATUS_Completed)) - { - list[index++]= (DocumentEngine.ACTION_Void); - list[index++]= (DocumentEngine.ACTION_ReActivate); - } - else if (DocStatus.equals(DocumentEngine.STATUS_WaitingPayment)) - { - list[index++]= (DocumentEngine.ACTION_ReActivate); - list[index++]= (DocumentEngine.ACTION_Close); - } - } - /******************** - * Shipment - */ - else if (m_AD_Table_ID == MInOut.Table_ID) - { - // Complete .. CO - if (DocStatus.equals(DocumentEngine.STATUS_Completed)) - { - list[index++]= (DocumentEngine.ACTION_Void); - list[index++]= (DocumentEngine.ACTION_Reverse_Correct); - } - } - /******************** - * Invoice - */ - else if (m_AD_Table_ID == MInvoice.Table_ID) - { - // Complete .. CO - if (DocStatus.equals(DocumentEngine.STATUS_Completed)) - { - list[index++]= (DocumentEngine.ACTION_Void); - list[index++]= (DocumentEngine.ACTION_Reverse_Correct); - } - } - /******************** - * Payment - */ - else if (m_AD_Table_ID == MPayment.Table_ID) - { - // Complete .. CO - if (DocStatus.equals(DocumentEngine.STATUS_Completed)) - { - list[index++]= (DocumentEngine.ACTION_Void); - list[index++]= (DocumentEngine.ACTION_Reverse_Correct); - } - } - /******************** - * GL Journal - */ - else if (m_AD_Table_ID == MJournal.Table_ID || m_AD_Table_ID == MJournalBatch.Table_ID) - { - // Complete .. CO - if (DocStatus.equals(DocumentEngine.STATUS_Completed)) - { - list[index++]= (DocumentEngine.ACTION_Reverse_Correct); - list[index++]= (DocumentEngine.ACTION_Reverse_Accrual); - } - } - /******************** - * Allocation - */ - else if (m_AD_Table_ID == MAllocationHdr.Table_ID) - { - // Complete .. CO - if (DocStatus.equals(DocumentEngine.STATUS_Completed)) - { - list[index++]= (DocumentEngine.ACTION_Void); - list[index++]= (DocumentEngine.ACTION_Reverse_Correct); - } - } - /******************** - * Bank Statement - */ - else if (m_AD_Table_ID == MBankStatement.Table_ID) - { - // Complete .. CO - if (DocStatus.equals(DocumentEngine.STATUS_Completed)) - { - list[index++]= (DocumentEngine.ACTION_Void); - } - } - /******************** - * Inventory Movement, Physical Inventory - */ - else if (m_AD_Table_ID == MMovement.Table_ID - || m_AD_Table_ID == MInventory.Table_ID) - { - // Complete .. CO - if (DocStatus.equals(DocumentEngine.STATUS_Completed)) - { - list[index++] = (DocumentEngine.ACTION_Void); - list[index++] = (DocumentEngine.ACTION_Reverse_Correct); - } - - } - - - option[] options = new option[index]; - /** - * Add Name to options - */ - for (int i = 0; i < index; i++) - { - // Serach for option and add it - boolean added = false; - for (int j = 0; j < s_value.length && !added; j++) - { - if (list[i].equals(s_value[j])) - { - options[i] = new option(list[i]).addElement(s_name[j]); - added = true; - if (DocAction.equals(s_value[i])) - options[i].setSelected(true); - } - } - } - - return options; - } // dynInit - - /** - * Fill Vector with DocAction Ref_List(135) values - */ - private void readReference() - { - String sql; - if (Env.isBaseLanguage(Env.getCtx(), "AD_Ref_List")) - sql = "SELECT Value, Name, Description FROM AD_Ref_List " - + "WHERE AD_Reference_ID=135 ORDER BY Name"; - else - sql = "SELECT l.Value, t.Name, t.Description " - + "FROM AD_Ref_List l, AD_Ref_List_Trl t " - + "WHERE l.AD_Ref_List_ID=t.AD_Ref_List_ID" - + " AND t.AD_Language='" + Env.getAD_Language(Env.getCtx()) + "'" - + " AND l.AD_Reference_ID=135 ORDER BY t.Name"; - - ArrayList v_value = new ArrayList(); - ArrayList v_name = new ArrayList(); - ArrayList v_description = new ArrayList(); - try - { - PreparedStatement pstmt = DB.prepareStatement(sql, null); - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) - { - String value = rs.getString(1); - String name = rs.getString(2); - String description = rs.getString(3); - if (description == null) - description = ""; - // - v_value.add(value); - v_name.add(name); - v_description.add(description); - } - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - - // convert to arrays - int size = v_value.size(); - s_value = new String[size]; - s_name = new String[size]; - s_description = new String[size]; - for (int i = 0; i < size; i++) - { - s_value[i] = (String)v_value.get(i); - s_name[i] = (String)v_name.get(i); - s_description[i] = (String)v_description.get(i); - } - } // readReference - - /** - * Check Status Change - * @param TableName table name - * @param Record_ID record - * @param DocStatus current doc status - * @return true if status not changed - */ - private boolean checkStatus (String TableName, int Record_ID, String DocStatus) - { - String sql = "SELECT 2 FROM " + TableName - + " WHERE " + TableName + "_ID=" + Record_ID - + " AND DocStatus='" + DocStatus + "'"; - int result = DB.getSQLValue(null, sql); - return result == 2; - } // checkStatusChange - - /** - * Get Select Field - * @param lookup lookup - * @param dataValue default value - * @return selction td - */ - private td createSelectField (String m_columnName, option[] options) - { - select sel = new select(m_columnName, options); - sel.setID(m_columnName); - sel.setDisabled(false); - sel.setClass("Cmandatory"); - - // - return createTD(sel); - - } // getSelectField - /** - * Create Left Top aligned TD - * @param element element - * @return td table data - */ - private td createTD (Element element) - { - td td = new td() - .addElement(element) - .setAlign(AlignType.LEFT) - .setVAlign(AlignType.TOP); - return td; - } // createTD - -} // WProcess diff --git a/serverApps/src/main/servlet/org/compiere/www/WProcessCtl.java b/serverApps/src/main/servlet/org/compiere/www/WProcessCtl.java deleted file mode 100644 index a92fd7a98d..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WProcessCtl.java +++ /dev/null @@ -1,512 +0,0 @@ -/****************************************************************************** - * Product: Compiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.*; -import java.lang.reflect.*; -import java.sql.*; -import java.util.Properties; -import java.util.logging.*; - -import javax.servlet.http.HttpServletRequest; - -import org.compiere.apps.Waiting; -import org.compiere.db.*; -import org.compiere.interfaces.*; -import org.compiere.model.*; -import org.compiere.print.*; -import org.compiere.process.*; -import org.compiere.util.*; -import org.compiere.wf.*; - -/** - * Process Interface Controller. - * - * @author Jorg Janke - * @version $Id: WProcessCtl.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WProcessCtl extends Thread -{ - /** - * Async Process - Do it all. - * - * - Get Instance ID - * - Get Parameters - * - execute (lock - start process - unlock) - * - * Creates a ProcessCtl instance, which calls - * lockUI and unlockUI if parent is a ASyncProcess - *
        - * Called from ProcessCtl.startProcess, ProcessDialog.actionPerformed, - * APanel.cmd_print, APanel.actionButton, VPaySelect.cmd_generate - * - * @param parent ASyncProcess & Container - * @param WindowNo window no - * @param pi ProcessInfo process info - * @param trx Transaction - * @return worker started ProcessCtl instance or null for workflow - */ - public static WProcessCtl process (Object parent, int WindowNo, ProcessInfo pi, Trx trx, HttpServletRequest request) - { - log.fine("WindowNo=" + WindowNo + " - " + pi); - WebSessionCtx wsc = WebSessionCtx.get (request); - MPInstance instance = new MPInstance(wsc.ctx, pi.getAD_Process_ID(), pi.getRecord_ID()); - - if (!instance.save()) - { - pi.setSummary (Msg.getMsg(wsc.ctx, "ProcessNoInstance")); - pi.setError (true); - return null; - } - pi.setAD_PInstance_ID (instance.getAD_PInstance_ID()); - - // Get Parameters (Dialog) - /**ProcessParameter para = new ProcessParameter (Env.getFrame((Container)parent), WindowNo, pi); - if (para.initDialog()) - { - para.setVisible(true); - if (!para.isOK()) - { - pi.setSummary (Msg.getMsg(Env.getCtx(), "ProcessCancelled")); - pi.setError (true); - return null; - } - } - **/ - // execute - WProcessCtl worker = new WProcessCtl(parent, pi, trx, wsc.ctx); - worker.start(); // MUST be start! - return worker; - } // execute - - - - /************************************************************************** - * Constructor - * @param parent Container & ASyncProcess - * @param pi Process info - * @param trx Transaction - * Created in process(), VInvoiceGen.generateInvoices - */ - public WProcessCtl (Object parent, ProcessInfo pi, Trx trx, Properties wscctx) - { - m_parent = parent; - m_pi = pi; - m_wscctx = wscctx; - m_trx = trx; // handeled correctly - } // ProcessCtl - - private Object m_parent; - private Properties m_wscctx; - private ProcessInfo m_pi; - private Trx m_trx; - private Waiting m_waiting; - private boolean m_IsServerProcess = false; - - /** Static Logger */ - private static CLogger log = CLogger.getCLogger (WProcessCtl.class); - - /** - * Execute Process Instance and Lock UI. - * Calls lockUI and unlockUI if parent is a ASyncProcess - *
        -	 *		- Get Process Information
        -	 *      - Call Class
        -	 *		- Submit SQL Procedure
        -	 *		- Run SQL Procedure
        -	 *	
        - */ - public void run () - { - log.fine("AD_PInstance_ID=" + m_pi.getAD_PInstance_ID() - + ", Record_ID=" + m_pi.getRecord_ID()); - - // Lock - //lock(); - // try {System.out.println(">> sleeping ..");sleep(20000);System.out.println(".. sleeping <<");} catch (Exception e) {} - - // Get Process Information: Name, Procedure Name, ClassName, IsReport, IsDirectPrint - String ProcedureName = ""; - int AD_ReportView_ID = 0; - int AD_Workflow_ID = 0; - boolean IsReport = false; - boolean IsDirectPrint = false; - // - String sql = "SELECT p.Name, p.ProcedureName,p.ClassName, p.AD_Process_ID," // 1..4 - + " p.isReport,p.IsDirectPrint,p.AD_ReportView_ID,p.AD_Workflow_ID," // 5..8 - + " CASE WHEN COALESCE(p.Statistic_Count,0)=0 THEN 0 ELSE p.Statistic_Seconds/p.Statistic_Count END CASE," - + " p.IsServerProcess " - + "FROM AD_Process p" - + " INNER JOIN AD_PInstance i ON (p.AD_Process_ID=i.AD_Process_ID) " - + "WHERE p.IsActive='Y'" - + " AND i.AD_PInstance_ID=?"; - if (!Env.isBaseLanguage(m_wscctx, "AD_Process")) - sql = "SELECT t.Name, p.ProcedureName,p.ClassName, p.AD_Process_ID," // 1..4 - + " p.isReport, p.IsDirectPrint,p.AD_ReportView_ID,p.AD_Workflow_ID," // 5..8 - + " CASE WHEN COALESCE(p.Statistic_Count,0)=0 THEN 0 ELSE p.Statistic_Seconds/p.Statistic_Count END CASE," - + " p.IsServerProcess " - + "FROM AD_Process p" - + " INNER JOIN AD_PInstance i ON (p.AD_Process_ID=i.AD_Process_ID) " - + " INNER JOIN AD_Process_Trl t ON (p.AD_Process_ID=t.AD_Process_ID" - + " AND t.AD_Language='" + Env.getAD_Language(m_wscctx) + "') " - + "WHERE p.IsActive='Y'" - + " AND i.AD_PInstance_ID=?"; - // - try - { - PreparedStatement pstmt = DB.prepareStatement(sql, - ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, null); - pstmt.setInt(1, m_pi.getAD_PInstance_ID()); - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) - { - m_pi.setTitle (rs.getString(1)); - if (m_waiting != null) - m_waiting.setTitle(m_pi.getTitle()); - ProcedureName = rs.getString(2); - m_pi.setClassName (rs.getString(3)); - m_pi.setAD_Process_ID (rs.getInt(4)); - // Report - if ("Y".equals(rs.getString(5))) - { - IsReport = true; - if ("Y".equals(rs.getString(6)) && !Ini.isPropertyBool(Ini.P_PRINTPREVIEW)) - IsDirectPrint = true; - } - AD_ReportView_ID = rs.getInt(7); - AD_Workflow_ID = rs.getInt(8); - // - int estimate = rs.getInt(9); - if (estimate != 0) - { - m_pi.setEstSeconds (estimate + 1); // admin overhead - if (m_waiting != null) - m_waiting.setTimerEstimate(m_pi.getEstSeconds()); - } - m_IsServerProcess = "Y".equals(rs.getString(10)); - } - else - log.log(Level.SEVERE, "No AD_PInstance_ID=" + m_pi.getAD_PInstance_ID()); - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - m_pi.setSummary (Msg.getMsg(m_wscctx, "ProcessNoProcedure") + " " + e.getLocalizedMessage(), true); - //unlock(); - log.log(Level.SEVERE, "run", e); - return; - } - - // No PL/SQL Procedure - if (ProcedureName == null) - ProcedureName = ""; - - - /********************************************************************** - * Workflow - */ - if (AD_Workflow_ID > 0) - { - startWorkflow (AD_Workflow_ID); - //unlock(); - return; - } - - /********************************************************************** - * Start Optional Class - */ - if (m_pi.getClassName() != null) - { - // Run Class - if (!startProcess()) - { - //unlock(); - return; - } - - // No Optional SQL procedure ... done - if (!IsReport && ProcedureName.length() == 0) - { - //unlock (); - return; - } - // No Optional Report ... done - if (IsReport && AD_ReportView_ID == 0) - { - //unlock (); - return; - } - } - - // If not a report, we need a prodedure name - if (!IsReport && ProcedureName.length() == 0) - { - m_pi.setSummary (Msg.getMsg(m_wscctx, "ProcessNoProcedure"), true); - //unlock(); - return; - } - - /********************************************************************** - * Report submission - */ - if (IsReport) - { - // Optional Pre-Report Process - if (ProcedureName.length() > 0) - { - if (!startDBProcess(ProcedureName)) - { - //unlock(); - return; - } - } // Pre-Report - - // Start Report ----------------------------------------------- - boolean ok = ReportCtl.start(m_pi, IsDirectPrint); - m_pi.setSummary("Report", !ok); - //unlock (); - } - /********************************************************************** - * Process submission - */ - else - { - if (!startDBProcess (ProcedureName)) - { - //unlock(); - return; - } - // Success - getResult - ProcessInfoUtil.setSummaryFromDB(m_pi); - //unlock(); - } // *** Process submission *** - // log.fine(Log.l3_Util, "ProcessCtl.run - done"); - } // run - - /** - * Lock UI & show Waiting - */ -/** private void lock () - { - // log.info("..."); - JFrame frame = Env.getFrame((Container)m_parent); - if (frame instanceof AWindow) - ((AWindow)frame).setBusyTimer(m_pi.getEstSeconds()); - else - m_waiting = new Waiting (frame, Msg.getMsg(Env.getCtx(), "Processing"), false, m_pi.getEstSeconds()); - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - log.finer("lock"); - m_parent.lockUI(m_pi); - } - }); - if (m_waiting != null) - { - m_waiting.toFront(); - m_waiting.setVisible(true); - } - } // lock -**/ - /** - * Unlock UI & dispose Waiting. - * Called from run() - */ -/** private void unlock () - { - // log.info("..."); - if (m_pi.isBatch()) - m_pi.setIsTimeout(true); - SwingUtilities.invokeLater(new Runnable() - { - public void run() - { - String summary = m_pi.getSummary(); - log.finer("unlock - " + summary); - if (summary != null && summary.indexOf("@") != -1) - m_pi.setSummary(Msg.parseTranslation(Env.getCtx(), summary)); - m_parent.unlockUI(m_pi); - } - }); - // Remove Waiting/Processing Indicator - if (m_waiting != null) - m_waiting.dispose(); - m_waiting = null; - } // unlock - -**/ - /************************************************************************** - * Start Workflow. - * - * @param AD_Workflow_ID workflow - * @return true if started - */ - private boolean startWorkflow (int AD_Workflow_ID) - { - log.fine(AD_Workflow_ID + " - " + m_pi); - boolean started = false; - if (DB.isRemoteProcess()) - { - log.info("trying to running on the server"); - Server server = CConnection.get().getServer(); - try - { - if (server != null) - { // See ServerBean - log.info("running on the server"); - m_pi = server.workflow (m_wscctx, m_pi, AD_Workflow_ID); - log.finest("server => " + m_pi); - started = true; - } - } - catch (Exception ex) - { - log.log(Level.SEVERE, "AppsServer error", ex); - started = false; - } - } - // Run locally - if (!started && !m_IsServerProcess) - { - log.info("running locally"); - MWorkflow wf = MWorkflow.get (m_wscctx, AD_Workflow_ID); - MWFProcess wfProcess = null; - if (m_pi.isBatch()) - wfProcess = wf.start(m_pi); // may return null - else - wfProcess = wf.startWait(m_pi); // may return null - started = wfProcess != null; - } - return started; - } // startWorkflow - - /************************************************************************** - * Start Java Process Class. - * instanciate the class implementing the interface ProcessCall. - * The class can be a Server/Client class (when in Package - * org compiere.process or org.compiere.model) or a client only class - * (e.g. in org.compiere.report) - * - * @return true if success - */ - private boolean startProcess () - { - log.fine(m_pi.toString()); - boolean started = false; - if (DB.isRemoteProcess()) - { - Server server = CConnection.get().getServer(); - try - { - if (server != null) - { // See ServerBean - m_pi = server.process (m_wscctx, m_pi); - log.finest("server => " + m_pi); - started = true; - } - } - catch (UndeclaredThrowableException ex) - { - Throwable cause = ex.getCause(); - if (cause != null) - { - if (cause instanceof InvalidClassException) - log.log(Level.SEVERE, "Version Server <> Client: " - + cause.toString() + " - " + m_pi, ex); - else - log.log(Level.SEVERE, "AppsServer error(1b): " - + cause.toString() + " - " + m_pi, ex); - } - else - log.log(Level.SEVERE, " AppsServer error(1) - " - + m_pi, ex); - started = false; - } - catch (Exception ex) - { - Throwable cause = ex.getCause(); - if (cause == null) - cause = ex; - log.log(Level.SEVERE, "AppsServer error - " + m_pi, cause); - started = false; - } - } - // Run locally - if (!started && !m_IsServerProcess) - { - ProcessCall myObject = null; - try - { - Class myClass = Class.forName(m_pi.getClassName()); - myObject = (ProcessCall)myClass.newInstance(); - if (myObject == null) - m_pi.setSummary("No Instance for " + m_pi.getClassName(), true); - else - myObject.startProcess(m_wscctx, m_pi, m_trx); - if (m_trx != null) - { - m_trx.commit(); - m_trx.close(); - } - } - catch (Exception e) - { - if (m_trx != null) - { - m_trx.rollback(); - m_trx.close(); - } - m_pi.setSummary("Error starting Class " + m_pi.getClassName(), true); - log.log(Level.SEVERE, m_pi.getClassName(), e); - } - } - return !m_pi.isError(); - } // startProcess - - - /************************************************************************** - * Start Database Process - * @param ProcedureName PL/SQL procedure name - * @return true if success - */ - private boolean startDBProcess (String ProcedureName) - { - // execute on this thread/connection - log.fine(ProcedureName + "(" + m_pi.getAD_PInstance_ID() + ")"); - String sql = "{call " + ProcedureName + "(?)}"; - try - { - CallableStatement cstmt = DB.prepareCall(sql, ResultSet.CONCUR_UPDATABLE,null); // ro?? - cstmt.setInt(1, m_pi.getAD_PInstance_ID()); - cstmt.executeUpdate(); - cstmt.close(); - } - catch (Exception e) - { - log.log(Level.SEVERE, sql, e); - m_pi.setSummary (Msg.getMsg(m_wscctx, "ProcessRunError") + " " + e.getLocalizedMessage()); - m_pi.setError (true); - return false; - } - // log.fine(Log.l4_Data, "ProcessCtl.startProcess - done"); - return true; - } // startDBProcess - - -} // ProcessCtl diff --git a/serverApps/src/main/servlet/org/compiere/www/WReport.java b/serverApps/src/main/servlet/org/compiere/www/WReport.java deleted file mode 100644 index 45e1b75e61..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WReport.java +++ /dev/null @@ -1,368 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.File; -import java.io.IOException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.logging.Level; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.model.GridField; -import org.compiere.model.GridTab; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.PrintInfo; -import org.compiere.print.MPrintFormat; -import org.compiere.print.ReportEngine; -import org.compiere.process.ProcessInfo; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Trx; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - - -/** -* Web (window) Report -* -* @author Jorg Janke -* @version $Id: WReport.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ -*/ -public class WReport extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -6281182537210181407L; - - /** Logger */ - protected CLogger log = CLogger.getCLogger(getClass()); - /** Current MTab */ - private GridTab m_curTab; - /** The Option List */ - private ArrayList m_list = new ArrayList(); - - /** - * Initialize global variables - */ - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WReport.init"); - } // init - - /** - * Process the HTTP Get request - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.fine("doGet"); - log.info(response.toString()); - WebSessionCtx wsc = WebSessionCtx.get(request); - WWindowStatus ws = WWindowStatus.get(request); - m_curTab = ws.curTab; - // - WebDoc doc = null; - File file = null; - if (ws == null) - { - doc = WebDoc.createPopup("No Context"); - doc.addPopupClose(wsc.ctx); - } - /**else if (fileName!=null) - { - int AD_PInstance_ID = WebUtil.getParameterAsInt(request, "AD_PInstance_ID"); - File file = new File (fileName); - String error = WebUtil.streamFile(response, file); - if (error == null) - return; - doc = WebDoc.createWindow(error); - }**/ - else{ - log.info(""); - if (!MRole.getDefault().isCanReport(ws.curTab.getAD_Table_ID())) - { - doc = WebDoc.createPopup("Access Cannot Report"); - doc.addPopupClose(wsc.ctx); - } - - - // Query - MQuery query = new MQuery(m_curTab.getTableName()); - // Link for detail records - String queryColumn = m_curTab.getLinkColumnName(); - // Current row otherwise - if (queryColumn.length() == 0) - queryColumn = m_curTab.getKeyColumnName(); - // Find display - String infoName = null; - String infoDisplay = null; - for (int i = 0; i < m_curTab.getFieldCount(); i++) - { - GridField field = m_curTab.getField(i); - if (field.isKey()) - infoName = field.getHeader(); - if ((field.getColumnName().equals("Name") || field.getColumnName().equals("DocumentNo") ) - && field.getValue() != null) - infoDisplay = field.getValue().toString(); - if (infoName != null && infoDisplay != null) - break; - } - if (queryColumn.length() != 0) - { - if (queryColumn.endsWith("_ID")) - query.addRestriction(queryColumn, MQuery.EQUAL, - new Integer(Env.getContextAsInt(wsc.ctx, m_curTab.getWindowNo(), queryColumn)), - infoName, infoDisplay); - else - query.addRestriction(queryColumn, MQuery.EQUAL, - Env.getContext(wsc.ctx, m_curTab.getWindowNo(), queryColumn), - infoName, infoDisplay); - } - - file = getPrintFormats (m_curTab.getAD_Table_ID(), request, m_curTab, query); - String error = WebUtil.streamFile(response, file); - if (error == null) - return; - doc = WebDoc.createWindow(error); - } - - // - WebUtil.createResponse(request, response, this, null, doc, false); - } // doGet - - - /** - * Process the HTTP Post request - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebDoc doc = WebDoc.createPopup ("Report - Post - Not Implemented"); - WebUtil.createResponse(request, response, this, null, doc, false); - } // doPost - - /** - * Get the Print Formats for the table. - * Fill the list and the popup menu - * @param AD_Table_ID table - * @param invoker component to display popup (optional) - */ - - private File getPrintFormats (int AD_Table_ID,HttpServletRequest request, GridTab m_curTab, MQuery m_query ) - { - WebSessionCtx wsc = WebSessionCtx.get(request); - WWindowStatus ws = WWindowStatus.get(request); - int AD_Client_ID = Env.getAD_Client_ID(wsc.ctx); - File file = null; - m_list = new ArrayList(); - // - String sql = MRole.getDefault().addAccessSQL ( - "SELECT AD_PrintFormat_ID, Name, AD_Client_ID " - + "FROM AD_PrintFormat " - + "WHERE AD_Table_ID=? AND IsTableBased='Y' " - + "ORDER BY AD_Client_ID DESC, IsDefault DESC, Name", // Own First - "AD_PrintFormat", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - KeyNamePair pp = null; - try - { - PreparedStatement pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, AD_Table_ID); - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) - { - pp = new KeyNamePair (rs.getInt(1), rs.getString(2)); - if (rs.getInt(3) == AD_Client_ID) - { - m_list.add(pp); - //m_popup.add(pp.toString()).addActionListener(this); - } - } - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - - // No Format exists - create it - if (m_list.size() == 0) - { - if (pp == null) - file = createNewFormat (AD_Table_ID,request, m_curTab, m_query); // calls launch - else - file = copyFormat(pp.getKey(), AD_Client_ID,request, m_curTab, m_query); - } - // One Format exists or no invoker - show it - //else if (m_list.size() == 1 || invoker == null) - else - file = launchReport ((KeyNamePair)m_list.get(0),request, m_curTab, m_query); - //TODO Display Multiple Report List - // Multiple Formats exist - show selection - //else if (invoker.isShowing()) - //m_popup.show(invoker, 0, invoker.getHeight()); // below button - return file; - } // getPrintFormats - - /** - * Create and Launch new Format for table - * @param AD_Table_ID table - */ - private File createNewFormat (int AD_Table_ID, HttpServletRequest request, GridTab m_curTab, MQuery m_query) - { - WebSessionCtx wsc = WebSessionCtx.get(request); - MPrintFormat pf = MPrintFormat.createFromTable(wsc.ctx, AD_Table_ID); - File file = launchReport (pf,request, m_curTab, m_query); - return file; - } // createNewFormat - - /** - * Copy existing Format - * @param AD_PrintFormat_ID print format - * @param To_Client_ID to client - */ - private File copyFormat (int AD_PrintFormat_ID, int To_Client_ID, HttpServletRequest request, GridTab m_curTab, MQuery m_query) - { - WebSessionCtx wsc = WebSessionCtx.get(request); - MPrintFormat pf = MPrintFormat.copyToClient(wsc.ctx, AD_PrintFormat_ID, To_Client_ID); - File file = launchReport (pf,request, m_curTab, m_query); - return file; - } // copyFormatFromClient - - /** - * Launch Report - * @param pp Key=AD_PrintFormat_ID - */ - private File launchReport (KeyNamePair pp, HttpServletRequest request, GridTab m_curTab,MQuery m_query) - { - WebSessionCtx wsc = WebSessionCtx.get(request); - MPrintFormat pf = MPrintFormat.get(wsc.ctx, pp.getKey(), false); - File file = launchReport (pf, request, m_curTab, m_query); - return file; - } // launchReport - - /** - * Launch Report - * @param pf print format - */ - private File launchReport (MPrintFormat pf, HttpServletRequest request, GridTab m_curTab, MQuery m_query) - { - int Record_ID = 0; - - WebSessionCtx wsc = WebSessionCtx.get(request); - WWindowStatus ws = WWindowStatus.get(request); - //Instance pInstance = new MPInstance (wsc.ctx, 0, 0); - - File fileName = null; - - - if (m_query.getRestrictionCount()==1 && m_query.getCode(0) instanceof Integer){ - Record_ID = ((Integer)m_query.getCode(0)).intValue(); - } - PrintInfo info = new PrintInfo( - pf.getName(), - pf.getAD_Table_ID(), - Record_ID); - info.setDescription(m_query.getInfo()); - if(pf != null && pf.getJasperProcess_ID() > 0) - { - // It's a report using the JasperReports engine - ProcessInfo pi = new ProcessInfo ("", pf.getJasperProcess_ID()); - Trx trx = Trx.get(Trx.createTrxName("WebPrc"), true); - // Execute Process - WProcessCtl.process(this, m_curTab.getAD_Window_ID(), pi, trx, request); - } - else - { - // It's a default report using the standard printing engine - ReportEngine re = new ReportEngine (wsc.ctx, pf, m_query, info); - if (re == null) - { - log.info("Could not start ReportEngine"); - } - else - { - try - { - File file = File.createTempFile("WProcess", ".pdf"); - boolean ok = re.createPDF(file); - if (ok) - { - fileName = file; - } - else{ - log.info("Could not create Report"); - } - } - catch (Exception e) - { - log.info(e.toString()); - } - } - } - //doc.addPopupClose(wsc.ctx); - - // if (m_popup.isVisible()) - // m_popup.setVisible(false); - - return fileName; - } // launchReport - - /************************************************************************** - * Get AD_Table_ID for Table Name - * @param TableName table name - * @return AD_Table_ID or 0 - */ - static public int getAD_Table_ID (String TableName) - { - int AD_Table_ID = 0; - String sql = "SELECT AD_Table_ID FROM AD_Table WHERE TableName=?"; - try - { - PreparedStatement pstmt = DB.prepareStatement(sql, null); - pstmt.setString(1, TableName); - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) - AD_Table_ID = rs.getInt(1); - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - //log.log(Level.SEVERE, sql, e); - } - return AD_Table_ID; - } // getAD_Table_ID - -} // WReport diff --git a/serverApps/src/main/servlet/org/compiere/www/WStart.java b/serverApps/src/main/servlet/org/compiere/www/WStart.java deleted file mode 100644 index 2bacf6c749..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WStart.java +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.util.WebEnv; -import org.compiere.util.WebUtil; - -/** - * Application Start Page - *
        - *  Creates a Frame with
        - *  - Command   - cmd.html  (invisible)
        - *  - Menu      - menu.html
        - *  - Window    = window.html
        - *  
        - * framesetOuter - * +- WCmd - * +- framesetMenuWindow - * +- WMenu - * +- framesetWindow - * +- WPopUp - * +- WWindow - * see webapps/adempiere/index.html - * @author Jorg Janke - * @version $Id: WStart.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WStart extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -3520310916249390852L; - - - /** - * Set UI directory to Servlet init param - */ - public void init(ServletConfig config) throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WStart.init"); - } // init - - /** - * Process the HTTP Get request - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebUtil.createLoginPage (request, response, this, null, null); - } // doGet - - - /** - * Process the HTTP Post request - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - doGet (request, response); - } // doPost - -} // WStart diff --git a/serverApps/src/main/servlet/org/compiere/www/WStatus.java b/serverApps/src/main/servlet/org/compiere/www/WStatus.java deleted file mode 100644 index 9f04b2dad1..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WStatus.java +++ /dev/null @@ -1,76 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebUtil; - -/** - * Status Servlet - * - * @author Jorg Janke - * @version $Id: WStatus.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WStatus extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -6029799149174591507L; - - /** - * Initialize global variables - * This servlet is also loaded on startup to initialize the system - */ - public void init(ServletConfig config) throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WStatus.init"); - } // init - - /** - * Process the HTTP Get request - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - WebDoc doc = WebDoc.create ("WStatus Get Request"); - // - WebUtil.createResponse(request, response, this, null, doc, false); - } // doGet - - - /** - * Process the HTTP Post request - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - WebDoc doc = WebDoc.create ("WStatus Post Request"); - // - WebUtil.createResponse(request, response, this, null, doc, false); - } // doPost - -} // WStatus diff --git a/serverApps/src/main/servlet/org/compiere/www/WStatusArrayList.java b/serverApps/src/main/servlet/org/compiere/www/WStatusArrayList.java deleted file mode 100644 index d18afa89fb..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WStatusArrayList.java +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.util.ArrayList; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -public class WStatusArrayList -{ - public WStatusArrayList(WWindowStatus ws) - { - ws.setStatusName(createStatusName()); - statusArray.add(ws); - } - private ArrayList statusArray=new ArrayList(); - public static final String STATUSLIST="WStatusArrayList"; - - public static WStatusArrayList get(HttpServletRequest request) - { - HttpSession sess = request.getSession(false); - if (sess == null) - return null; - WStatusArrayList wsl=(WStatusArrayList)sess.getAttribute(STATUSLIST); - return wsl; - } - public void addWSToStatusArray(WWindowStatus ws) - { - ws.setStatusName(createStatusName()); - statusArray.add(ws); - } - public WWindowStatus getWSFromStatusArray(String name) - { - int len=statusArray.size(); - if(len==0) - return null; - for(int i=0;in) - n=j; - } - return String.valueOf(++n); - } -} diff --git a/serverApps/src/main/servlet/org/compiere/www/WTask.java b/serverApps/src/main/servlet/org/compiere/www/WTask.java deleted file mode 100644 index f6f304b741..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WTask.java +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebUtil; - -public class WTask extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 4088461230847084532L; - - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WTask.init"); - } - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebDoc doc = WebDoc.create ("WTask - Get - Not Implemented Yet"); - WebUtil.createResponse(request, response, this, null, doc, false); - } - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebDoc doc = WebDoc.create ("WTask - Post - Not Implemented Yet"); - WebUtil.createResponse(request, response, this, null, doc, false); - } -} \ No newline at end of file diff --git a/serverApps/src/main/servlet/org/compiere/www/WTest.java b/serverApps/src/main/servlet/org/compiere/www/WTest.java deleted file mode 100644 index 188f066c40..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.util.CLogger; -import org.compiere.util.Env; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebUtil; - -/** - * Web (window) Help - * - * @author Jorg Janke - * @version $Id: WTest.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WTest extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = -669477433080711028L; - - /** Logger */ - protected CLogger log = CLogger.getCLogger(WTest.class); - - /** - * Initialize global variables - */ - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WTest.init"); - } // init - - /** - * Process the HTTP Get request - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - log.fine("doGet"); - WWindowStatus ws = WWindowStatus.get(request); - // - WebDoc doc = null; - if (ws == null) - { - doc = WebDoc.createPopup("No Context"); - //Modified by Rob Klein 4/29/07 - doc.addPopupClose(Env.getCtx()); - } - else - doc = WebDoc.createPopup ("Test - Get - Not Implemented"); - // - WebUtil.createResponse(request, response, this, null, doc, false); - } // doGet - - - /** - * Process the HTTP Post request - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebDoc doc = WebDoc.createPopup ("Test - Post - Not Implemented"); - WebUtil.createResponse(request, response, this, null, doc, false); - } // doPost - -} // WHelp diff --git a/serverApps/src/main/servlet/org/compiere/www/WValuePreference.java b/serverApps/src/main/servlet/org/compiere/www/WValuePreference.java deleted file mode 100644 index ca2469ab96..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WValuePreference.java +++ /dev/null @@ -1,520 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; -import java.util.Properties; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.ecs.AlignType; -import org.apache.ecs.Element; -import org.apache.ecs.xhtml.form; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.label; -import org.apache.ecs.xhtml.option; -import org.apache.ecs.xhtml.select; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.MRole; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.Util; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - - -/** - * HTML Process and Report UI - * - * @author Jorg Janke - * @version $Id: WValuePreference.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WValuePreference extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 6283213348834944668L; - - /** Logger */ - protected CLogger log = CLogger.getCLogger(getClass()); - //Modified by Rob Klein 4/29/07 - private String errorMessage = null; - - private Properties m_ctx; - //private int m_WindowNo; - private int m_AD_Client_ID; - private int m_AD_Org_ID; - private int m_AD_User_ID; - private int m_AD_Window_ID; - private String m_Attribute; - private String m_DisplayAttribute; - private String m_Value; - private String m_DisplayValue; - private int m_DisplayType; - private MRole m_role; - private String m_Explination; - private Boolean m_Client; - private Boolean m_User; - private Boolean m_Window; - private Boolean m_Org; - /** - * Initialize global variables - * @param config - * @throws ServletException - */ - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WValuePreference.init"); - } // init - - /** - * Process the HTTP Get request. - * Initial Call - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - // Get Session attributes - WebSessionCtx wsc = WebSessionCtx.get(request); - WWindowStatus ws = WWindowStatus.get(request); - if (wsc == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - - if (ws == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - - String m_UpdateResult = ""; - WebDoc doc = null; - //Get/Set Parameter - m_ctx = wsc.ctx; - m_AD_Window_ID = WebUtil.getParameterAsInt(request, "AD_Window_ID"); - m_AD_Client_ID = WebUtil.getParameterAsInt(request, "AD_Client_ID"); - m_AD_Org_ID = WebUtil.getParameterAsInt(request, "AD_Org_ID"); - m_AD_User_ID = WebUtil.getParameterAsInt(request, "AD_User_ID"); - m_Attribute = WebUtil.getParameter(request, "Attribute"); - m_DisplayAttribute = WebUtil.getParameter(request, "DisplayAtrribute"); - m_Value = WebUtil.getParameter(request, "Value"); - m_DisplayValue = WebUtil.getParameter(request, "DisplayValue"); - m_DisplayType = WebUtil.getParameterAsInt(request, "DisplayType"); - m_role = MRole.getDefault (wsc.ctx, false); - m_Client = false; - m_User = false; - m_Window = false; - m_Org = false; - - doc = createParameterPage(ws, wsc, request, m_UpdateResult); - - WebUtil.createResponse(request, response, this, null, doc, false); - } // doGet - - - /** - * Process the HTTP Post request. - * Get Parameters and Process - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - - WebDoc doc = null; - // Get Session attributes - WebSessionCtx wsc = WebSessionCtx.get(request); - WWindowStatus ws = WWindowStatus.get(request); - String m_UpdateResult = ""; - - if (wsc == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - - log.info("This is #1"); - m_Client = WebUtil.getParameterAsBoolean(request, "Client"); - m_User = WebUtil.getParameterAsBoolean(request, "User"); - m_Window = WebUtil.getParameterAsBoolean(request, "Window"); - m_Org = WebUtil.getParameterAsBoolean(request, "Org"); - log.info("This is #2"); - String m_Action = WebUtil.getParameter(request, "PostAction"); - - - setExplanation(); - - log.info("This is the m_Action"+m_Action); - if (m_Action.equals("Delete")) - m_UpdateResult = delete( m_Client, m_User, m_Window, m_Org); - else if (m_Action.equals("Add")) - m_UpdateResult = insert( m_Client, m_User, m_Window, m_Org); - - log.info("This is the call"); - doc = createParameterPage(ws, wsc, request, m_UpdateResult); - - WebUtil.createResponse(request, response, this, null, doc, false); - return; - - //Modified by Rob Klein 6/01/07 - //WebDoc doc = createProcessPage(request, AD_Process_ID, AD_Window_ID); - //createProcessPage(request, response, AD_Process_ID, AD_Window_ID); - // - - } // doPost - - //Modified by Rob Klein 4/29/07 - /************************************************************************** - * Create Parameter Page - * @param wsc web session context - * @param AD_Menu_ID Menu - * @return Page - */ - private WebDoc createParameterPage (WWindowStatus ws, WebSessionCtx wsc, HttpServletRequest request, - String m_UpdateResult) - { - form myForm = null; - myForm = new form("WValuePreference") - .setName("valuepreference"); - - table table = new table("0", "0", "5", "100%", null); - table.setID("WValuePrefTable"); - tr line = new tr(); - line.addElement(new td(" ").setRowSpan(6)); - table.addElement(line); - - - //Attribute Field - line - .addElement(getLabel(Msg.translate(m_ctx,"Attribute"))) - .addElement(new td(new input(input.TYPE_TEXT, "DisplayAttribute", m_DisplayAttribute))); - table.addElement(line); - - //Key Field - line = new tr(); - line - .addElement(getLabel(Msg.translate(m_ctx,"Key"))) - .addElement(new td(new input(input.TYPE_TEXT, "DisplayAttribute", m_DisplayValue))); - table.addElement(line); - line = new tr(); - line.addElement(new td(" ").setRowSpan(6)); - - //Checkboxs Field - table tablecheckbox = new table("0", "0", "5", "80%", null); - line = new tr(); - input checkbox1 = new input(input.TYPE_CHECKBOX, "Client", m_AD_Client_ID); - checkbox1.setChecked(m_Client); - checkbox1.setOnClick("updateValuePref('Update');"); - checkbox1.setTagText(Msg.translate(m_ctx,"AD_Client_ID")); - input checkbox2 = new input(input.TYPE_CHECKBOX, "Org", m_AD_Org_ID); - checkbox2.setChecked(m_Org); - checkbox2.setOnClick("updateValuePref('Update');"); - checkbox2.setTagText(Msg.translate(m_ctx,"AD_Org_ID")); - input checkbox3 = new input(input.TYPE_CHECKBOX, "User", m_AD_User_ID); - checkbox3.setChecked(m_User); - checkbox3.setOnClick("updateValuePref('Update');"); - checkbox3.setTagText(Msg.translate(m_ctx,"AD_User_ID")); - input checkbox4 = new input(input.TYPE_CHECKBOX, "Window", m_AD_Window_ID); - checkbox4.setChecked(m_Window); - checkbox4.setOnClick("updateValuePref('Update');"); - checkbox4.setTagText(Msg.translate(m_ctx,"AD_Window_ID")); - line - .addElement(new td(checkbox1).setWidth("25%")) - .addElement(new td(checkbox2).setWidth("25%")) - .addElement(new td(checkbox3).setWidth("25%")) - .addElement(new td(checkbox4).setWidth("25%")); - tablecheckbox.addElement(line); - table.addElement(tablecheckbox); - line = new tr(); - line.addElement(new td(" ").setRowSpan(6)); - - //Explination - table tableexplination = new table("0", "0", "5", "80%", null); - setExplanation(); - line.addElement(new td(Msg.translate(m_ctx,m_Explination)).setAlign(AlignType.CENTER)); - tableexplination.addElement(line); - table.addElement(tableexplination); - - line = new tr(); - line.addElement(new td(" ").setRowSpan(6)); - - //Update Results - table tableresult = new table("0", "0", "5", "80%", null); - line.addElement(new td(Msg.translate(m_ctx,m_UpdateResult)).setAlign(AlignType.CENTER)); - tableresult.addElement(line); - table.addElement(tableresult); - - - line = new tr(); - line.addElement(new td(" ").setRowSpan(6)); - // Reset - String textbtn = "Delete"; - if (wsc.ctx != null) - textbtn = Msg.getMsg (wsc.ctx, "Delete"); - input restbtn = new input(input.TYPE_BUTTON, textbtn, " "+textbtn); - restbtn.setID(textbtn); - restbtn.setOnClick("updateValuePref('Delete')"); - restbtn.setClass("deletebtn"); - - // Submit - textbtn = "Submit"; - if (wsc.ctx != null) - textbtn = Msg.getMsg (wsc.ctx, "Submit"); - input submitbtn = new input(input.TYPE_BUTTON, textbtn, " "+textbtn); - submitbtn.setID(textbtn); - submitbtn.setOnClick("updateValuePref('Add')"); - submitbtn.setClass("submitbtn"); - - // Close - textbtn = "Close"; - if (wsc.ctx != null) - textbtn = Msg.getMsg (wsc.ctx, "Close"); - input closebtn = new input(input.TYPE_SUBMIT, textbtn, " "+textbtn); - closebtn.setID(textbtn); - closebtn.setClass("closebtn"); - closebtn.setOnClick ("self.close();return false;"); - - table tablebuttons = new table("0", "0", "5", "100%", null); - tablebuttons.addElement(new tr() - .addElement(new td(null, AlignType.CENTER, AlignType.MIDDLE, false, - restbtn)) - .addElement(new td(null, AlignType.CENTER, AlignType.MIDDLE, false, - submitbtn)) - .addElement(new td(null, AlignType.CENTER, AlignType.MIDDLE, false, - closebtn))); - table.addElement(tablebuttons); - myForm.addElement(table); - - WebDoc doc = WebDoc.createPopup ("Set Value Preference"); - - td center = doc.addWindowCenter(false); - - myForm - .addElement(new input(input.TYPE_HIDDEN, "PostAction", "")) - .addElement(table); - - center.addElement(myForm); - - return doc; - } // createParameterPage - - /** - * Get Select Field - * @param lookup lookup - * @param dataValue default value - * @return selction td - */ - private td createSelectField (String m_columnName, option[] options) - { - select sel = new select(m_columnName, options); - sel.setID(m_columnName); - sel.setDisabled(false); - sel.setClass("Cmandatory"); - - // - return createTD(sel); - - } // getSelectField - /** - * Create Left Top aligned TD - * @param element element - * @return td table data - */ - private td createTD (Element element) - { - td td = new td() - .addElement(element) - .setAlign(AlignType.LEFT) - .setVAlign(AlignType.TOP); - return td; - } // createTD - /** - * Get the field Label - * @return label - */ - public td getLabel(String mLabel) - { - // - label myLabel = new label(mLabel + "F", null, Util.maskHTML(mLabel)); - myLabel.setID(mLabel + "L"); - // - td td = new td() - .addElement(myLabel) - .setAlign(AlignType.RIGHT) - .setVAlign(AlignType.TOP); - return td; - } // getLabel - - /** - * Set Explanation - */ - private void setExplanation() - { - /** @todo translation */ - StringBuffer expl = new StringBuffer("For "); - if (m_Client && m_Org) - expl.append("this Client and Organization"); - else if (m_Client && !m_Org) - expl.append("all Organizations of this Client"); - else if (!m_Client && m_Org) - { - m_Org = false; - expl.append("entire System"); - } - else - expl.append("entire System"); - // - if (m_User) - expl.append(", this User"); - else - expl.append(", all Users"); - // - if (m_Window) - expl.append(" and this Window"); - else - expl.append(" and all Windows"); - // - if (Env.getLanguage(m_ctx).isBaseLanguage()) - { - m_Explination = expl.toString (); - } - } // setExplanation - /** - * Delete Preference - * @return number of rows deleted - */ - public String delete(Boolean m_Client,Boolean m_User, Boolean m_Window, Boolean m_Org) - { - log.info(""); - String m_UpdateResult; - StringBuffer sql = new StringBuffer ("DELETE FROM AD_Preference WHERE "); - sql.append("AD_Client_ID=").append(m_Client ? m_AD_Client_ID : 0); - sql.append(" AND AD_Org_ID=").append(m_Org ? m_AD_Org_ID : 0); - if (m_User) - sql.append(" AND AD_User_ID=").append(m_AD_User_ID); - else - sql.append(" AND AD_User_ID IS NULL"); - if (m_Window) - sql.append(" AND AD_Window_ID=").append(m_AD_Window_ID); - else - sql.append(" AND AD_Window_ID IS NULL"); - sql.append(" AND Attribute='").append(m_Attribute).append("'"); - // - log.fine( sql.toString()); - int no = DB.executeUpdate(sql.toString(), null); - if (no > 0){ - Env.setContext(m_ctx, getContextKey(m_Window), (String)null); - m_UpdateResult = no+" Record Deleted"; - } - else - m_UpdateResult = "Record not found for deletion"; - return m_UpdateResult; - } // delete - - /** - * Get Context Key - * @return Context Key - */ - private String getContextKey(Boolean m_Window) - { - if (m_Window) - return "P" + m_AD_Window_ID + "|" + m_Attribute; - else - return "P|" + m_Attribute; - } // getContextKey - - /** - * Save to Disk - */ - public String insert(Boolean m_Client,Boolean m_User, Boolean m_Window, Boolean m_Org) - { - log.info(""); - String m_UpdateResult; - int no=0; - // --- Delete first - m_UpdateResult = delete(m_Client, m_User, m_Window, m_Org); - - // Handle NULL - if (m_Value == null || m_Value.length() == 0) - { - if (DisplayType.isLookup(m_DisplayType)) - m_Value = "-1"; // -1 may cause problems (BPartner - M_DiscountSchema - else if (DisplayType.isDate(m_DisplayType)) - m_Value = " "; - else - { - m_UpdateResult = m_UpdateResult+" Can not update record"; - return m_UpdateResult; - } - } - - // --- Inserting - int Client_ID = m_Client ? m_AD_Client_ID : 0; - int Org_ID = m_Org ? m_AD_Org_ID : 0; - int AD_Preference_ID = DB.getNextID(m_ctx, "AD_Preference", null); - // - StringBuffer sql = new StringBuffer ("INSERT INTO AD_Preference (" - + "AD_Preference_ID, AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy,Updated,UpdatedBy," - + "AD_Window_ID, AD_User_ID, Attribute, Value) VALUES ("); - sql.append(AD_Preference_ID).append(",").append(Client_ID).append(",").append(Org_ID) - .append(", 'Y',SysDate,").append(m_AD_User_ID).append(",SysDate,").append(m_AD_User_ID).append(", "); - if (m_Window) - sql.append(m_AD_Window_ID).append(","); - else - sql.append("NULL,") ; - if (m_User) - sql.append(m_AD_User_ID).append(","); - else - sql.append("NULL,"); - // - sql.append(DB.TO_STRING(m_Attribute)).append(",").append(DB.TO_STRING(m_Value)).append(")"); - // - log.fine( sql.toString()); - no = DB.executeUpdate(sql.toString(), null); - if (no >0) - m_UpdateResult = no+" Record Inserted"; - else - m_UpdateResult = "Record not Inserted"; - - return m_UpdateResult; - } // insert - -} // WValuePrefernce diff --git a/serverApps/src/main/servlet/org/compiere/www/WWindow.java b/serverApps/src/main/servlet/org/compiere/www/WWindow.java deleted file mode 100644 index f2e97d4d8e..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WWindow.java +++ /dev/null @@ -1,1496 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.Enumeration; -import java.util.logging.Level; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.ecs.AlignType; -import org.apache.ecs.xhtml.a; -import org.apache.ecs.xhtml.button; -import org.apache.ecs.xhtml.div; -import org.apache.ecs.xhtml.form; -import org.apache.ecs.xhtml.hr; -import org.apache.ecs.xhtml.i; -import org.apache.ecs.xhtml.img; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.script; -import org.apache.ecs.xhtml.span; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.th; -import org.apache.ecs.xhtml.thead; -import org.apache.ecs.xhtml.tr; -import org.compiere.model.GridField; -import org.compiere.model.GridTab; -import org.compiere.model.GridWindowVO; -import org.compiere.model.Lookup; -import org.compiere.model.MQuery; -import org.compiere.model.MRole; -import org.compiere.model.MSession; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - -/** - * Web Window Servlet - * - * @author Jorg Janke - * @version $Id: WWindow.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WWindow extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 2565659091166594270L; - - /** Logger */ - protected static CLogger log = CLogger.getCLogger(WWindow.class); - - /** - * Initialize global variables - * @param config - * @throws ServletException - */ - public void init(ServletConfig config) throws ServletException - { - super.init (config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WWindow.init"); - } // init - - /** - * Get Servlet information - * @return info - */ - public String getServletInfo() - { - return "Adempiere Web Window"; - } // getServletInfo - - /** - * Clean up resources - */ - public void destroy() - { - log.fine("destroy"); - } // destroy - - /** Window Number Counter */ - private static int s_WindowNo = 1; - /** Form Name */ - protected static final String FORM_NAME = "WForm"; - //Modified by Rob Klein 4/29/07 - - - protected static String sectionNameOld = null; - - /** Hidden Parameter Command - Button */ - private static final String P_Command = "PCommand"; - /** Hidden Parameter - Tab No */ - private static final String P_Tab = "PTab"; - /** Hidden Parameter - MultiRow Row No */ - private static final String P_MR_RowNo = "PMRRowNo"; - /** Hidden Parameter - Changed Field for Callout/etc. */ - private static final String P_ChangedColumn = "ChangedColumn"; - - /** Multi Row Lines per Screen */ - // Modified by Rob Klein 4/29/2007 - //private static final int MAX_LINES = 12; - private static final int MAX_LINES = 100; - /** Indicator for last line */ - private static final int LAST_LINE = 999999999; - - /** Error Indicator */ - private static final String ERROR = " ERROR! "; - - private String m_searchField; - private String m_targetWindow; - - /** - * Process the HTTP Get request - Initial Call. - *
        - * http://localhost/adempiere/WWindow?AD_Window_ID=123 - *
        - * Create Window with request parameters - * AD_Window_ID - * AD_Menu_ID - * - * Clean up old/existing window - * - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - // Get Session attributes - WebDoc doc = null; - HttpSession sess = request.getSession(); - WebSessionCtx wsc = WebSessionCtx.get(request); - if (wsc == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - - // Parameter: AD_Window_ID - int AD_Window_ID = WebUtil.getParameterAsInt(request, "AD_Window_ID"); - // Get Parameter: Menu_ID - int AD_Menu_ID = WebUtil.getParameterAsInt(request, "AD_Menu_ID"); - - log.info("AD_Window_ID=" + AD_Window_ID - + "; AD_Menu_ID=" + AD_Menu_ID); - - String TableName = null; - //Check to see if Zoom - int AD_Record_ID = WebUtil.getParameterAsInt(request, "AD_Record_ID"); - int AD_Table_ID = WebUtil.getParameterAsInt(request, "AD_Table_ID"); - if (AD_Record_ID != 0 || AD_Table_ID != 0){ - - AD_Window_ID = 0; - int PO_Window_ID = 0; - String sql = "SELECT TableName, AD_Window_ID, PO_Window_ID FROM AD_Table WHERE AD_Table_ID=?"; - try - { - PreparedStatement pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, AD_Table_ID); - ResultSet rs = pstmt.executeQuery(); - if (rs.next()) - { - TableName = rs.getString(1); - AD_Window_ID = rs.getInt(2); - PO_Window_ID = rs.getInt(3); - } - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - - if (TableName == null || AD_Window_ID == 0){ - doc = WebDoc.createPopup ("No Context"); - doc.addPopupClose(wsc.ctx); - } - - // PO Zoom ? - boolean isSOTrx = true; - if (PO_Window_ID != 0) - { - String whereClause = TableName + "_ID=" + AD_Record_ID; - isSOTrx = DB.isSOTrx(TableName, whereClause); - if (!isSOTrx) - AD_Window_ID = PO_Window_ID; - } - } - - - // Clean up old Window - WWindowStatus ws = WWindowStatus.get(request); - if (ws != null) - { - int WindowNo = ws.mWindow.getWindowNo(); - log.fine("Disposing - WindowNo=" + WindowNo + ", ID=" + ws.mWindow.getAD_Window_ID()); - ws.mWindow.dispose(); - Env.clearWinContext(wsc.ctx, WindowNo); - } - - - /** - * New Window data - */ - GridWindowVO mWindowVO = GridWindowVO.create (wsc.ctx, s_WindowNo++, AD_Window_ID, AD_Menu_ID); - if (mWindowVO == null) - { - String msg = Msg.translate(wsc.ctx, "AD_Window_ID") + " " - + Msg.getMsg(wsc.ctx, "NotFound") + ", ID=" + AD_Window_ID + "/" + AD_Menu_ID; - WebUtil.createErrorPage(request, response, this, msg); - sess.setAttribute(WWindowStatus.NAME, null); - return; - } - // Create New Window - ws = new WWindowStatus(mWindowVO); - sess.setAttribute(WWindowStatus.NAME, ws); - - // Query - if (AD_Record_ID != 0 || AD_Table_ID != 0){ //If Zoom - ws.mWindow.initTab(ws.curTab.getTabNo()); - ws.curTab.setQuery(MQuery.getEqualQuery(TableName + "_ID", AD_Record_ID)); - ws.curTab.query(false); - } else { - ws.mWindow.initTab(ws.curTab.getTabNo()); - ws.curTab.query(ws.mWindow.isTransaction()); - ws.curTab.navigate(0); - } - - /** - * Build Page - */ - - if (ws.curTab.isSingleRow()) - doc = getSR_Form (request.getRequestURI(), wsc, ws); - else - doc = getMR_Form (request.getRequestURI(), wsc, ws); - - // fini - log.fine("Fini"); - // log.trace(log.l6_Database, doc.toString()); - WebUtil.createResponse (request, response, this, null, doc, false); - log.fine("Closed"); - } // doGet - - - /************************************************************************** - * Process the HTTP Post request - * - * @param request request - * @param response response - * @throws ServletException - * @throws IOException - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - WebEnv.dump(request); - // Get Session Info - WebSessionCtx wsc = WebSessionCtx.get(request); - WWindowStatus ws = WWindowStatus.get(request); - if (wsc == null || ws == null) - { - if (wsc == null) - WebUtil.createTimeoutPage(request, response, this, "No Context"); - else - doGet(request, response); - return; - } - - // Get Parameter: Command - String p_cmd = WebUtil.getParameter (request, P_Command); - String column = WebUtil.getParameter (request, P_ChangedColumn); - log.info("Cmd=" + p_cmd + " - ChangedColumn=" + column); - - // Changed Column - if (column != null && column.length() > 0) - { - updateFields(request, wsc, ws); - } - else // Exit & Commands - { - if (p_cmd.equals("Exit")) - { - MSession cSession = MSession.get(wsc.ctx, false); - if (cSession != null) - cSession.logout(); - WebUtil.createLoginPage(request, response, this, ws.ctx, "Exit"); - return; - } - executeCommand(request, p_cmd, wsc, ws); - } - - /************************************************** - * Build Page - */ - WebDoc doc = null; - // Create Simgle/Multi Row - if (ws.curTab.isSingleRow()) - doc = getSR_Form (request.getRequestURI(), wsc, ws); - else - doc = getMR_Form (request.getRequestURI(), wsc, ws); - - // - log.fine("Fini"); - // log.trace(log.l6_Database, doc.toString()); - WebUtil.createResponse (request, response, this, null, doc, false); - log.fine("Closed"); - } // doPost - - - /************************************************************************** - * Execute Command. - * - * @param request request - * @param p_cmd command - * @param wsc session context - * @param ws window status - */ - private void executeCommand (HttpServletRequest request, - String p_cmd, WebSessionCtx wsc, WWindowStatus ws) - { - // Get Parameter: Command and Tab changes - String p_tab = WebUtil.getParameter (request, P_Tab); - String p_row = WebUtil.getParameter (request, P_MR_RowNo); // MR Row Command - log.config(p_cmd + " - Tab=" + p_tab + " - Row=" + p_row); - - /** - * Multi-Row Selection (i.e. display single row) - */ - if (p_row != null && p_row.length() > 0) - { - try - { - int newRowNo = Integer.parseInt (p_row); - ws.curTab.navigate(newRowNo); - ws.curTab.setSingleRow(true); - } - catch (Exception e) - { - log.log(Level.SEVERE, "Parse RowNo="+ p_row, e); - } - } - - /** - * Tab Change - */ - else if (p_tab != null && p_tab.length() > 0) - { - int newTabNo = 0; - try - { - newTabNo = Integer.parseInt (p_tab); - } - catch (Exception e) - { - log.log(Level.SEVERE, "Parse TabNo="+ p_tab, e); - } - // move to detail - if (newTabNo > ws.curTab.getTabNo()) - { - ws.mWindow.initTab(newTabNo); - ws.curTab = ws.mWindow.getTab(newTabNo); - ws.curTab.query(false); - ws.curTab.navigate(0); - - //Modified by Rob Klein 6/01/07 create new record if no record exists - if (ws.curTab.getRowCount() < 1 ){ - if (!ws.curTab.dataNew(false)) - ws.curTab.dataIgnore(); - } - - } - // move back - else if (newTabNo < ws.curTab.getTabNo()) - { - ws.curTab = ws.mWindow.getTab(newTabNo); - ws.curTab.dataRefresh(); - } - } - - /** - * Multi-Row Toggle - */ - else if (p_cmd.equals("Multi")) - { - boolean single = ws.curTab.isSingleRow(); - ws.curTab.setSingleRow(!single); - if (single) - ws.curTab.navigate(0); - } - - /** - * Position Commands - */ - else if (p_cmd.equals("First")) - { - ws.curTab.navigate(0); - } - else if (p_cmd.equals("Next")) - { - ws.curTab.navigateRelative(+1); // multi row is positioned at last displayed row - } - else if (p_cmd.equals("Previous")) - { - int rows = ws.curTab.isSingleRow() ? -1 : -2*MAX_LINES; - ws.curTab.navigateRelative(rows); - } - else if (p_cmd.equals("Last")) - { - ws.curTab.navigateRelative(LAST_LINE); - } - /** - * Find - */ - else if (p_cmd.equals("Test")) - { - /** @todo Chat */ - } - - /** - * Refresh - */ - else if (p_cmd.equals("Refresh")) - { - ws.curTab.dataRefreshAll(); - } - - /** - * Attachment - */ - else if (p_cmd.equals("Attachment")) - { - /** @todo Attachment */ - } - - /** - * Favorite - */ - else if (p_cmd.equals("Favorite")) - { - int AD_Window_ID = ws.curTab.getAD_Window_ID(); - String sqlNode = "SELECT AD_Menu_ID FROM AD_Menu WHERE" - + " AD_Window_ID = "+AD_Window_ID; - int Node_ID = DB.getSQLValue(null,sqlNode); - - - int AD_User_ID = Env.getAD_User_ID(wsc.ctx); - int AD_Role_ID = Env.getAD_Role_ID(wsc.ctx); - int AD_Org_ID = Env.getAD_Org_ID(wsc.ctx); - int AD_Client_ID = Env.getAD_Client_ID(wsc.ctx); - int AD_Tree_ID = DB.getSQLValue(null, - "SELECT COALESCE(r.AD_Tree_Menu_ID, ci.AD_Tree_Menu_ID)" - + "FROM AD_ClientInfo ci" - + " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) " - + "WHERE AD_Role_ID=?", AD_Role_ID); - - if (AD_Tree_ID <= 0) - AD_Tree_ID = 10; // Menu - - String sql = "SELECT count(*) FROM AD_TreeBar WHERE" - + " Node_ID = "+Node_ID - + " AND CreatedBy = "+AD_User_ID - + " AND AD_Tree_ID = "+AD_Tree_ID; - int Favorite = DB.getSQLValue(null,sql); - if (Favorite >0){ - sql = "DELETE FROM AD_TreeBar WHERE" - + " Node_ID = "+Node_ID - + " AND CreatedBy = "+AD_User_ID - + " AND AD_Tree_ID = "+AD_Tree_ID; - DB.executeUpdate(sql, null); - } - - else{ - sql = "INSERT INTO AD_TreeBar " - + "( Node_ID, AD_User_ID, AD_Client_ID, AD_Org_ID," - + " IsActive, CreatedBy, AD_Tree_ID, UpdatedBy)" - + "VALUES ( "+Node_ID+", "+AD_User_ID+", "+AD_Client_ID+", "+AD_Org_ID - + ", 'Y', "+AD_User_ID+", "+AD_Tree_ID+", "+AD_User_ID+")"; - DB.executeUpdate(sql, null); - } - } - - /** - * History - */ - else if (p_cmd.equals("History")) - { - //Modified by Rob Klein 4/29/07 - //if (ws.mWindow.isTransaction() && ws.curTab.getWindowNo() == 0) - //{ - ws.mWindow.initTab(ws.curTab.getTabNo()); - ws.curTab.query( !ws.curTab.isOnlyCurrentRows() ); - ws.curTab.navigate(0); - //} - } - - /** - * Report - */ - else if (p_cmd.equals("Report")) - { - /** @todo Report */ - - } - - /** - * Print - */ - else if (p_cmd.equals("Print")) - { - /** @todo Print */ - } - - /** - * New - */ - else if (p_cmd.equals("New")) - { - if (!ws.curTab.dataNew(false)) - ws.curTab.dataIgnore(); - } - - /** - * Delete - */ - else if (p_cmd.equals("Delete")) - { - ws.curTab.dataDelete(); - } - - /** - * Save - Check for changed values - */ - else if (p_cmd.equals("Save")) - { - executeSave (request, wsc, ws); - } - - else if (p_cmd.equals("Find")) - { - String strSearch=WebUtil.getParameter(request, "txtSearch"); - if (strSearch!=null) { - MQuery query=new MQuery(); - if (strSearch.length()!=0) - query.addRestriction(m_searchField, MQuery.LIKE, strSearch); - ws.curTab.setQuery(query); - ws.curTab.query(false); - ws.curTab.navigate(0); - } - } - - else if (p_cmd.equals("FindAdv")) - { - String strSQL=WebUtil.getParameter(request, "txtSQL"); - if (strSQL!=null) { - MQuery query=new MQuery(); - if (strSQL.equals("FIND")) { - String value=WebUtil.getParameter(request, "txtValue"); - String docno=WebUtil.getParameter(request, "txtDocumentNo"); - String name=WebUtil.getParameter(request, "txtName"); - String desc=WebUtil.getParameter(request, "txtDescription"); - - if (value!=null && value.length()!=0) query.addRestriction("Value", MQuery.LIKE, value); - if (docno!=null && docno.length()!=0) query.addRestriction("DocumentNo", MQuery.LIKE, docno); - if (name!=null && name.length()!=0) query.addRestriction("Name", MQuery.LIKE, name); - if (desc!=null && desc.length()!=0) query.addRestriction("Description", MQuery.LIKE, desc); - } else { - query.addRestriction(strSQL); - } - ws.curTab.setQuery(query); - ws.curTab.query(false); - ws.curTab.navigate(0); - } - } - } // executeCommand - - /** - * Execute Save - * @param request request - * @param wsc web session - * @param ws - */ - private void executeSave (HttpServletRequest request, WebSessionCtx wsc, WWindowStatus ws) - { - log.info(""); - boolean error = updateFields(request, wsc, ws); - - // Check Mandatory - log.fine("Mandatory check"); - int size = ws.curTab.getFieldCount(); - for (int i = 0; i < size; i++) - { - GridField field = ws.curTab.getField(i); - if (field.isMandatory(true)) // context check - { - Object value = field.getValue(); - if (value == null || value.toString().length() == 0) - { - field.setInserting (true); // set editable otherwise deadlock - field.setError(true); - field.setErrorValue(value == null ? null : value.toString()); - if (!error) - error = true; - log.info("Mandatory Error: " + field.getColumnName()); - } - else - field.setError(false); - } - } - - if (error) - return; - - // save it - of errors ignore changes - if (!ws.curTab.dataSave(true)) - ws.curTab.dataIgnore(); - log.fine("done"); - } // executeSave - - /** - * Update Field Values from Parameter - * @param request request - * @param wsc session context - * @param ws window status - * @return true if error - */ - private boolean updateFields(HttpServletRequest request, WebSessionCtx wsc, WWindowStatus ws) - { - boolean error = false; - try - { - String enc = request.getCharacterEncoding(); - if (enc == null) - request.setCharacterEncoding(WebEnv.ENCODING); - } - catch (Exception e) - { - log.log(Level.SEVERE, "Set CharacterEndocung=" + WebEnv.ENCODING, e); - } - // loop through parameters - Enumeration en = request.getParameterNames(); - while (en.hasMoreElements()) - { - String key = (String)en.nextElement(); - // ignore hidden commands - if (key.equals(P_Command) - || key.equals(P_ChangedColumn) - || key.equals(P_MR_RowNo) - || key.equals(P_Tab)) - continue; - GridField mField = ws.curTab.getField(key); - // log.fine("executeSave - Key=" + key + " - " + mField); - // we found a writable field - if (mField != null && mField.isEditable(true)) - { - String oldValue = WebUtil.getParameter(request, key); - String newValue = WebUtil.getParameter(request, key + "F"); - String value=null; - if (newValue!=null) { - Object val=lookupValue(newValue, mField.getLookup()); - if (val!=null) value=val.toString(); - } - if (value==null)value=oldValue; - - Object dbValue = mField.getValue(); - boolean fieldError = false; - String columnName = mField.getColumnName(); - log.finest(columnName - + ": " + (dbValue==null ? "null" : dbValue.toString()) - + " -> " + (value==null ? "null" : value.toString())); - // same = both null - if (dbValue == null && value == null) - continue; - // new value null - else if (dbValue != null && value == null) - ws.curTab.setValue (mField, null); - // from null to new value - else if (dbValue == null && value != null) - fieldError = !setFieldValue (wsc, ws, mField, value); - // same - else if (dbValue.equals(value)) - continue; - else - fieldError = !setFieldValue (wsc, ws, mField, value); - // - if (!error && fieldError) - { - log.info("Error: " + mField.getColumnName()); - error = true; - } - } - } // for all parameteres - - // Re-Do Changed Column to overwrite - /*String columnName = WebUtil.getParameter (request, P_ChangedColumn); - if (columnName != null && columnName.length() > 0) - { - GridField mField = ws.curTab.getField(columnName); - if (mField != null) - { - String value = WebUtil.getParameter(request, columnName); - Object newValue = getFieldValue (wsc, mField, value); - if (!ERROR.equals(newValue)) - { - // De-Selected Check Boxes are null - if (newValue == null && mField.getDisplayType() == DisplayType.YesNo) - newValue = "N"; - log.fine("ChangedColumn: " + columnName + "=" + newValue); - ws.curTab.setValue(mField, newValue); - } - } - }*/ - return error; - } // updateFields - - - /************************************************************************** - * Set Field Value - * @param wsc web session - * @param ws window status - * @param mField field - * @param value as String - * @return true if correct - */ - private boolean setFieldValue (WebSessionCtx wsc, WWindowStatus ws, - GridField mField, String value) - { - Object newValue = getFieldValue (wsc, mField, value); - if (ERROR.equals(newValue)) - { - mField.setErrorValue(value); - return false; - } - Object dbValue = mField.getValue(); - if ((newValue == null && dbValue != null) - || (newValue != null && !newValue.equals(dbValue))) - ws.curTab.setValue(mField, newValue); - return true; - } // setFieldValue - - /** - * Get Field value (convert value to datatype of MField) - * @param wsc session context - * @param mField field - * @param value String Value - * @return converted Field Value - */ - private Object getFieldValue (WebSessionCtx wsc, GridField mField, String value) - { - //Modified by Rob Klein 4/29/07 - //if (value == null || value.length() == 0) - //return null; - - Object defaultObject = null; - - int dt = mField.getDisplayType(); - String columnName = mField.getColumnName(); - - if (value == null || value.length() == 0){ - defaultObject = mField.getDefault(); - mField.setValue (defaultObject, true); - if (value == null || value.length() == 0 || mField.getValue() == null){ - return null;} - else - value = mField.getValue().toString(); - } - // BigDecimal - if (DisplayType.isNumeric(dt)) - { - BigDecimal bd = null; - try - { - Number nn = null; - if (dt == DisplayType.Amount) - nn = wsc.amountFormat.parse(value); - else if (dt == DisplayType.Quantity) - nn = wsc.quantityFormat.parse(value); - else // DisplayType.CostPrice - nn = wsc.numberFormat.parse(value); - if (nn instanceof BigDecimal) - bd = (BigDecimal)nn; - else - bd = new BigDecimal(nn.toString()); - } - catch (Exception e) - { - log.warning("BigDecimal: " + columnName + "=" + value + ERROR); - return ERROR; - } - log.fine("BigDecimal: " + columnName + "=" + value + " -> " + bd); - return bd; - } - - // ID - else if (DisplayType.isID(dt)) - { - Integer ii = null; - try - { - ii = new Integer (value); - } - catch (Exception e) - { - log.log(Level.WARNING, "ID: " + columnName + "=" + value, e); - ii = null; - } - // -1 indicates NULL - if (ii != null && ii.intValue() == -1) - ii = null; - log.fine("ID: " + columnName + "=" + value + " -> " + ii); - return ii; - } - - // Date/Time - else if (DisplayType.isDate(dt)) - { - Timestamp ts = null; - try - { - java.util.Date d = null; - if (dt == DisplayType.Date) - d = wsc.dateFormat.parse(value); - else - d = wsc.dateTimeFormat.parse(value); - ts = new Timestamp(d.getTime()); - } - catch (Exception e) - { - log.warning("Date: " + columnName + "=" + value + ERROR); - return ERROR; - } - log.fine("Date: " + columnName + "=" + value + " -> " + ts); - return ts; - } - - // Checkbox - else if (dt == DisplayType.YesNo) - { - Boolean retValue = Boolean.FALSE; - if (value.equals("true")) - retValue = Boolean.TRUE; - log.fine("YesNo: " + columnName + "=" + value + " -> " + retValue); - return retValue; - } - - // treat as string - log.fine(columnName + "=" + value); - return value; - } // getFieldValue - - - /************************************************************************** - * Return SingleRow Form details - * @param action action - * @param wsc web session context - * @param ws window status - * @return Form - */ - public WebDoc getSR_Form (String action, WebSessionCtx wsc, WWindowStatus ws) - { - log.fine("Tab=" + ws.curTab.getTabNo()); - - /********************** - * For all Fields - */ - //Modified by Rob Klein 4/29/07 - //table table = new table() - // .setAlign(AlignType.CENTER); - table table = new table(); - table.setClass("centerTable"); - StringBuffer scriptSrc = new StringBuffer(); - MRole role = MRole.getDefault(wsc.ctx, false); - // - tr line = new tr(); - //Modified by Rob Klein 4/29/07 - m_searchField=null; - boolean isTabRO = ws.curTab.isReadOnly(); - if (ws.curTab.isDisplayed()) - { - int noFields = ws.curTab.getFieldCount(); - for (int i = 0; i < noFields; i++) - { - GridField field = ws.curTab.getField(i); - String columnName = field.getColumnName(); - - /** - * Get Data and convert to String (singleRow) - */ - Object oData = ws.curTab.getValue(field); - //Modified by Rob Klein 4/29/07 - /** - * Get Record ID and Table ID for Processes - */ - int recordID = ws.curTab.getRecord_ID(); - int tableID = ws.curTab.getAD_Table_ID(); - - /** - * Display field - */ - if (field.isDisplayed(true)) - { - if (!field.isSameLine()) - line = new tr(); - // - boolean hasDependents = ws.curTab.hasDependants(columnName); - //Modified by Rob Klein 4/29/07 - addField(wsc, line, field, oData, hasDependents, recordID, tableID, isTabRO, i, ws.curTab,role); - //addField(wsc, line, field, oData, hasDependents); - table.addElement(line); - // Additional Values - String dispLogic = field.getDisplayLogic(); - if (dispLogic != null && dispLogic.length() > 0) - { - dispLogic = dispLogic.replace('\'', '"'); // replace ' with " - scriptSrc.append("document.").append(FORM_NAME) - .append(".").append(columnName) - .append(".displayLogic='").append(dispLogic).append("';\n"); - } - - if (m_searchField==null) - if (columnName.equals("Description")) - m_searchField=columnName; - else if (columnName.equals("Name")) - m_searchField=columnName; - else if (columnName.equals("DocumentNo")) - m_searchField=columnName; - else if (columnName.equals("Value")) - m_searchField=columnName; - } - } // for all fields - } // displayed - if (scriptSrc.length() > 0) - table.addElement(new script(scriptSrc.toString())); - - // Status Line - int rowNo = ws.curTab.getCurrentRow(); - String statusDB = String.valueOf(rowNo+1) + " / " + ws.curTab.getRowCount(); - // - return createLayout (action, table, wsc, ws, ws.curTab.getDescription(), statusDB); - } // getSR_Form - - - /************************************************************************** - * Return MultiRow Form details - * @param action action - * @param wsc session context - * @param ws window status - * @return Form - */ - public WebDoc getMR_Form (String action, WebSessionCtx wsc, WWindowStatus ws) - { - log.fine("Tab=" + ws.curTab.getTabNo()); - - int initRowNo = ws.curTab.getCurrentRow(); - - /** - * Table Header - */ - table table = new table().setAlign(AlignType.CENTER); - //Modified by Rob Klein 4/29/07 - table.setClass("MultiRow table-autofilter table-filterable table-autosort table-autostripe table-stripeclass:alternate"); - //.setClass("MultiRow"); - table.setBorder(1); - table.setCellSpacing(1); - tr line = new tr(); - // First Column - //Modified by Rob Klein 4/29/07 - m_searchField=null; - line.addElement(new th().addElement(" ")); - // Tab not displayed - if (!ws.curTab.isDisplayed()) - return createLayout (action, table, wsc, ws, "The table is not displayed", "-"); - - int noFields = ws.curTab.getFieldCount(); - // for all (header) columns - for (int colNo = 0; colNo < noFields; colNo++) - { - GridField field = ws.curTab.getField(colNo); - String columnName = field.getColumnName(); - if (field.isDisplayed(false)) - { - th th = new th(); - //Modified by Rob Klein 4/29/07 with Autofilter - th.addElement(field.getHeader()).setClass("table-filterable table-filtered table-sortable:default"); - //th.addElement(field.getHeader()); - th.setAbbr(field.getDescription()); - line.addElement(th); - - if (m_searchField==null) - if (columnName.equals("Description")) - m_searchField=columnName; - else if (columnName.equals("Name")) - m_searchField=columnName; - else if (columnName.equals("DocumentNo")) - m_searchField=columnName; - else if (columnName.equals("Value")) - m_searchField=columnName; - - } - } // for all columns - // Modified by Rob Klein Client Side Filter Manual Filter 6/1/07 - //tr line2 = new tr(); - //th th = new th(); - //input filter = new input (input.TYPE_TEXT, " filter", ""); - //filter.setOnKeyUp("Table.filter(this,this)"); - //th.addElement(" "); - //line2.addElement(th); - //input filter = null; - //for (int colNo = 0; colNo < noFields; colNo++) - //{ - // GridField field = ws.curTab.getField(colNo); - // if (field.isDisplayed(false)) - // { - // th = new th(); - // filter = new input (input.TYPE_TEXT, field.getHeader()+"filter", ""); - // filter.setOnKeyUp("Table.filter(this,this)"); - // th.addElement(filter); - // line2.addElement(th); - //line.addElement(th); - // } - //} // for all columns - //Modified by Rob Klein 4/29/07 - table.addElement(new thead().addElement(line)); - - //Modified by Rob Klein 4/29/07 - table.addElement(""); - /** - * Table Lines - */ - int lastRow = initRowNo + MAX_LINES; - lastRow = Math.min(lastRow, ws.curTab.getRowCount()); - for (int lineNo = initRowNo; lineNo < lastRow; lineNo++) - { - // Row - ws.curTab.navigate(lineNo); - - line = new tr(); - // Selector - button selector = new button(); - selector.addElement(">"); // displays ">" - selector.setOnClick("document." + FORM_NAME + "." + P_MR_RowNo + ".value='" + lineNo + "'; submit();"); - line.addElement(new td().addElement(selector)); - - // for all columns - for (int colNo = 0; colNo < noFields; colNo++) - { - td td = new td(); - // - GridField field = ws.curTab.getField(colNo); - if (!field.isDisplayed(false)) - continue; - - // Get Data - turn to string - Object data = ws.curTab.getValue(field.getColumnName()); - String info = null; - // - if (data == null) - info = ""; - else - { - int dt = field.getDisplayType(); - switch (dt) - { - case DisplayType.Date: - info = wsc.dateFormat.format(data); - td.setAlign("right"); - break; - case DisplayType.DateTime: - info = wsc.dateTimeFormat.format(data); - td.setAlign("right"); - break; - case DisplayType.Amount: - info = wsc.amountFormat.format(data); - td.setAlign("right"); - break; - case DisplayType.Number: - case DisplayType.CostPrice: - info = wsc.numberFormat.format(data); - td.setAlign("right"); - break; - case DisplayType.Quantity: - info = wsc.quantityFormat.format(data); - td.setAlign("right"); - break; - case DisplayType.Integer: - info = wsc.integerFormat.format(data); - td.setAlign("right"); - break; - case DisplayType.YesNo: - info = Msg.getMsg(ws.ctx, data.toString()); - break; - /** @todo output formatting 2 */ - default: - if (DisplayType.isLookup(dt)) - info = field.getLookup().getDisplay(data); - else - info = data.toString(); - } - } - - // Empty info - if (info == null || info.length() == 0) - info = " "; // Space - // - td.addElement(info); - line.addElement(td); - } // for all columns - table.addElement(line); - - } // for all table lines - //Modified by Rob Klein 4/29/07 - table.addElement(""); - // Status Line - String statusDB = String.valueOf(initRowNo+1) + "-" + String.valueOf(lastRow) + " / " + ws.curTab.getRowCount(); - - return createLayout (action, table, wsc, ws, ws.curTab.getDescription(), statusDB); - } // getMR_Form - - /** - * Create Window Layout. - * @param action form action - * @param contentTable content table - * @param wsc web session context - * @param ws window status - * @param statusInfo status line info - * @param statusDB status db info - * @return Form - */ - private WebDoc createLayout (String action, table contentTable, - WebSessionCtx wsc, WWindowStatus ws, String statusInfo, String statusDB) - { - form myForm = null; - myForm = new form(action); - myForm.setID("WForm"); - myForm.setOnSubmit("this.target=window.name"); - String AD_Language = Env.getAD_Language(ws.ctx); - - // Window - myForm.setName(FORM_NAME); - myForm.addElement(new input("hidden", P_Command, "")); // button commands - myForm.addElement(new input("hidden", P_MR_RowNo, "")); // RowNo - myForm.addElement(new input("hidden", P_ChangedColumn, "")); // - - // Set Title of main window - String title = ws.mWindow.getName() + " - " + wsc.loginInfo; - myForm.addElement(new script("top.document.title='" + title + "';")); - //Modified by Rob Klein 4/29/07 - // Buttons - td toolbar = new td("toolbar", AlignType.LEFT, AlignType.MIDDLE, true); - // Toolbar - toolbar.addElement(createImageLink (AD_Language, "Menu", - "parent.resizeFrame('5,*')", - true, false)); - toolbar.addElement(createImageLink (AD_Language, "Ignore", - "'reset'", true, false)); - toolbar.addElement(" "); - toolbar.addElement(createImageLink (AD_Language, "Help", - "startPopup('WHelp?AD_Window_ID=" + ws.mWindow.getAD_Window_ID() + "')", - true, false)); - toolbar.addElement(createImageLink (AD_Language, "New")); - toolbar.addElement(createImageLink (AD_Language, "Delete","'if(confirm(deleteText))'", true, false)); - toolbar.addElement(createImageLink (AD_Language, "Save")); - toolbar.addElement(" "); - toolbar.addElement(createImageLink (AD_Language, "Chat","startPopup('WChat')", true, false)); - toolbar.addElement(createImageLink (AD_Language, "Refresh")); - toolbar.addElement(createImageLink (AD_Language, "Attachment", - "startPopup('WAttachment')", ws.curTab.canHaveAttachment(), ws.curTab.hasAttachment())); - toolbar.addElement(createImageLink (AD_Language, "Multi", null, true, !ws.curTab.isSingleRow())); - toolbar.addElement(createImageLink (AD_Language, "FindAdv","startPopup('WFindAdv')", true, false)); - - if (m_searchField!=null) { - input txtSearch = new input(input.TYPE_TEXT, "txtSearch", "[" + m_searchField + "]"); - txtSearch.setOnChange("SubmitForm('Find', 'Submit','toolbar');return false;"); - toolbar.addElement(txtSearch); - } - - toolbar.addElement(" "); - toolbar.addElement(createImageLink (AD_Language, "History","startPopup('WHistory')", true, false)); - //toolbar.addElement(createImageLink (AD_Language, "History", - // null, ws.mWindow.isTransaction()&&ws.curTab.getTabNo()==0, !ws.curTab.isOnlyCurrentRows())); - toolbar.addElement(" "); - boolean isFirst = ws.curTab.getCurrentRow() < 1; - toolbar.addElement(createImageLink (AD_Language, "First", null, !isFirst, false)); - toolbar.addElement(createImageLink (AD_Language, "Previous", null, !isFirst, false)); - boolean isLast = ws.curTab.getCurrentRow()+1 == ws.curTab.getRowCount(); - toolbar.addElement(createImageLink (AD_Language, "Next", null, !isLast, false)); - toolbar.addElement(createImageLink (AD_Language, "Last", null, !isLast, false)); - toolbar.addElement(" "); - toolbar.addElement(createImageLink (AD_Language, "Report","startPopup('WReport')", true, false)); - toolbar.addElement(" "); - toolbar.addElement(createImageLink (AD_Language, "Favorite")); - toolbar.addElement(createImageLink (AD_Language, "Exit")); - // Tabs - td tabbar = new td("windowCenter", AlignType.LEFT, AlignType.MIDDLE, false); - tabbar.addElement(new input(input.TYPE_HIDDEN, P_Tab, "")); - for (int i = 0; i < ws.mWindow.getTabCount(); i++) - { - GridTab tab = ws.mWindow.getTab(i); - if (tab.isSortTab()) - continue; - //Modified by Rob Klein 4/29/07 - a big = new a("#",new span(tab.getName())); - if (ws.curTab.getTabNo() == i) - big.setID("tabSelected"); // css - else - { - //Modified by Rob Klein 4/29/07 - big.setID("tab"); // css - big.setOnClick( "SubmitForm(" + i + ",'Submit','tab')"); - } - // Status: Description - if (tab.getDescription().length() > 0) - big.setOnMouseOver("status='" + tab.getDescription() + "';return true;"); - - if (tab.isReadOnly()) - tabbar.addElement(new i().addElement(big)); - else - tabbar.addElement(big); - } - - // Top Table - //Modified by Rob Klein 4/29/07 - table topTable = new table ("0", "0", "0", "100%", null); - topTable.setID("WWindow.topTable"); - topTable.addElement(new tr(toolbar)); - topTable.addElement(new tr(tabbar)); - myForm.addElement(topTable); - - // Fields - - div panel=new div(); - panel.setStyle("overflow: scroll;overflow: auto;"); - panel.addElement(contentTable); - - myForm.addElement(panel); - - // Status Line - table statusTable = new table ("0", "0", "0", "100%", null); - topTable.setID("WWindow.statusLine"); - tr statusLine = new tr(); - statusLine.addElement(new td().setWidth("85%").setAlign(AlignType.LEFT) - .addElement(" # " + statusInfo)); - a db =new a("#"); - db.setOnClick("alert('" + ws.curTab.getKeyColumnName() + " = " + ws.curTab.getRecord_ID() + "')"); - db.addElement(statusDB); - statusLine.addElement(new td().setWidth("10%").setAlign(AlignType.RIGHT) - .addElement(db)); - statusLine.addElement(new td().setWidth("5%").setAlign(AlignType.RIGHT) - //Modified by Rob Klein 4/29/07 - .addElement(createImageLink (AD_Language, "Save"))); - statusTable.addElement(statusLine).setClass("windowCenter"); - myForm.addElement(statusTable); - - //Beg Modified by Rob Klein - //div menupop = new div(); - //menupop.setOnMouseOver("clearhidemenu()"); - //menupop.setOnMouseOut("dynamichide(event)"); - //menupop.setID("popitmenu"); - //myForm.addElement(menupop); - //End Modified by Rob Klein - - // fini - /** @todo Dynamic Display */ - // myForm.addElement(new script("dynDisplay(); createWCmd();")); // initial Display & set Cmd Window - - WebDoc doc = createPage(ws); - // Main Table - doc.getTable().addElement(new tr() - .addElement( - new td(null, AlignType.CENTER, AlignType.MIDDLE, - true, myForm).setColSpan(2))); - // - return doc; - } // createLayout - - /** - * Create Page. - * - Set Header - * @param ws status - * @return WDoc page - */ - private static WebDoc createPage (WWindowStatus ws) - { - WebDoc doc = WebDoc.createWindow (ws.mWindow.getName()); - // Set Variables - doc.getBody().addElement( - new script("deleteText='" + Msg.getMsg(ws.ctx, "DeleteRecord?") + "';")); - // - return doc; - } // createPage - - -/************************************************************************** - * Create Image with name, id of button_name and set P_Command onClick - * @param AD_Language - * @param name Name of the Image used also for Name24.gif - * @param js_command Java script command, null results in 'submit();', an empty string disables OnClick - * @param enabled Enable the immage button, if not uses the "D" image - * @param pressed If true, use the "X" image - * @return Image - */ - private static img createImage (String AD_Language, String name, String js_command, boolean enabled, boolean pressed) - { - StringBuffer imgName = new StringBuffer(name); - if (!enabled) - imgName.append("D"); - else if (pressed) - imgName.append("X"); - imgName.append("16.gif"); - // - img img = new img (WebEnv.getImageDirectory(imgName.toString()), name); - if (enabled) - img.setAlt(Msg.getMsg(AD_Language, name)); // Translate ToolTip - // - if (!pressed || !enabled) - img.setID("imgButton"); // css - else - img.setID("imgButtonPressed"); // css - img.setHeight(16); - img.setWidth(16); - img.setBorder(0); - img.setTitle(name); - // - // - return img; - } // createImage - - /** - * Create enabled Image with name, id of button_name and sumbit command - * @param AD_Language - * @param name Name of the Image used also for Name24.gif - * @return Image - */ - private static img createImage (String AD_Language, String name) - { - return createImage (AD_Language, name, null, true, false); - } // createImage - - - //Modified by Rob Klein 4/29/07 - - /************************************************************************** - * Create Image with name, id of button_name and set P_Command onClick - * @param AD_Language - * @param name Name of the Image used also for Name24.gif - * @param js_command Java script command, null results in 'submit();', an empty string disables OnClick - * @param enabled Enable the immage button, if not uses the "D" image - * @param pressed If true, use the "X" image - * @return Image - */ - private static a createImageLink (String AD_Language, String name, String js_command, boolean enabled, boolean pressed) - { - - a img = new a ("#", createImage (AD_Language, name)); - - if (!pressed || !enabled) - img.setID("imgButtonLink"); // css - else - img.setID("imgButtonPressedLink"); // css - // - if (js_command == null) - js_command = "'Submit'"; - if (js_command.length() > 0 && enabled){ - if(js_command.startsWith("startPopup")) - img.setOnClick(js_command); - else - img.setOnClick( "SubmitForm('" + name + "', " + js_command + ",'toolbar');return false;"); - } - img.setClass("ToolbarButton"); - img.setOnMouseOver("window.status='"+name+"';return true;"); - img.setOnMouseOut("window.status='';return true;"); - img.setOnBlur("this.hideFocus=false"); - // - return img; - } // createImageLink - /** - * Create enabled Image with name, id of button_name and sumbit command - * @param AD_Language - * @param name Name of the Image used also for Name24.gif - * @return Image - */ - private static a createImageLink (String AD_Language, String name) - { - return createImageLink (AD_Language, name, null, true, false); - } // createImageLink - - - /************************************************************************** - * Add Field to Line - * @param wsc session context - * @param line format element - * @param field field - * @param oData original data - * @param hasDependents has Callout function(s) - */ - public static void addField (WebSessionCtx wsc, tr line, GridField field, - Object oData, boolean hasDependents, int recordID, int tableID, boolean tabRO, int fieldNumber, - GridTab mTab, MRole role) - { - String columnName = field.getColumnName(); - // Any Error? - boolean error = field.isErrorValue(); - if (error) - oData = field.getErrorValue(); - int dt = field.getDisplayType(); - boolean hasCallout = field.getCallout().length() > 0; - //Modified by Rob Klein 4/29/07 - if(!field.getFieldGroup().equals(sectionNameOld)&&!field.getFieldGroup().equals("")&&field.getFieldGroup()!=null) - { - log.fine("Fieldgroup=" + field.getFieldGroup()+"."); - td td1 = new td(); - td1.setClass("Fieldgroup"); - td1.addElement(field.getFieldGroup()); - td td2 = new td().setColSpan(4); - td2.setClass("Fieldgroup"); - td2.addElement(new hr().setWidth("100%")); - line.addElement( new tr().addElement(td1)); - line.addElement( new tr().addElement(td2)); - - sectionNameOld = field.getFieldGroup(); - } - - /** Set read only value - * - */ - boolean fieldRO = true; - if (tabRO==true) - fieldRO = true; - else - fieldRO = !field.isEditable(true); - - /** - * HTML Label Element - * ID = ID_columnName - * - * HTML Input Elements - * NAME = columnName - * ID = ID_columnName - */ - WebField wField = new WebField (wsc, - columnName, field.getHeader(), field.getDescription(), - dt, field.getFieldLength(), field.getDisplayLength(), field.isLongField(), - // readOnly context check, mandatory no context check, - //Modified by Rob Klein 4/29/07 - //!field.isEditable(true), field.isMandatory(false), error, - fieldRO, field.isMandatory(false), error, - hasDependents, hasCallout,field.getAD_Process_ID(),field.getAD_Window_ID(), - recordID, tableID, fieldNumber, field.getDefault(), field.getCallout(), - mTab, field, role ); - line - .addElement(wField.getLabel()) - .addElement(wField.getField(field.getLookup(), oData)); - } // addField - - private Object lookupValue(String key, Lookup lookup) { - if (lookup.containsKey(key)) - return lookup.get(key); - - return DB.getSQLValueString(null, "SELECT " + lookup.getColumnName() + " FROM " + lookup.getZoomQuery().getTableName() + " WHERE " + lookup.getZoomQuery().getWhereClause() + " AND Value LIKE ?", key); - } - -} // WWindow diff --git a/serverApps/src/main/servlet/org/compiere/www/WWindowStatus.java b/serverApps/src/main/servlet/org/compiere/www/WWindowStatus.java deleted file mode 100644 index a633170cb1..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WWindowStatus.java +++ /dev/null @@ -1,116 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import org.compiere.model.*; -import org.compiere.util.WebUtil; - - -public class WWindowStatus -{ - public static WWindowStatus get (HttpServletRequest request) - { - HttpSession sess = request.getSession(false); - if (sess == null) - return null; - String wsName=WebUtil.getParameter(request,"wsName"); - System.out.println("main window wsName = "+wsName); - String newWindow=WebUtil.getParameter(request,"blankWindow"); - WWindowStatus clientWS=(WWindowStatus)sess.getAttribute(NAME); - if((wsName==null&&WStatusArrayList.get(request)==null)||clientWS.getStatusName().equals(wsName)) - { - System.out.println("Run wsName==null 1"); - System.out.println("clientWS = "+clientWS); - return clientWS; - } - String AD_Menu_ID=WebUtil.getParameter(request,"AD_Menu_ID"); - if(wsName==null&&WStatusArrayList.get(request)!=null&&newWindow==null&&AD_Menu_ID!=null) - { System.out.println("Run if(wsName == null) 2"); - WWindowStatus ws=(WWindowStatus)WStatusArrayList.get(request).getWSFromStatusArray("1"); - sess.setAttribute(WWindowStatus.NAME, ws); - return ws; - } - if(wsName!=null) - { - System.out.println("if(wsName!=null)"); - WStatusArrayList wsl=WStatusArrayList.get(request); - - if(wsl==null) - {System.out.println("wsName!=null && wsl == null"); - return null; - } - - WWindowStatus serverWS=wsl.getWSFromStatusArray(wsName); - - if(serverWS==null) - { System.out.println("wsName!=null && serverWS == null"); - return null; - } - - sess.setAttribute(WWindowStatus.NAME, serverWS); - System.out.println("serverWS"); - return serverWS; - - } - return clientWS; - } - public WWindowStatus (GridWindowVO mWindowVO) - { - mWindow = new GridWindow(mWindowVO); - curTab = mWindow.getTab(0); - curTab.setSingleRow(true); - // - ctx = mWindowVO.ctx; - statusName=""; - } // WWindowStatus -/* public WWindowStatus (GridWindowVO mWindowVO) - { - mWindow = new GridWindow(mWindowVO); - curTab = mWindow.getTab(0); - curTab.setSingleRow(true); - ctx = mWindowVO.ctx; - statusName=""; - } */ - public static final String NAME = "WWindowStatus"; - protected GridWindow mWindow; - protected GridTab curTab; - private String statusName; - - public Properties ctx = null; - public String getStatusName() - { - return statusName; - } - public void setStatusName(String name) - { - statusName=name; - } - public int getWindowNo() - { - return mWindow.getWindowNo(); - } - public String toString() - { - return "WWindowStatus[" + mWindow - + " - " + curTab + "]"; - } -} \ No newline at end of file diff --git a/serverApps/src/main/servlet/org/compiere/www/WWorkflow.java b/serverApps/src/main/servlet/org/compiere/www/WWorkflow.java deleted file mode 100644 index 84c3b6a3bf..0000000000 --- a/serverApps/src/main/servlet/org/compiere/www/WWorkflow.java +++ /dev/null @@ -1,933 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.www; - -import java.io.IOException; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Properties; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.ecs.xhtml.body; -import org.apache.ecs.xhtml.br; -import org.apache.ecs.xhtml.form; -import org.apache.ecs.xhtml.h6; -import org.apache.ecs.xhtml.head; -import org.apache.ecs.xhtml.hr; -import org.apache.ecs.xhtml.img; -import org.apache.ecs.xhtml.input; -import org.apache.ecs.xhtml.link; -import org.apache.ecs.xhtml.script; -import org.apache.ecs.xhtml.table; -import org.apache.ecs.xhtml.td; -import org.apache.ecs.xhtml.tr; -import org.compiere.util.DB; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.compiere.util.WebDoc; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; -import org.compiere.wf.MWFNode; -import org.compiere.wf.MWorkflow; - - - - -/** - * - * - * @author Jack Lam - * @version $Id: WWorkflow.java,v 1.1 2009/04/15 11:27:15 vinhpt Exp $ - */ -public class WWorkflow extends HttpServlet -{ - /** - * - */ - private static final long serialVersionUID = 7220553249782175533L; - - /** - * Initialize global variables - */ - -public static final int SIZE = 3; -public static final int SPACE = 0; -public static final int ARROW_FORWARD = -1; -public static final int ARROW_BACKWARD = -3; -public static final int ARROW_DOWN = -2; - -public static final String WORKFLOW = "Workflow"; -public static final String NODES = "Nodes"; -public static final String NODES_ID = "Nodes_ID"; -public static final String IMAGE_MAP= "Image_Map"; -public static final String ACTIVE_NODE= "Active_Node"; - -public static final String M_Command = "MCommand"; // move command -public static final String J_Command = "JCommand"; // jump command - -public static final String FIRST = "Start"; -public static final String NEXT = "Next"; -public static final String BACK= "Back"; -public static final String LAST= "End"; - -private static final String FORM_NAME = "MForm"; -private static final String TARGET_WINDOW = "WWindow"; -private static final String FORM_ACTION = "/adempiere/WWorkflow"; - - -private static String AD_Language = null; -Properties ctx = null; - -/** Window Number Counter */ -private static int s_WindowNo = 1; - - - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - if (!WebEnv.initWeb(config)) - throw new ServletException("WWorkflow.init"); - } // init - - /** - * Process the HTTP Get request - Initial Call. - *
        - * http://localhost/adempiere/WWorkflow?AD_Menu_ID=123 - *
        - * - * Find the AD_Workflow_ID - * Load workflow and initial session atribute - * Create output - * - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - //Log.trace(Log.l1_User, "WWorkflow.doGet"); -//WUtil.debug(new String("In do get"),""); - - - // Get Session attributes - HttpSession sess = request.getSession(); - WebSessionCtx wsc = WebSessionCtx.get(request); - ctx = wsc.ctx; - //String loginInfo = (String)sess.getAttribute(WebEnv.SA_LOGININFO); - if (ctx == null) - { - WebUtil.createTimeoutPage(request, response, this, null); - return; - } - - - - // Get Parameter: Menu_ID - int AD_Menu_ID = WebUtil.getParameterAsInt(request, "AD_Menu_ID"); - - // Get Parameter: Menu_ID - int AD_Window_ID = WebUtil.getParameterAsInt(request, "AD_Window_ID"); - - - //set language - AD_Language = Env.getAD_Language(ctx); - - //load AD_Workflow_ID - int AD_Workflow_ID = getAD_Workflow_ID(AD_Menu_ID); - - //load workflow - loadWorkflow(ctx, AD_Workflow_ID,sess); - - //get session attributes - MWorkflow wf = (MWorkflow)sess.getAttribute(WORKFLOW); - MWFNode [] nodes = (MWFNode []) sess.getAttribute( NODES); - ArrayList nodes_ID = (ArrayList) sess.getAttribute( NODES_ID); - int [][] imageMap = (int [][] )sess.getAttribute( IMAGE_MAP); - int activeNode = ((Integer) sess.getAttribute( ACTIVE_NODE)).intValue(); - - //create output - WebDoc doc = preparePage("loginInfo"); - doc = createLayout( doc,wf,activeNode,nodes,nodes_ID,imageMap); - WebUtil.createResponse(request, response, this, null, doc, false); - } // doGet - - - /** - * Process the HTTP Post request - Initial Call. - * - * Execute the received command - * Update session attributes - * Create output - * - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - //WUtil.debug(new String("In do Post"),""); - HttpSession sess = request.getSession(); - - WebSessionCtx wsc = WebSessionCtx.get(request); - Properties ctx = wsc.ctx; - if (ctx == null){ - WebUtil.createTimeoutPage(request, response, this, null); - - return; - } - //String loginInfo = (String)sess.getAttribute(WEnv.SA_LOGININFO); - - - - - //get session attributes - MWorkflow wf = (MWorkflow)sess.getAttribute(WORKFLOW); - MWFNode [] nodes = (MWFNode []) sess.getAttribute( NODES); - ArrayList nodes_ID = (ArrayList) sess.getAttribute( NODES_ID); - int [][] imageMap = (int [][] )sess.getAttribute( IMAGE_MAP); - int activeNode = ((Integer) sess.getAttribute( ACTIVE_NODE)).intValue(); - - - - //execute commnad - String m_command = request.getParameter(M_Command); - int j_command = WebUtil.getParameterAsInt(request, J_Command); - //WUtil.debug(m_command,"m_command"); - //WUtil.debug(""+j_command,"j_command"); - - - executeCommand(m_command,j_command ,wf,activeNode,nodes,nodes_ID,sess); - - -//get updated session attributes - wf = (MWorkflow)sess.getAttribute(WORKFLOW); - nodes = (MWFNode []) sess.getAttribute( NODES); - nodes_ID = (ArrayList) sess.getAttribute( NODES_ID); - imageMap = (int [][] )sess.getAttribute( IMAGE_MAP); - activeNode = ((Integer) sess.getAttribute( ACTIVE_NODE)).intValue(); - - - //create layout - WebDoc doc = preparePage ("loginInfo"); - doc = createLayout(doc,wf,activeNode,nodes,nodes_ID,imageMap); - WebUtil.createResponse(request, response, this, null, doc, false); - } // doPost - - -/**********************************************************************************************/ - -/** - * Generate image map array. - * - Generate the orientation of workflow automatically - * - * @param nodes - * @return int [][] - */ -private int [][] generateImageMap(ArrayList nodes_ID){ - -// number of nodes -int numOfNode = nodes_ID.size(); - -int rowNode_count = (int) Math.ceil( (float)numOfNode/SIZE ) ; - -int rowTotal_count = 2*rowNode_count -1 ; - -int ROW = rowTotal_count; -int COL = 2*SIZE-1; - - -int [][] imageMap = new int [ROW][COL]; -// -boolean isEmptyRow_Right = true; -boolean isForwardRow = true; -int row_Last = ROW - 1; -//indexs -int index_Row =0; -int index_Node =0; -int i,j; - - -//operate on every row -for (index_Row=0;index_Row < ROW ;index_Row++) -{ -//odd row -if ( (index_Row % 2) != 0) -{ -if(isEmptyRow_Right){ - imageMap[index_Row][COL-1] = ARROW_DOWN; -isEmptyRow_Right = false; -} -else { - imageMap[index_Row][0]= ARROW_DOWN; -isEmptyRow_Right = true; -} -}//odd row - - -//even row -if ( (index_Row % 2) == 0) -{ -if (isForwardRow) -{ -isForwardRow = false; - -// Last row -if (index_Row == row_Last) -{ -j=0; -for (i=index_Node;i"+nodes[getIndex(imageMap[i][j],nodes_ID)].getName()+""); -}//active node - -else { -//Create image -AD_Window_ID = nodes[getIndex(imageMap[i][j],nodes_ID)].getAD_Window_ID(); - // url = "'WWindow?AD_Window_ID="+AD_Window_ID+"&Target_Window=win_"+AD_Window_ID+"'"; - url = "'WWindow?AD_Window_ID="+AD_Window_ID; - -//url=WebEnv.getBaseDirectory("WWindow")+"?AD_Window_ID="+AD_Window_ID+"&Target_Window=win_"+AD_Window_ID+"'"; - Target_Window = "'WWindow"+AD_Window_ID+"'"; - - System.out.println("WorkFlow else======"+url); - parameters = url+ "',"+Target_Window; - js_command = "popUp("+parameters+");submit()"; - normalNodeImage = createWorkflowImage("mWorkFlow_", imageMap[i][j],js_command, false); - -grid.addElement(normalNodeImage); -grid.addElement(new br()); -grid.addElement(""+imageMap[i][j]); -grid.addElement(new br()); -grid.addElement(nodes[getIndex(imageMap[i][j],nodes_ID)].getName()); -}//inactive node -} -aRow.addElement(grid); -}//process every gird - -imageTable.addElement(aRow); -}//every row - - - -return imageTable; -}//printWorkflow - - - -/** - * Print the description for a workflow or a node. - * - * - * @param activeNode - * @param wf - * @param nodes - * @param nodes_ID - * - * @return table - */ -private table printDescription(int activeNode, MWorkflow wf, MWFNode [] nodes, ArrayList nodes_ID){ -//create new table -table desTable = new table(); - -String WFName=""; -String WFDescription =""; - -//not started yet -if(activeNode < 0 ){ -WFName =wf.getName(); -WFDescription=wf.getHelp(); -} - -//started -else{ -WFName =nodes[getIndex(activeNode,nodes_ID)].getName(); -WFDescription=nodes[getIndex(activeNode,nodes_ID)].getHelp(); -} - -//add info to the desciption table -tr aRow = new tr(); -td aGrid = new td(); -aGrid.addElement (new h6(WFName)); -aGrid.addElement (new br()); -aGrid.addElement (WFDescription); -desTable.addElement(aRow.addElement(aGrid)); - -return desTable; -}// printDescription - - - -/** - * Find the index at which the WFNode ID is positioned. - * - * - * @param node_ID - * @param nodes_ID - * - * @return int - */ -private int getIndex(int node_ID, ArrayList nodes_ID){ - -int index = 0; - -for(int i =0;i=0 ? getIndex(activeNode,nodes_ID)-1 : 0 ; -//WUtil.debug(""+index,"index"); -Back_Window_ID= nodes[index].getAD_Window_ID(); -} -if(!isLast){ -index = activeNode >=0 ? getIndex(activeNode,nodes_ID)+1 : 0 ; -Next_Window_ID= nodes[index].getAD_Window_ID(); -} -boolean enableFirst = true; -boolean enableBack = true; -boolean enableNext = true; -boolean enableLast = true; - -if(isFirst) { - enableBack = false; - enableFirst = false; -} -if(isLast) { -enableNext = false; -enableLast = false; -} - -td firstImage = new td(); -td backImage = new td(); -td nextImage = new td(); -td lastImage = new td(); - -//first - String url = "'WWindow?AD_Window_ID="+First_Window_ID +"'"; - //String url=WebEnv.getBaseDirectory("WWindow")+"?AD_Window_ID="+First_Window_ID+"&Target_Window=win_"+First_Window_ID+"'"; - String Target_Window = "'WWindow"+First_Window_ID+"'"; - String parameters = url+ ","+Target_Window; - String js_command = "popUp("+parameters+");submit()"; - firstImage.addElement(createControlButtonImage("Start", js_command, enableFirst)); -//back - url = "'WWindow?AD_Window_ID="+Back_Window_ID + "'"; - // url=WebEnv.getBaseDirectory("WWindow")+"?AD_Window_ID="+Back_Window_ID+"&Target_Window=win_"+Back_Window_ID+"'"; - Target_Window = "'WWindow"+Back_Window_ID+"'"; - parameters = url+ ","+Target_Window; - js_command = "popUp("+parameters+");submit()"; - backImage.addElement(createControlButtonImage("Back", js_command, enableBack)); - -//next - url = "'WWindow?AD_Window_ID="+Next_Window_ID+"'"; - //url=WebEnv.getBaseDirectory("WWindow")+"?AD_Window_ID="+Next_Window_ID+"&Target_Window=win_"+Next_Window_ID+"'"; - Target_Window = "'WWindow"+Next_Window_ID+"'"; - parameters = url+ ","+Target_Window; - js_command = "popUp("+parameters+");submit()"; - nextImage.addElement(createControlButtonImage("Next", js_command, enableNext)); - -//last - url = "'WWindow?AD_Window_ID="+Last_Window_ID+"'"; -// url=WebEnv.getBaseDirectory("WWindow")+"?AD_Window_ID="+Last_Window_ID+"&Target_Window=win_"+Last_Window_ID+"'"; - Target_Window = "'WWindow"+Last_Window_ID+"'"; - parameters = url+ ","+Target_Window; - js_command = "popUp("+parameters+");submit()"; - lastImage.addElement(createControlButtonImage("End", js_command, enableLast)); - - -tr aRow = new tr(); -aRow.addElement(firstImage); -aRow.addElement(backImage); -aRow.addElement(nextImage); -aRow.addElement(lastImage); - -//add the table to the form -myForm.addElement(new table().addElement(aRow)); - -return myForm; -}//printControlPanel - - -/** - * Create Image with name, id of button_name and set M_Command onClick - * - * - * @param name Name of the Image used also for Name24.gif - * @param js_command Java script command, null results in 'submit();', an empty string disables OnClick - * @param enabled Enable the immage button, if not uses the "D" image - - * @return Image - */ - private static img createControlButtonImage (String name, String js_command, boolean enabled) - { - StringBuffer imgName = new StringBuffer("wf" + name); - - if (!enabled) - imgName.append("D"); - - imgName.append("24.gif"); - // - img img = new img (WebEnv.getImageDirectory(imgName.toString()), name); - if (enabled) - img.setAlt(Msg.getMsg(AD_Language, name)); // Translate ToolTip - - img.setID("imgButton"); // css - - //append js command only to enabled image - if ( js_command != null && js_command.length() > 0 && enabled){ - img.setOnClick("document." + FORM_NAME + "." + M_Command + ".value='" + name + "';" + js_command); - } - // - return img; - } // createImage - -/** - * Create Image with name, id of button_name and set M_Command onClick - * - * - * @param name Name of the Image used also for Name24.gif - * @param js_command Java script command, null results in 'submit();', an empty string disables OnClick - * @param enabled Enable the immage button, if not uses the "D" image - - * @return Image - */ - private static img createWorkflowImage (String name, int activeNode , String js_command, boolean pressed) - { - StringBuffer imgName = new StringBuffer(name); - imgName.append("WF"); - - imgName.append(".gif"); - // - img img = new img (WebEnv.getImageDirectory(imgName.toString()), name); - - - -if ( !(imgName.toString()).startsWith("Spacer") && !(imgName.toString()).startsWith("Arrow")){ - if(!pressed) - img.setID("imgButton"); // css - else - img.setID("imgButtonPressed"); - } - - //append js command only to enabled image - if ( js_command != null && js_command.length() > 0 && activeNode != 0){ -String js_command_front = "document." + FORM_NAME + "." + J_Command + ".value='" + activeNode + "'; " ; -js_command_front= js_command_front + "document." + FORM_NAME + ".submit();"; - img.setOnClick(js_command_front + js_command ); - } - // - return img; - } // createImage - - -/** - * Print the entire layout . - * - * - * @param activeNode - * @param wf - * @param nodes - * @param nodes_ID - * @param imageMap - * - * @return WReportEngine - */ -private WebDoc createLayout(WebDoc doc , MWorkflow wf,int activeNode,MWFNode [] nodes, ArrayList nodes_ID, int [][] imageMap){ -body b= doc.getBody(); - -b.addElement(printWorkflow(activeNode, wf, nodes, nodes_ID, imageMap)); -b.addElement(new hr()); -b.addElement(printDescription(activeNode, wf, nodes, nodes_ID)); -b.addElement(new br()); -b.addElement(printControlPanel(activeNode, wf, nodes, nodes_ID)); - -return doc; -}//createLayout - -/** - * Load workflw and initialize the session attributes. - * - * - * @param ctx - * @param AD_Workflow_ID - * @param sess - * - */ -private void loadWorkflow(Properties ctx, int AD_Workflow_ID, HttpSession sess) { - - - MWorkflow wf = new MWorkflow (ctx, AD_Workflow_ID,null); - //get the MWFNode in order - MWFNode[] nodes = wf.getNodes(true,Env.getContextAsInt(ctx, "#AD_Client_ID")); - MWFNode wfn=null; - ArrayList nodes_ID = new ArrayList(); - for (int i = 0; i < nodes.length; i++) - { - wfn= nodes[i]; - nodes_ID.add (new Integer(wfn.getAD_WF_Node_ID())); - }//for - int imageMap [][] = generateImageMap(nodes_ID); - //printMap(imageMap); -//set session attribtes -sess.setAttribute( WORKFLOW,wf); -sess.setAttribute( NODES,nodes); -sess.setAttribute( NODES_ID,nodes_ID); -sess.setAttribute( IMAGE_MAP,imageMap); -sess.setAttribute( ACTIVE_NODE,new Integer(-999)); - -}//loadWorkflow - -/** - * Execute the M_Command and update the . - * - * - * @param m_command - * @param wf - * @param activeNode - * @param nodes - * @param nodes_ID - * @param sess - * - */ -private void executeCommand(String m_command, int j_command , MWorkflow wf,int activeNode, MWFNode [] nodes,ArrayList nodes_ID, HttpSession sess){ -if (j_command != 0 ) -{ -sess.setAttribute(ACTIVE_NODE, new Integer(j_command)); -return; -} - -debug(m_command,"m_command in executeCommand"); -//check first or last node -boolean isFirst = wf.isFirst(activeNode,Env.getContextAsInt(ctx, "#AD_Client_ID")); -boolean isLast = wf.isLast(activeNode,Env.getContextAsInt(ctx, "#AD_Client_ID")); - -boolean notReady = false; -int updatedActiveNode = activeNode; - -if (activeNode < 0 ) notReady = true; - -if (notReady){ -updatedActiveNode = ((Integer) nodes_ID.get(0)).intValue(); - -} - -else{ -if(m_command.equals(NEXT)){ -if(notReady) - updatedActiveNode = ((Integer) nodes_ID.get(0)).intValue(); - else - updatedActiveNode= wf.getNext(activeNode,Env.getContextAsInt(ctx, "#AD_Client_ID")); - -}//next -if(m_command.equals(BACK)) { - if(notReady) - updatedActiveNode = ((Integer) nodes_ID.get(0)).intValue(); - else - updatedActiveNode= wf.getPrevious(activeNode,Env.getContextAsInt(ctx, "#AD_Client_ID")); -}//back -if(m_command.equals(FIRST)) - updatedActiveNode= ((Integer) nodes_ID.get(0)).intValue(); - -if(m_command.equals(LAST)) updatedActiveNode= wf.getLast(0,Env.getContextAsInt(ctx, "#AD_Client_ID")); -}//ready - -//update -sess.setAttribute(ACTIVE_NODE,new Integer(updatedActiveNode)); -}//executeCommand - - -/** - * Retrieve the AD_Workflow_ID from database using AD_Menu_ID. - * - * - * @param AD_Menu_ID - * - * @return int - */ -private int getAD_Workflow_ID(int AD_Menu_ID){ - - int AD_Workflow_ID=0; - String sql = "SELECT AD_Workflow_ID FROM AD_Menu " - + "WHERE AD_Menu_ID=? AND Action='F'"; - try - { - PreparedStatement pstmt = DB.prepareStatement(sql); - pstmt.setInt(1, AD_Menu_ID); - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) - AD_Workflow_ID= rs.getInt(1); - rs.close(); - pstmt.close(); - } - catch (SQLException e) - { - - e.printStackTrace(); - } -return AD_Workflow_ID; -}//getAD_Workflow_ID - - -/** - * Prepare Page. - * - Set Header - * - * @param loginInfo - * - * @return WReportEngine page - */ - private WebDoc preparePage(String loginInfo) - { - WebDoc doc = WebDoc.create ("Workflow"); - head header = doc.getHead(); - body b=doc.getBody(); - // add window.js & .css - header.addElement(new script("", WebEnv.getBaseDirectory("/js/window.js"))); - header.addElement(new link().setRel("stylesheet").setHref(WebEnv.getBaseDirectory("/css/window.css"))); - // - // - String title ="Workflow"+" - " + loginInfo; - b.addElement(new script("top.document.title='" + title + "';")); - return doc; - } // preparePage - -/** - * Debugger. - * - Display the name and value set - * - * @param variable - * @param name - * - * @return WReportEngine page - */ -private void debug(Object variable , String name){ -if (variable!=null) -{ -System.out.println("*************"+name+"="+variable); -} -else -System.out.println("*************"+name+" is null"); -}//debug -private void printMap(int [][] map){ -final int ROW = map.length; -final int COL = map[0].length; - - for(int row=0;row 0) - m_description = description; - // - m_defaultObject = defaultvalue; - m_displayType = displayType; - m_processID = AD_Process_ID; - m_windowID = AD_Window_ID; - m_tableID = AD_Table_ID; - m_recordID = AD_Record_ID; - m_fieldLength = fieldLength; - m_displayLength = displayLength; - if (m_displayLength <= 22) - m_displayLength = 22; // default length - else - m_displayLength = 44; // default length - m_longField = longField; - // - m_readOnly = readOnly; - m_mandatory = mandatory; - m_error = error; - m_hasDependents = hasDependents; - m_hasCallout = hasCallout; - m_callOut = callOut; - m_fieldNumber = fieldNumber; - m_Tab = mTab; - m_Field = mField; - m_Role = mRole; - - // - - } // WebField - - /** CSS Field Mandatory Class */ - public static final String C_MANDATORY = "Cmandatory"; - /** CSS Field Error Class */ - public static final String C_ERROR = "Cerror"; - - /** Web Session Context */ - private WebSessionCtx m_wsc; - - private String m_columnName; - private String m_name; - private String m_description; - private String m_callOut; - private GridTab m_Tab; - private GridField m_Field; - private MRole m_Role; - // - private Object m_defaultObject; - private int m_displayType; - private int m_processID; - private int m_windowID; - private int m_tableID; - private int m_recordID; - private int m_fieldLength; - private int m_displayLength; - private boolean m_longField; - // - private boolean m_readOnly; - private boolean m_mandatory; - private boolean m_error; - private boolean m_hasDependents; - private boolean m_hasCallout; - private int m_fieldNumber; - private Object m_dataDisplay; - //Modified by Rob Klein 4/29/07 - - private Lookup m_lookup; - - /** - * Get the field Label - * @return label - */ - public td getLabel() - { - if (m_displayType == DisplayType.YesNo||m_displayType == DisplayType.Button) - return new td(WebEnv.NBSP); - // - label myLabel = new label(m_columnName + "F", null, Util.maskHTML(m_name)); - myLabel.setID(m_columnName + "L"); - if (m_description != null) - myLabel.setTitle(Util.maskHTML(m_description)); - // - td td = new td() - .addElement(myLabel) - .setAlign(AlignType.RIGHT) - .setVAlign(AlignType.TOP); - return td; - } // getLabel - - /** - * Create Left Top aligned TD - * @param element element - * @return td table data - */ - private td createTD (Element element) - { - td td = new td() - .addElement(element) - .setAlign(AlignType.LEFT) - .setVAlign(AlignType.TOP); - if (m_longField) - td.setColSpan(3); - return td; - } // createTD - - - /** - * Get Field - * @param lookup lookup - * @param data data - * @return field - */ - public td getField (Lookup lookup, Object data) - { - m_lookup=lookup; - String dataValue = (data == null) ? "" : data.toString(); - // - if (m_displayType == DisplayType.Search - || m_displayType == DisplayType.Location - || m_displayType == DisplayType.Account - || m_displayType == DisplayType.PAttribute) - { - String dataDisplay = ""; - if (lookup != null && data != null) - dataDisplay = lookup.getDisplay(data); - return getPopupField (dataDisplay, dataValue); - } - - if (DisplayType.isLookup(m_displayType) - || m_displayType == DisplayType.Locator){ - return getSelectField(lookup, dataValue);} - - if (m_displayType == DisplayType.YesNo){ - return getCheckField (dataValue);} - - if (m_displayType == DisplayType.Button){ - return getButtonField (); - } - //Modified by Rob Klein 4/29/07 - if (DisplayType.isDate(m_displayType)) - { - return getPopupDateField(data); - } - else if (DisplayType.isNumeric(m_displayType)){ - return getNumberField(data); - } - - // Strings - if (m_displayType == DisplayType.Text){ - return getTextField (dataValue, 3); - } - else if (m_displayType == DisplayType.TextLong){ - return getTextField (dataValue, 10); - } - else if (m_displayType == DisplayType.Memo){ - return getTextField (dataValue, 15); - } - - //other - //if (m_displayType == DisplayType.PAttribute){ - // return getPopupField(dataDisplay, dataValue);} - - if (m_displayType == DisplayType.Assignment){ - return getAssignmentField(data);} - return getStringField(dataValue); - } // getField - - - /** - * Create String Field - * @param data initial value - * @return td - */ - private td getStringField (String data) - { - input string = null; - - Boolean isEncrypted = false; - - if(m_Field != null) - isEncrypted = m_Field.isEncryptedField(); - - - if(isEncrypted) - string = new input(input.TYPE_PASSWORD, m_columnName, Util.maskHTML(data)); - else - string = new input(input.TYPE_TEXT, m_columnName, Util.maskHTML(data)); - - string.setID(m_columnName + "F"); - string.setSize(m_displayLength); - if (m_fieldLength > 0) - string.setMaxlength(m_fieldLength); - // - string.setDisabled(m_readOnly); - if (m_error) - string.setClass(C_ERROR); - else if (m_mandatory) - string.setClass(C_MANDATORY); - // - if (m_hasDependents || m_hasCallout) - string.setOnChange("startUpdate(this);"); -// string.setOnChange("dynDisplay();"); - // - return createTD(string); - } // getStringField - - /** - * Create Text Field - * @param data initial value - * @param rows no of rows - * @return td - */ - private td getTextField (String data, int rows) - { - textarea text = new textarea (m_columnName, rows, m_displayLength) - .addElement(Util.maskHTML(data)); - text.setID(m_columnName + "F"); - text.setDisabled(m_readOnly); - if (m_error) - text.setClass(C_ERROR); - else if (m_mandatory) - text.setClass(C_MANDATORY); - // - if (m_hasDependents || m_hasCallout) - text.setOnChange("startUpdate(this);"); - // - return createTD(text); - } // getTextField - - - /** - * Create Date Field - * @param data initial value - * @return td - */ - private td getDateField (Object data) - { - String formattedData = ""; - if (data == null) - ; - else if (m_displayType == DisplayType.DateTime) - formattedData = m_wsc.dateTimeFormat.format(data); - else - formattedData = m_wsc.dateFormat.format(data); - - input string = new input(input.TYPE_TEXT, m_columnName, formattedData); - string.setID(m_columnName + "F"); - string.setSize(m_displayLength); - if (m_fieldLength > 0) - string.setMaxlength(m_fieldLength); - // - string.setDisabled(m_readOnly); - if (m_error) - string.setClass(C_ERROR); - else if (m_mandatory) - string.setClass(C_MANDATORY); - // - if (m_hasDependents || m_hasCallout) - string.setOnChange("startUpdate(this);"); - // - return createTD(string); - } // getDateField - - /** - * Create Assignment Field - * @param data initial value - * @return td - */ - private td getAssignmentField (Object data) - { - - input string = new input(input.TYPE_TEXT, m_columnName, Util.maskHTML("")); - if (m_fieldLength > 0) - string.setMaxlength(m_fieldLength); - // - string.setDisabled(true); - if (m_error) - string.setClass(C_ERROR); - else if (m_mandatory) - string.setClass(C_MANDATORY); - // - if (m_hasDependents || m_hasCallout) - string.setOnChange("startUpdate(this);"); - return createTD(string).addElement("Not Yet Supported"); - } - - - /** - * Create Number Field - * @param data initial value - * @return td - */ - private td getNumberField (Object data) - { - String formattedData = ""; -//Modified by Rob Klein 4/29/07 - if (data == null) - if (m_displayType == DisplayType.Amount ) - formattedData = m_wsc.amountFormat.format(0.00); - else if (m_displayType == DisplayType.Number - || m_displayType == DisplayType.CostPrice) - formattedData = m_wsc.numberFormat.format(0.00); - else if (m_displayType == DisplayType.Integer) - formattedData = m_wsc.integerFormat.format(0); - else - formattedData = "0"; - //else if (m_displayType == DisplayType.Amount) - //formattedData = m_wsc.amountFormat.format(data); - //else if (m_displayType == DisplayType.Number - //|| m_displayType == DisplayType.CostPrice) - //formattedData = m_wsc.numberFormat.format(data); - else if (m_displayType == DisplayType.Quantity) - formattedData = m_wsc.quantityFormat.format(data); - else if (m_displayType == DisplayType.Integer) - formattedData = m_wsc.integerFormat.format(data); - else - formattedData = data.toString(); - // - input string = new input(input.TYPE_TEXT, m_columnName, formattedData); - string.setID(m_columnName + "F"); - string.setSize(m_displayLength); - if (m_fieldLength > 0) - string.setMaxlength(m_fieldLength); - // - string.setDisabled(m_readOnly); - if (m_error) - string.setClass(C_ERROR); - else if (m_mandatory) - string.setClass(C_MANDATORY); - // - if (m_hasDependents || m_hasCallout) - string.setOnChange("startUpdate(this);"); - // - return createTD(string); - } // getNumberField - - - /** - * Create Checkbox Field - * @param data initial value - * @return td - */ - private td getCheckField (String data) - { - boolean check = data != null - && (data.equals("true") || data.equals("Y")); - // - input cb = new input (input.TYPE_CHECKBOX, m_columnName, "true") - .setChecked(check) - .addElement(m_name); - cb.setID(m_columnName + "F"); - cb.setDisabled(m_readOnly); - if (m_error) - cb.setClass(C_ERROR); - // else if (m_mandatory) // looks odd - // cb.setClass(C_MANDATORY); - // - if (m_hasDependents || m_hasCallout) - cb.setOnChange("startUpdate(this);"); - // - return createTD(cb); - } // getCheckField - - /** - * Get Popup Field (lookup, location, account, ..) - * @param dataDisplay data to be displayed - * @param dataValue data of value field - * @return td - */ - private td getPopupField (String dataDisplay, String dataValue) - { - log.info("0"); - // The hidden data field Name=columnName - input hidden = new input (input.TYPE_HIDDEN, m_columnName, dataValue); - hidden.setID(m_columnName + "D"); - //Modified by Rob Klein 4/29/07 - input display = null; - m_dataDisplay = null; - // The display field Name=columnName, ID=FcolumnName - display = new input(input.TYPE_TEXT, m_columnName + "F", Util.maskHTML(dataDisplay)); - m_dataDisplay = dataDisplay; - display.setID(m_columnName + "F"); - display.setReadOnly(m_readOnly); - - //Modified by Rob Klein 4/29/07 - // The button Name=columnName, ID=BcolumnName - input button = new input (input.TYPE_IMAGE, m_columnName+ "B", "x"); - button.setID(m_columnName + "B"); - String gif = "PickOpen10.gif"; - if (m_displayType == DisplayType.Location) - gif = "Location10.gif"; - else if (m_displayType == DisplayType.Account) - gif = "Account10.gif"; - else if (m_columnName.equals("C_BPartner_ID")) - gif = "BPartner10.gif"; - else if (m_columnName.equals("M_Product_ID")) - gif = "Product10.gif"; - //Set PopUp - button.setSrc(WebEnv.getImageDirectory(gif)); - button.setBorder(1); - if (m_displayType == DisplayType.Location) - button.setOnClick("startLocation('" + m_columnName + "');return false;"); - else if (m_displayType == DisplayType.Account) - //modified by rob klein 4/29/07 - button.setOnClick("startLookup('" + m_columnName + "', "+m_processID+", 1);return false;"); - else - //modified by rob klein 4/29/07 - button.setOnClick("startLookup('" + m_columnName + "', "+m_processID+", 1);return false;"); - - //Start Popup Menu - //Add by Rob Klein 6/6/2007 - a buttonFlyout = null; - String menu = null; - - if(m_Field != null) - { - menu = getpopUpMenu (); - // Popmenu - if(menu!=null){ - buttonFlyout = new a("#", ""); - buttonFlyout.addElement(new img(WebEnv.getImageDirectory("menufly10.gif")).setBorder(0)); - buttonFlyout.setID(m_columnName + "PV"); - buttonFlyout.setOnMouseOver("dropdownmenu(this, event, 'menu1["+m_fieldNumber+"]')"); - buttonFlyout.setOnMouseOut("delayhidemenu()"); - } - } - if (m_error) - display.setClass(C_ERROR); - else if (m_mandatory) - display.setClass(C_MANDATORY); - // - if (m_hasDependents || m_hasCallout){ - display.setOnChange("startUpdate(this)"); - } - - // - if(m_Field != null) - { - div popup = new div(menu); - popup.setClass("anylinkcss"); - popup.setID("menu1["+m_fieldNumber+"]"); - return createTD(hidden) - .addElement(display) - .addElement(button) - .addElement(buttonFlyout) - .addElement(popup); - } - else - { - return createTD(hidden) - .addElement(display) - .addElement(button); - } - } // getPopupField - - - /** - * Get Popup Field (lookup, location, account, ..) - * @param dataDisplay data to be displayed - * @param dataValue data of value field - * @return td - */ - private td getPopupDateField ( Object data) - { - // The hidden data field Name=columnName - - String dataValue = (data == null) ? "" : data.toString(); - - input hidden = new input (input.TYPE_HIDDEN, m_columnName+"D", dataValue); - hidden.setID(m_columnName + "D"); - input display = null; - // The display field Name=columnName, ID=FcolumnName - String formattedData = ""; - if (data == null) - ; - else if (m_displayType == DisplayType.DateTime){ - if (dataValue.equals("@#Date@")) - formattedData = m_wsc.dateTimeFormat.format(new java.util.Date()); - else - formattedData = m_wsc.dateTimeFormat.format(data); - } - else if (m_displayType == DisplayType.Date){ - if (dataValue.equals("@#Date@")) - formattedData = m_wsc.dateFormat.format(new java.util.Date()); - else - formattedData = m_wsc.dateFormat.format(data); - } - display = new input(input.TYPE_TEXT, m_columnName, formattedData); - display.setID(m_columnName + "F"+m_fieldNumber); - display.setReadOnly(m_readOnly); - // The button Name=columnName, ID=BcolumnName - input button = new input (input.TYPE_IMAGE, m_columnName+ "B", "x"); - button.setID(m_columnName + "B"); - button.setSrc(WebEnv.getImageDirectory("Calendar10.gif")); - - - if (m_displayType == DisplayType.Date){ - button.setOnClick("return showCalendar('"+m_columnName+ "F"+m_fieldNumber+"', '%m/%d/%Y');"); - } - else if (m_displayType == DisplayType.DateTime){ - button.setOnClick("showCalendar('"+m_columnName+ "F"+m_fieldNumber+"', '%b %d, %Y %H:%M:%S %p', '24');return false;"); - } - // - if (m_error) - display.setClass(C_ERROR); - else if (m_mandatory) - display.setClass(C_MANDATORY); - // - if (m_hasDependents || m_hasCallout) - display.setOnChange("startUpdate(this);"); - // - return createTD(hidden) - .addElement(display) - .addElement(button.setBorder(0)); - } // getPopupField - - /** - * Get Select Field - * @param lookup lookup - * @param dataValue default value - * @return selction td - */ - private td getSelectField (Lookup lookup, String dataValue) - { - - - if (dataValue.length()<1 && m_defaultObject != null) { - dataValue = m_defaultObject.toString(); - } - - String dataDisplay = ""; - if (lookup != null && dataValue != null && dataValue.length() > 0) - dataDisplay = lookup.getDisplay(dataValue); - - option[] ops = getOptions(lookup, dataValue); - select sel = new select(m_columnName, ops); - sel.setID(m_columnName); - sel.setDisabled(m_readOnly); - - if (m_error) - sel.setClass(C_ERROR); - else if (m_mandatory) - sel.setClass(C_MANDATORY); - - if (m_hasDependents || m_hasCallout) - sel.setOnChange("startUpdate(this);"); - - //Start Setting up popUpMenu - //Add by Rob Klein 6/6/2007 - a buttonFlyout = null; - String menu = null; - - if(m_Field != null && !m_readOnly) - { - // Popmenu create - menu = getpopUpMenu (); - if(menu!=null){ - buttonFlyout = new a("#", ""); - buttonFlyout.addElement(new img(WebEnv.getImageDirectory("menufly10.gif")).setBorder(0)); - buttonFlyout.setID(m_columnName + "PV"); - buttonFlyout.setOnMouseOver("dropdownmenu(this, event, 'menu1["+m_fieldNumber+"]')"); - buttonFlyout.setOnMouseOut("delayhidemenu()");} - - } - // - div popup = new div(menu); - popup.setClass("anylinkcss"); - popup.setID("menu1["+m_fieldNumber+"]"); - return createTD(sel).addElement(buttonFlyout).addElement(popup); - } // getSelectField - - /** - * Get Array of options - * @param lookup lookup - * @param dataValue default value - * @return selction td - */ - private option[] getOptions (Lookup lookup, String dataValue) - { - if (lookup == null) - return new option[0]; - //boolean keyFound = false; - // - - NamePair value = null; - Object[] list = lookup.getData (m_mandatory, true, !m_readOnly, false) - .toArray(); // if r/o also inactive - int size = list.length; - option[] options = new option[size]; - - if (size == 0 && dataValue.length()>0){ - - value = lookup.getDirect(dataValue, false, false); - if (value != null){ - options = new option[2]; - if (dataValue.length()<1){ - options[0] = new option("-1").addElement(" ").setSelected(true); - options[1] = new option(value.getID()).addElement(value.getName()); - m_dataDisplay =value.getName(); - } - else - { - options[0] = new option("-1").addElement(" "); - options[1] = new option(value.getID()).addElement(value.getName()).setSelected(true); - m_dataDisplay =value.getName(); - } - } - return options; - } - - for (int i = 0; i < size; i++) - { - boolean isNumber = list[0] instanceof KeyNamePair; - String key = null; - if (m_displayType == DisplayType.Locator) - { - MLocator loc = (MLocator)list[i]; - key = String.valueOf(loc.getM_Locator_ID()); - String name = Util.maskHTML(loc.getValue()); - if (dataValue.equals(key)){ - options[i] = new option(key).addElement(name).setSelected(true); - m_dataDisplay = name;} - else - options[i] = new option(key).addElement(name); - } - else if (isNumber) - { - KeyNamePair p = (KeyNamePair)list[i]; - key = String.valueOf(p.getKey()); - String name = Util.maskHTML(p.getName()); - if (dataValue.equals(key)){ - options[i] = new option(key).addElement(name).setSelected(true); - m_dataDisplay =name;} - else - options[i] = new option(key).addElement(name); - } - else - { - ValueNamePair p = (ValueNamePair)list[i]; - key = p.getValue(); - if (key == null || key.length() == 0) - key = "??"; - String name = p.getName(); - if (name == null || name.length() == 0) - name = "???"; - name = Util.maskHTML(name); - if (dataValue.equals(key)){ - options[i] = new option(key).addElement(name).setSelected(true); - m_dataDisplay =name;} - else - options[i] = new option(key).addElement(name); - } - } - //If no key found then default to first value - //if (!keyFound && size>0) - //options[0].setSelected(true); - return options; - } // getOptions - - - /** - * Get Button Field - * @return Button - */ - private td getButtonField () - { - //Modified by Rob Klein 4/29/07 - input button = new input("button", m_columnName, " "+Util.maskHTML(m_name)); - button.setID(m_columnName); - button.setClass("processbtn"); - button.setDisabled(m_readOnly); - button.setOnClick("startButton("+m_processID+", "+m_windowID+", "+m_recordID+", "+m_tableID+", '"+ m_columnName+"');"); - return createTD(button) - .setAlign(AlignType.LEFT); // overwrite - } // getButtonField - - - /** - * Get Popup Menu - * @return Menu String - */ - private String getpopUpMenu () - { - //Start Popup Menu - //Add by Rob Klein 6/6/2007 - a buttonZoom = null; - a buttonValuePref = null; - String menu = null; - Boolean tableAccess =false; - - if(m_dataDisplay!=null){ - // Set ValuePreference - // Add by Rob Klein 6/6/2007 - buttonValuePref = new a("#", (new img(WebEnv.getImageDirectory("vPreference10.gif")).setBorder(0))+" Preference"); - buttonValuePref.setID(m_columnName + "PV"); - buttonValuePref.setOnClick("startValuePref(" + m_displayType + ", '"+Util.maskHTML(m_dataDisplay.toString())+ "', '" - + m_Field.getValue()+ "', '"+m_Field.getHeader()+ "', '"+m_Field.getColumnName()+ "', " - + Env.getAD_User_ID(m_wsc.ctx)+ ", " + Env.getAD_Org_ID(m_wsc.ctx) + ", "+Env.getAD_Client_ID(m_wsc.ctx) - + ", "+m_Field.getAD_Window_ID()+");return false;"); - menu = ""+buttonValuePref+" \n"; - } - - //Set Zoom - StringBuffer sql = null; - int refID = m_Field.getAD_Reference_Value_ID(); - Object recordID =0; - if (m_displayType == DisplayType.List ){ - sql = new StringBuffer ("SELECT AD_Table_ID " - + "FROM AD_Table WHERE TableName = 'AD_Reference'"); - - recordID = refID; - } - else if (refID > 0){ - sql = new StringBuffer ("SELECT AD_Table_ID " - + "FROM AD_Ref_Table WHERE AD_Reference_ID = "+refID); - recordID =m_Field.getValue(); - } - else{ - sql = new StringBuffer ("SELECT AD_Table_ID " - + "FROM AD_Table WHERE TableName = '"+m_columnName.replace("_ID", "")+"'"); - recordID =m_Field.getValue(); - } - int tableID = DB.getSQLValue(null, sql.toString()); - - tableAccess = m_Role.isTableAccess(tableID, false); - if(tableAccess==true){ - buttonZoom = new a("#", (new img(WebEnv.getImageDirectory("Zoom10.gif")).setBorder(0))+" Zoom"); - buttonZoom.setID(m_columnName + "Z"); - buttonZoom.setOnClick("startZoom(" + tableID + ", "+recordID+");return false;"); - if(m_dataDisplay!=null) - menu = menu + ""+buttonZoom+"\n"; - else - menu = ""+buttonZoom+"\n"; - - } - return menu; - } // getpopUpMenu - - public String getColumnName() - { - return m_columnName; - } - public String getFieldName() - { - return m_name; - } - public boolean isHasDependents() - { - return m_hasDependents; - } - - public boolean isHasCallout() - { - return m_hasCallout; - } - //public Lookup getLookup() - //{ - // return m_lookup; - //} - public boolean isMandatory() - { - return m_mandatory; - } - public Lookup getLookup() - { - return m_lookup; - } -} // WebField diff --git a/serverRoot/.classpath b/serverRoot/.classpath index 7b34e694b2..087fd16a7c 100644 --- a/serverRoot/.classpath +++ b/serverRoot/.classpath @@ -1,14 +1,12 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/serverRoot/src/main/ejb/jboss.xml b/serverRoot/src/main/ejb/jboss.xml deleted file mode 100644 index b9206efe4f..0000000000 --- a/serverRoot/src/main/ejb/jboss.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - java:/jaas/adempiere - - - - adempiereStatus - adempiere/Status - - - adempiereServer - adempiere/Server - - - diff --git a/serverRoot/src/main/ejb/org/compiere/session/ServerBean.java b/serverRoot/src/main/ejb/org/compiere/session/ServerBean.java deleted file mode 100644 index 542aa233d7..0000000000 --- a/serverRoot/src/main/ejb/org/compiere/session/ServerBean.java +++ /dev/null @@ -1,297 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.session; - -import java.util.Properties; -import java.util.logging.Level; - -import javax.annotation.PostConstruct; -import javax.annotation.security.DeclareRoles; -import javax.annotation.security.PermitAll; -import javax.annotation.security.RolesAllowed; -import javax.ejb.CreateException; -import javax.ejb.Local; -import javax.ejb.Remote; -import javax.ejb.Stateless; - -import org.adempiere.util.ProcessUtil; -import org.compiere.Adempiere; -import org.compiere.acct.Doc; -import org.compiere.interfaces.Server; -import org.compiere.interfaces.ServerLocal; -import org.compiere.interfaces.ServerRemote; -import org.compiere.model.MAcctSchema; -import org.compiere.model.MClient; -import org.compiere.model.MTask; -import org.compiere.model.MUser; -import org.compiere.process.ProcessInfo; -import org.compiere.util.CLogger; -import org.compiere.util.CacheMgt; -import org.compiere.util.EMail; -import org.compiere.util.Env; - -/** - * Adempiere Server Bean. - * - * @author Jorg Janke - * @version $Id: ServerBean.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $ - * @author Low Heng Sin - * - Added remote transaction management - * - Added support to run db process remotely on server - * - * @author Teo Sarca, SC ARHIPAC SERVICE SRL - BF [ 1757523 ] - */ -@Stateless(mappedName=Server.JNDI_NAME, name=Server.EJB_NAME) -@Local({ServerLocal.class}) -@Remote({ServerRemote.class}) -@DeclareRoles({"adempiereUsers"}) -@RolesAllowed({"adempiereUsers"}) -public class ServerBean implements ServerRemote, ServerLocal -{ - /** Logger */ - private static CLogger log = CLogger.getCLogger(ServerBean.class); - // - private static int s_no = 0; - private int m_no = 0; - // - private int m_windowCount = 0; - private int m_postCount = 0; - private int m_processCount = 0; - private int m_workflowCount = 0; - private int m_paymentCount = 0; - private int m_nextSeqCount = 0; - private int m_stmt_rowSetCount = 0; - private int m_stmt_updateCount = 0; - private int m_cacheResetCount = 0; - private int m_updateLOBCount = 0; - - /** - * Post Immediate - * - * @param ctx Client Context - * @param AD_Client_ID Client ID of Document - * @param AD_Table_ID Table ID of Document - * @param Record_ID Record ID of this document - * @param force force posting - * @param trxName ignore, retained for backward compatibility - * @return null, if success or error message - */ - public String postImmediate (Properties ctx, - int AD_Client_ID, int AD_Table_ID, int Record_ID, boolean force, String trxName) - { - log.info ("[" + m_no + "] Table=" + AD_Table_ID + ", Record=" + Record_ID); - - m_postCount++; - MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(ctx, AD_Client_ID); - return Doc.postImmediate(ass, AD_Table_ID, Record_ID, force, null); - } // postImmediate - - /************************************************************************* - * Process Remote - * - * @param ctx Context - * @param pi Process Info - * @return resulting Process Info - */ - public ProcessInfo process (Properties ctx, ProcessInfo pi) - { - - m_processCount++; - - // Start Process - ProcessUtil.startJavaProcess(ctx, pi, null); - return pi; - } // process - - - /************************************************************************* - * Run Workflow (and wait) on Server - * - * @param ctx Context - * @param pi Process Info - * @param AD_Workflow_ID id - * @return process info - */ - public ProcessInfo workflow (Properties ctx, ProcessInfo pi, int AD_Workflow_ID) - { - log.info ("[" + m_no + "] " + AD_Workflow_ID); - m_workflowCount++; - ProcessUtil.startWorkFlow(ctx, pi, AD_Workflow_ID); - return pi; - } // workflow - - /** - * Create EMail from Server (Request User) - * @param ctx Context - * @param AD_Client_ID client - * @param to recipient email address - * @param subject subject - * @param message message - * @return EMail - */ - public EMail createEMail (Properties ctx, int AD_Client_ID, - String to, String subject, String message) - { - MClient client = MClient.get(ctx, AD_Client_ID); - boolean html = false; - if (message != null && message.startsWith(EMail.HTML_MAIL_MARKER)) - { - html = true; - message = message.substring(EMail.HTML_MAIL_MARKER.length()); - } - return client.createEMail(to, subject, message, html); - } // createEMail - - /** - * Create EMail from Server (Request User) - * @param ctx Context - * @param AD_Client_ID client - * @param AD_User_ID user to send email from - * @param to recipient email address - * @param subject subject - * @param message message - * @return EMail - */ - public EMail createEMail (Properties ctx, int AD_Client_ID, - int AD_User_ID, - String to, String subject, String message) - { - MClient client = MClient.get(ctx, AD_Client_ID); - MUser from = new MUser (ctx, AD_User_ID, null); - boolean html = false; - if (message != null && message.startsWith(EMail.HTML_MAIL_MARKER)) - { - html = true; - message = message.substring(EMail.HTML_MAIL_MARKER.length()); - } - return client.createEMail(from, to, subject, message, html); - } // createEMail - - - /** - * Execute task on server - * @param AD_Task_ID task - * @return execution trace - */ - public String executeTask (int AD_Task_ID) - { - MTask task = new MTask (Env.getCtx(), AD_Task_ID, null); // Server Context - return task.execute(); - } // executeTask - - - /** - * Cash Reset - * @param tableName table name - * @param Record_ID record or 0 for all - * @return number of records reset - */ - public int cacheReset (String tableName, int Record_ID) - { - log.config(tableName + " - " + Record_ID); - m_cacheResetCount++; - return CacheMgt.get().reset(tableName, Record_ID); - } // cacheReset - - /************************************************************************** - * Describes the instance and its content for debugging purpose - * @return Debugging information about the instance and its content - */ - @PermitAll - public String getStatus() - { - StringBuffer sb = new StringBuffer("ServerBean["); - sb.append(m_no) - .append("-Window=").append(m_windowCount) - .append(",Post=").append(m_postCount) - .append(",Process=").append(m_processCount) - .append(",NextSeq=").append(m_nextSeqCount) - .append(",Workflow=").append(m_workflowCount) - .append(",Payment=").append(m_paymentCount) - .append(",RowSet=").append(m_stmt_rowSetCount) - .append(",Update=").append(m_stmt_updateCount) - .append(",CacheReset=").append(m_cacheResetCount) - .append(",UpdateLob=").append(m_updateLOBCount) - .append("]"); - return sb.toString(); - } // getStatus - - /** - * Execute db proces on server - * @param processInfo - * @param procedureName - * @return ProcessInfo - */ - public ProcessInfo dbProcess(ProcessInfo processInfo, String procedureName) - { - ProcessUtil.startDatabaseProcedure(processInfo, procedureName, null); - return processInfo; - } - - /** - * String Representation - * @return info - */ - public String toString() - { - return getStatus(); - } // toString - - - /************************************************************************** - * Create the Session Bean - */ - @PostConstruct - public void ejbCreate() - { - m_no = ++s_no; - try - { - if (!Adempiere.startup(false)) - throw new CreateException("Adempiere could not start"); - } - catch (Exception ex) - { - log.log(Level.SEVERE, "ejbCreate", ex); - // throw new CreateException (); - } - log.info ("#" + getStatus()); - } // ejbCreate - - /************************************************************************** - * Dump SerialVersionUID of class - * @param clazz class - */ - protected static void dumpSVUID (Class clazz) - { - String s = clazz.getName() - + " ==\nstatic final long serialVersionUID = " - + java.io.ObjectStreamClass.lookup(clazz).getSerialVersionUID() - + "L;\n"; - System.out.println (s); - } // dumpSVUID - - /** - * Print UID of used classes. - * @param args ignored - */ - public static void main (String[] args) - { - dumpSVUID(ProcessInfo.class); - } // main - -} // ServerBean diff --git a/serverRoot/src/main/ejb/org/compiere/session/StatusBean.java b/serverRoot/src/main/ejb/org/compiere/session/StatusBean.java deleted file mode 100644 index a69d4d6293..0000000000 --- a/serverRoot/src/main/ejb/org/compiere/session/StatusBean.java +++ /dev/null @@ -1,231 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.session; - -import java.util.logging.Level; - -import javax.annotation.PostConstruct; -import javax.annotation.security.PermitAll; -import javax.ejb.CreateException; -import javax.ejb.Local; -import javax.ejb.Remote; -import javax.ejb.Stateless; - -import org.compiere.Adempiere; -import org.compiere.db.CConnection; -import org.compiere.interfaces.Status; -import org.compiere.interfaces.StatusLocal; -import org.compiere.interfaces.StatusRemote; -import org.compiere.util.CLogger; - - -/** - * Adempiere Status Bean - * - * @author Jorg Janke - * @version $Id: StatusBean.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $ - */ -@Stateless(mappedName=Status.JNDI_NAME, name=Status.EJB_NAME) -@Local({StatusLocal.class}) -@Remote({StatusRemote.class}) -@PermitAll -public class StatusBean implements StatusRemote, StatusLocal -{ - private static final String ALLOW_CLIENT_QUERY_DB_PWD = "adempiere.client.getDBPwd"; - - /** Logging */ - private static CLogger log = CLogger.getCLogger(StatusBean.class); - - private static int s_no = 0; - private int m_no = 0; - // - private int m_versionCount = 0; - private int m_databaseCount = 0; - - - /** - * Get Version (Date) - * @return version e.g. 2002-09-02 - */ - public String getDateVersion() - { - m_versionCount++; - log.info ("getDateVersion " + m_versionCount); - return Adempiere.DATE_VERSION; - } // getDateVersion - - /** - * Get Main Version - * @return main version - e.g. Version 2.4.3b - */ - public String getMainVersion() - { - return Adempiere.MAIN_VERSION; - } // getMainVersion - - /** - * Get Database Type - * @return Database Type - */ - public String getDbType() - { - return CConnection.get().getType(); - } // getDbType - - /** - * Get Database Host - * @return Database Host Name - */ - public String getDbHost() - { - m_databaseCount++; - log.info ("getDbHost " + m_databaseCount); - return CConnection.get().getDbHost(); - } // getDbHost - - /** - * Get Database Port - * @return Database Port - */ - public int getDbPort() - { - return CConnection.get().getDbPort(); - } // getDbPort - - /** - * Get Database SID - * @return Database SID - */ - public String getDbName() - { - return CConnection.get().getDbName(); - } // getDbSID - - /** - * Get Database URL - * @return Database URL - */ - public String getConnectionURL() - { - return CConnection.get().getConnectionURL(); - } // getConnectionURL - - /** - * Get Database UID - * @return Database User Name - */ - public String getDbUid() - { - return CConnection.get().getDbUid(); - } // getDbUID - - /** - * Get Database PWD - * @return Database User Password - */ - public String getDbPwd() - { - String f = System.getProperty(ALLOW_CLIENT_QUERY_DB_PWD); - if ("false".equalsIgnoreCase(f)) - return ""; - - return CConnection.get().getDbPwd(); - } // getDbPWD - - /** - * Get Connection Manager Host - * @return Connection Manager Host - */ - public String getFwHost() - { - return CConnection.get().getFwHost(); - } // getCMHost - - /** - * Get Connection Manager Port - * @return Connection Manager Port - */ - public int getFwPort() - { - return CConnection.get().getFwPort(); - } // getCMPort - - - /************************************************************************** - * Get Version Count - * @ejb.interface-method view-type="both" - * @return number of version inquiries - */ - public int getVersionCount() - { - return m_versionCount; - } // getVersionCount - - /** - * Get Database Count - * @return number of database inquiries - */ - public int getDatabaseCount() - { - return m_databaseCount; - } // getVersionCount - - /** - * Describes the instance and its content for debugging purpose - * @return Debugging information about the instance and its content - */ - public String getStatus() - { - StringBuffer sb = new StringBuffer("StatusBean[No="); - sb.append(m_no) - .append(",VersionCount=").append(m_versionCount) - .append(",DatabaseCount=").append(m_versionCount) - .append("]"); - return sb.toString(); - } // getStatus - - - /** - * String Representation - * @return info - */ - public String toString() - { - return getStatus(); - } // toString - - - /************************************************************************** - * Create the Session Bean - */ - @PostConstruct - public void ejbCreate() - { - m_no = ++s_no; - try - { - if (!Adempiere.startup(false)) - throw new CreateException("Compiere could not start"); - } - catch (Exception ex) - { - log.log(Level.SEVERE, "", ex); - // throw new CreateException (); - } - log.info("#" + m_no + " - " + getStatus()); - } // ejbCreate -} // StatusBean diff --git a/serverRoot/src/main/ejb/sun-ejb-jar.xml b/serverRoot/src/main/ejb/sun-ejb-jar.xml deleted file mode 100644 index 5b81d439f3..0000000000 --- a/serverRoot/src/main/ejb/sun-ejb-jar.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - adempiereServer - - - USERNAME_PASSWORD - adempiere - true - - - - - diff --git a/webCM/.classpath b/webCM/.classpath deleted file mode 100644 index d65fa72812..0000000000 --- a/webCM/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/webCM/.packaging b/webCM/.packaging deleted file mode 100644 index a336b0bb42..0000000000 --- a/webCM/.packaging +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/webCM/.project b/webCM/.project deleted file mode 100644 index 640dfd7c51..0000000000 --- a/webCM/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - webCM - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/webCM/.settings/com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs b/webCM/.settings/com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs deleted file mode 100644 index 214fea8850..0000000000 --- a/webCM/.settings/com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Sun Jun 11 17:51:42 PDT 2006 -eclipse.preferences.version=1 -xdoclet.build.policy=automatic -xdoclet.jdk.support=jdk5 diff --git a/webCM/.settings/org.eclipse.ltk.core.refactoring.prefs b/webCM/.settings/org.eclipse.ltk.core.refactoring.prefs deleted file mode 100644 index 1562767b46..0000000000 --- a/webCM/.settings/org.eclipse.ltk.core.refactoring.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sat Sep 16 18:27:05 CEST 2006 -eclipse.preferences.version=1 -org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/webCM/.settings/org.eclipse.wst.validation.prefs b/webCM/.settings/org.eclipse.wst.validation.prefs deleted file mode 100644 index 79ab30f281..0000000000 --- a/webCM/.settings/org.eclipse.wst.validation.prefs +++ /dev/null @@ -1,6 +0,0 @@ -#Sat Sep 16 18:27:05 CEST 2006 -DELEGATES_PREFERENCE=delegateValidatorList -USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator;org.eclipse.jst.jsp.core.internal.validation.JSPELValidator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator;org.eclipse.wst.html.internal.validation.HTMLValidator; -USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator;org.eclipse.jst.jsp.core.internal.validation.JSPELValidator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator;org.eclipse.wst.html.internal.validation.HTMLValidator; -USER_PREFERENCE=overrideGlobalPreferencesfalse -eclipse.preferences.version=1 diff --git a/webCM/.settings/org.hibernate.eclipse.console.prefs b/webCM/.settings/org.hibernate.eclipse.console.prefs deleted file mode 100644 index cf74dec012..0000000000 --- a/webCM/.settings/org.hibernate.eclipse.console.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Thu Mar 02 17:55:23 CET 2006 -default.configuration= -eclipse.preferences.version=1 -hibernate3.enabled=false diff --git a/webCM/.xdoclet b/webCM/.xdoclet deleted file mode 100644 index a336b0bb42..0000000000 --- a/webCM/.xdoclet +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/webCM/RUN_build.bat b/webCM/RUN_build.bat deleted file mode 100644 index 70faed51ef..0000000000 --- a/webCM/RUN_build.bat +++ /dev/null @@ -1,19 +0,0 @@ -@Title Build Adempiere Root -@Rem $Header: /cvs/adempiere/webCM/RUN_build.bat,v 1.1 2006/05/10 04:43:52 jjanke Exp $ - -@CALL ..\utils_dev\myDevEnv.bat -@IF NOT %ADEMPIERE_ENV%==Y GOTO NOBUILD - -@echo Cleanup ... -@"%JAVA_HOME%\bin\java" -Dant.home="." %ANT_PROPERTIES% org.apache.tools.ant.Main clean - -@echo Building ... -@"%JAVA_HOME%\bin\java" -Dant.home="." %ANT_PROPERTIES% org.apache.tools.ant.Main main - -@Echo Done ... -@sleep 60 -@exit - -:NOBUILD -@Echo Check myDevEnv.bat (copy from myDevEnvTemplate.bat) -@Pause diff --git a/webCM/RUN_build.sh b/webCM/RUN_build.sh deleted file mode 100644 index 5f80633c60..0000000000 --- a/webCM/RUN_build.sh +++ /dev/null @@ -1,18 +0,0 @@ -# Module compiling script -# Ported from Windows script Marek Mosiewicz - - -SAVED_DIR=`pwd` #save current dir -cd `dirname $0`/../utils_dev #change dir to place where script resides - doesn not work with sym links -UTILS_DEV=`pwd` #this is adempiere source -cd $SAVED_DIR #back to the saved directory - -. $UTILS_DEV/myDevEnv.sh #call environment -echo done -if [ ! $ADEMPIERE_ENV==Y ] ; then - echo "Can't set developemeent environemnt - check myDevEnv.sh" - exit 1 -fi - -echo running Ant -$JAVA_HOME/bin/java -Dant.home="." $ANT_PROPERTIES org.apache.tools.ant.Main diff --git a/webCM/build.xml b/webCM/build.xml deleted file mode 100644 index 813745233c..0000000000 --- a/webCM/build.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/webCM/documentation.bat b/webCM/documentation.bat deleted file mode 100644 index 182c3fd299..0000000000 --- a/webCM/documentation.bat +++ /dev/null @@ -1,5 +0,0 @@ -@Rem API Documentation for Server - -call ..\doc\documentation.bat "src\main\client;src\main\ejb;src\main\server;src\main\servlet" doc -private - -@pause diff --git a/webCM/src/ear/application.xml b/webCM/src/ear/application.xml deleted file mode 100644 index 7f91e1bb53..0000000000 --- a/webCM/src/ear/application.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - ADempiere Web CM - - - adempiereWebCM.war - / - - - diff --git a/webCM/src/main/servlet/org/compiere/cm/AdRedirector.java b/webCM/src/main/servlet/org/compiere/cm/AdRedirector.java deleted file mode 100644 index d25c73df7b..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/AdRedirector.java +++ /dev/null @@ -1,72 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.model.MAd; - -/** - * AdRedirector will forward the Ad Request to the destination URL and log the request - * @author Yves Sandfort - * @version $Id$ - */ -@SuppressWarnings("serial") -public class AdRedirector extends HttpServletCM -{ - /** - * Process the HTTP Get request - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - if (request.getParameter("CM_Ad_ID")!=null) { - try { - String CM_Ad_ID = request.getParameter("CM_Ad_ID"); - MAd thisAd = new MAd(ctx, Integer.parseInt(CM_Ad_ID), "webCM"); - thisAd.addClick(request); - response.sendRedirect(thisAd.getTargetURL()); - } catch (Exception E) { - response.sendError(500, "Internal Error while processing Ad Redirect..."); - } - } else { - response.sendError(500,"Unknown or illegal Ad set, can't handle request..."); - } - } - - /** - * Process the HTTP Post request - * to simplify we reuse the doGet functionality - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - doGet(request, response); - } // doPost -} diff --git a/webCM/src/main/servlet/org/compiere/cm/Broadcast.java b/webCM/src/main/servlet/org/compiere/cm/Broadcast.java deleted file mode 100644 index e38c125b11..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/Broadcast.java +++ /dev/null @@ -1,162 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.compiere.cm.utils.AccessLogger; -import org.compiere.cm.utils.LocaleHandler; -import org.compiere.cm.utils.RequestAnalyzer; -import org.compiere.cm.xml.Generator; -import org.compiere.cm.xml.XSLTProcessor; -import org.compiere.util.WebEnv; - -/** - * Broadcast Servlet This servlet normally does Page processing for all pages, - * so it creates context etc. - * - * @author Yves Sandfort - * @version $Id$ - */ -@SuppressWarnings("serial") -public class Broadcast extends HttpServletCM -{ - - /** - * Process Get Request - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet (HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - // Create New Session - HttpSession sess = request.getSession (true); - sess.setMaxInactiveInterval (WebEnv.TIMEOUT); - StringBuffer output = new StringBuffer (); - // We will reset the Media URL for each request. Should be moved in the session. - resetInternalMediaURL (request); - if (configLoaded && !fatalError) - { - String acceptLanguage = request.getHeader ("Accept-Language"); - String acceptCharset = request.getHeader ("Accept-Charset"); - LocaleHandler lhandler = new LocaleHandler (acceptLanguage, - acceptCharset); - RequestAnalyzer thisRequest = new RequestAnalyzer (this, request, - false, ""); - StringBuffer xmlCode = new StringBuffer(); - StringBuffer xmlAppend = new StringBuffer(); - - // Fill up ExternalMediaURL - //if (externalMediaURL == null) { - if (thisRequest.getWebProject()!=null) - externalMediaURL = getExternalMediaURL (thisRequest - .getWebProject ().get_ID ()); - else - externalMediaURL = getInternalMediaURL(); - //} - sess.setAttribute ("ctx", getCtx()); - // This Request has a Processor Class Name, so we should process it! - if (thisRequest.getProcClassName ()!=null) { - try { - org.compiere.cm.Extend thisProcessor = thisRequest.getProcClass(); - thisProcessor.doIt (); - xmlAppend.append(thisProcessor.getXML()); - if (thisProcessor.getRedirectURL()!=null) - thisRequest.setRedirectURL(thisProcessor.getRedirectURL()); - } - catch (Exception ex) - { - ex.printStackTrace (); - } - - } - if (thisRequest.getIsRedirect ()) - { - // If we need to redirect as the URL is different do it beofre - // we transmit to client - response.sendRedirect (thisRequest.getRedirectURL ()); - } - else - { - // No need to redirect so we will display the content - // Generate the needed XMLCode - Generator thisXMLGen = new Generator (this, request, - thisRequest, xmlAppend); - xmlCode.append(thisXMLGen.get ()); - // Get or generate Template needed - String xslCode = templateCache.getCM_Template ( - thisRequest.getCM_Container ().getCM_Template_ID (), - thisRequest.getWebProject ().get_ID ()) - .getPreBuildTemplate ().toString (); - // Put it all together - try - { - output.append (XSLTProcessor.run (request, xslCode, xmlCode.toString())); - } - catch (Exception E) - { - response.sendError (500); - } - // response.setContentType("text/html; charset=" + - // lhandler.getCharset()); - response.setContentType ("text/html; charset=UTF-8"); - response.setHeader ("CMBuild", buildDate); - PrintWriter out; - out = response.getWriter (); - out.print (output.toString ()); - out.close (); - - if (thisRequest.getWebProject()!=null) { - // We will log the request in a seperate task to speed up page display - AccessLogger thisAccessLogger = new AccessLogger(request, this, thisRequest); - thisAccessLogger.setFileSize(new java.math.BigDecimal(output.length())); - thisAccessLogger.start(); - } - } - } - else if (fatalError) - { - PrintWriter out; - out = response.getWriter (); - out.print ("

        Fatal Error:" + ErrorMessage + "

        "); - out.close (); - } - } // doGet - - /** - * Process Post Request (handled by get) - * - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doPost (HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - doGet (request, response); - } // doPost -} // Broadcast diff --git a/webCM/src/main/servlet/org/compiere/cm/Community.java b/webCM/src/main/servlet/org/compiere/cm/Community.java deleted file mode 100644 index be57b0bbb6..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/Community.java +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. - * This program is free software; you can redistribute it and/or modify it - * under the terms version 2 of the GNU General Public License as published - * by the Free Software Foundation. This program 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 General Public License for more details. - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * You may reach us at: ComPiere, Inc. - http://www.adempiere.org/license.html - * 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA or info@adempiere.org - *****************************************************************************/ -package org.compiere.cm; - -import java.io.IOException; -import java.util.Properties; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.compiere.cm.utils.RequestAnalyzer; -import org.compiere.model.X_W_Store; -import org.compiere.util.CLogger; -import org.compiere.util.WebEnv; -import org.compiere.util.WebLogin; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - -/** - * Community Servlet to handle login, BPartner create & Update etc. - * - * @author Yves Sandfort - * @version $Id$ - */ -public class Community extends HttpServletCM -{ - /** - * - */ - private static final long serialVersionUID = -1137119385690937015L; - /** Logging */ - private CLogger log = CLogger.getCLogger(getClass()); - - /** - * Process Get Request - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet (HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - HttpSession sess = request.getSession (true); - sess.setMaxInactiveInterval (WebEnv.TIMEOUT); - - ctx = getCtx(); - - if (sess.getAttribute ("ctx")!=null) - ctx = (Properties) sess.getAttribute ("ctx"); - - if (ctx.get ("#AD_Client_ID")!=null) { - RequestAnalyzer thisRequest = new RequestAnalyzer(this, request, false, null); - } - - - WebSessionCtx wsc = (WebSessionCtx)sess.getAttribute(WebSessionCtx.NAME); - // Create New - if (wsc == null) - { - int [] allIDs = X_W_Store.getAllIDs ("W_Store", "AD_Client_ID=" + ctx.get ("#AD_Client_ID"), ""); - if (allIDs!=null && allIDs.length>0) - { - wsc = WebSessionCtx.get(request, allIDs[0]); - wsc.setWStore (allIDs[0]); - sess.setAttribute(WebSessionCtx.NAME, wsc); - } - } - - WebLogin thisLogin = new WebLogin(request, response, ctx); - thisLogin.init (); - if (!thisLogin.action ()) - { - WebUtil.reload(thisLogin.getMessage(), thisLogin.getUpdate_page (), sess, request, response, getServletContext()); - return; - } - String url = thisLogin.getForward (); - if (!url.startsWith("/")) - url = "/" + url; - log.info("doPost - Forward to " + url); - response.sendRedirect (url); - } - - /** - * Process Post Request (handled by get) - * - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doPost (HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - doGet (request, response); - } // doPost - -} diff --git a/webCM/src/main/servlet/org/compiere/cm/Extend.java b/webCM/src/main/servlet/org/compiere/cm/Extend.java deleted file mode 100644 index b2e435a449..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/Extend.java +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. - * This program is free software; you can redistribute it and/or modify it - * under the terms version 2 of the GNU General Public License as published - * by the Free Software Foundation. This program 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 General Public License for more details. - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * You may reach us at: ComPiere, Inc. - http://www.adempiere.org/license.html - * 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA or info@adempiere.org - *****************************************************************************/ -package org.compiere.cm; - -import java.io.Serializable; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import org.compiere.util.WebInfo; - -/** - * - * - * @author Yves Sandfort - * @version $Id$ - */ -public abstract class Extend implements Serializable -{ - /** - * - */ - private static final long serialVersionUID = -6808492189985974917L; - protected HttpServletRequest e_request; - protected HttpSession e_session; - protected Properties ctx; - protected WebInfo wi = null; - private StringBuffer e_xmlCode; - private String e_redirectURL; - - /** - * Extend - * @param request - * @param t_ctx - */ - public Extend (HttpServletRequest request, Properties t_ctx) { - ctx = t_ctx; - e_request = request; - e_session = request.getSession(); - if (e_session.getAttribute (WebInfo.NAME)!=null) - { - wi = (WebInfo) e_session.getAttribute (WebInfo.NAME); - } - e_xmlCode = new StringBuffer(); - } - - /** - * set XML Code - * @param xmlCode - */ - protected void setXML(StringBuffer xmlCode) - { - e_xmlCode = xmlCode; - } - - /** - * append XML Code - * @param xmlCode String containing XMLCode - */ - public void appendXML(String xmlCode) - { - e_xmlCode.append(xmlCode); - } - - /** - * append XML Code - * @param xmlCode Stringbuffer containing XMLCode - */ - public void appendXML(StringBuffer xmlCode) - { - e_xmlCode.append(xmlCode); - } - - /** - * get XML Code - * @returns xmlCode - */ - protected StringBuffer getXML() - { - if (e_xmlCode==null) - return new StringBuffer(""); - return e_xmlCode; - } - - /** - * get Redirect URL - * @param redirectURL - */ - protected String getRedirectURL() - { - return e_redirectURL; - } - - /** - * set Redirect URL - * @param redirectURL - */ - protected void setRedirectURL(String redirectURL) - { - e_redirectURL = redirectURL; - } - - protected Properties getCtx() - { - return ctx; - } - - protected boolean doIt() - { - return true; - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/HttpServletCM.java b/webCM/src/main/servlet/org/compiere/cm/HttpServletCM.java deleted file mode 100644 index d7dd7fca6a..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/HttpServletCM.java +++ /dev/null @@ -1,388 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm; - -import java.util.Properties; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; - -import org.compiere.cm.cache.Chat; -import org.compiere.cm.cache.Container; -import org.compiere.cm.cache.ContainerElement; -import org.compiere.cm.cache.ContainerTree; -import org.compiere.cm.cache.Domain; -import org.compiere.cm.cache.MediaServer; -import org.compiere.cm.cache.Template; -import org.compiere.cm.cache.WebProject; -import org.compiere.cm.cache.XML; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.WebEnv; - -/** - * HttpServletCM we extended the normal HttpServlet to store some global - * environment and cache here - * - * @author Yves Sandfort - * @version $Id$ - */ -public class HttpServletCM extends HttpServlet -{ - /** - * serialVersionUID for serializable HttpServlet - */ - private static final long serialVersionUID = -4426808307458449693L; - - /** - * status if config is loaded... true if loaded false is default after - * startup - */ - protected static boolean configLoaded = false; - - /** - * fatalError stores a shared variable which will be set to yes whenever a - * global Server Error from which we can not recover occurs. You should not - * set it manually as will stop all servlet's and will not rerun them unless - * set back to false true if there is a global error false if there is no - * global error - */ - protected static boolean fatalError = false; - - /** - * belongs to fatalError, should get a corresponding error message to - * display in the web frontend. null if no error - */ - protected static String ErrorMessage = null; - - /** - * special application templates ssometimes depend on a special version, - * this is to give them an idea. Is included in the XML Code. - */ - protected static String buildDate = "200606062343"; - - /** - * DomainCache is storing the domains of the system, to reduce DB lookups - */ - protected static Domain domainCache = new Domain (); - - /** - * WebProject is storing the projects often used by the system, to reduce DB - * lookups - */ - protected static WebProject webProjectCache = new WebProject (); - - /** - * ChatCache is storing the chat's often used by the system, to reduce DB - * lookups - */ - protected static Chat chatCache = new Chat (); - - /** - * ContainerCache is storing the containers's often used by the system, to - * reduce DB lookups - */ - protected static Container containerCache = new Container (); - - /** - * ContainerElementCache is storing the container's elements often used by - * the system, to reduce DB lookups - */ - protected static ContainerElement containerElementCache = new ContainerElement (); - - /** - * ContainerTreeCache is storing the container's tree often used by the - * system, to reduce DB lookups - */ - protected static ContainerTree containerTreeCache = new ContainerTree (); - - /** - * MediaServerCache is storing the project's media server in combination - * with Request Info - */ - protected static MediaServer mediaServerCache = new MediaServer (); - - /** - * TemplateCache stores the oftens used templates - */ - protected static Template templateCache = new Template (); - - /** - * XMLCache stores the oftens used templates - */ - protected static XML xmlCache = new XML (); - - /** - * Context of this Servlet - */ - protected Properties ctx = null; - - /** - * String containing the internal media path (should not be used for real - * page deployment) the normal broadcaster will replace this URL with the - * correct media server for this client - */ - protected String internalMediaURL = null; - - /** - * String containing the external media URL - */ - protected String externalMediaURL = null; - - /** Logger */ - protected CLogger log = CLogger.getCLogger (this.getClass ()); - - /** - * Init - * - * @param config - * @throws ServletException - */ - public void init (ServletConfig config) - throws ServletException - { - super.init (config); - if (!WebEnv.initWeb (config)) - throw new ServletException ("Broadcast.init"); - if (!DB.isConnected ()) - { - fatalError = true; - ErrorMessage = "Connection to DB dropped!"; - log.severe ("No Database Connection!"); - } - org.compiere.cm.utils.CMEnv cmEnv = new org.compiere.cm.utils.CMEnv (); - ctx = cmEnv.getDefaults (); - chatCache.setCtx (ctx); - containerCache.setCtx (ctx); - containerElementCache.setCtx (ctx); - containerTreeCache.setCtx (ctx); - domainCache.setCtx (ctx); - mediaServerCache.setCtx (ctx); - templateCache.setCtx (ctx); - webProjectCache.setCtx (ctx); - xmlCache.setCtx(ctx); - if (!fatalError) - configLoaded = true; - } - - /** - * Returns the current build version/date of the servlet engine, this is - * used by special application templates which depend on certain - * functionality to check for their availability. - * - * @return the Build Date as a string in format YYYYMMDDHHMM - */ - public String getBuildDate () - { - return buildDate; - } - - /** - * Returns the ContainerCache Object - * - * @return CO Object Container - */ - public org.compiere.cm.cache.Container getContainerCache () - { - return containerCache; - } - - /** - * Returns the ChatCache Object - * - * @return CO Object Chat - */ - public org.compiere.cm.cache.Chat getChatCache () - { - return chatCache; - } - - /** - * Returns the ContainerElementCache Object - * - * @return CO Object ContainerElement - */ - public org.compiere.cm.cache.ContainerElement getContainerElementCache () - { - return containerElementCache; - } - - /** - * Returns the ContainerTreeCache Object - * - * @return CO Object ContainerElement - */ - public org.compiere.cm.cache.ContainerTree getContainerTreeCache () - { - return containerTreeCache; - } - - /** - * Returns the DomainCache Object - * - * @return CO Object Domain - */ - public org.compiere.cm.cache.Domain getDomainCache () - { - return domainCache; - } - - /** - * Returns the MediaServerCache Object - * - * @return CO Object MediaServer - */ - public org.compiere.cm.cache.MediaServer getMediaServerCache () - { - return mediaServerCache; - } - - /** - * Returns the WebProjectCache Object - * - * @return CO Object WebProject - */ - public org.compiere.cm.cache.WebProject getWebProjectCache () - { - return webProjectCache; - } - - /** - * Returns the Template Object - * - * @return CO Object Template - */ - public org.compiere.cm.cache.Template getTemplateCache () - { - return templateCache; - } - - /** - * Returns the Template Object - * - * @return CO Object Template - */ - public org.compiere.cm.cache.XML getXMLCache () - { - return xmlCache; - } - - /** - * Returns the internalMediaURL for replacement - * - * @return String with internal MediaURL normally context + "/" + media + - * "/" - */ - public String getInternalMediaURL () - { - return internalMediaURL; - } - - /** - * Returns the sessionMediaURL, this is the ideal Media URL for this Request - * - * @param request - * the Request for this - * @param CM_WebProject_ID - * Returns the WebProject ID - * @return String with session MediaURL, if none found we return the - * internal one - */ - public String getSessionMediaURL (HttpServletRequest request, - int CM_WebProject_ID) - { - String sessionMediaURL = getMediaServerCache ().getMediaServer ( - getCtx (), CM_WebProject_ID, null); - if (sessionMediaURL == null) - sessionMediaURL = getInternalMediaURL (); - return internalMediaURL; - } - - /** - * Sets internal Media URL - * - * @param request - */ - public void resetInternalMediaURL (HttpServletRequest request) - { - internalMediaURL = request.getRequestURL ().toString ().substring ( - 0, - request.getRequestURL ().toString ().indexOf ( - request.getServerName ()) - + request.getServerName ().length ()) - + request.getContextPath () + "/media/"; - } - - /** - * Returns the Context of the current session. This is a very sensitive - * function as we will take care of all parameters here! - * - * @return Context - */ - public Properties getCtx () - { - return ctx; - } - - /** - * Returns the current External Media URL for the Project - * - * @param CM_WebProject_ID - * WebProject - * @return ExternalMediaURL as String - */ - public String getExternalMediaURL (int CM_WebProject_ID) - { - externalMediaURL = getMediaServerCache ().getMediaServer (getCtx (), - CM_WebProject_ID, null); - if (externalMediaURL != null - && externalMediaURL.charAt (externalMediaURL.length () - 1) != '/') - externalMediaURL = externalMediaURL + "/"; - return externalMediaURL; - } - - /** - * Returns the current External Media URL be carefull this Function needs to - * be called after the URL is set! - * - * @return ExternalMediaURL as String - */ - public String getExternalMediaURL () - { - return externalMediaURL; - } - - /** - * setAD_Client_ID to update AD_Client as soon System has recognized the Client - * @param newVal - */ - public void setAD_Client_ID(int newVal) - { - ctx.put ("#AD_Client_ID", (String) (""+newVal)); - } - - /** - * get Servlet Logger - * @return CLooger log - */ - public CLogger getLogger() - { - return log; - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/MediaBroadcast.java b/webCM/src/main/servlet/org/compiere/cm/MediaBroadcast.java deleted file mode 100644 index 634eae8ffc..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/MediaBroadcast.java +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** - * Product: Compiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.compiere.model.MImage; -import org.compiere.model.MMedia; -import org.compiere.util.WebEnv; - -/** - * Broadcast Servlet - * - * @author $Author$ - * @version $Id$ - */ -@SuppressWarnings("serial") -public class MediaBroadcast extends HttpServletCM -{ - /** - * Process the HTTP Get request - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - // Create New Session - HttpSession sess = request.getSession(true); - sess.setMaxInactiveInterval(WebEnv.TIMEOUT); - - if (configLoaded && !fatalError) { - String requestURL = request.getRequestURL().toString(); - String serverName = request.getServerName(); - String baseURL = requestURL.substring(0,requestURL.indexOf(serverName)+serverName.length()+6)+request.getContextPath(); - String relativeURL = requestURL.substring(baseURL.length()); - // If the relativeURL still contains / we will simply strip them off... - if (relativeURL.indexOf('/')>=0) - relativeURL = relativeURL.substring(relativeURL.lastIndexOf('/')+1); - - // We should have only an ID before the first dot. - Integer mediaID = null; - try { - if (relativeURL.indexOf('.')>=0) { - mediaID = Integer.parseInt(relativeURL.substring(0,relativeURL.indexOf('.'))); - } else { - mediaID = Integer.parseInt(relativeURL); - } - } catch (NumberFormatException ne) { - - } - - if (mediaID!=null && mediaID.intValue()>0) { - - MMedia thisMedia = new org.compiere.model.MMedia(webProjectCache.getCtx(),mediaID,null); - if (thisMedia!=null && thisMedia.get_ID()>0) { - if (thisMedia.getMediaType ().equals ("CSS")) { - response.setContentType("text/css"); - // Text Content will get handled via direct Stream - response.setContentLength (thisMedia.getContentText ().length ()); - PrintWriter out; - out = response.getWriter (); - out.print (thisMedia.getContentText ()); - out.close (); - } else { - response.setContentType(thisMedia.getMediaType()); - // Binary / Image content will get handled here - MImage thisImage = thisMedia.getImage(); - if (thisImage != null) { - response.setContentLength(thisImage.getData().length); - - // Open the file and output streams - byte[] buffer = thisImage.getData(); - ByteArrayInputStream in = new ByteArrayInputStream(buffer); - OutputStream out = response.getOutputStream(); - - // Copy the contents of the file to the output stream - byte[] buf = new byte[1024]; - int count = 0; - while ((count = in.read(buf)) >= 0) { - out.write(buf, 0, count); - } - in.close(); - out.close(); - } - } - } else { - response.sendError(404); - } - } else { - response.sendError(404); - } - } else if (fatalError) { - response.sendError(500, ErrorMessage); - } - } // doGet - - - /** - * Process the HTTP Post request - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - doGet(request, response); - } // doPost - -} // Broadcast diff --git a/webCM/src/main/servlet/org/compiere/cm/RequestServlet.java b/webCM/src/main/servlet/org/compiere/cm/RequestServlet.java deleted file mode 100644 index 7bea6ccbea..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/RequestServlet.java +++ /dev/null @@ -1,91 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. - * This program is free software; you can redistribute it and/or modify it - * under the terms version 2 of the GNU General Public License as published - * by the Free Software Foundation. This program 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 General Public License for more details. - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * You may reach us at: ComPiere, Inc. - http://www.adempiere.org/license.html - * 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA or info@adempiere.org - *****************************************************************************/ -package org.compiere.cm; - -import java.io.IOException; -import java.util.Properties; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.compiere.cm.request.Request; -import org.compiere.util.WebEnv; -import org.compiere.util.WebSessionCtx; -import org.compiere.util.WebUtil; - -/** - * Request Servlet to handle Request create & Update etc. - * - * @author Kai Viiksaar - * @version $Id: RequestServlet.java,v 1.1 2006/10/11 06:30:11 comdivision Exp $ - */ -public class RequestServlet extends HttpServletCM { - /** serialVersionUID */ - private static final long serialVersionUID = 6979583935052312291L; - - /** - * Process Get Request - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet (HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - String l_szRequestID = null; - HttpSession sess = request.getSession (true); - sess.setMaxInactiveInterval (WebEnv.TIMEOUT); - - ctx = getCtx(); - - if (sess.getAttribute ("ctx")!=null) - ctx = (Properties) sess.getAttribute ("ctx"); - - WebSessionCtx wsc = (WebSessionCtx)sess.getAttribute(WebSessionCtx.NAME); - - // Create New Request - if (wsc != null) { - String mode = WebUtil.getParameter(request, "Mode"); - if (mode != null && mode.equals("RequestNew")) { - l_szRequestID = Request.createRequest(request, ctx); - } else if (mode != null && mode.equals("RequestChange")) { - l_szRequestID = Request.changeRequest(request, ctx); - } - } - String url = request.getParameter("ForwardTo") + l_szRequestID; - if (!url.startsWith("/")) - url = "/" + url; - response.sendRedirect(url); - } - - /** - * Process Post Request (handled by get) - * - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doPost (HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - doGet (request, response); - } // doPost - -} diff --git a/webCM/src/main/servlet/org/compiere/cm/StageBroadcast.java b/webCM/src/main/servlet/org/compiere/cm/StageBroadcast.java deleted file mode 100644 index 2c106f167d..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/StageBroadcast.java +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.compiere.cm.utils.LocaleHandler; -import org.compiere.cm.utils.RequestAnalyzer; -import org.compiere.cm.xml.Generator; -import org.compiere.cm.xml.XSLTProcessor; -import org.compiere.util.WebEnv; - -/** - * Broadcast Servlet - * - * @author $Author$ - * @version $Id$ - */ -public class StageBroadcast extends HttpServletCM -{ - - /** serialVersionUID */ - private static final long serialVersionUID = 7348394433516908807L; - - /** - * Handle Get Request - * - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet (HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - // Create New Session - HttpSession sess = request.getSession (true); - sess.setMaxInactiveInterval (WebEnv.TIMEOUT); - StringBuffer output = new StringBuffer (); - if (configLoaded && !fatalError) - { - String acceptLanguage = request.getHeader ("Accept-Language"); - String acceptCharset = request.getHeader ("Accept-Charset"); - LocaleHandler lhandler = new LocaleHandler (acceptLanguage, - acceptCharset); - RequestAnalyzer thisRequest = new RequestAnalyzer (this, request, - true, ""); - if (thisRequest.getIsRedirect ()) - { - // If we need to redirect as the URL is different do it beofre - // we transmit to client - response.sendRedirect (thisRequest.getRedirectURL ()); - } - else - { - // No need to redirect so we will display the content - // Generate the needed XMLCode - Generator thisXMLGen = new Generator (this, request, - thisRequest, new StringBuffer("")); - // thisXMLGen.addPObject(thisRequest.getCM_Container()); - String xmlCode = thisXMLGen.get (); - // Get or generate Template needed - String xslCode = templateCache.getCM_Template ( - thisRequest.getCM_Container ().getCM_Template_ID (), - thisRequest.getWebProject ().get_ID ()) - .getTemplateXST (); - // Put it all together - try - { - output.append (XSLTProcessor.run (request, xslCode, xmlCode)); - } - catch (Exception E) - { - response.sendError (500); - } - response.setContentType ("text/html; charset=" - + lhandler.getCharset ()); - response.setHeader ("CMBuild", buildDate); - PrintWriter out; - out = response.getWriter (); - out.print (output.toString ()); - out.close (); - } - } - else if (fatalError) - { - PrintWriter out; - out = response.getWriter (); - out.print ("

        Fatal Error:" + ErrorMessage + "

        "); - out.close (); - } - } // doGet - - /** - * Process Post Request - handled by Get - * - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doPost (HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - doGet (request, response); - } // doPost -} // Broadcast diff --git a/webCM/src/main/servlet/org/compiere/cm/XMLBroadcast.java b/webCM/src/main/servlet/org/compiere/cm/XMLBroadcast.java deleted file mode 100644 index bad49f6bc2..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/XMLBroadcast.java +++ /dev/null @@ -1,70 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.cm.utils.RequestAnalyzer; -import org.compiere.cm.xml.Generator; - -/** - * @author YS - * @version $Id$ - */ -public class XMLBroadcast extends HttpServletCM -{ - /** serialVersionUID */ - private static final long serialVersionUID = -1280320974132533949L; - - /** - * Get - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet (HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - RequestAnalyzer thisRequest = new RequestAnalyzer (this, request, - false, "/xml"); - // Even if we will only display the XML tree we are forced to build the Media URLs - resetInternalMediaURL (request); - if (externalMediaURL == null) { - if (thisRequest.getWebProject()!=null) - externalMediaURL = getExternalMediaURL (thisRequest - .getWebProject ().get_ID ()); - else - externalMediaURL = getInternalMediaURL(); - - } - // Generate the needed XMLCode - Generator thisXMLGen = new Generator (this, request, thisRequest, new StringBuffer("")); - String xmlCode = thisXMLGen.get (); - response.setContentType ("text/xml; charset=UTF8"); - PrintWriter out; - out = response.getWriter (); - out.print (xmlCode); - out.close (); - } // doGet - -} // HttpServletCM diff --git a/webCM/src/main/servlet/org/compiere/cm/cache/CO.java b/webCM/src/main/servlet/org/compiere/cm/cache/CO.java deleted file mode 100644 index 6f5699c58b..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/cache/CO.java +++ /dev/null @@ -1,184 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.cache; - -import java.util.Collections; -import java.util.Date; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Properties; -import java.util.Vector; - -import org.compiere.util.CLogger; - -/** - * CO CacheObject - * we store parts of the content in caches on the webservers to reduce DB load and speed up page deployment - * - * @author Yves Sandfort - * @version $Id$ - */ -public class CO { - - protected static int cacheSize = 100; - protected Hashtable cache = new Hashtable(cacheSize); - protected Hashtable cacheUsage = new Hashtable(cacheSize); - protected Properties ctx; - - /** Logger */ - protected CLogger log = CLogger.getCLogger(this.getClass()); - - /** - * Cache Object - */ - public CO () { - } - - /** - * set Context - * @param thisCtx - */ - public void setCtx(Properties thisCtx) { - ctx = thisCtx; - } - - /** - * get Context - * @return Context - */ - public Properties getCtx() { - return ctx; - } - - /** - * put - * @param ID - * @param thisObject - */ - public void put(String ID, Object thisObject) { - cache.put(ID,thisObject); - Long thisLong = new Long(new Date().getTime()); - cacheUsage.put(ID, thisLong); - if (cacheUsage.size()>cacheSize-1) { - cleanUp(); - } - } - - /** - * remove - * @param ID - */ - public void remove(String ID) { - cache.remove(ID); - cacheUsage.remove(ID); - } - - /** - * getSize of current cache - * @return number of cache entries - */ - public int getSize() { - return cache.size(); - } - - /** - * get key enumeration - * @return key enumeration - */ - public Enumeration getKeys() { - return cache.keys(); - } - - private void cleanUp () { - Vector vecKeys = new Vector(); - //Gets keys from hashtable - - Enumeration myEnum = cacheUsage.elements(); - - while (myEnum.hasMoreElements()) - { - vecKeys.add(myEnum.nextElement()); - } - - //Sorts vector in Ascending order - Collections.sort(vecKeys); - Collections.reverse(vecKeys); - - //Displays values using Key - for(int i=0;icacheSize-1) { - cache.remove(key); - cacheUsage.remove(key); - log.fine("Item: " + key + " from cache: " + this.getClass().getName() + " was removed."); - } - } - } - - /** - * Update Usage value for cache optimization - * @param ID - */ - public void use(int ID) { - Long thisLong = new Long(new java.util.Date().getTime()); - cacheUsage.put("" + ID, thisLong); - } - - /** - * Update Usage value for cache optimization - * @param ID - */ - public void use(String ID) { - Long thisLong = new Long(new java.util.Date().getTime()); - cacheUsage.put(ID, thisLong); - } - - /** - * empty complete Cache - */ - public void empty() { - cache = new Hashtable(cacheSize); - cacheUsage = new Hashtable(cacheSize); - log.fine("Cache: " + this.getClass().getName() + " was cleared."); - } - - /** - * Show Cache Content - * @return XML String with CacheContent - */ - public String show() { - StringBuffer tStrHTML = new StringBuffer(); - Enumeration thisEnum = null; - tStrHTML.append(" " + this.getSize() + "\n"); - thisEnum = this.getKeys(); - while (thisEnum.hasMoreElements()) { - tStrHTML.append(" " + thisEnum.nextElement() + "\n"); - } - return tStrHTML.toString(); - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/cache/Chat.java b/webCM/src/main/servlet/org/compiere/cm/cache/Chat.java deleted file mode 100644 index de770f4fbf..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/cache/Chat.java +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.cache; - -import java.util.Hashtable; - -import org.compiere.model.MChat; - -/** - * Chat Cache Object - * - * @author Yves Sandfort - * @version $Id$ - */ -public class Chat extends CO { - - protected Hashtable cacheContainerURL = new Hashtable(cacheSize); - - /** - * getCM_Chat - * @param ID - * @return Chat - */ - public MChat getCM_Chat(int ID) { - return getCM_Chat(""+ ID); - } - - /** - * getCM_Chat - * @param ID - * @return Chat - */ - public MChat getCM_Chat(String ID) { - if (cache.containsKey(ID)) { - use(ID); - return (MChat) cache.get(ID); - } else { - int[] tableKeys = MChat.getAllIDs("CM_Chat", "CM_Chat_ID=" + ID, "WebCM"); - if (tableKeys.length==0) { - // No Chat entry - return null; - } else if (tableKeys.length==1) { - MChat thisChat = new MChat(ctx, tableKeys[0], "WebCM"); - put ("" + thisChat.get_ID(),thisChat); - return thisChat; - } else { - // More than one result, this is funny, normally this is not possible :-/ - return null; - } - } - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/cache/Container.java b/webCM/src/main/servlet/org/compiere/cm/cache/Container.java deleted file mode 100644 index 2027d0148e..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/cache/Container.java +++ /dev/null @@ -1,111 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.cache; - -import java.util.Hashtable; - -import org.compiere.model.MContainer; - -/** - * Container Cache - * - * @author Yves Sandfort - * @version $ID$ - */ -public class Container extends CO { - - protected Hashtable cacheContainerURL = new Hashtable(cacheSize); - - /** - * Get Container from cache by ID - * @param ID Container ID - * @param CM_WebProject_ID Web Project - * @return Container - */ - public MContainer getCM_Container(String ID, int CM_WebProject_ID) { - return getCM_Container(Integer.parseInt(ID), CM_WebProject_ID); - } - - /** - * Get Container from cache by ID - * @param ID Container ID - * @param CM_WebProject_ID Web Project - * @return Container - */ - public MContainer getCM_Container(int ID, int CM_WebProject_ID) { - if (cache.containsKey(ID)) { - use(ID); - return (MContainer) cache.get(ID); - } else { - MContainer thisContainer = MContainer.get(ctx, ID, CM_WebProject_ID, "WebCM"); - if (thisContainer==null) - { - return getCM_ContainerByURL("/error404.html", CM_WebProject_ID, true); - } - else - { - put ("" + thisContainer.getCM_Container_ID(),thisContainer); - cacheContainerURL.put (CM_WebProject_ID + "-" + thisContainer.getRelativeURL(),"" + thisContainer.getCM_Container_ID()); - return thisContainer; - } - } - } - - /** - * Get Container from cache by URL - * @param URL URL to look for - * @param CM_WebProject_ID Web Project - * @param resolveURLErrors - * @return Container - */ - public MContainer getCM_ContainerByURL(String URL, int CM_WebProject_ID, boolean resolveURLErrors) { - if (cacheContainerURL.containsKey(CM_WebProject_ID + "-" + URL)) { - // Found a hit, so return it... - // Found exactly one record, so we return it - MContainer thisContainer = getCM_Container((String) cacheContainerURL.get(CM_WebProject_ID + "-" + URL), CM_WebProject_ID); - if (thisContainer.isSummary ()) { - thisContainer = getCM_ContainerByURL(URL + "/index.html", CM_WebProject_ID, resolveURLErrors); - } - return thisContainer; - } else { - // Let's try to find the URL... - MContainer thisContainer = MContainer.get (ctx, URL, CM_WebProject_ID, "WebCM"); - if (thisContainer==null) { - if (resolveURLErrors) { - if (URL.equals("/error404.html")) { - // Okay we are already been requested as the error message, so we try the index.html - MContainer tempContainer = getCM_ContainerByURL("/index.html", CM_WebProject_ID, false); - if (tempContainer!=null) - return tempContainer; - else - return null; - } else { - return getCM_ContainerByURL("/error404.html", CM_WebProject_ID, true); - } - } else { - return null; - } - } else { - // Found exactly one record, so we return it - if (thisContainer.isSummary ()) { - thisContainer = getCM_ContainerByURL(URL + "/index.html", CM_WebProject_ID, resolveURLErrors); - } - return thisContainer; - } - } - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/cache/ContainerElement.java b/webCM/src/main/servlet/org/compiere/cm/cache/ContainerElement.java deleted file mode 100644 index 19e5bb0dcd..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/cache/ContainerElement.java +++ /dev/null @@ -1,60 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.cache; - -import org.compiere.model.MContainerElement; - -/** - * Container Element Cache - * - * @author Yves Sandfort - * @version $Id$ - */ -public class ContainerElement extends CO { - /** - * getCM_Container_Element - * @param ID - * @param CM_WebProject_ID - * @return Container Element - */ - public MContainerElement getCM_Container_Element(String ID, int CM_WebProject_ID) { - return getCM_Container_Element(Integer.parseInt(ID), CM_WebProject_ID); - } - - /** - * getCM_Container_Element - * @param ID - * @param CM_WebProject_ID - * @return Container Element - */ - public MContainerElement getCM_Container_Element(int ID, int CM_WebProject_ID) { - if (cache.containsKey(ID)) { - use(ID); - return (MContainerElement) cache.get(ID); - } else { - MContainerElement thisContainerElement = MContainerElement.get(ctx, ID, "WebCM"); - if (thisContainerElement==null) { - // No Elements in DB found, needs to get handled - return null; - } else { - put ("" + thisContainerElement.get_ID(),thisContainerElement); - return thisContainerElement; - } - } - } - -} diff --git a/webCM/src/main/servlet/org/compiere/cm/cache/ContainerTree.java b/webCM/src/main/servlet/org/compiere/cm/cache/ContainerTree.java deleted file mode 100644 index 8eee050f5c..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/cache/ContainerTree.java +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.cache; - -import java.util.Hashtable; - -import org.compiere.cm.utils.TreeXML; -import org.compiere.model.MWebProject; - -/** - * Container Tree Cache - * - * @author Yves Sandfort - * @version $Id$ - */ -public class ContainerTree extends CO { - - protected Hashtable cacheContainerURL = new Hashtable(cacheSize); - - /** - * getContainerTree - * @param ID - * @param trxName - * @return XML StringBuffer - */ - public StringBuffer getContainerTree(int ID, String trxName) { - StringBuffer xmlCode = new StringBuffer(); - if (cache.containsKey("" + ID)) { - use("" + ID); - return (StringBuffer) cache.get("" + ID); - } else { - MWebProject thisProject = new MWebProject(ctx, ID, trxName); - TreeXML thisTree = new TreeXML(thisProject); - xmlCode.append(thisTree.getContainerXML()); - xmlCode.append(thisTree.getTreeXML()); - put ("" + ID, xmlCode); - return xmlCode; - } - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/cache/Domain.java b/webCM/src/main/servlet/org/compiere/cm/cache/Domain.java deleted file mode 100644 index c8ebc886e1..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/cache/Domain.java +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.cache; - -import org.compiere.model.MWebProjectDomain; - -/** - * @author Yves Sandfort - * @version $Id$ - */ -public class Domain extends CO -{ - /** - * Get Web Project Domain - * @param serverName - * @return web project domain - */ - public MWebProjectDomain getWebProjectDomain (String serverName) - { - if (cache.containsKey (serverName)) - { - use (serverName); - return (MWebProjectDomain)cache.get (serverName); - } - else - { - MWebProjectDomain thisWebProjectDomain = MWebProjectDomain.get(ctx, serverName, "WebCM"); - if (thisWebProjectDomain==null) - { - // HardCoded to deliver the GardenWorld Site as default - return null; - } - else - { - put (thisWebProjectDomain.getFQDN (), thisWebProjectDomain); - return thisWebProjectDomain; - } - } - } // getWebProjectDomain -} // Domain diff --git a/webCM/src/main/servlet/org/compiere/cm/cache/MediaServer.java b/webCM/src/main/servlet/org/compiere/cm/cache/MediaServer.java deleted file mode 100644 index 8b7a3f632f..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/cache/MediaServer.java +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.cache; - -import java.util.Hashtable; -import java.util.Properties; - -import org.compiere.model.MMediaServer; - -/** - * MediaServer CO stores Cache Objects for the Media Servers, so later we will - * always return kind of nearest / fastest media server to user... - * - * @author Yves Sandfort - * @version $Id$ - */ -public class MediaServer extends CO { - - protected Hashtable cacheContainerURL = new Hashtable(cacheSize); - - /** - * getMediaServer will return the correct MediaServer for this request - * @param ctx Context - * @param WebProjectID The Web Project ID - * @param trxName TrxName - * @return String with URL, or null if none found - */ - public String getMediaServer(Properties ctx, int WebProjectID, String trxName) { - String mediaServer = null; - if (cache.containsKey("" + WebProjectID)) { - use("" + WebProjectID); - return (String) cache.get("" + WebProjectID); - } else { - int[] mServerIDs = MMediaServer.getAllIDs("CM_Media_Server","CM_WebProject_ID=" + WebProjectID, trxName); - if (mServerIDs.length==0) { - return null; - } else if (mServerIDs.length==1) { - // One Result, that's easy, so put it to cache... - MMediaServer thisMediaServer = new MMediaServer(ctx, mServerIDs[0], trxName); - mediaServer = thisMediaServer.getURL(); - put("" + WebProjectID, mediaServer); - return mediaServer; - } else { - // TODO: We have more than one result, so this means we should be able to run round robin - MMediaServer thisMediaServer = new MMediaServer(ctx, mServerIDs[0], trxName); - mediaServer = thisMediaServer.getURL(); - put("" + WebProjectID, mediaServer); - return mediaServer; - - } - } - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/cache/Service.java b/webCM/src/main/servlet/org/compiere/cm/cache/Service.java deleted file mode 100644 index c97c4fdc89..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/cache/Service.java +++ /dev/null @@ -1,104 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.cache; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.compiere.cm.HttpServletCM; - -/** - * Cache Object Service classes - * - * @author Yves Sandfort - * @version $Id$ - */ -public class Service extends HttpServletCM { - /** serialVersionUID */ - private static final long serialVersionUID = 167843885331587478L; - - /** - * doGet - * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) - * @param request - * @param response - * @throws ServletException - * @throws IOException - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException - { - PrintWriter out; - out = response.getWriter(); - out.print("

        This servlet only handles service requests!

        "); - if (request.getParameter("Cache")!=null) { - if (request.getParameter("Cache").equals("Container")) { - if (request.getParameter("ID")!=null) { - containerCache.remove(request.getParameter("ID")); - } - if (request.getParameter("SHOW")!=null) { - out.print("" + containerCache.show() + ""); - } - } - if (request.getParameter("Cache").equals("ContainerElement")) { - if (request.getParameter("ID")!=null) { - containerElementCache.remove(request.getParameter("ID")); - } - if (request.getParameter("SHOW")!=null) { - out.print("" + containerElementCache.show() + ""); - } - } - if (request.getParameter("Cache").equals("ContainerTree")) { - if (request.getParameter("ID")!=null) { - containerTreeCache.remove(request.getParameter("ID")); - } - if (request.getParameter("SHOW")!=null) { - out.print("" + containerTreeCache.show() + ""); - } - } - if (request.getParameter("Cache").equals("Template")) { - if (request.getParameter("ID")!=null) { - if (request.getParameter("ID").equals("0")) { - templateCache.empty(); - } else { - templateCache.remove(request.getParameter("ID")); - } - } - if (request.getParameter("SHOW")!=null) { - out.print(""); - } - } - if (request.getParameter("Cache").equals("all")) { - chatCache.empty (); - containerCache.empty (); - containerElementCache.empty (); - containerTreeCache.empty (); - domainCache.empty (); - mediaServerCache.empty (); - templateCache.empty (); - webProjectCache.empty (); - xmlCache.empty (); - } - } - out.close(); - } - -} diff --git a/webCM/src/main/servlet/org/compiere/cm/cache/Template.java b/webCM/src/main/servlet/org/compiere/cm/cache/Template.java deleted file mode 100644 index bf396bfadc..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/cache/Template.java +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.cache; - -import org.compiere.model.MTemplate; - -/** - * Template - * we create a cacheObject for the template. - * - * @author Yves Sandfort - * @version $Id$ - */ -public class Template extends CO { - /** - * get Template by ID - * @param ID - * @param CM_WebProject_ID - * @return MTemplate - */ - public MTemplate getCM_Template(int ID, int CM_WebProject_ID) { - return getCM_Template(""+ ID, CM_WebProject_ID); - } - - /** - * get Template by ID - * @param ID - * @param CM_WebProject_ID - * @return MTemplate - */ - public MTemplate getCM_Template(String ID, int CM_WebProject_ID) { - if (cache.containsKey(ID)) { - use(ID); - return (MTemplate) cache.get(ID); - } else { - int[] tableKeys = MTemplate.getAllIDs("CM_Template", "CM_Template_ID=" + ID + " AND CM_WebProject_ID=" + CM_WebProject_ID, "WebCM"); - if (tableKeys.length==0) { - // TODO Throw Template Exception - return null; - } else if (tableKeys.length==1) { - MTemplate thisTemplate = new MTemplate(ctx, tableKeys[0], "WebCM"); - // We must prebuild the Template here, as we will not have Access to it later! - thisTemplate.getPreBuildTemplate(); - put ("" + thisTemplate.getCM_Template_ID(),thisTemplate); - return thisTemplate; - } else { - // More than one result, this is funny, normally this is not possible :-/ - return null; - } - } - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/cache/WebProject.java b/webCM/src/main/servlet/org/compiere/cm/cache/WebProject.java deleted file mode 100644 index 6390a79c49..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/cache/WebProject.java +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.cache; - -import org.compiere.model.MWebProject; - -/** - * Web Project Cache - * @author YS - * @version $Id$ - */ -public class WebProject extends CO -{ - /** - * Get WebProject - * @param ID id - * @return web project - */ - public MWebProject getWebProject (int ID) - { - return getWebProject ("" + ID); - } // getWebProject - - /** - * Get WebProject - * @param ID id - * @return webProject - */ - public MWebProject getWebProject (String ID) - { - if (cache.containsKey (ID)) - { - use (ID); - return (MWebProject)cache.get (ID); - } - else - { - int[] tableKeys = MWebProject.getAllIDs ("CM_WebProject", - "CM_WebProject_ID=" + ID, "WebCM"); - if (tableKeys.length == 0) - { - // Shouldn't happen, needs handler! - return null; - } - else if (tableKeys.length == 1) - { - MWebProject thisProject = new MWebProject (ctx, - tableKeys[0], "WebCM"); - put ("" + thisProject.get_ID (), thisProject); - return thisProject; - } - else - { - return null; - } - } - } // getWebProject - -} // WebProject diff --git a/webCM/src/main/servlet/org/compiere/cm/cache/XML.java b/webCM/src/main/servlet/org/compiere/cm/cache/XML.java deleted file mode 100644 index acdbbefae6..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/cache/XML.java +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.cache; - -import java.util.Hashtable; - -import org.compiere.model.MCountry; - -public class XML extends CO { - - protected Hashtable cacheContainerURL = new Hashtable(cacheSize); - - public String getXML(String ID) { - if (cache.containsKey(ID)) { - use(ID); - return (String) cache.get(ID).toString (); - } else { - // This Cache is special we do not base on records we provide common data, i.e. Countries etc. - StringBuffer result = new StringBuffer(); - if (ID.equals ("C_Country")) - result = genCountryList(result); - if (result!=null) { - put (ID,result); - return result.toString (); - } else { - return null; - } - } - } - - private StringBuffer genCountryList(StringBuffer result) - { - result.append("\n"); - result.append(" \n"); - MCountry defaultCountry = MCountry.getDefault (getCtx()); - result = defaultCountry.get_xmlString (result); - result.append(" \n"); - MCountry theseCountries[] = MCountry.getCountries(getCtx()); - for (int i=0;i\n"); - return result; - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/extend/indexSearch.java b/webCM/src/main/servlet/org/compiere/cm/extend/indexSearch.java deleted file mode 100644 index d23037d3e6..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/extend/indexSearch.java +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. - * This program is free software; you can redistribute it and/or modify it - * under the terms version 2 of the GNU General Public License as published - * by the Free Software Foundation. This program 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 General Public License for more details. - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * You may reach us at: ComPiere, Inc. - http://www.adempiere.org/license.html - * 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA or info@adempiere.org - *****************************************************************************/ -package org.compiere.cm.extend; - -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; - -/** - * Search the index for results - * - * @author Yves Sandfort - * @version $Id$ - */ -public class indexSearch extends org.compiere.cm.Extend -{ - /** - * - */ - private static final long serialVersionUID = 2182007427785520124L; - - public indexSearch (HttpServletRequest request, Properties ctx) - { - super (request, ctx); - } - - public boolean doIt() - { - return true; - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/request/Request.java b/webCM/src/main/servlet/org/compiere/cm/request/Request.java deleted file mode 100644 index a3b1b36fe6..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/request/Request.java +++ /dev/null @@ -1,414 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. - * This program is free software; you can redistribute it and/or modify it - * under the terms version 2 of the GNU General Public License as published - * by the Free Software Foundation. This program 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 General Public License for more details. - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * You may reach us at: ComPiere, Inc. - http://www.adempiere.org/license.html - * 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA or info@adempiere.org - *****************************************************************************/ -package org.compiere.cm.request; - -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; - -import org.compiere.model.MRequest; -import org.compiere.util.DB; - -/** - * Request Class to create or update Requests. - * - * @author Kai Viiksaar - * @version $Id: Request.java,v 1.3 2006/10/16 11:34:47 comdivision Exp $ - */ -public class Request { - - //Integer values - private final static int i_integer = 11; - private final static int i_id = 13; - private final static int i_table = 18; - private final static int i_tableDirect = 19; - private final static int i_rowID = 26; - private final static int i_searchField = 30; - - //BigDecimal values - private final static int bd_amount = 12; - private final static int bd_floatNumber = 22; - private final static int bd_quantity = 29; - private final static int bd_costsAndPrice = 37; - - //Date values - private final static int d_date = 15; - private final static int d_dateTime = 16; - private final static int d_time = 24; - - //String values - private final static int s_string = 10; - private final static int s_text = 14; - private final static int s_textLong = 36; - private final static int s_list = 17; - private final static int s_location = 21; - private final static int s_binary = 23; - private final static int s_account = 25; - private final static int s_color = 27; - private final static int s_button = 28; - private final static int s_warehousLocator = 31; - private final static int simage = 32; - private final static int s_assignment = 33; - private final static int s_memo = 34; - private final static int s_productAttribute = 35; - - //Boolean values - private final static int b_bool = 20; - - - /** - * Creates a new Request. - * - * @param request - * @param ctx - * @return new Request ID - */ - public static String createRequest(HttpServletRequest request, Properties ctx) { - String l_szTrxName = null; - String l_szReturn = null; - - boolean l_bSuccess = true; - - BigDecimal l_bdAmt = getParameterAsBD(request, "RequestAmt"); - - int l_nOrgID = getParameterAsInt(request, "AD_Org_ID"); - //int l_nSalesRepID = getParameterAsInt(request, "SalesRep_ID"); - int l_nRoleID = getParameterAsInt(request, "AD_Role_ID"); - int l_nRReqTypeID = getParameterAsInt(request, "R_RequestType_ID"); - int l_nRGroupID = getParameterAsInt(request, "R_Group_ID"); - int l_nRCategoryID = getParameterAsInt(request, "R_Category_ID"); - int l_nRReqRelID = getParameterAsInt(request, "R_RequestRelated_ID"); - int l_nRStatusID = getParameterAsInt(request, "R_Status_ID"); - int l_nRResolID = getParameterAsInt(request, "R_Resolution_ID"); - - int l_nBPartnerID = getParameterAsInt(request, "C_BPartner_ID"); - int l_nUserID = getParameterAsInt(request, "AD_User_ID"); - int l_nProjectID = getParameterAsInt(request, "C_Project_ID"); - int l_nAssetID = getParameterAsInt(request, "A_Asset_ID"); - int l_nOrderID = getParameterAsInt(request, "C_Order_ID"); - int l_nInvoiceID = getParameterAsInt(request, "C_Invoice_ID"); - int l_nProductID = getParameterAsInt(request, "M_Product_ID"); - int l_nPaymentID = getParameterAsInt(request, "C_Payment_ID"); - int l_nInOutID = getParameterAsInt(request, "M_InOut_ID"); - int l_nRMAID = getParameterAsInt(request, "M_RMA_ID"); - int l_nCampaignID = getParameterAsInt(request, "C_Campaign_ID"); - - - /* - * Durchlauf der Parameter Werte. Dabei werden alle übergebenen Parameter - * als Columns in der MColumn gesucht und bei einem Treffer diese Werte - * dann über set_ValueOfColumn gesetzt - */ -/* MRequest l_newRequest = new MRequest(ctx, 0, l_szTrxName); - Enumeration l_eParameterNames = request.getParameterNames(); - MColumn curColumn = null; - - int l_nColumnID = 0; - int l_nRefID = 0; - - while (l_eParameterNames.hasMoreElements()) { - String name = l_eParameterNames.nextElement().toString(); - - l_nColumnID = l_newRequest.get_ColumnIndex(name); - if (l_nColumnID > -1) { - curColumn = new MColumn(ctx, l_nColumnID, l_szTrxName); - l_nRefID = curColumn.getAD_Reference_ID(); - - if (l_nRefID == b_bool) { - l_newRequest.set_ValueOfColumn(l_nColumnID, getParameterAsBool(request, name)); - } else if (l_nRefID == bd_amount || l_nRefID == bd_costsAndPrice || l_nRefID == bd_floatNumber || l_nRefID == bd_quantity) { - l_newRequest.set_ValueOfColumn(l_nColumnID, getParameterAsBD(request, name)); - } else if (l_nRefID == d_date || l_nRefID == d_dateTime || l_nRefID == d_time) { - l_newRequest.set_ValueOfColumn(l_nColumnID, getParameterAsDate(request, name)); - } else if (l_nRefID == i_id || l_nRefID == i_integer || l_nRefID == i_rowID || l_nRefID == i_searchField || l_nRefID == i_table || l_nRefID == i_table) { - l_newRequest.set_ValueOfColumn(l_nColumnID, getParameterAsInt(request, name)); - } else { - l_newRequest.set_ValueOfColumn(l_nColumnID, getParameterAsString(request, name)); - } - } - } - l_bSuccess &= l_newRequest.save(); -*/ - - MRequest newRequest = new MRequest(ctx, 0, l_szTrxName); - - // values for values no fieldgroup - newRequest.setAD_Org_ID(l_nOrgID); - newRequest.setDueType(getParameterAsString(request, "DueType")); - newRequest.setR_RequestType_ID(l_nRReqTypeID); - newRequest.setR_Group_ID(l_nRGroupID); - newRequest.setR_Category_ID(l_nRCategoryID); - newRequest.setR_RequestRelated_ID(l_nRReqRelID); - newRequest.setR_Status_ID(l_nRStatusID); - newRequest.setR_Resolution_ID(l_nRResolID); - newRequest.setPriority(getParameterAsString(request, "Priority")); - newRequest.setPriorityUser(getParameterAsString(request, "PriorityUser")); - newRequest.setSummary(getParameterAsString(request, "Summary")); - newRequest.setConfidentialType(getParameterAsString(request, "ConfidentialType")); - newRequest.setIsInvoiced(getParameterAsBool(request, "IsInvoiced")); - - // Mandatory values for fieldgroup Action - newRequest.setConfidentialTypeEntry(getParameterAsString(request, "ConfidentialTypeEntry")); - newRequest.setAD_Role_ID(l_nRoleID); - //newRequest.setSalesRep_ID(l_nSalesRepID); - - // values for fieldgroup Reference - newRequest.setC_BPartner_ID(l_nBPartnerID); - newRequest.setAD_User_ID(l_nUserID); - newRequest.setC_Project_ID(l_nProjectID); - newRequest.setA_Asset_ID(l_nAssetID); - newRequest.setC_Order_ID(l_nOrderID); - newRequest.setC_Invoice_ID(l_nInvoiceID); - newRequest.setM_Product_ID(l_nProductID); - newRequest.setC_Payment_ID(l_nPaymentID); - newRequest.setM_InOut_ID(l_nInOutID); - newRequest.setM_RMA_ID(l_nRMAID); - newRequest.setRequestAmt(l_bdAmt); - newRequest.setC_Campaign_ID(l_nCampaignID); - - l_bSuccess &= newRequest.save(); - - if (l_bSuccess) { - try { - DB.commit(true, l_szTrxName); - l_szReturn = "" + newRequest.get_ID(); - } catch (Exception e) { - l_szReturn = e.getMessage(); - } - } - return l_szReturn; - } - - /** - * Updates a Request. - * - * @param request - * @param ctx - * @return - */ - public static String changeRequest(HttpServletRequest request, Properties ctx) { - String l_szTrxName = null; - String l_szReturn = null; - - boolean l_bSuccess = true; - - BigDecimal l_bdAmt = getParameterAsBD(request, "RequestAmt"); - - int l_nReqID = getParameterAsInt(request, "R_Request_ID"); - int l_nOrgID = getParameterAsInt(request, "AD_Org_ID"); - //int l_nSalesRepID = getParameterAsInt(request, "SalesRep_ID"); - int l_nRReqTypeID = getParameterAsInt(request, "R_RequestType_ID"); - int l_nRGroupID = getParameterAsInt(request, "R_Group_ID"); - int l_nRCategoryID = getParameterAsInt(request, "R_Category_ID"); - int l_nRReqRelID = getParameterAsInt(request, "R_RequestRelated_ID"); - int l_nRStatusID = getParameterAsInt(request, "R_Status_ID"); - int l_nRResolID = getParameterAsInt(request, "R_Resolution_ID"); - - int l_nBPartnerID = getParameterAsInt(request, "C_BPartner_ID"); - int l_nUserID = getParameterAsInt(request, "AD_User_ID"); - int l_nProjectID = getParameterAsInt(request, "C_Project_ID"); - int l_nAssetID = getParameterAsInt(request, "A_Asset_ID"); - int l_nOrderID = getParameterAsInt(request, "C_Order_ID"); - int l_nInvoiceID = getParameterAsInt(request, "C_Invoice_ID"); - int l_nProductID = getParameterAsInt(request, "M_Product_ID"); - int l_nPaymentID = getParameterAsInt(request, "C_Payment_ID"); - int l_nInOutID = getParameterAsInt(request, "M_InOut_ID"); - int l_nRMAID = getParameterAsInt(request, "M_RMA_ID"); - int l_nCampaignID = getParameterAsInt(request, "C_Campaign_ID"); - - int l_nResponseID = getParameterAsInt(request, "R_StandardResponse_ID"); - int l_nMailTextID = getParameterAsInt(request, "R_MailText_ID"); - int l_nActivityID = getParameterAsInt(request, "C_Activity_ID"); - int l_nProdSpentID = getParameterAsInt(request, "M_ProductSpent_ID"); - - BigDecimal l_QtySpent = getParameterAsBD(request, "QtySpent"); - BigDecimal l_QtyInvoiced = getParameterAsBD(request, "QtyInvoiced"); - BigDecimal l_QtyPlan = getParameterAsBD(request, "QtyPlan"); - - Timestamp l_tsDateNextAction = getParameterAsDate(request, "DateNextAction"); - Timestamp l_tsDateStartPlan = getParameterAsDate(request, "DateStartPlan"); - Timestamp l_tsDateCompletePlan = getParameterAsDate(request, "DateCompletePlan"); - Timestamp l_tsStartDate = getParameterAsDate(request, "StartDate"); - Timestamp l_tsCloseDate = getParameterAsDate(request, "CloseDate"); - - MRequest newRequest = new MRequest(ctx, l_nReqID, l_szTrxName); - - // values for values no fieldgroup - newRequest.setAD_Org_ID(l_nOrgID); - newRequest.setDueType(getParameterAsString(request, "DueType")); - newRequest.setR_RequestType_ID(l_nRReqTypeID); - newRequest.setR_Group_ID(l_nRGroupID); - newRequest.setR_Category_ID(l_nRCategoryID); - newRequest.setR_RequestRelated_ID(l_nRReqRelID); - newRequest.setR_Status_ID(l_nRStatusID); - newRequest.setR_Resolution_ID(l_nRResolID); - newRequest.setPriority(getParameterAsString(request, "Priority")); - newRequest.setPriorityUser(getParameterAsString(request, "PriorityUser")); - newRequest.setSummary(getParameterAsString(request, "Summary")); - newRequest.setConfidentialType(getParameterAsString(request, "ConfidentialType")); - newRequest.setIsInvoiced(getParameterAsBool(request, "IsInvoiced")); - - // values for fieldgroup Action - newRequest.setDateNextAction(l_tsDateNextAction); - newRequest.setConfidentialTypeEntry(getParameterAsString(request, "ConfidentialTypeEntry")); - newRequest.setR_StandardResponse_ID(l_nResponseID); - newRequest.setR_MailText_ID(l_nMailTextID); - newRequest.setResult(getParameterAsString(request, "Result")); - newRequest.setC_Activity_ID(l_nActivityID); - newRequest.setQtyPlan(l_QtyPlan); - newRequest.setQtySpent(l_QtySpent); - newRequest.setM_ProductSpent_ID(l_nProdSpentID); - newRequest.setQtyInvoiced(l_QtyInvoiced); - newRequest.setDateStartPlan(l_tsDateStartPlan); - newRequest.setDateCompletePlan(l_tsDateCompletePlan); - newRequest.setStartDate(l_tsStartDate); - newRequest.setCloseDate(l_tsCloseDate); - - // values for fieldgroup Reference - newRequest.setC_BPartner_ID(l_nBPartnerID); - newRequest.setAD_User_ID(l_nUserID); - newRequest.setC_Project_ID(l_nProjectID); - newRequest.setA_Asset_ID(l_nAssetID); - newRequest.setC_Order_ID(l_nOrderID); - newRequest.setC_Invoice_ID(l_nInvoiceID); - newRequest.setM_Product_ID(l_nProductID); - newRequest.setC_Payment_ID(l_nPaymentID); - newRequest.setM_InOut_ID(l_nInOutID); - newRequest.setM_RMA_ID(l_nRMAID); - newRequest.setRequestAmt(l_bdAmt); - newRequest.setC_Campaign_ID(l_nCampaignID); - - l_bSuccess &= newRequest.save(); - - if (l_bSuccess) { - try { - DB.commit(true, l_szTrxName); - l_szReturn = "" + newRequest.get_ID(); - } catch (Exception e) { - l_szReturn = e.getMessage(); - } - } - return l_szReturn; - } - - /** - * Returns a Request Parameter as String. - * Removes format characters. - * - * @param request - * @param parameterName - * @return - */ - private static String getParameterAsString(HttpServletRequest request, String parameterName) { - String l_szReturn = new String(""); - - if (request.getParameter(parameterName) != null && !request.getParameter(parameterName).equals("")) { - l_szReturn = request.getParameter(parameterName).toString(); - l_szReturn = l_szReturn.replace("\r",""); - l_szReturn = l_szReturn.replace("\n",""); - } - return l_szReturn; - } - - /** - * Returns a Request Parameter as Integer. - * - * @param request - * @param parameterName - * @return value, 0 if no parameter or parse error - */ - private static int getParameterAsInt(HttpServletRequest request, String parameterName) { - int l_nID = 0; - - if (request.getParameter(parameterName) != null && !request.getParameter(parameterName).equals("")) { - try { - l_nID = Integer.parseInt(request.getParameter(parameterName)); - } catch (Exception e) { - l_nID = 0; - } - } - return l_nID; - } - - /** - * Returns a Request Parameter as BigDecimal. - * - * @param request - * @param parameterName - * @return value, 0 if no parameter or parse error - */ - private static BigDecimal getParameterAsBD(HttpServletRequest request, String parameterName) { - BigDecimal l_bdValue = new BigDecimal(0); - - if (request.getParameter(parameterName) != null && !request.getParameter(parameterName).equals("")) { - try { - String l_szValue = request.getParameter(parameterName); - l_szValue = l_szValue.replace(",", "."); - l_bdValue = new BigDecimal(Float.parseFloat(l_szValue)); - } catch (Exception e) { - l_bdValue = new BigDecimal(0); - } - } - l_bdValue = l_bdValue.setScale(2, BigDecimal.ROUND_CEILING); - return l_bdValue; - } - - /** - * Returns a Parameter as boolean. - * - * @param request - * @param parameterName - * @return true if parameter != null - */ - private static boolean getParameterAsBool(HttpServletRequest request, String parameterName) { - boolean l_bIs = false; - - if (request.getParameter(parameterName) != null) { - l_bIs = true; - } - return l_bIs; - } - - /** - * Returns a Parameter as Timestamp. - * - * @param request - * @param parameterName - * @return Timestamp or null - */ - private static Timestamp getParameterAsDate(HttpServletRequest request, String parameterName) { - Date myDate = new Date(); - SimpleDateFormat ger = new SimpleDateFormat("dd.MM.yyyy"); - long time = 0; - - if (request.getParameter(parameterName) != null && !request.getParameter(parameterName).equals("")) { - try { - myDate = ger.parse(request.getParameter(parameterName).toString()); - time = myDate.getTime(); - } catch (ParseException e) { - return null; - } - return new Timestamp(time); - } - return null; - } -} - \ No newline at end of file diff --git a/webCM/src/main/servlet/org/compiere/cm/utils/AccessLogger.java b/webCM/src/main/servlet/org/compiere/cm/utils/AccessLogger.java deleted file mode 100644 index c8d007e93f..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/utils/AccessLogger.java +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.utils; - -import java.math.BigDecimal; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; - -import org.compiere.cm.HttpServletCM; -import org.compiere.model.X_CM_WebAccessLog; -import org.compiere.util.Env; - - -public class AccessLogger extends Thread -{ - private X_CM_WebAccessLog thisLog = null; - - public AccessLogger(HttpServletRequest tRequest, HttpServletCM tServletCM, RequestAnalyzer tRequestAnalyzer) - { - Properties ctx = tServletCM.getCtx(); - if (tRequestAnalyzer.getWebProject()!=null) - Env.setContext(ctx, "#AD_Client_ID", "" + tRequestAnalyzer.getWebProject().getAD_Client_ID()); - //ctx.put() - thisLog = new X_CM_WebAccessLog(ctx, 0, null); - thisLog.setAD_Org_ID(0); - // Set Access Type - thisLog.setLogType("W"); - // Set Web Project - if (tRequestAnalyzer.getWebProject()!=null) - thisLog.setCM_WebProject_ID(tRequestAnalyzer.getWebProject().get_ID()); - // Set IP_Address - thisLog.setIP_Address("217.171.192.001"); - // Set BroadcastServer - - // Set the RequestType - if (tRequest.getMethod()!=null) - thisLog.setRequestType(tRequest.getMethod()); - // Set Page URL - if (tRequest.getRequestURL()!=null) - thisLog.setPageURL(tRequest.getRequestURL().toString()); - // Set Referrer - if (tRequest.getHeader("Referer")!=null) - thisLog.setReferrer(tRequest.getHeader("Referer")); - // Set RemoteHost - if (tRequest.getRemoteHost()!=null) - thisLog.setRemote_Host(tRequest.getRemoteHost()); - // set RemoteAddr - if (tRequest.getRemoteAddr()!=null) - thisLog.setRemote_Addr(tRequest.getRemoteAddr()); - // set Useragent / Browser - if (tRequest.getHeader("User-Agent")!=null) - thisLog.setUserAgent(tRequest.getHeader("User-Agent")); - // Set AcceptLanguage - if (tRequest.getHeader("Accept-Language")!=null) - thisLog.setAcceptLanguage(tRequest.getHeader("Accept-Language")); - // Set Websession ID - if (tRequest.getSession()!=null) - thisLog.setWebSession(tRequest.getSession().getId()); - // Seth Hyphen - - // Set Protocol - if (tRequest.getProtocol()!=null) - thisLog.setProtocol(tRequest.getProtocol()); - else - // This is hardcoded we must fix this later! - thisLog.setProtocol("unknown"); - // Statuscode - if (tRequestAnalyzer.getIsRedirect()) - thisLog.setStatusCode(302); - else - thisLog.setStatusCode(200); - // Set Filesize - if (tRequest.getContentLength()>0) { - thisLog.setFileSize(new java.math.BigDecimal(tRequest.getContentLength())); - } - // Set AD_User - - // Set CM_Media_ID - - } - - public void setFileSize(BigDecimal fileSize) - { - thisLog.setFileSize(fileSize); - } - - public void run() - { - thisLog.save(); - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/utils/Attributes.java b/webCM/src/main/servlet/org/compiere/cm/utils/Attributes.java deleted file mode 100644 index 9618fd48d6..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/utils/Attributes.java +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.utils; - -import java.util.Hashtable; - -import javax.servlet.http.HttpSessionAttributeListener; -import javax.servlet.http.HttpSessionBindingEvent; - -public class Attributes implements HttpSessionAttributeListener { - private static Hashtable projectSessions = new Hashtable(); - - public void attributeAdded(HttpSessionBindingEvent se) { - if (se.getName().equals("isy.user.project_id")) { - String project_id = se.getValue().toString(); - int projectSessionCount = 0; - // There is already an entry in the Hashtable - if (projectSessions.containsKey(project_id)) { - projectSessionCount= ((Integer)projectSessions.get(project_id)).intValue(); - projectSessionCount++; - projectSessions.put(project_id,new Integer(projectSessionCount)); - } else { - projectSessionCount = 1; - projectSessions.put(project_id,new Integer(projectSessionCount)); - } - } - } - - public void attributeRemoved(HttpSessionBindingEvent se) { - if (se.getName().equals("isy.user.project_id")) { - String project_id = se.getValue().toString(); - int projectSessionCount = 0; - // There is already an entry in the Hashtable - if (projectSessions.containsKey(project_id)) { - projectSessionCount= ((Integer)projectSessions.get(project_id)).intValue(); - if (projectSessionCount>0) projectSessionCount--; - projectSessions.put(project_id,new Integer(projectSessionCount)); - } else { - projectSessionCount = 0; - projectSessions.put(project_id,new Integer(projectSessionCount)); - } - } - } - - public void attributeReplaced(HttpSessionBindingEvent se) { - } - - public static int getActiveSessions(String project_id) { - int projectSessionCount = 0; - if (projectSessions.containsKey(project_id)) { - projectSessionCount= ((Integer)projectSessions.get(project_id)).intValue(); - } - return projectSessionCount; - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/utils/CMEnv.java b/webCM/src/main/servlet/org/compiere/cm/utils/CMEnv.java deleted file mode 100644 index a61775bc18..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/utils/CMEnv.java +++ /dev/null @@ -1,38 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.utils; - -import java.util.Properties; - -import org.compiere.util.Env; - -public class CMEnv { - - public Properties getDefaults() { - Properties ctx = new Properties(); - - Env.setContext(ctx, "#AD_Client_ID", "0"); - Env.setContext(ctx, "#AD_Org_ID", "0"); - Env.setContext(ctx, "#AD_User_ID", "0"); - Env.setContext(ctx, "#AD_Role_ID", "0"); - Env.setContext(ctx, "#AD_Language", "en_US"); - - return ctx; - - } - -} diff --git a/webCM/src/main/servlet/org/compiere/cm/utils/Counter.java b/webCM/src/main/servlet/org/compiere/cm/utils/Counter.java deleted file mode 100644 index 669075f81c..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/utils/Counter.java +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.utils; - -import javax.servlet.http.HttpSessionEvent; -import javax.servlet.http.HttpSessionListener; - -/** - * @author YS - * @version $Id$ - */ -public class Counter - implements HttpSessionListener -{ - - private static int m_activeSessions = 0; - - /** - * SessionCreated - * @param se - */ - public void sessionCreated (HttpSessionEvent se) - { - m_activeSessions++; - } - - /** - * Session Destroyed - * @param se - */ - public void sessionDestroyed (HttpSessionEvent se) - { - if (m_activeSessions > 0) - m_activeSessions--; - } - - /** - * Get Active Sessions - * @return no of sessions - */ - public static int getActiveSessions () - { - return m_activeSessions; - } -} // diff --git a/webCM/src/main/servlet/org/compiere/cm/utils/LocaleHandler.java b/webCM/src/main/servlet/org/compiere/cm/utils/LocaleHandler.java deleted file mode 100644 index a4771c8667..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/utils/LocaleHandler.java +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.utils; - -import java.util.Hashtable; -import java.util.Locale; -import java.util.StringTokenizer; - -/** - * @author YS - * @version $Id$ - */ -public class LocaleHandler -{ - /** Locale */ - private Locale m_chosenLocale; - /** Charset */ - private String m_chosenCharset; - - /** Locale - character set map */ - private static Hashtable s_map; - - /** Static Init */ - static - { - s_map = new Hashtable (); - s_map.put ("ar", "ISO-8859-6"); - s_map.put ("be", "ISO-8859-5"); - s_map.put ("bg", "ISO-8859-5"); - s_map.put ("ca", "ISO-8859-1"); - s_map.put ("cs", "ISO-8859-2"); - s_map.put ("da", "ISO-8859-1"); - s_map.put ("de", "ISO-8859-1"); - s_map.put ("el", "ISO-8859-7"); - s_map.put ("en", "ISO-8859-1"); - s_map.put ("es", "ISO-8859-1"); - s_map.put ("et", "ISO-8859-1"); - s_map.put ("fi", "ISO-8859-1"); - s_map.put ("fr", "ISO-8859-1"); - s_map.put ("hr", "ISO-8859-2"); - s_map.put ("hu", "ISO-8859-2"); - s_map.put ("is", "ISO-8859-1"); - s_map.put ("it", "ISO-8859-1"); - s_map.put ("iw", "ISO-8859-8"); - s_map.put ("ja", "Shift_JIS"); - s_map.put ("ko", "EUC-KR"); - s_map.put ("lt", "ISO-8859-2"); - s_map.put ("lv", "ISO-8859-2"); - s_map.put ("mk", "ISO-8859-5"); - s_map.put ("nl", "ISO-8859-1"); - s_map.put ("no", "ISO-8859-1"); - s_map.put ("pl", "ISO-8859-2"); - s_map.put ("pt", "ISO-8859-1"); - s_map.put ("ro", "ISO-8859-2"); - s_map.put ("ru", "ISO-8859-5"); - s_map.put ("sh", "ISO-8859-5"); - s_map.put ("sk", "ISO-8859-2"); - s_map.put ("sl", "ISO-8859-2"); - s_map.put ("sq", "ISO-8859-2"); - s_map.put ("sr", "ISO-8859-5"); - s_map.put ("sv", "ISO-8859-1"); - s_map.put ("tr", "ISO-8859-9"); - s_map.put ("uk", "ISO-8859-5"); - s_map.put ("zh", "GB2312"); - s_map.put ("zh_TW", "Big5"); - } // static - - /** - * Constructs a new LocaleHandler language list, and charset list. - * - * @param languages - * the Accept-Language header - * @param charsets - * the Accept-Charset header - */ - public LocaleHandler (String languages, String charsets) - { - Locale defaultLocale = new Locale ("en", "US"); - String defaultCharset = "ISO-8859-1"; - // If no specific language we will keep the default values - if (languages == null) - { - m_chosenLocale = defaultLocale; - m_chosenCharset = defaultCharset; - return; // quick exit - } - StringTokenizer langTokenizer = new StringTokenizer (languages, ","); - while (langTokenizer.hasMoreTokens ()) - { - String lang = langTokenizer.nextToken (); - Locale loc = getLocaleForLanguage (lang); - String charset = getCharsetForLocale (loc, charsets); - if (charset == null) - continue; - // We can use the values if this point is reached - m_chosenLocale = loc; - m_chosenCharset = charset; - return; - } - // We didn't found anything, so we will use the defaults - m_chosenLocale = defaultLocale; - m_chosenCharset = defaultCharset; - } // LocaleHandler - - /** - * Gets the chosen locale. - * - * @return the chosen locale - */ - public Locale getLocale () - { - return m_chosenLocale; - } // getLocale - - /** - * Gets the chosen charset. - * - * @return the chosen charset - */ - public String getCharset () - { - return m_chosenCharset; - } // getCharset - - /* - * Gets a Locale object for a given language string - */ - private Locale getLocaleForLanguage (String lang) - { - Locale loc; - int semi, dash; - // Cut off any qvalue that might come after a semi-colon - if ((semi = lang.indexOf (';')) != -1) - { - lang = lang.substring (0, semi); - } - // Trim any whitespace - lang = lang.trim (); - // Create a Locale from the language. A dash may separate the - // language from the country. - if ((dash = lang.indexOf ('-')) == -1) - { - loc = new Locale (lang, ""); // No dash, no country - } - else - { - loc = new Locale (lang.substring (0, dash), lang - .substring (dash + 1)); - } - return loc; - } // getLanguageForLanguage - - /** - * Gets the best charset for a given locale, selecting from a charset list. - * Currently ignores the charset list. Subclasses can override this method - * to take the list into account. - * - * @param loc - * the locale - * @param charsets - * a comma-separated charset list - * @return the best charset for the given locale from the given list - */ - protected String getCharsetForLocale (Locale loc, String charsets) - { - // Note: This method ignores the client-specified charsets - return getCharset (loc); - } // getCharsetForLocale - - /** - * Gets the preferred charset for the given locale, or null if the locale is - * not recognized. - * - * @param loc - * the locale - * @return the preferred charset - */ - public static String getCharset (Locale loc) - { - String charset; - // Try for an full name match (may include country) - charset = (String)s_map.get (loc.toString ()); - if (charset != null) - return charset; - // If a full name didn't match, try just the language - charset = (String)s_map.get (loc.getLanguage ()); - return charset; // may be null - } // getCharset - -} // LocaleHandler - diff --git a/webCM/src/main/servlet/org/compiere/cm/utils/RequestAnalyzer.java b/webCM/src/main/servlet/org/compiere/cm/utils/RequestAnalyzer.java deleted file mode 100644 index ba9c6e02d4..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/utils/RequestAnalyzer.java +++ /dev/null @@ -1,369 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.utils; - -import java.lang.reflect.Constructor; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import org.compiere.cm.Extend; -import org.compiere.cm.HttpServletCM; -import org.compiere.cm.cache.Container; -import org.compiere.cm.cache.Domain; -import org.compiere.cm.cache.WebProject; -import org.compiere.model.MContainer; -import org.compiere.model.MWebProject; -import org.compiere.model.MWebProjectDomain; -import org.compiere.util.CLogger; - -/** - * RequestAnalyzer - * - * @author Yves Sandfort - * @version $Id$ - */ -public class RequestAnalyzer -{ - - private String m_requestURL; - - private String m_relativeURL; - - private String m_serverName; - - private String m_baseURL; - - private String m_redirectURL; - - private String m_procClassName = null; - - private MWebProjectDomain m_WebProjectDomain; - - private MWebProject m_WebProject; - - private MContainer m_Container; - - private boolean m_isValid = false; - - private boolean m_isSecure = false; - - private boolean m_isRedirect = false; - - private int m_portNumber = 80; - - private HttpServletRequest m_request; - - private Properties m_ctx; - - private HttpSession m_session; - - /** - * RequestAnalyzer - * @param servlet servlet - * @param request request - * @param showStage show stage - * @param servletExtend servlet extend - */ - public RequestAnalyzer (HttpServletCM servlet, HttpServletRequest request, - boolean showStage, String servletExtend) - { - Domain domainCache = servlet.getDomainCache (); - WebProject webProjectCache = servlet.getWebProjectCache (); - Container containerCache = servlet.getContainerCache (); - if (servletExtend==null) servletExtend=""; - m_request = request; - m_ctx = servlet.getCtx (); - m_requestURL = m_request.getRequestURL ().toString (); - m_serverName = m_request.getServerName (); - int baseStart = m_requestURL.indexOf(m_request.getContextPath(), m_requestURL.indexOf (m_serverName) + m_serverName.length ()); - if (baseStart <= 0) - baseStart = m_requestURL.indexOf (m_serverName) + m_serverName.length (); - m_baseURL = m_requestURL.substring (0, baseStart + servletExtend.length ()) - + m_request.getContextPath (); - m_relativeURL = m_requestURL.substring (m_baseURL.length ()); - // If RelativeURL is empty it should be / - if (m_relativeURL== null || m_relativeURL.equals("")) m_relativeURL="/"; - // If URL ends with a / we should continue it with index.html - if (m_relativeURL.substring (m_relativeURL.length () - 1).equals ("/")) - m_relativeURL = m_relativeURL + "index.html"; - m_isSecure = m_request.isSecure (); - m_portNumber = m_request.getServerPort (); - m_WebProjectDomain = domainCache.getWebProjectDomain (m_serverName); - if (m_WebProjectDomain != null) - { - // If we could identify the Domain we will have a project etc. - m_WebProject = webProjectCache.getWebProject - (m_WebProjectDomain.getCM_WebProject_ID ()); - } - else - { - // Since we have not found a sufficient WebProject Domain we will - // fallback to the default - int[] defaultID = MWebProject.getAllIDs ("CM_WebProject", - "AD_Client_ID=0", null); - if (defaultID.length > 0) - m_WebProject = webProjectCache.getWebProject (defaultID[0]); - else { - m_isRedirect = true; - m_redirectURL - = m_requestURL.substring(0, m_requestURL.indexOf("/", m_requestURL.indexOf (m_serverName) + m_serverName.length ())); - m_redirectURL += "/admin/"; - } - // JJ - //throw new IllegalStateException("Unknown context - Set up Web Project"); // no known context - } - // Check for adempiere.jnlp - if (m_relativeURL!=null) { - if(m_relativeURL.equals("/adempiere.jnlp") || m_relativeURL.equals("/adempiereDirect.jnlp")) - { - m_isRedirect = true; - m_redirectURL = m_requestURL.substring(0,m_requestURL.indexOf(m_serverName)+m_serverName.length()) + "/admin" + m_relativeURL; - } - } - if (!m_isRedirect) { - if (m_relativeURL != null) - { - // We have a URL, so let's see whether we can handle it... - m_Container = containerCache.getCM_ContainerByURL (m_relativeURL, - m_WebProject.get_ID (), true); - if (m_Container == null) - m_isValid = false; - else - m_isValid = true; - if (m_isValid && !m_Container.getRelativeURL ().equals (m_relativeURL)) - { - m_isRedirect = true; - m_redirectURL = m_Container.getRelativeURL (); - } - } - else - { - // We have no or an invalid relative URL found, so we need to - // fallback to Domain or Error handling - if (m_WebProjectDomain.getCM_Container_ID () > 0) - { - m_Container = containerCache.getCM_Container ( - m_WebProjectDomain.getCM_Container_ID (), - m_WebProject.get_ID ()); - } - if (m_Container == null) - { - m_Container = containerCache.getCM_ContainerByURL - ("/index.html", m_WebProject.get_ID (), true); - if (m_Container == null) - { - m_isValid = false; - } - else - { - m_isValid = true; - } - if (m_isValid - && !m_Container.getRelativeURL ().equals ("/index.html")) - { - m_isRedirect = true; - m_redirectURL = m_Container.getRelativeURL (); - } - } - } - if (m_isValid == false) { - // Try to solve invalid requests - if (m_WebProject==null || m_WebProject.getAD_Client_ID()==0) - { - // If we endup with an invalid request in NULL or System Project we redirect to /admin/ - m_isRedirect = true; - m_redirectURL = m_requestURL.substring(0,m_requestURL.indexOf(m_serverName)+m_serverName.length()) + "/admin/"; - } - } - if (m_isValid) { - if (m_Container.getContainerType ().equals ("L")) { - m_isRedirect = true; - MContainer linkedContainer = containerCache.getCM_Container (m_Container.getCM_ContainerLink_ID (), m_WebProject.get_ID()); - if (linkedContainer!=null) - m_redirectURL = linkedContainer.getRelativeURL (); - } - servlet.setAD_Client_ID(m_WebProject.getAD_Client_ID()); - - } - } - if (m_request.getParameter ("cn")!=null) { - String className = m_request.getParameter("cn"); - // First check adempiere.cm. - if (classChecker("adempiere.cm." + className,servlet.getLogger())) - m_procClassName = "adempiere.cm." + className; - if (classChecker("org.compiere.cm.extend." + className,servlet.getLogger())) - m_procClassName = "org.compiere.cm.extend." + className; - } - } // RequestAnalyzer - - private boolean classChecker(String className, CLogger log) { - try - { - Class clazz = Class.forName(className); - // Make sure that it is a cm.Extend class - Class superClazz = clazz.getSuperclass(); - while (superClazz != null) - { - if (superClazz == org.compiere.cm.Extend.class) - { - log.fine("Use: " + className); - return true; - } - } - } - catch (Exception e) - { - } - log.finest("Not found: " + className); - return false; - } - - public org.compiere.cm.Extend getProcClass() - { - if (m_procClassName==null) - return null; - try { - Class thisProcClass = Class.forName (m_procClassName); - boolean errorLogged = false; - try - { - Constructor constructor = thisProcClass.getDeclaredConstructor(new Class[]{HttpServletRequest.class, Properties.class}); - Extend procClass = (Extend)constructor.newInstance(new Object[] {m_request, m_ctx}); - return procClass; - } - catch (Exception e) - { - } - return null; - } - catch (Exception e) - { - } - return null; - } - - /** - * Get Request URL - * @return request url - */ - public String getRequestURL () - { - return m_requestURL; - } // getRequestURL - - /** - * Get ServerName - * @return server name - */ - public String getServerName () - { - return m_serverName; - } // getServerName - - /** - * get WebProject_Domain - * @return web project domain - */ - public MWebProjectDomain getWebProjectDomain() - { - return m_WebProjectDomain; - } // getWebProjectDomain - - /** - * Get WebProject - * @return web project - */ - public MWebProject getWebProject () - { - return m_WebProject; - } // getWebProject - - /** - * Get CM_Container - * @return container - */ - public MContainer getCM_Container () - { - return m_Container; - } // getCM_Container - - /** - * Valid - * @return true if valid - */ - public boolean getIsValid () - { - return m_isValid; - } // getIsValid - - /** - * Redirect - * @return true redirect - */ - public boolean getIsRedirect () - { - return m_isRedirect; - } // getIsRedirect - - /** - * setRedirectURL - * @param redirectURL - */ - public void setRedirectURL(String redirectURL) - { - m_redirectURL = redirectURL; - } - - /** - * Get Redirect URL - * @return URL - */ - public String getRedirectURL () - { - try { - /* We will use the URL Object to check the validity of the URL - * this would not imply that the URL is reachable, it only - * checks the format. - */ - URL testURL = new URL(m_redirectURL); - return m_redirectURL; - } catch (MalformedURLException E) { - if (m_redirectURL.equals ("/error404.html")) - { - return m_baseURL + m_redirectURL + "?errorURL=" + m_relativeURL; - } - else - { - return m_baseURL + m_redirectURL; - } - } - } // getRedirectURL - - /** - * Get Processor Class Name - * @return ClassName for Processor - */ - public String getProcClassName() - { - return m_procClassName; - } - -} // RequestAnalyzer diff --git a/webCM/src/main/servlet/org/compiere/cm/utils/TreeXML.java b/webCM/src/main/servlet/org/compiere/cm/utils/TreeXML.java deleted file mode 100644 index e29423f887..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/utils/TreeXML.java +++ /dev/null @@ -1,93 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.utils; - -import java.util.HashMap; -import java.util.Properties; - -import org.compiere.model.MContainer; -import org.compiere.model.MTree; -import org.compiere.model.MTreeNode; -import org.compiere.model.MWebProject; - -public class TreeXML { - protected StringBuffer xmlContainer = new StringBuffer(" "); - protected StringBuffer xmlTree = new StringBuffer(" "); - protected Properties ctx; - protected String trxName; - private HashMap m_map = new HashMap(); - - - public TreeXML(MWebProject m_project) { - ctx = m_project.getCtx(); - trxName = m_project.get_TrxName(); - - // Containers - MContainer[] containers = MContainer.getContainers(m_project); - for (int i = 0; i < containers.length; i++) - m_map.put(new Integer(containers[i].getCM_Container_ID()), containers[i]); - - MTree thisTree = new MTree (m_project.getCtx(), m_project.getAD_TreeCMC_ID(), true, true, m_project.get_TrxName()); - generateTree(m_project, thisTree); - } - - public void generateTree(MWebProject m_project, MTree thisTree) { - MTreeNode root = thisTree.getRoot(); - xmlTree.append(appendNode(root)); - } - - private String appendNode(MTreeNode thisNode) { - StringBuffer tempTree = new StringBuffer(); - Integer ID = new Integer(thisNode.getNode_ID()); - MContainer container = m_map.get(ID); - // - int size = thisNode.getChildCount(); - for (int i = 0; i < size; i++) - { - MTreeNode child = (MTreeNode)thisNode.getChildAt(i); - ID = new Integer(child.getNode_ID()); - container = m_map.get(ID); - if (container == null) - { - continue; - } - if (!container.isActive()) - continue; - // - tempTree.append(""); - tempTree.append("" + container.get_ID() + ""); - tempTree.append("" + container.getName() + ""); - tempTree.append("" + container.getTitle() + ""); - tempTree.append("" + container.getRelativeURL() + ""); - tempTree.append("" + container.getDescription() + ""); - tempTree.append("" + child.getChildCount() + ""); - xmlContainer = container.get_xmlString(xmlContainer); - if (child.isSummary()) - tempTree.append(appendNode(child)); - tempTree.append(""); - } - return tempTree.toString(); - } - - public String getTreeXML() { - return "\n\n" + xmlTree.toString() + "\n\n"; - } - - public String getContainerXML() { - return "\n\n" + xmlContainer.toString() + "\n\n"; - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/xml/Generator.java b/webCM/src/main/servlet/org/compiere/cm/xml/Generator.java deleted file mode 100644 index 852a91c837..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/xml/Generator.java +++ /dev/null @@ -1,562 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.xml; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Calendar; -import java.util.Enumeration; -import java.util.Properties; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import org.compiere.Adempiere; -import org.compiere.cm.HttpServletCM; -import org.compiere.cm.cache.Chat; -import org.compiere.cm.cache.ContainerElement; -import org.compiere.cm.cache.ContainerTree; -import org.compiere.cm.utils.Counter; -import org.compiere.cm.utils.RequestAnalyzer; -import org.compiere.model.MAd; -import org.compiere.model.MBPBankAccount; -import org.compiere.model.MBPartner; -import org.compiere.model.MBPartnerLocation; -import org.compiere.model.MLocation; -import org.compiere.model.MLookupFactory; -import org.compiere.model.MNewsChannel; -import org.compiere.model.MTable; -import org.compiere.model.MTemplate; -import org.compiere.model.MUser; -import org.compiere.model.PO; -import org.compiere.model.X_CM_Container_Element; -import org.compiere.model.X_CM_NewsChannel; -import org.compiere.model.X_CM_TemplateTable; -import org.compiere.util.DB; -import org.compiere.util.Language; -import org.compiere.util.WebInfo; - -/** - * This Generator builds up the XML for the XSLT Template Engine - * - * @author Yves Sandfort - * @version $Id$ - */ -public class Generator -{ - - protected StringBuffer xmlCode = new StringBuffer (); - - protected RequestAnalyzer thisRequest; - - /** - * Generator Object for the generation of XML Context - * - * @param thisServlet - * currentServletHandler - * @param httpRequest - * currentRequest - * @param tempRequest - * currentRequestAnalyzer - * @param xmlAppend - */ - public Generator (HttpServletCM thisServlet, - HttpServletRequest httpRequest, RequestAnalyzer tempRequest, StringBuffer xmlAppend) - { - thisRequest = tempRequest; - xmlCode.append ("\n").append ( - "\n").append ("\n").append ("").append ( - thisServlet.getBuildDate ()).append ("\n"); - generateSystemHeader (thisServlet); - generateProjectHeader (); - generateThisContainer (thisServlet.getContainerElementCache (), - thisServlet.getChatCache ()); - generateExternalTables (thisServlet.getDomainCache ().getCtx (), httpRequest); - generateContainerTree (thisServlet.getContainerTreeCache ()); - MTemplate thisTemplate = thisRequest.getCM_Container ().getTemplate (); - if (thisTemplate.isNews ()) - generateNewsFeed (thisServlet.getDomainCache ().getCtx ()); - if (thisTemplate.isUseAd ()) - generateAdCode (httpRequest, thisTemplate); - // TODO change the decision via IsRequest boolean for Template - if (thisTemplate.getName().toUpperCase().indexOf("REQUEST") > -1) - generateRequest(httpRequest, thisServlet.getXMLCache(), thisServlet.getCtx ()); - generateCommunity(thisServlet.getXMLCache ()); - generateSessionEquiv(thisServlet, httpRequest, thisServlet.getCtx ()); - queryStringToXML (httpRequest); - xmlCode.append(xmlAppend); - } - - private void generateSystemHeader (HttpServletCM thisServlet) - { - xmlCode.append ("\n"); - xmlCode.append ("\n"); - xmlCode.append ("" + Adempiere.MAIN_VERSION - + "\n"); - xmlCode.append ("" + Adempiere.DATE_VERSION - + "\n"); - xmlCode.append ("" + Adempiere.DB_VERSION + "\n"); - xmlCode.append ("\n"); - xmlCode.append ("\n"); - xmlCode.append ("" - + thisServlet.getInternalMediaURL () + "\n"); - xmlCode.append ("" - + thisServlet.getExternalMediaURL () + "\n"); - xmlCode.append ("\n"); - Calendar cal = Calendar.getInstance (); - xmlCode.append ("" + cal.get (Calendar.DAY_OF_MONTH) - + "\n"); - xmlCode.append ("" + cal.get (Calendar.MONTH) - + "\n"); - xmlCode.append ("" + cal.get (Calendar.YEAR) - + "\n"); - xmlCode.append ("" + cal.get (Calendar.HOUR_OF_DAY) - + "\n"); - xmlCode.append ("" + cal.get (Calendar.MINUTE) - + "\n"); - xmlCode.append ("" + cal.get (Calendar.SECOND) - + "\n"); - xmlCode.append ("" + Counter.getActiveSessions () - + "\n"); - xmlCode.append ("\n"); - } - - private void generateSessionEquiv(HttpServletCM thisServlet, HttpServletRequest httpRequest, Properties ctx) - { - xmlCode.append("\n"); - HttpSession thisSession = httpRequest.getSession (false); - if (thisSession!=null) { - if (thisSession.getAttribute (WebInfo.NAME)!=null) - { - WebInfo wi = (WebInfo) thisSession.getAttribute (WebInfo.NAME); - xmlCode.append ("\n"); - xmlCode.append ("\n"); - if (wi.getUser_ID ()>0) - { - MUser thisUser = MUser.get (ctx, wi.getAD_User_ID ()); - xmlCode = thisUser.get_xmlString (xmlCode); - MBPartner thisBPartner = new MBPartner(ctx, wi.getC_BPartner_ID (), null); - if (thisBPartner!=null) - xmlCode = thisBPartner.get_xmlString (xmlCode); - MBPartnerLocation thisBPartnerLocation = thisBPartner.getPrimaryC_BPartner_Location (); - if (thisBPartnerLocation!=null) - xmlCode = thisBPartnerLocation.get_xmlString (xmlCode); - MLocation thisLocation = MLocation.getBPLocation (ctx, thisBPartnerLocation.get_ID (), null); - if (thisLocation!=null) - xmlCode = thisLocation.get_xmlString (xmlCode); - MBPBankAccount[] theseBPBankAccount = thisBPartner.getBankAccounts (true); - if (theseBPBankAccount!=null && theseBPBankAccount.length>0) - for (int i=0; i\n"); - wi.getWebUser ().setPasswordMessage (null); - } - if (wi.getWebUser ().getSaveErrorMessage ()!=null) - { - xmlCode.append ("\n"); - wi.getWebUser ().setSaveErrorMessage (null); - } - if (thisSession.getAttribute("hdrMessage")!=null) { - xmlCode.append ("\n"); - thisSession.removeAttribute ("hdrMessage"); - } - xmlCode.append ("\n"); - xmlCode.append ("" + wi.getWebUser ().isLoggedIn () + "\n"); - xmlCode.append ("\n"); - xmlCode.append ("\n"); - } - if (thisSession.getAttribute ("EMail")!=null) - xmlCode.append ("\n"); - } - xmlCode.append("\n"); - } - - private void generateCommunity(org.compiere.cm.cache.XML thisXML) - { - xmlCode.append("\n"); - xmlCode.append(thisXML.getXML ("C_Country")); - xmlCode.append("\n"); - } - - /** - * Creates the XML tree for request tables. - * - * @param httpRequest - * @param thisXML - * @param ctx - */ - private void generateRequest(HttpServletRequest httpRequest, org.compiere.cm.cache.XML thisXML, Properties ctx) - { - HttpSession thisSession = httpRequest.getSession (false); - WebInfo wi = null; - if (thisSession!=null) { - if (thisSession.getAttribute (WebInfo.NAME)!=null) - wi = (WebInfo) thisSession.getAttribute (WebInfo.NAME); - - xmlCode.append("\n"); - int l_nClientID = Integer.parseInt(ctx.getProperty("#AD_Client_ID")); - - if (wi != null) { - if (wi.getC_BPartner_ID() != -1) { - genTable("AD_User", "(AD_User.IsActive='Y' AND AD_User.AD_Client_ID=" + l_nClientID + " AND AD_User.C_BPartner_ID=@C_BPartner_ID@) ORDER BY AD_User.AD_User_ID", false, ctx, wi); - genTable("C_BPartner", "(C_BPartner.IsActive='Y' AND C_BPartner.AD_Client_ID=" + l_nClientID + " AND C_BPartner.C_BPartner_ID=@C_BPartner_ID@)ORDER BY C_BPartner.C_BPartner_ID", false, ctx, wi); - genTable("C_Invoice", "(C_Invoice.IsActive='Y' AND C_Invoice.AD_Client_ID=" + l_nClientID + " AND C_Invoice.C_BPartner_ID=@C_BPartner_ID@) ORDER BY C_Invoice.C_Invoice_ID", false, ctx, wi); - genTable("C_Order", "(C_Order.IsActive='Y' AND C_Order.AD_Client_ID=" + l_nClientID + " AND C_Order.C_BPartner_ID=@C_BPartner_ID@) ORDER BY C_Order.C_Order_ID", false, ctx, wi); - genTable("C_Payment", "(C_Payment.IsActive='Y' AND C_Payment.AD_Client_ID=" + l_nClientID + " AND C_Payment.C_BPartner_ID=@C_BPartner_ID@) ORDER BY C_Payment.C_Payment_ID", false, ctx, wi); - genTable("C_Project", "(C_Project.IsActive='Y' AND C_Project.AD_Client_ID=" + l_nClientID + " AND C_Project.C_BPartner_ID=@C_BPartner_ID@) ORDER BY C_Project.C_Project_ID", false, ctx, wi); - genTable("M_InOut", "(M_InOut.IsActive='Y' AND M_InOut.AD_Client_ID=" + l_nClientID + " AND M_InOut.C_BPartner_ID=@C_BPartner_ID@) ORDER BY M_InOut.M_InOut_ID", false, ctx, wi); - genTable("R_Request", "(R_Request.IsActive='Y' AND R_Request.AD_Client_ID=" + l_nClientID + " AND R_Request.C_BPartner_ID=@C_BPartner_ID@) ORDER BY R_Request.R_Request_ID", true, ctx, wi); - genTable("R_RequestUpdate", "(R_RequestUpdate.IsActive='Y' AND R_RequestUpdate.AD_Client_ID=" + l_nClientID + " AND R_RequestUpdate.R_Request_ID IN (SELECT R_Request.R_Request_ID FROM R_Request WHERE R_Request.IsActive='Y' AND R_Request.AD_Client_ID=" + l_nClientID + " AND R_Request.C_BPartner_ID=@C_BPartner_ID@)) ORDER BY R_RequestUpdate.R_RequestUpdate_ID", true, ctx, wi); - } - genTable("A_Asset", "A_Asset.IsActive='Y' AND A_Asset.AD_Client_ID=" + l_nClientID + " ORDER BY A_Asset.A_Asset_ID", false, ctx, wi); - //genTable("AD_Role", "AD_Role.IsActive='Y' AND AD_Role.AD_Client_ID=" + l_nClientID + " ORDER BY AD_Role.AD_Role_ID", false, ctx, wi); - genTable("C_Activity", "C_Activity.IsActive='Y' AND C_Activity.AD_Client_ID=" + l_nClientID + " ORDER BY C_Activity.C_Activity_ID", false, ctx, wi); - genTable("C_Campaign", "C_Campaign.IsActive='Y' AND C_Campaign.AD_Client_ID=" + l_nClientID + " ORDER BY C_Campaign.C_Campaign_ID", false, ctx, wi); - genTable("M_Product", "M_Product.IsActive='Y' AND M_Product.AD_Client_ID=" + l_nClientID + " AND M_Product.Value like 'cd_%' ORDER BY M_Product.M_Product_ID", false, ctx, wi); - genTable("M_RMA", "M_RMA.IsActive='Y' AND M_RMA.AD_Client_ID=" + l_nClientID + " ORDER BY M_RMA.M_RMA_ID", false, ctx, wi); - genTable("R_Category", "R_Category.IsActive='Y' AND R_Category.AD_Client_ID=" + l_nClientID + " ORDER BY R_Category.R_Category_ID", false, ctx, wi); - genTable("R_Group", "R_Group.IsActive='Y' AND R_Group.AD_Client_ID=" + l_nClientID + " ORDER BY R_Group.R_Group_ID", false, ctx, wi); - genTable("R_MailText", "R_MailText.IsActive='Y' AND R_MailText.AD_Client_ID=" + l_nClientID + " ORDER BY R_MailText.R_MailText_ID", true, ctx, wi); - genTable("R_RequestType", "R_RequestType.IsActive='Y' AND R_RequestType.AD_Client_ID=" + l_nClientID + " ORDER BY R_RequestType.R_RequestType_ID", false, ctx, wi); - genTable("R_Resolution", "R_Resolution.IsActive='Y' AND R_Resolution.AD_Client_ID=" + l_nClientID + " ORDER BY R_Resolution.R_Resolution_ID", false, ctx, wi); - genTable("R_StandardResponse", "R_StandardResponse.IsActive='Y' AND R_StandardResponse.AD_Client_ID=" + l_nClientID + " ORDER BY R_StandardResponse.R_StandardResponse_ID", false, ctx, wi); - genTable("R_Status", "R_Status.IsActive='Y' AND R_Status.AD_Client_ID=" + l_nClientID + " ORDER BY R_Status.R_Status_ID", false, ctx, wi); - - genTable("_PriorityRule", "(AD_Ref_List.IsActive='Y' AND AD_Ref_List.AD_Reference_ID=154) ORDER BY AD_Ref_List.AD_Ref_List_ID", false, ctx, wi); - genTable("R_Request_Confidential", "(AD_Ref_List.IsActive='Y' AND AD_Ref_List.AD_Reference_ID=340) ORDER BY AD_Ref_List.AD_Ref_List_ID", false, ctx, wi); - genTable("R_Request_Due_Typ", "(AD_Ref_List.IsActive='Y' AND AD_Ref_List.AD_Reference_ID=222) ORDER BY AD_Ref_List.AD_Ref_List_ID", false, ctx, wi); - genTable("R_Request_Next_Action", "(AD_Ref_List.IsActive='Y' AND AD_Ref_List.AD_Reference_ID=219) ORDER BY AD_Ref_List.AD_Ref_List_ID", false, ctx, wi); - genTable("R_Request_TaskStatus", "(AD_Ref_List.IsActive='Y' AND AD_Ref_List.AD_Reference_ID=366) ORDER BY AD_Ref_List.AD_Ref_List_ID", false, ctx, wi); - } - xmlCode.append("\n"); - } - } - - private void generateProjectHeader () - { - xmlCode.append ("\n"); - xmlCode = thisRequest.getWebProject ().get_xmlString (xmlCode); - if (thisRequest.getWebProjectDomain () != null) - xmlCode = thisRequest.getWebProjectDomain () - .get_xmlString (xmlCode); - xmlCode.append ("\n\n"); - } - - private void generateThisContainer (ContainerElement containerElementCache, - Chat chatCache) - { - xmlCode.append ("\n"); - xmlCode = thisRequest.getCM_Container ().get_xmlString (xmlCode); - /*int[] tableKeys = X_CM_Chat.getAllIDs ("CM_Chat", "AD_Table_ID=" - + thisRequest.getCM_Container ().get_Table_ID () - + " AND Record_ID=" + thisRequest.getCM_Container ().get_ID (), - "WebCM"); - if (tableKeys != null) - { - if (tableKeys.length > 0) - { - for (int i = 0; i < tableKeys.length; i++) - { - xmlCode = chatCache.getCM_Chat (tableKeys[i]) - .get_xmlString (xmlCode); - } - } - }*/ - int[] tableKeys = X_CM_Container_Element.getAllIDs ("CM_Container_Element", - "CM_Container_ID=" + thisRequest.getCM_Container ().get_ID (), - "WebCM"); - if (tableKeys.length > 0) - { - // Found elements, so let's show them... - for (int i = 0; i < tableKeys.length; i++) - { - X_CM_Container_Element thisElement = containerElementCache - .getCM_Container_Element (tableKeys[i], thisRequest - .getCM_Container ().getCM_WebProject_ID ()); - if (thisElement != null) - { - StringBuffer newCode = new StringBuffer (); - thisElement.get_xmlString (newCode); - if (newCode.indexOf ("") >= 0) - newCode.delete (newCode - .indexOf ("") + 6); - if (newCode.indexOf ("") >= 0) - newCode.delete (newCode.indexOf (""), newCode - .indexOf ("]]>")); - xmlCode.append (newCode); - } - } - } - xmlCode.append ("\n\n"); - } - - /** - * Creates the nodes for the request tables in the XML-tree. - * - * @param tableName - * @param whereClause - * @param completeXML - * @param ctx - * @param wi - */ - private void genTable(String tableName, String whereClause, boolean completeXML, Properties ctx, WebInfo wi) { - String l_szTrxName = null; - StringBuffer tmpCode = new StringBuffer(); - String dataTableName = tableName; - String l_whereClause = replaceSessionElements(wi, whereClause); - - tmpCode.append("<" + tableName + ">\n"); - - // For the different AD_Ref_List tables - if (whereClause.indexOf("AD_Reference") > -1) { - dataTableName = "AD_Ref_List"; - } - int[] l_nIDs = PO.getAllIDs(dataTableName, l_whereClause, l_szTrxName); - int[] l_nTableIDs = MTable.getAllIDs("AD_Table", "TableName='" + dataTableName + "'", l_szTrxName); - if (l_nTableIDs.length > 0) { - MTable table = MTable.get (ctx, l_nTableIDs[0]); - PO l_Object = null; - - // If the table should contain complete xml use the PO function get_xmlString - if (completeXML) { - for (int i = 0; i < l_nIDs.length; i++) { - l_Object = table.getPO(l_nIDs[i], l_szTrxName); - l_Object.get_xmlString(tmpCode); - } - // else only append ID and DisplayName - } else { - String sql = MLookupFactory.getLookup_TableDirEmbed(Language.getLanguage("en"), dataTableName + "_ID", dataTableName); - sql = sql.concat(" AND " + l_whereClause); - PreparedStatement pstm = DB.prepareStatement(sql, l_szTrxName); - ResultSet rs = null; - try { - rs = pstm.executeQuery(); - } catch (Exception e) { - - } - for (int i = 0; i < l_nIDs.length; i++) { - l_Object = table.getPO(l_nIDs[i], l_szTrxName); - tmpCode.append("<" + dataTableName + " AD_Table_ID=\"" + table.get_ID() + "\" Record_ID=\"" + l_Object.get_ID() + "\">\n"); - tmpCode.append("<" + dataTableName + "_ID>"); - tmpCode.append(l_Object.get_ID()); - tmpCode.append("\n"); - // Only AD_Ref_List works with value as reference - if (dataTableName.equals("AD_Ref_List")) { - tmpCode.append(""); - tmpCode.append("\n"); - tmpCode.append("\n"); - } - // for these two table the BPartner is needed - if (dataTableName.equals("AD_User") || dataTableName.equals("C_Project")) { - tmpCode.append(""); - tmpCode.append(l_Object.get_Value("C_BPartner_ID")); - tmpCode.append("\n"); - } - tmpCode.append("\n"); - try { - if (rs.next()) { - tmpCode.append("\n"); - } - } catch (SQLException e) { - tmpCode.append("\n"); - tmpCode.append("\n"); - } - try { - rs.close(); - pstm.close(); - } catch (Exception e) { - - } - } - } - tmpCode.append("\n"); - xmlCode.append(tmpCode); - } - - private void generateExternalTables (Properties ctx, HttpServletRequest httpRequest) - { - HttpSession thisSession = httpRequest.getSession (false); - WebInfo wi = null; - if (thisSession!=null) - if (thisSession.getAttribute (WebInfo.NAME)!=null) - wi = (WebInfo) thisSession.getAttribute (WebInfo.NAME); - - - int[] tableKeys = X_CM_TemplateTable.getAllIDs ("CM_TemplateTable", - "CM_Template_ID=" - + thisRequest.getCM_Container ().getCM_Template_ID (), "WebCM"); - if (tableKeys.length > 0) - { - xmlCode.append ("\n"); - for (int i = 0; i < tableKeys.length; i++) - { - X_CM_TemplateTable thisTemplateTable = new X_CM_TemplateTable ( - ctx, tableKeys[i], "WebCM"); - try - { - StringBuffer tempXML = new StringBuffer(); - tempXML.append ("<" + thisTemplateTable.getName () + ">\n"); - MTable table = MTable.get (ctx, thisTemplateTable - .getAD_Table_ID ()); - String trxName = null; - int[] ids = PO.getAllIDs (table.getTableName (), - replaceSessionElements(wi,thisTemplateTable.getWhereClause ()), trxName); - if (ids!=null && ids.length>0) { - for (int j = 0; j < ids.length; j++) - { - PO po = null; - po = table.getPO (ids[j], null); - if (po != null) - { - tempXML = po.get_xmlString (tempXML); - } - } - } - tempXML.append ("\n\n"); - xmlCode.append(tempXML); - } - catch (Exception e) - { - e.printStackTrace (); - } - } - xmlCode.append ("\n\n"); - } - } - - public String replaceSessionElements(WebInfo wi, String whereClause) - { - if (wi!=null && whereClause!=null && whereClause.indexOf ("@")>=0) { - if (whereClause.indexOf ("@C_BPartner_ID@")>0) - whereClause = org.compiere.util.Util.replace(whereClause,"@C_BPartner_ID@", "" + wi.getC_BPartner_ID ()); - } - return whereClause; - } - - private void generateContainerTree (ContainerTree containerTreeCache) - { -/* xmlCode.append (containerTreeCache.getContainerTree (containerTreeCache - .getCtx (), thisRequest.getWebProject ().get_ID (), null));*/ - xmlCode.append (containerTreeCache.getContainerTree ( - thisRequest.getWebProject ().get_ID (), null)); - } - - /** - * Get should return the complete XML Code for this page - * - * @return current XML Code for this request - */ - public String get () - { - return xmlCode.toString () + "\n\n"; - } - - /* - * private void addPObject(PO thisObject) { xmlCode = - * thisObject.get_xmlString(xmlCode); } - */ - private void queryStringToXML (HttpServletRequest request) - { - xmlCode.append (" \n"); - xmlCode.append (" \n"); - Enumeration e = request.getParameterNames (); - String tempArray[] = new String[255]; - int j = 0; - while (e.hasMoreElements ()) - { - String name = (String)e.nextElement (); - tempArray[j] = name; - j++; - } - String nameArray[] = new String[j]; - for (int i = 0; i < j; i++) - nameArray[i] = tempArray[i]; - java.util.Arrays.sort (nameArray); - for (int i = 0; i < j; i++) - { - if (nameArray[i] != null) - { - xmlCode.append (" \n"); - String vals[] = (String[])request - .getParameterValues (nameArray[i]); - if (vals != null) - { - for (int k = 0; k < vals.length; k++) - { - xmlCode.append (" " - + nameArray[i] - + "" - + org.compiere.util.Util.replace ( - org.compiere.util.Util.replace (vals[k], - "'", "'"), "&", "&") + "\n"); - } - } - else - { - xmlCode - .append (" " + nameArray[i] + "\n"); - } - xmlCode.append (" \n"); - } - } - xmlCode.append (" \n"); - } - - private void generateNewsFeed (Properties ctx) - { - xmlCode.append (""); - int[] theseChannels = X_CM_NewsChannel - .getAllIDs ("CM_NewsChannel", "CM_WebProject_ID=" - + thisRequest.getWebProject ().getCM_WebProject_ID (), "WevbCM"); - if (theseChannels != null && theseChannels.length > 0) - { - for (int i = 0; i < theseChannels.length; i++) - { - MNewsChannel thisChannel = new MNewsChannel (ctx, - theseChannels[i], "WebCM"); - thisChannel.get_rss2ChannelCode(xmlCode, false); - } - } - xmlCode.append (""); - } - - private void generateAdCode (HttpServletRequest httpRequest, - MTemplate thisTemplate) - { - xmlCode.append (""); - MAd[] thisAd = thisTemplate.getAds (); - if (thisAd != null) - { - for (int i = 0; i < thisAd.length; i++) - if (thisAd[i] != null) - thisAd[i].get_xmlString (xmlCode); - } - xmlCode.append (""); - } -} diff --git a/webCM/src/main/servlet/org/compiere/cm/xml/XSLTProcessor.java b/webCM/src/main/servlet/org/compiere/cm/xml/XSLTProcessor.java deleted file mode 100644 index 88e9283dfe..0000000000 --- a/webCM/src/main/servlet/org/compiere/cm/xml/XSLTProcessor.java +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * - * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it * - * under the terms version 2 of the GNU General Public License as published * - * by the Free Software Foundation. This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License along * - * with this program; if not, write to the Free Software Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * - * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * - * or via info@compiere.org or http://www.compiere.org/license.html * - *****************************************************************************/ -package org.compiere.cm.xml; - -import java.io.ByteArrayOutputStream; -import java.io.OutputStream; -import java.io.StringReader; -import java.util.Calendar; -import java.util.Enumeration; - -import javax.servlet.http.HttpServletRequest; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; - -/** - * @author YS - * @version $Id$ - */ -public class XSLTProcessor -{ - /** - * Run - * @param request - * @param xslStream - * @param xmlStream - * @return xml - * @throws Exception - */ - public static StringBuffer run (HttpServletRequest request, - StringBuffer xslStream, StringBuffer xmlStream) throws Exception - { - return run(request, xslStream.toString (), xmlStream.toString ()); - } - - /** - * Run - * @param request - * @param xslStream - * @param xmlStream - * @return xml - * @throws Exception - */ - public static StringBuffer run (HttpServletRequest request, - String xslStream, String xmlStream) - throws Exception - { - Calendar myCal = Calendar.getInstance (); - TransformerFactory tFactory = TransformerFactory.newInstance (); - Transformer transformer = tFactory.newTransformer (new StreamSource ( - new StringReader (xslStream))); - Enumeration e = request.getParameterNames (); - StringBuffer tStrHTML = new StringBuffer (); - while (e.hasMoreElements ()) - { - String name = (String)e.nextElement (); - transformer.setParameter (name, request.getParameter (name)); - } - OutputStream out = new ByteArrayOutputStream (); - transformer.transform (new StreamSource (new StringReader (xmlStream)), - new StreamResult (out)); - tStrHTML.append (out.toString ()); - if (request.getParameter ("debug") != null) - { - Calendar myCal2 = Calendar.getInstance (); - long timeDiff = (myCal2.get (Calendar.HOUR_OF_DAY) * 60 * 60 * 1000) - + (myCal2.get (Calendar.MINUTE) * 60 * 1000) - + (myCal2.get (Calendar.SECOND) * 1000) - + myCal2.get (Calendar.MILLISECOND); - timeDiff = timeDiff - - ((myCal.get (Calendar.HOUR_OF_DAY) * 60 * 60 * 1000) - + (myCal.get (Calendar.MINUTE) * 60 * 1000) - + (myCal.get (Calendar.SECOND) * 1000) + myCal - .get (Calendar.MILLISECOND)); - tStrHTML.append ("\n"); - System.out.println ("XSLT Processing:" + timeDiff); - } - return tStrHTML; - } // run - -} // XSLTProcessor diff --git a/webCM/src/web/WEB-INF/favicon.ico b/webCM/src/web/WEB-INF/favicon.ico deleted file mode 100644 index 14c3ee6ebd..0000000000 Binary files a/webCM/src/web/WEB-INF/favicon.ico and /dev/null differ diff --git a/webCM/src/web/WEB-INF/web.xml b/webCM/src/web/WEB-INF/web.xml deleted file mode 100644 index e6c9c0ecb3..0000000000 --- a/webCM/src/web/WEB-INF/web.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - ADempiere Web CM - - - AD_Client_ID - 0 - - - ServerApps - 1 - - - - org.compiere.cm.utils.Counter - - - - - org.compiere.cm.utils.Attributes - - - - ADempiere WebCM Ad Redirector - AdRedirector - org.compiere.cm.AdRedirector - - - ADempiere WebCM Broadcaster - Broadcast - org.compiere.cm.Broadcast - - - ADempiere WebCM CacheService - CacheService - org.compiere.cm.cache.Service - - - ADempiere WebCM Community Handler - Community - org.compiere.cm.Community - - - ADempiere WebCM Request Handler - RequestServlet - org.compiere.cm.RequestServlet - - - ADempiere WebCM XML Broadcaster - XMLBroadcast - org.compiere.cm.XMLBroadcast - - - ADempiere WebCM Stage Broadcaster - StageBroadcast - org.compiere.cm.StageBroadcast - - - ADempiere WebCM Media Broadcaster - MediaBroadcast - org.compiere.cm.MediaBroadcast - - - - AdRedirector - /AdRedirector - - - XMLBroadcast - /xml/* - - - StageBroadcast - /stage/* - - - CacheService - /cache/* - - - Community - /communityServlet - - - RequestServlet - /requestServlet - - - MediaBroadcast - /media/* - - - Broadcast - / - - - 10 - - - - Broadcast - - - - css - text/css - - - - 404 - / - - -