From c19b550ae7f3649a63b68977a4866e19530685ae Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 22 Jan 2008 04:35:32 +0000 Subject: [PATCH] FR [ 1876984 ] Make payment numbering configurable --- base/src/org/compiere/model/MPayment.java | 35 +++++++++++-------- migration/331b-trunk/074_FR1876984.sql | 10 ++++++ .../331b-trunk/postgresql/074_FR1876984.sql | 10 ++++++ 3 files changed, 41 insertions(+), 14 deletions(-) create mode 100644 migration/331b-trunk/074_FR1876984.sql create mode 100644 migration/331b-trunk/postgresql/074_FR1876984.sql diff --git a/base/src/org/compiere/model/MPayment.java b/base/src/org/compiere/model/MPayment.java index 37e68cde08..959ce3c888 100644 --- a/base/src/org/compiere/model/MPayment.java +++ b/base/src/org/compiere/model/MPayment.java @@ -1021,34 +1021,41 @@ public final class MPayment extends X_C_Payment } documentNo = ""; + // globalqss - read configuration to assign credit card or check number number for Payments // Credit Card if (TENDERTYPE_CreditCard.equals(getTenderType())) { - documentNo = getCreditCardType() - + " " + Obscure.obscure(getCreditCardNumber()) - + " " + getCreditCardExpMM() - + "/" + getCreditCardExpYY(); + if (MSysConfig.getBooleanValue("PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CREDIT_CARD", true, getAD_Client_ID())) { + documentNo = getCreditCardType() + + " " + Obscure.obscure(getCreditCardNumber()) + + " " + getCreditCardExpMM() + + "/" + getCreditCardExpYY(); + } } // Own Check No else if (TENDERTYPE_Check.equals(getTenderType()) && !isReceipt() && getCheckNo() != null && getCheckNo().length() > 0) { - documentNo = getCheckNo(); + if (MSysConfig.getBooleanValue("PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_PAYMENT", true, getAD_Client_ID())) { + documentNo = getCheckNo(); + } } // Customer Check: Routing: Account #Check else if (TENDERTYPE_Check.equals(getTenderType()) && isReceipt()) { - if (getRoutingNo() != null) - documentNo = getRoutingNo() + ": "; - if (getAccountNo() != null) - documentNo += getAccountNo(); - if (getCheckNo() != null) - { - if (documentNo.length() > 0) - documentNo += " "; - documentNo += "#" + getCheckNo(); + if (MSysConfig.getBooleanValue("PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_RECEIPT", true, getAD_Client_ID())) { + if (getRoutingNo() != null) + documentNo = getRoutingNo() + ": "; + if (getAccountNo() != null) + documentNo += getAccountNo(); + if (getCheckNo() != null) + { + if (documentNo.length() > 0) + documentNo += " "; + documentNo += "#" + getCheckNo(); + } } } diff --git a/migration/331b-trunk/074_FR1876984.sql b/migration/331b-trunk/074_FR1876984.sql new file mode 100644 index 0000000000..88da4c196c --- /dev/null +++ b/migration/331b-trunk/074_FR1876984.sql @@ -0,0 +1,10 @@ +-- Jan 21, 2008 11:13:10 PM COT +-- 1876984 - Make payment numbering configurable +INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50011,'C',TO_DATE('2008-01-21 23:13:07','YYYY-MM-DD HH24:MI:SS'),100,'Y/N - Define if the payment document number must be overwritten with the check number','D','Y','PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_PAYMENT',TO_DATE('2008-01-21 23:13:07','YYYY-MM-DD HH24:MI:SS'),100,'Y') +; + +INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50012,'C',TO_DATE('2008-01-21 23:13:30','YYYY-MM-DD HH24:MI:SS'),100,'Y/N - Define if the payment document number must be overwritten with the credit card','D','Y','PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CREDIT_CARD',TO_DATE('2008-01-21 23:13:30','YYYY-MM-DD HH24:MI:SS'),100,'Y') +; + +INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50013,'C',TO_DATE('2008-01-21 23:19:48','YYYY-MM-DD HH24:MI:SS'),100,'Y/N - Define if the payment (receipt) document number must be overwritten with the check number','D','Y','PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_RECEIPT',TO_DATE('2008-01-21 23:19:48','YYYY-MM-DD HH24:MI:SS'),100,'Y') +; diff --git a/migration/331b-trunk/postgresql/074_FR1876984.sql b/migration/331b-trunk/postgresql/074_FR1876984.sql new file mode 100644 index 0000000000..d2aaf05bbd --- /dev/null +++ b/migration/331b-trunk/postgresql/074_FR1876984.sql @@ -0,0 +1,10 @@ +-- Jan 21, 2008 11:13:10 PM COT +-- 1876984 - Make payment numbering configurable +INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50011,'C',TO_TIMESTAMP('2008-01-21 23:13:07','YYYY-MM-DD HH24:MI:SS'),100,'Y/N - Define if the payment document number must be overwritten with the check number','D','Y','PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_PAYMENT',TO_TIMESTAMP('2008-01-21 23:13:07','YYYY-MM-DD HH24:MI:SS'),100,'Y') +; + +INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50012,'C',TO_TIMESTAMP('2008-01-21 23:13:30','YYYY-MM-DD HH24:MI:SS'),100,'Y/N - Define if the payment document number must be overwritten with the credit card','D','Y','PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CREDIT_CARD',TO_TIMESTAMP('2008-01-21 23:13:30','YYYY-MM-DD HH24:MI:SS'),100,'Y') +; + +INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50013,'C',TO_TIMESTAMP('2008-01-21 23:19:48','YYYY-MM-DD HH24:MI:SS'),100,'Y/N - Define if the payment (receipt) document number must be overwritten with the check number','D','Y','PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_RECEIPT',TO_TIMESTAMP('2008-01-21 23:19:48','YYYY-MM-DD HH24:MI:SS'),100,'Y') +;