Merge with eb737df095c2fdeac36e42b1786173d066d95757
This commit is contained in:
commit
614a431e0b
|
@ -86,3 +86,5 @@ Import-Package: javax.net.ssl,
|
||||||
org.restlet.security,
|
org.restlet.security,
|
||||||
org.restlet.service,
|
org.restlet.service,
|
||||||
org.restlet.util
|
org.restlet.util
|
||||||
|
Service-Component: OSGI-INF/paymentformcash.xml, OSGI-INF/paymentformcheck.xml, OSGI-INF/paymentformcreditcard.xml, OSGI-INF/paymentformdirectdebit.xml, OSGI-INF/paymentformdirectdeposit.xml, OSGI-INF/paymentformmixedpos.xml, OSGI-INF/paymentformoncredit.xml
|
||||||
|
Bundle-ActivationPolicy: lazy
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.swing.payment.form.cash">
|
||||||
|
<implementation class="org.compiere.grid.VPaymentFormCash"/>
|
||||||
|
<property name="paymentRule" type="String" value="B"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.swing.payment.form.check">
|
||||||
|
<implementation class="org.compiere.grid.VPaymentFormCheck"/>
|
||||||
|
<property name="paymentRule" type="String" value="S"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.swing.payment.form.creditcard">
|
||||||
|
<implementation class="org.compiere.grid.VPaymentFormCreditCard"/>
|
||||||
|
<property name="paymentRule" type="String" value="K"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.swing.payment.form.directdebit">
|
||||||
|
<implementation class="org.compiere.grid.VPaymentFormDirectDebit"/>
|
||||||
|
<property name="paymentRule" type="String" value="D"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.swing.payment.form.directdeposit">
|
||||||
|
<implementation class="org.compiere.grid.VPaymentFormDirectDeposit"/>
|
||||||
|
<property name="paymentRule" type="String" value="T"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.swing.payment.form.mixedpos">
|
||||||
|
<implementation class="org.compiere.grid.VPaymentFormMixedPOS"/>
|
||||||
|
<property name="paymentRule" type="String" value="M"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.swing.payment.form.oncredit">
|
||||||
|
<implementation class="org.compiere.grid.VPaymentFormOnCredit"/>
|
||||||
|
<property name="paymentRule" type="String" value="P"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -1,9 +1,17 @@
|
||||||
bin.includes = META-INF/,\
|
bin.includes = META-INF/,\
|
||||||
client.jar,\
|
client.jar,\
|
||||||
plugin.xml,\
|
plugin.xml,\
|
||||||
swingx-1.6.jar,\
|
swingx-1.6.jar,\
|
||||||
looks-2.0.4.jar,\
|
looks-2.0.4.jar,\
|
||||||
miglayout-3.7.1-swing.jar,\
|
miglayout-3.7.1-swing.jar,\
|
||||||
jpedal.jar
|
jpedal.jar,\
|
||||||
source.client.jar = src/
|
OSGI-INF/,\
|
||||||
output.client.jar = build/
|
OSGI-INF/paymentformcash.xml,\
|
||||||
|
OSGI-INF/paymentformcheck.xml,\
|
||||||
|
OSGI-INF/paymentformcreditcard.xml,\
|
||||||
|
OSGI-INF/paymentformdirectdebit.xml,\
|
||||||
|
OSGI-INF/paymentformdirectdeposit.xml,\
|
||||||
|
OSGI-INF/paymentformmixedpos.xml,\
|
||||||
|
OSGI-INF/paymentformoncredit.xml
|
||||||
|
source.client.jar = src/
|
||||||
|
output.client.jar = build/
|
||||||
|
|
|
@ -56,8 +56,12 @@ public class VPaymentFormCash extends PaymentFormCash implements ActionListener
|
||||||
private CLabel bAmountLabel = new CLabel();
|
private CLabel bAmountLabel = new CLabel();
|
||||||
private VNumber bAmountField = new VNumber();
|
private VNumber bAmountField = new VNumber();
|
||||||
|
|
||||||
public VPaymentFormCash(int windowNo, GridTab mTab) {
|
public VPaymentFormCash() {
|
||||||
super(windowNo, mTab);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
bDateField = new VDate("DateAcct", false, false, true, DisplayType.Date, "DateAcct");
|
bDateField = new VDate("DateAcct", false, false, true, DisplayType.Date, "DateAcct");
|
||||||
dialog = new VPaymentFormDialog(this, windowNo);
|
dialog = new VPaymentFormDialog(this, windowNo);
|
||||||
init();
|
init();
|
||||||
|
|
|
@ -64,8 +64,12 @@ public class VPaymentFormCheck extends PaymentFormCheck implements ActionListene
|
||||||
private CButton sOnline = new CButton();
|
private CButton sOnline = new CButton();
|
||||||
private CLabel sStatus = new CLabel();
|
private CLabel sStatus = new CLabel();
|
||||||
|
|
||||||
public VPaymentFormCheck(int windowNo, GridTab mTab) {
|
public VPaymentFormCheck() {
|
||||||
super(windowNo, mTab);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
dialog = new VPaymentFormDialog(this, windowNo);
|
dialog = new VPaymentFormDialog(this, windowNo);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,8 +63,12 @@ public class VPaymentFormCreditCard extends PaymentFormCreditCard implements Act
|
||||||
private CLabel kStatus = new CLabel();
|
private CLabel kStatus = new CLabel();
|
||||||
|
|
||||||
|
|
||||||
public VPaymentFormCreditCard(int windowNo, GridTab mTab) {
|
public VPaymentFormCreditCard() {
|
||||||
super(windowNo, mTab);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
dialog = new VPaymentFormDialog(this, windowNo);
|
dialog = new VPaymentFormDialog(this, windowNo);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,8 +50,12 @@ public abstract class VPaymentFormDirect extends PaymentFormDirect implements Ac
|
||||||
private CLabel tRoutingText = new CLabel();
|
private CLabel tRoutingText = new CLabel();
|
||||||
private CLabel tNumberText = new CLabel();
|
private CLabel tNumberText = new CLabel();
|
||||||
|
|
||||||
public VPaymentFormDirect(int windowNo, GridTab mTab, boolean isDebit) {
|
public VPaymentFormDirect(boolean isDebit) {
|
||||||
super(windowNo, mTab, isDebit);
|
super(isDebit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
dialog = new VPaymentFormDialog(this, windowNo);
|
dialog = new VPaymentFormDialog(this, windowNo);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,8 @@ import org.compiere.model.GridTab;
|
||||||
*/
|
*/
|
||||||
public class VPaymentFormDirectDebit extends VPaymentFormDirect {
|
public class VPaymentFormDirectDebit extends VPaymentFormDirect {
|
||||||
|
|
||||||
public VPaymentFormDirectDebit(int windowNo, GridTab mTab) {
|
public VPaymentFormDirectDebit() {
|
||||||
super(windowNo, mTab, true);
|
super(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.compiere.model.GridTab;
|
||||||
*/
|
*/
|
||||||
public class VPaymentFormDirectDeposit extends VPaymentFormDirect {
|
public class VPaymentFormDirectDeposit extends VPaymentFormDirect {
|
||||||
|
|
||||||
public VPaymentFormDirectDeposit(int windowNo, GridTab mTab) {
|
public VPaymentFormDirectDeposit() {
|
||||||
super(windowNo, mTab, false);
|
super(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,12 +13,9 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.grid;
|
package org.compiere.grid;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import org.adempiere.base.Service;
|
||||||
import java.util.logging.Level;
|
import org.adempiere.base.ServiceQuery;
|
||||||
|
|
||||||
import org.compiere.model.GridTab;
|
import org.compiere.model.GridTab;
|
||||||
import org.compiere.model.MInvoice;
|
|
||||||
import org.compiere.util.CLogger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -26,57 +23,19 @@ import org.compiere.util.CLogger;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class VPaymentFormFactory {
|
public class VPaymentFormFactory {
|
||||||
/** Static Logger */
|
|
||||||
private static CLogger s_log = CLogger.getCLogger (VPaymentFormFactory.class);
|
public static IPaymentForm getPaymentForm(int windowNo, GridTab mTab, String paymentRule)
|
||||||
|
|
||||||
private static HashMap<String, Class<? extends IPaymentForm>> s_registeredClasses = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register custom VPaymentForm* class
|
|
||||||
* @param ad_table_id
|
|
||||||
* @param cl custom class
|
|
||||||
*/
|
|
||||||
public static final void registerClass(String paymentRule, Class<? extends IPaymentForm> cl)
|
|
||||||
{
|
{
|
||||||
s_registeredClasses.put(paymentRule, cl);
|
ServiceQuery query = new ServiceQuery();
|
||||||
s_log.info("Registered PaymentRule="+paymentRule+", Class="+cl);
|
query.put("paymentRule", paymentRule);
|
||||||
|
return Service.locator().locate(IPaymentForm.class, query).getService();
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
public static IPaymentForm create(int windowNo, GridTab mTab, String paymentRule)
|
||||||
{
|
{
|
||||||
// Register defaults:
|
IPaymentForm form = getPaymentForm(windowNo, mTab, paymentRule);
|
||||||
s_registeredClasses = new HashMap<String, Class<? extends IPaymentForm>>();
|
if (form != null)
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_Cash, VPaymentFormCash.class);
|
form.init(windowNo, mTab);
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_Check, VPaymentFormCheck.class);
|
return form;
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_CreditCard, VPaymentFormCreditCard.class);
|
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_DirectDebit, VPaymentFormDirectDebit.class);
|
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_DirectDeposit, VPaymentFormDirectDeposit.class);
|
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_MixedPOSPayment, VPaymentFormMixedPOS.class);
|
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_OnCredit, VPaymentFormOnCredit.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IPaymentForm create (int windowNo, GridTab mTab, String paymentRule)
|
|
||||||
{
|
|
||||||
IPaymentForm retValue = null;
|
|
||||||
Class<? extends IPaymentForm> cl = s_registeredClasses.get(paymentRule);
|
|
||||||
if (cl != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
java.lang.reflect.Constructor<? extends IPaymentForm> ctor = cl.getConstructor(int.class, GridTab.class);
|
|
||||||
retValue = ctor.newInstance(windowNo, mTab);
|
|
||||||
}
|
|
||||||
catch (Throwable e)
|
|
||||||
{
|
|
||||||
s_log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (retValue == null)
|
|
||||||
{
|
|
||||||
s_log.info("Unsupported PaymentRule=" + paymentRule);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return retValue;
|
|
||||||
} // create
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,12 @@ import org.compiere.model.GridTab;
|
||||||
public class VPaymentFormMixedPOS extends PaymentFormMixedPOS {
|
public class VPaymentFormMixedPOS extends PaymentFormMixedPOS {
|
||||||
private VPaymentFormDialog dialog;
|
private VPaymentFormDialog dialog;
|
||||||
|
|
||||||
public VPaymentFormMixedPOS(int windowNo, GridTab mTab) {
|
public VPaymentFormMixedPOS() {
|
||||||
super(windowNo, mTab);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
dialog = new VPaymentFormDialog(this, windowNo);
|
dialog = new VPaymentFormDialog(this, windowNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,12 @@ public class VPaymentFormOnCredit extends PaymentFormOnCredit {
|
||||||
private CLabel pTermLabel = new CLabel();
|
private CLabel pTermLabel = new CLabel();
|
||||||
private CComboBox pTermCombo = new CComboBox();
|
private CComboBox pTermCombo = new CComboBox();
|
||||||
|
|
||||||
public VPaymentFormOnCredit(int windowNo, GridTab mTab) {
|
public VPaymentFormOnCredit() {
|
||||||
super(windowNo, mTab);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
dialog = new VPaymentFormDialog(this, windowNo);
|
dialog = new VPaymentFormDialog(this, windowNo);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,4 +57,4 @@ Bundle-Activator: org.adempiere.webui.WebUIActivator
|
||||||
Eclipse-ExtensibleAPI: true
|
Eclipse-ExtensibleAPI: true
|
||||||
Eclipse-RegisterBuddy: org.zkoss.zk.library
|
Eclipse-RegisterBuddy: org.zkoss.zk.library
|
||||||
Web-ContextPath: webui
|
Web-ContextPath: webui
|
||||||
Service-Component: OSGI-INF/reportviewerprovider.xml, OSGI-INF/defaultinfofactory.xml, OSGI-INF/defaulteditorfactory.xml, OSGI-INF/jrviewerprovider.xml, OSGI-INF/resourcefinder.xml
|
Service-Component: OSGI-INF/reportviewerprovider.xml, OSGI-INF/defaultinfofactory.xml, OSGI-INF/defaulteditorfactory.xml, OSGI-INF/jrviewerprovider.xml, OSGI-INF/resourcefinder.xml, OSGI-INF/paymentformcash.xml, OSGI-INF/paymentformcheck.xml, OSGI-INF/paymentformcreditcard.xml, OSGI-INF/paymentformdirectdebit.xml, OSGI-INF/paymentformdirectdeposit.xml, OSGI-INF/paymentformmixedpos.xml, OSGI-INF/paymentformoncredit.xml
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.zk.payment.form.cash">
|
||||||
|
<implementation class="org.adempiere.webui.apps.form.WPaymentFormCash"/>
|
||||||
|
<property name="paymentRule" type="String" value="B"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.zk.payment.form.check">
|
||||||
|
<implementation class="org.adempiere.webui.apps.form.WPaymentFormCheck"/>
|
||||||
|
<property name="paymentRule" type="String" value="S"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.zk.payment.form.creditcard">
|
||||||
|
<implementation class="org.adempiere.webui.apps.form.WPaymentFormCreditCard"/>
|
||||||
|
<property name="paymentRule" type="String" value="K"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.zk.payment.form.directdebit">
|
||||||
|
<implementation class="org.adempiere.webui.apps.form.WPaymentFormDirectDebit"/>
|
||||||
|
<property name="paymentRule" type="String" value="D"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.zk.payment.form.directdeposit">
|
||||||
|
<implementation class="org.adempiere.webui.apps.form.WPaymentFormDirectDeposit"/>
|
||||||
|
<property name="paymentRule" type="String" value="T"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.zk.payment.form.mixedpos">
|
||||||
|
<implementation class="org.adempiere.webui.apps.form.WPaymentFormMixedPOS"/>
|
||||||
|
<property name="paymentRule" type="String" value="M"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.zk.payment.form.oncredit">
|
||||||
|
<implementation class="org.adempiere.webui.apps.form.WPaymentFormOnCredit"/>
|
||||||
|
<property name="paymentRule" type="String" value="P"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="org.compiere.grid.IPaymentForm"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
|
@ -61,8 +61,12 @@ public class WPaymentFormCash extends PaymentFormCash implements EventListener<E
|
||||||
private Label bAmountLabel = new Label();
|
private Label bAmountLabel = new Label();
|
||||||
private WNumberEditor bAmountField = new WNumberEditor();
|
private WNumberEditor bAmountField = new WNumberEditor();
|
||||||
|
|
||||||
public WPaymentFormCash(int windowNo, GridTab mTab) {
|
public WPaymentFormCash() {
|
||||||
super(windowNo, mTab);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
bDateField = new WDateEditor("DateAcct", false, false, true, "DateAcct");
|
bDateField = new WDateEditor("DateAcct", false, false, true, "DateAcct");
|
||||||
window = new WPaymentFormWindow(this, windowNo);
|
window = new WPaymentFormWindow(this, windowNo);
|
||||||
init();
|
init();
|
||||||
|
|
|
@ -74,8 +74,12 @@ public class WPaymentFormCheck extends PaymentFormCheck implements EventListener
|
||||||
private Label sStatus = new Label();
|
private Label sStatus = new Label();
|
||||||
private Panel customizePanel = new Panel();
|
private Panel customizePanel = new Panel();
|
||||||
|
|
||||||
public WPaymentFormCheck(int windowNo, GridTab mTab) {
|
public WPaymentFormCheck() {
|
||||||
super(windowNo, mTab);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
window = new WPaymentFormWindow(this, windowNo);
|
window = new WPaymentFormWindow(this, windowNo);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,12 @@ public class WPaymentFormCreditCard extends PaymentFormCreditCard implements Eve
|
||||||
private Label kStatus = new Label();
|
private Label kStatus = new Label();
|
||||||
private Panel customizePanel = new Panel();
|
private Panel customizePanel = new Panel();
|
||||||
|
|
||||||
public WPaymentFormCreditCard(int windowNo, GridTab mTab) {
|
public WPaymentFormCreditCard() {
|
||||||
super(windowNo, mTab);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
window = new WPaymentFormWindow(this, windowNo);
|
window = new WPaymentFormWindow(this, windowNo);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,8 +61,12 @@ public abstract class WPaymentFormDirect extends PaymentFormDirect implements Ev
|
||||||
private Label tNumberText = new Label();
|
private Label tNumberText = new Label();
|
||||||
private Panel customizePanel = new Panel();
|
private Panel customizePanel = new Panel();
|
||||||
|
|
||||||
public WPaymentFormDirect(int windowNo, GridTab mTab, boolean isDebit) {
|
public WPaymentFormDirect(boolean isDebit) {
|
||||||
super(windowNo, mTab, isDebit);
|
super(isDebit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
window = new WPaymentFormWindow(this, windowNo);
|
window = new WPaymentFormWindow(this, windowNo);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.compiere.model.GridTab;
|
||||||
*/
|
*/
|
||||||
public class WPaymentFormDirectDebit extends WPaymentFormDirect {
|
public class WPaymentFormDirectDebit extends WPaymentFormDirect {
|
||||||
|
|
||||||
public WPaymentFormDirectDebit(int windowNo, GridTab mTab) {
|
public WPaymentFormDirectDebit() {
|
||||||
super(windowNo, mTab, true);
|
super(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.compiere.model.GridTab;
|
||||||
*/
|
*/
|
||||||
public class WPaymentFormDirectDeposit extends WPaymentFormDirect {
|
public class WPaymentFormDirectDeposit extends WPaymentFormDirect {
|
||||||
|
|
||||||
public WPaymentFormDirectDeposit(int windowNo, GridTab mTab) {
|
public WPaymentFormDirectDeposit() {
|
||||||
super(windowNo, mTab, false);
|
super(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,13 +13,10 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.adempiere.webui.apps.form;
|
package org.adempiere.webui.apps.form;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import org.adempiere.base.Service;
|
||||||
import java.util.logging.Level;
|
import org.adempiere.base.ServiceQuery;
|
||||||
|
|
||||||
import org.compiere.grid.IPaymentForm;
|
import org.compiere.grid.IPaymentForm;
|
||||||
import org.compiere.model.GridTab;
|
import org.compiere.model.GridTab;
|
||||||
import org.compiere.model.MInvoice;
|
|
||||||
import org.compiere.util.CLogger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -28,57 +25,18 @@ import org.compiere.util.CLogger;
|
||||||
*/
|
*/
|
||||||
public class WPaymentFormFactory {
|
public class WPaymentFormFactory {
|
||||||
|
|
||||||
/** Static Logger */
|
public static IPaymentForm getPaymentForm(int windowNo, GridTab mTab, String paymentRule)
|
||||||
private static CLogger s_log = CLogger.getCLogger (WPaymentFormFactory.class);
|
|
||||||
|
|
||||||
private static HashMap<String, Class<? extends IPaymentForm>> s_registeredClasses = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register custom WPaymentForm* class
|
|
||||||
* @param ad_table_id
|
|
||||||
* @param cl custom class
|
|
||||||
*/
|
|
||||||
public static final void registerClass(String paymentRule, Class<? extends IPaymentForm> cl)
|
|
||||||
{
|
{
|
||||||
s_registeredClasses.put(paymentRule, cl);
|
ServiceQuery query = new ServiceQuery();
|
||||||
s_log.info("Registered PaymentRule="+paymentRule+", Class="+cl);
|
query.put("paymentRule", paymentRule);
|
||||||
}
|
return Service.locator().locate(IPaymentForm.class, query).getService();
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
// Register defaults:
|
|
||||||
s_registeredClasses = new HashMap<String, Class<? extends IPaymentForm>>();
|
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_Cash, WPaymentFormCash.class);
|
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_Check, WPaymentFormCheck.class);
|
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_CreditCard, WPaymentFormCreditCard.class);
|
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_DirectDebit, WPaymentFormDirectDebit.class);
|
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_DirectDeposit, WPaymentFormDirectDeposit.class);
|
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_MixedPOSPayment, WPaymentFormMixedPOS.class);
|
|
||||||
s_registeredClasses.put(MInvoice.PAYMENTRULE_OnCredit, WPaymentFormOnCredit.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IPaymentForm create(int windowNo, GridTab mTab, String paymentRule)
|
public static IPaymentForm create(int windowNo, GridTab mTab, String paymentRule)
|
||||||
{
|
{
|
||||||
IPaymentForm retValue = null;
|
IPaymentForm form = getPaymentForm(windowNo, mTab, paymentRule);
|
||||||
Class<? extends IPaymentForm> cl = s_registeredClasses.get(paymentRule);
|
if (form != null)
|
||||||
if (cl != null)
|
form.init(windowNo, mTab);
|
||||||
{
|
return form;
|
||||||
try
|
}
|
||||||
{
|
|
||||||
java.lang.reflect.Constructor<? extends IPaymentForm> ctor = cl.getConstructor(int.class, GridTab.class);
|
|
||||||
retValue = ctor.newInstance(windowNo, mTab);
|
|
||||||
}
|
|
||||||
catch (Throwable e)
|
|
||||||
{
|
|
||||||
s_log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (retValue == null)
|
|
||||||
{
|
|
||||||
s_log.info("Unsupported PaymentRule=" + paymentRule);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return retValue;
|
|
||||||
} // create
|
|
||||||
}
|
}
|
|
@ -25,8 +25,12 @@ public class WPaymentFormMixedPOS extends PaymentFormMixedPOS {
|
||||||
|
|
||||||
private WPaymentFormWindow window;
|
private WPaymentFormWindow window;
|
||||||
|
|
||||||
public WPaymentFormMixedPOS(int windowNo, GridTab mTab) {
|
public WPaymentFormMixedPOS() {
|
||||||
super(windowNo, mTab);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
window = new WPaymentFormWindow(this, windowNo);
|
window = new WPaymentFormWindow(this, windowNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,12 @@ public class WPaymentFormOnCredit extends PaymentFormOnCredit {
|
||||||
private Label pTermLabel = new Label();
|
private Label pTermLabel = new Label();
|
||||||
private Listbox pTermCombo = ListboxFactory.newDropdownListbox();
|
private Listbox pTermCombo = ListboxFactory.newDropdownListbox();
|
||||||
|
|
||||||
public WPaymentFormOnCredit(int windowNo, GridTab mTab) {
|
public WPaymentFormOnCredit() {
|
||||||
super(windowNo, mTab);
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int windowNo, GridTab mTab) {
|
||||||
|
super.init(windowNo, mTab);
|
||||||
window = new WPaymentFormWindow(this, windowNo);
|
window = new WPaymentFormWindow(this, windowNo);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -311,18 +311,7 @@ public class WPaymentEditor extends WEditor implements ListDataListener {
|
||||||
Events.sendEvent(comp, new Event(ON_SAVE_PAYMENT, comp));
|
Events.sendEvent(comp, new Event(ON_SAVE_PAYMENT, comp));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Events.sendEvent(new Event("onSave", this));
|
|
||||||
|
|
||||||
// onSave(false, false, new Callback<Boolean>() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onCallback(Boolean result) {
|
|
||||||
// onRefresh(false, false);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,50 +1,58 @@
|
||||||
output.. = WEB-INF/classes/
|
output.. = WEB-INF/classes/
|
||||||
bin.includes = META-INF/,\
|
bin.includes = META-INF/,\
|
||||||
WEB-INF/,\
|
WEB-INF/,\
|
||||||
css/,\
|
css/,\
|
||||||
images/,\
|
images/,\
|
||||||
index.zul,\
|
index.zul,\
|
||||||
js/,\
|
js/,\
|
||||||
theme/,\
|
theme/,\
|
||||||
theme.zs,\
|
theme.zs,\
|
||||||
zul/,\
|
zul/,\
|
||||||
timeout.zul,\
|
timeout.zul,\
|
||||||
plugin.xml,\
|
plugin.xml,\
|
||||||
WEB-INF/classes/,\
|
WEB-INF/classes/,\
|
||||||
WEB-INF/lib/atmosphere-runtime-0.9.jar,\
|
WEB-INF/lib/atmosphere-runtime-0.9.jar,\
|
||||||
WEB-INF/lib/atmosphere-compat-jbossweb-0.9.jar,\
|
WEB-INF/lib/atmosphere-compat-jbossweb-0.9.jar,\
|
||||||
WEB-INF/lib/atmosphere-compat-tomcat-0.9.jar,\
|
WEB-INF/lib/atmosphere-compat-tomcat-0.9.jar,\
|
||||||
WEB-INF/lib/atmosphere-compat-tomcat7-0.9.jar,\
|
WEB-INF/lib/atmosphere-compat-tomcat7-0.9.jar,\
|
||||||
metainfo/,\
|
metainfo/,\
|
||||||
WEB-INF/lib/calendar.jar,\
|
WEB-INF/lib/calendar.jar,\
|
||||||
calendar.css,\
|
calendar.css,\
|
||||||
calendar.zul,\
|
calendar.zul,\
|
||||||
calendar_mini.zul,\
|
calendar_mini.zul,\
|
||||||
divarrow.zul,\
|
divarrow.zul,\
|
||||||
divtab.zul,\
|
divtab.zul,\
|
||||||
OSGI-INF/reportviewerprovider.xml,\
|
OSGI-INF/,\
|
||||||
OSGI-INF/defaultinfofactory.xml,\
|
OSGI-INF/reportviewerprovider.xml,\
|
||||||
OSGI-INF/defaulteditorfactory.xml,\
|
OSGI-INF/defaultinfofactory.xml,\
|
||||||
OSGI-INF/jrviewerprovider.xml,\
|
OSGI-INF/defaulteditorfactory.xml,\
|
||||||
OSGI-INF/resourcefinder.xml
|
OSGI-INF/jrviewerprovider.xml,\
|
||||||
src.includes = WEB-INF/classes/,\
|
OSGI-INF/resourcefinder.xml,\
|
||||||
WEB-INF/tld/,\
|
OSGI-INF/paymentformcash.xml,\
|
||||||
WEB-INF/web.xml,\
|
OSGI-INF/paymentformcheck.xml,\
|
||||||
WEB-INF/xsd/,\
|
OSGI-INF/paymentformcreditcard.xml,\
|
||||||
WEB-INF/zk.xml,\
|
OSGI-INF/paymentformdirectdebit.xml,\
|
||||||
css/,\
|
OSGI-INF/paymentformdirectdeposit.xml,\
|
||||||
images/,\
|
OSGI-INF/paymentformmixedpos.xml,\
|
||||||
index.zul,\
|
OSGI-INF/paymentformoncredit.xml
|
||||||
js/,\
|
src.includes = WEB-INF/classes/,\
|
||||||
theme/,\
|
WEB-INF/tld/,\
|
||||||
theme.zs,\
|
WEB-INF/web.xml,\
|
||||||
zul/,\
|
WEB-INF/xsd/,\
|
||||||
metainfo/,\
|
WEB-INF/zk.xml,\
|
||||||
calendar.css,\
|
css/,\
|
||||||
calendar.zul,\
|
images/,\
|
||||||
calendar_mini.zul,\
|
index.zul,\
|
||||||
divarrow.zul,\
|
js/,\
|
||||||
divtab.zul
|
theme/,\
|
||||||
source.. = WEB-INF/src/
|
theme.zs,\
|
||||||
bin.excludes = WEB-INF/src/,\
|
zul/,\
|
||||||
WEB-INF/web-2.5.xml
|
metainfo/,\
|
||||||
|
calendar.css,\
|
||||||
|
calendar.zul,\
|
||||||
|
calendar_mini.zul,\
|
||||||
|
divarrow.zul,\
|
||||||
|
divtab.zul
|
||||||
|
source.. = WEB-INF/src/
|
||||||
|
bin.excludes = WEB-INF/src/,\
|
||||||
|
WEB-INF/web-2.5.xml
|
||||||
|
|
|
@ -13,9 +13,12 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.grid;
|
package org.compiere.grid;
|
||||||
|
|
||||||
|
import org.compiere.model.GridTab;
|
||||||
import org.compiere.model.MBankAccountProcessor;
|
import org.compiere.model.MBankAccountProcessor;
|
||||||
|
|
||||||
public interface IPaymentForm {
|
public interface IPaymentForm {
|
||||||
|
|
||||||
|
public void init(int WindowNo, GridTab mTab);
|
||||||
|
|
||||||
public boolean dynInit() throws Exception;
|
public boolean dynInit() throws Exception;
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,10 @@ public abstract class PaymentForm implements IPaymentForm {
|
||||||
|
|
||||||
public Hashtable<Integer,KeyNamePair> s_Currencies = null;
|
public Hashtable<Integer,KeyNamePair> s_Currencies = null;
|
||||||
|
|
||||||
public PaymentForm(int WindowNo, GridTab mTab) {
|
public PaymentForm() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(int WindowNo, GridTab mTab) {
|
||||||
m_WindowNo = WindowNo;
|
m_WindowNo = WindowNo;
|
||||||
m_isSOTrx = "Y".equals(Env.getContext(Env.getCtx(), WindowNo, "IsSOTrx"));
|
m_isSOTrx = "Y".equals(Env.getContext(Env.getCtx(), WindowNo, "IsSOTrx"));
|
||||||
m_mTab = mTab;
|
m_mTab = mTab;
|
||||||
|
|
|
@ -57,8 +57,7 @@ public abstract class PaymentFormCash extends PaymentForm {
|
||||||
/** Start CashBook */
|
/** Start CashBook */
|
||||||
public int m_C_CashBook_ID = 0;
|
public int m_C_CashBook_ID = 0;
|
||||||
|
|
||||||
public PaymentFormCash(int WindowNo, GridTab mTab) {
|
public PaymentFormCash() {
|
||||||
super(WindowNo, mTab);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -48,8 +48,7 @@ public abstract class PaymentFormCheck extends PaymentForm {
|
||||||
/** Start Bank Account */
|
/** Start Bank Account */
|
||||||
public int m_C_BankAccount_ID = 0;
|
public int m_C_BankAccount_ID = 0;
|
||||||
|
|
||||||
public PaymentFormCheck(int WindowNo, GridTab mTab) {
|
public PaymentFormCheck() {
|
||||||
super(WindowNo, mTab);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -45,8 +45,7 @@ public abstract class PaymentFormCreditCard extends PaymentForm {
|
||||||
/** Start CreditCard */
|
/** Start CreditCard */
|
||||||
public String m_CCType = "";
|
public String m_CCType = "";
|
||||||
|
|
||||||
public PaymentFormCreditCard(int WindowNo, GridTab mTab) {
|
public PaymentFormCreditCard() {
|
||||||
super(WindowNo, mTab);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -45,8 +45,7 @@ public abstract class PaymentFormDirect extends PaymentForm {
|
||||||
public MPayment m_mPayment = null;
|
public MPayment m_mPayment = null;
|
||||||
public MPayment m_mPaymentOriginal = null;
|
public MPayment m_mPaymentOriginal = null;
|
||||||
|
|
||||||
public PaymentFormDirect(int WindowNo, GridTab mTab, boolean isDebit) {
|
public PaymentFormDirect(boolean isDebit) {
|
||||||
super(WindowNo, mTab);
|
|
||||||
PAYMENTRULE = isDebit ? MInvoice.PAYMENTRULE_DirectDebit : MInvoice.PAYMENTRULE_DirectDeposit;
|
PAYMENTRULE = isDebit ? MInvoice.PAYMENTRULE_DirectDebit : MInvoice.PAYMENTRULE_DirectDeposit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ import org.compiere.model.GridTab;
|
||||||
*/
|
*/
|
||||||
public abstract class PaymentFormMixedPOS extends PaymentForm {
|
public abstract class PaymentFormMixedPOS extends PaymentForm {
|
||||||
|
|
||||||
public PaymentFormMixedPOS(int WindowNo, GridTab mTab) {
|
public PaymentFormMixedPOS() {
|
||||||
super(WindowNo, mTab);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,7 @@ public abstract class PaymentFormOnCredit extends PaymentForm {
|
||||||
/** Start Payment Term */
|
/** Start Payment Term */
|
||||||
public int m_C_PaymentTerm_ID = 0;
|
public int m_C_PaymentTerm_ID = 0;
|
||||||
|
|
||||||
public PaymentFormOnCredit(int WindowNo, GridTab mTab) {
|
public PaymentFormOnCredit() {
|
||||||
super(WindowNo, mTab);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue