Adempiere 3.1.2 + marekmosiewicz , hengsin

This commit is contained in:
vpj-cd 2006-12-07 23:07:46 +00:00
parent 0c7b34ddd3
commit dee6003f14
3 changed files with 1370 additions and 1331 deletions

View File

@ -622,6 +622,7 @@ public class VPaySelect extends CPanel
// //
ff.pack(); ff.pack();
this.setVisible(false); this.setVisible(false);
AEnv.addToWindowManager(ff);
AEnv.showCenterScreen(ff); AEnv.showCenterScreen(ff);
this.dispose(); this.dispose();
} // unlockUI } // unlockUI

View File

@ -193,8 +193,13 @@ public class VPayment extends CDialog
private CLabel bCashBookLabel = new CLabel(); private CLabel bCashBookLabel = new CLabel();
private CComboBox bCashBookCombo = new CComboBox(); private CComboBox bCashBookCombo = new CComboBox();
private GridBagLayout tPanelLayout = new GridBagLayout(); private GridBagLayout tPanelLayout = new GridBagLayout();
private CButton tOnline = new CButton();
private CLabel kStatus = new CLabel(); private CLabel kStatus = new CLabel();
private CTextField tRoutingField = new CTextField();
private CTextField tNumberField = new CTextField();
private CLabel tStatus = new CLabel(); private CLabel tStatus = new CLabel();
private CLabel tRoutingText = new CLabel();
private CLabel tNumberText = new CLabel();
private CLabel sStatus = new CLabel(); private CLabel sStatus = new CLabel();
/** /**
@ -215,7 +220,7 @@ public class VPayment extends CDialog
northPanel.add(paymentCombo, null); northPanel.add(paymentCombo, null);
// //
centerPanel.setLayout(centerLayout); centerPanel.setLayout(centerLayout);
// CreditCard // CreditCard
kPanel.setLayout(kLayout); kPanel.setLayout(kLayout);
kNumberField.setPreferredSize(new Dimension(120, 21)); kNumberField.setPreferredSize(new Dimension(120, 21));
kExpField.setPreferredSize(new Dimension(40, 21)); kExpField.setPreferredSize(new Dimension(40, 21));
@ -252,6 +257,11 @@ public class VPayment extends CDialog
// DircetDebit/Credit // DircetDebit/Credit
tPanel.setLayout(tPanelLayout); tPanel.setLayout(tPanelLayout);
tAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BP_BankAccount_ID")); tAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BP_BankAccount_ID"));
tRoutingField.setColumns(8);
tNumberField.setColumns(10);
tRoutingText.setText(Msg.translate(Env.getCtx(), "RoutingNo"));
tNumberText.setText(Msg.translate(Env.getCtx(), "AccountNo"));
tOnline.setText(Msg.getMsg(Env.getCtx(), "Online"));
tStatus.setText(" "); tStatus.setText(" ");
centerPanel.add(tPanel, "tPanel"); centerPanel.add(tPanel, "tPanel");
centerLayout.addLayoutComponent(tPanel, "tPanel"); centerLayout.addLayoutComponent(tPanel, "tPanel");
@ -259,8 +269,18 @@ public class VPayment extends CDialog
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 0), 0, 0)); ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 0), 0, 0));
tPanel.add(tAccountCombo, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 tPanel.add(tAccountCombo, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
tPanel.add(tRoutingField, new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
tPanel.add(tNumberField, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
tPanel.add(tStatus, new GridBagConstraints(0, 3, 2, 1, 0.0, 0.0 tPanel.add(tStatus, new GridBagConstraints(0, 3, 2, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
tPanel.add(tRoutingText, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0));
tPanel.add(tNumberText, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0));
tPanel.add(tOnline, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0
,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
// //
sPanel.setLayout(sPanelLayout); sPanel.setLayout(sPanelLayout);
sBankAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID")); sBankAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID"));
@ -442,6 +462,8 @@ public class VPayment extends CDialog
sCheckField.setText(m_mPayment.getCheckNo()); sCheckField.setText(m_mPayment.getCheckNo());
sStatus.setText(m_mPayment.getR_PnRef()); sStatus.setText(m_mPayment.getR_PnRef());
// Transfer // Transfer
tRoutingField.setText(m_mPayment.getRoutingNo());
tNumberField.setText(m_mPayment.getAccountNo());
tStatus.setText(m_mPayment.getR_PnRef()); tStatus.setText(m_mPayment.getR_PnRef());
} }
} }
@ -507,13 +529,14 @@ public class VPayment extends CDialog
Object[] a = values.keySet().toArray(); Object[] a = values.keySet().toArray();
for (int i = 0; i < a.length; i++) for (int i = 0; i < a.length; i++)
{ {
String PaymentRule = (String)a[i]; // used for Panel selection String PaymentRule = (String)a[i]; // used for Panel selection
if (X_C_Order.PAYMENTRULE_DirectDebit.equals(PaymentRule) // SO if (X_C_Order.PAYMENTRULE_DirectDebit.equals(PaymentRule) // SO
&& !m_isSOTrx) && !m_isSOTrx)
continue; continue;
else if (X_C_Order.PAYMENTRULE_DirectDeposit.equals(PaymentRule) // PO else if (X_C_Order.PAYMENTRULE_DirectDeposit.equals(PaymentRule) // PO
&& m_isSOTrx) && m_isSOTrx)
continue; continue;
ValueNamePair pp = new ValueNamePair(PaymentRule, (String)values.get(a[i])); ValueNamePair pp = new ValueNamePair(PaymentRule, (String)values.get(a[i]));
paymentCombo.addItem(pp); paymentCombo.addItem(pp);
if (PaymentRule.toString().equals(m_PaymentRule)) // to select if (PaymentRule.toString().equals(m_PaymentRule)) // to select
@ -1020,6 +1043,12 @@ public class VPayment extends CDialog
kNumberField.getText(), "", kExpField.getText()); kNumberField.getText(), "", kExpField.getText());
m_mPayment.setPaymentProcessor(); m_mPayment.setPaymentProcessor();
} }
else if (newPaymentRule.equals(MOrder.PAYMENTRULE_DirectDeposit)
|| newPaymentRule.equals(MOrder.PAYMENTRULE_DirectDebit))
{
m_mPayment.setBankACH(newC_BankAccount_ID, m_isSOTrx, newPaymentRule,
tRoutingField.getText(), tNumberField.getText());
}
else if (newPaymentRule.equals(MOrder.PAYMENTRULE_Check)) else if (newPaymentRule.equals(MOrder.PAYMENTRULE_Check))
{ {
m_mPayment.setBankCheck(newC_BankAccount_ID, m_isSOTrx, sRoutingField.getText(), m_mPayment.setBankCheck(newC_BankAccount_ID, m_isSOTrx, sRoutingField.getText(),
@ -1154,6 +1183,7 @@ public class VPayment extends CDialog
{ {
KeyNamePair bpba = (KeyNamePair)tAccountCombo.getSelectedItem(); KeyNamePair bpba = (KeyNamePair)tAccountCombo.getSelectedItem();
if (bpba == null) if (bpba == null)
{ {
tAccountCombo.setBackground(AdempierePLAF.getFieldBackground_Error()); tAccountCombo.setBackground(AdempierePLAF.getFieldBackground_Error());
ADialog.error(m_WindowNo, this, "PaymentBPBankNotFound"); ADialog.error(m_WindowNo, this, "PaymentBPBankNotFound");
@ -1216,7 +1246,7 @@ public class VPayment extends CDialog
tender = MPayment.TENDERTYPE_Check; tender = MPayment.TENDERTYPE_Check;
// Check must have a bank account // Check must have a bank account
if (C_BankAccount_ID == 0 && "S".equals(PaymentRule)) if (C_BankAccount_ID == 0 && "S".equals(PaymentRule))
{ {
ADialog.error(m_WindowNo, this, "PaymentNoProcessor"); ADialog.error(m_WindowNo, this, "PaymentNoProcessor");
dataOK = false; dataOK = false;
} }

View File

@ -894,7 +894,7 @@ public class CConnection implements Serializable
} // isPostgreSQL } // isPostgreSQL
//end //end
/** /**
* Is PostgreSQL DB * Is Fyracle DB
* @return true if PostgreSQL * @return true if PostgreSQL
*/ */
public boolean isFyracle () public boolean isFyracle ()
@ -1224,7 +1224,15 @@ public class CConnection implements Serializable
{ {
try try
{ {
m_db = Database.getDatabase(m_type); for (int i = 0; i < Database.DB_NAMES.length; i++)
{
if (Database.DB_NAMES[i].equals (m_type))
{
m_db = (AdempiereDatabase)Database.DB_CLASSES[i].
newInstance ();
break;
}
}
} }
catch (Exception e) catch (Exception e)
{ {