IDEMPIERE-1492 when login with Organization = *, run "Bank Transfer" make error "Fill mandatory fields: : Organization" / based on patch from hieplq
This commit is contained in:
parent
d867a0f2a7
commit
5e04ddd8a8
|
@ -0,0 +1,27 @@
|
|||
SET SQLBLANKLINES ON
|
||||
SET DEFINE OFF
|
||||
|
||||
-- Jan 7, 2015 10:39:54 AM COT
|
||||
-- IDEMPIERE-1492
|
||||
UPDATE AD_Process SET Name='Bank/Cash Transfer', Description='Bank/Cash Transfer let money tranfer between Banks',Updated=TO_DATE('2015-01-07 10:39:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=53153
|
||||
;
|
||||
|
||||
-- Jan 7, 2015 10:39:54 AM COT
|
||||
UPDATE AD_Menu SET Name='Bank/Cash Transfer', Description='Bank/Cash Transfer let money tranfer between Banks', IsActive='Y',Updated=TO_DATE('2015-01-07 10:39:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53190
|
||||
;
|
||||
|
||||
-- Jan 7, 2015 10:43:38 AM COT
|
||||
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,DefaultValue,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200115,0,0,'Y',TO_DATE('2015-01-07 10:43:37','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-01-07 10:43:37','YYYY-MM-DD HH24:MI:SS'),100,'Organization','Organizational entity within client','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.',53153,120,19,130,'N',10,'Y','@#AD_Org_ID@','AD_Org_ID','Y','D',113,'cf69cf9d-aac5-430f-b290-d6d4ba70cf8e','N')
|
||||
;
|
||||
|
||||
-- Jan 7, 2015 11:00:05 AM COT
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Banks From and To must be different',0,0,'Y',TO_DATE('2015-01-07 11:00:04','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-01-07 11:00:04','YYYY-MM-DD HH24:MI:SS'),100,200329,'BankFromToMustDiffer','D','238c4118-870c-47b7-833a-f2d51f200ac6')
|
||||
;
|
||||
|
||||
-- Jan 7, 2015 11:04:17 AM COT
|
||||
UPDATE AD_Process_Para SET DefaultValue='@$C_Currency_ID@',Updated=TO_DATE('2015-01-07 11:04:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53256
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201501071044_IDEMPIERE-1492.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
-- Jan 7, 2015 10:39:54 AM COT
|
||||
-- IDEMPIERE-1492
|
||||
UPDATE AD_Process SET Name='Bank/Cash Transfer', Description='Bank/Cash Transfer let money tranfer between Banks',Updated=TO_TIMESTAMP('2015-01-07 10:39:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=53153
|
||||
;
|
||||
|
||||
-- Jan 7, 2015 10:39:54 AM COT
|
||||
UPDATE AD_Menu SET Name='Bank/Cash Transfer', Description='Bank/Cash Transfer let money tranfer between Banks', IsActive='Y',Updated=TO_TIMESTAMP('2015-01-07 10:39:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=53190
|
||||
;
|
||||
|
||||
-- Jan 7, 2015 10:43:38 AM COT
|
||||
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,AD_Reference_Value_ID,IsRange,FieldLength,IsMandatory,DefaultValue,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200115,0,0,'Y',TO_TIMESTAMP('2015-01-07 10:43:37','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-01-07 10:43:37','YYYY-MM-DD HH24:MI:SS'),100,'Organization','Organizational entity within client','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.',53153,120,19,130,'N',10,'Y','@#AD_Org_ID@','AD_Org_ID','Y','D',113,'cf69cf9d-aac5-430f-b290-d6d4ba70cf8e','N')
|
||||
;
|
||||
|
||||
-- Jan 7, 2015 11:00:05 AM COT
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Banks From and To must be different',0,0,'Y',TO_TIMESTAMP('2015-01-07 11:00:04','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-01-07 11:00:04','YYYY-MM-DD HH24:MI:SS'),100,200329,'BankFromToMustDiffer','D','238c4118-870c-47b7-833a-f2d51f200ac6')
|
||||
;
|
||||
|
||||
-- Jan 7, 2015 11:04:17 AM COT
|
||||
UPDATE AD_Process_Para SET DefaultValue='@$C_Currency_ID@',Updated=TO_TIMESTAMP('2015-01-07 11:04:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53256
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201501071044_IDEMPIERE-1492.sql') FROM dual
|
||||
;
|
||||
|
|
@ -2477,7 +2477,7 @@ public abstract class PO
|
|||
value = DB.getDocumentNo(AD_Client_ID, p_info.getTableName(), m_trxName, this);
|
||||
}
|
||||
else
|
||||
log.warning("DocumentNo updated: " + m_oldValues[i] + " -> " + value);
|
||||
if (log.isLoggable(Level.INFO)) log.info("DocumentNo updated: " + m_oldValues[i] + " -> " + value);
|
||||
}
|
||||
|
||||
if (changes)
|
||||
|
|
|
@ -42,16 +42,18 @@ public class BankTransfer extends SvrProcess
|
|||
private String p_DocumentNo= ""; // Document No
|
||||
private String p_Description= ""; // Description
|
||||
private int p_C_BPartner_ID = 0; // Business Partner to be used as bridge
|
||||
private int p_C_Currency_ID = 0; // Payment Currency
|
||||
private int p_C_Currency_ID = 0; // Payment Currency
|
||||
private int p_C_ConversionType_ID = 0; // Payment Conversion Type
|
||||
private int p_C_Charge_ID = 0; // Charge to be used as bridge
|
||||
private int p_C_Charge_ID = 0; // Charge to be used as bridge
|
||||
|
||||
private BigDecimal p_Amount = Env.ZERO; // Amount to be transfered between the accounts
|
||||
private int p_From_C_BankAccount_ID = 0; // Bank Account From
|
||||
private int p_To_C_BankAccount_ID= 0; // Bank Account To
|
||||
private Timestamp p_StatementDate = null; // Date Statement
|
||||
private Timestamp p_DateAcct = null; // Date Account
|
||||
private int p_AD_Org_ID = 0;
|
||||
private int m_created = 0;
|
||||
|
||||
/**
|
||||
* Prepare - e.g., get Parameters.
|
||||
*/
|
||||
|
@ -83,6 +85,8 @@ public class BankTransfer extends SvrProcess
|
|||
p_StatementDate = (Timestamp)para[i].getParameter();
|
||||
else if (name.equals("DateAcct"))
|
||||
p_DateAcct = (Timestamp)para[i].getParameter();
|
||||
else if (name.equals("AD_Org_ID"))
|
||||
p_AD_Org_ID = para[i].getParameterAsInt();
|
||||
else
|
||||
log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name);
|
||||
}
|
||||
|
@ -100,26 +104,26 @@ public class BankTransfer extends SvrProcess
|
|||
+ " - Description="+p_Description+ " - Statement Date="+p_StatementDate+
|
||||
" - Date Account="+p_DateAcct);
|
||||
|
||||
if (Env.getAD_Org_ID(getCtx()) == 0)
|
||||
throw new AdempiereUserError(Msg.getMsg(getCtx(), "Org0NotAllowed"));
|
||||
|
||||
if (p_To_C_BankAccount_ID == 0 || p_From_C_BankAccount_ID == 0)
|
||||
throw new IllegalArgumentException("Banks required");
|
||||
throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@: @To_C_BankAccount_ID@, @From_C_BankAccount_ID@"));
|
||||
|
||||
if (p_To_C_BankAccount_ID == p_From_C_BankAccount_ID)
|
||||
throw new AdempiereUserError ("Banks From and To must be different");
|
||||
throw new AdempiereUserError (Msg.getMsg(getCtx(), "BankFromToMustDiffer"));
|
||||
|
||||
if (p_C_BPartner_ID == 0)
|
||||
throw new AdempiereUserError ("Business Partner required");
|
||||
throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@ @C_BPartner_ID@"));
|
||||
|
||||
if (p_C_Currency_ID == 0)
|
||||
throw new AdempiereUserError ("Currency required");
|
||||
throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@ @C_Currency_ID@"));
|
||||
|
||||
if (p_C_Charge_ID == 0)
|
||||
throw new AdempiereUserError ("Business Partner required");
|
||||
throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@ @C_Charge_ID@"));
|
||||
|
||||
if (p_Amount.signum() == 0)
|
||||
throw new AdempiereUserError ("Amount required");
|
||||
throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@ @Amount@"));
|
||||
|
||||
if (p_AD_Org_ID == 0)
|
||||
throw new AdempiereUserError (Msg.parseTranslation(getCtx(), "@FillMandatory@ @AD_Org_ID@"));
|
||||
|
||||
// Login Date
|
||||
if (p_StatementDate == null)
|
||||
|
@ -147,6 +151,7 @@ public class BankTransfer extends SvrProcess
|
|||
|
||||
MPayment paymentBankFrom = new MPayment(getCtx(), 0 , get_TrxName());
|
||||
paymentBankFrom.setC_BankAccount_ID(mBankFrom.getC_BankAccount_ID());
|
||||
paymentBankFrom.setAD_Org_ID(p_AD_Org_ID);
|
||||
if (!Util.isEmpty(p_DocumentNo, true))
|
||||
paymentBankFrom.setDocumentNo(p_DocumentNo);
|
||||
paymentBankFrom.setDateAcct(p_DateAcct);
|
||||
|
@ -174,6 +179,7 @@ public class BankTransfer extends SvrProcess
|
|||
|
||||
MPayment paymentBankTo = new MPayment(getCtx(), 0 , get_TrxName());
|
||||
paymentBankTo.setC_BankAccount_ID(mBankTo.getC_BankAccount_ID());
|
||||
paymentBankTo.setAD_Org_ID(p_AD_Org_ID);
|
||||
if (!Util.isEmpty(p_DocumentNo, true))
|
||||
paymentBankTo.setDocumentNo(p_DocumentNo);
|
||||
paymentBankTo.setDateAcct(p_DateAcct);
|
||||
|
@ -200,6 +206,6 @@ public class BankTransfer extends SvrProcess
|
|||
m_created++;
|
||||
return;
|
||||
|
||||
} // createCashLines
|
||||
} // generateBankTransfer
|
||||
|
||||
} // ImmediateBankTransfer
|
||||
} // BankTransfer
|
||||
|
|
Loading…
Reference in New Issue