FR 1840016 - Avoid usage of clearing accounts
This commit is contained in:
parent
43801a02fe
commit
0876e35a3b
|
@ -31,6 +31,11 @@ import org.compiere.util.*;
|
||||||
* </pre>
|
* </pre>
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: Doc_Allocation.java,v 1.6 2006/07/30 00:53:33 jjanke Exp $
|
* @version $Id: Doc_Allocation.java,v 1.6 2006/07/30 00:53:33 jjanke Exp $
|
||||||
|
*
|
||||||
|
* FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual
|
||||||
|
* Avoid posting if Receipt and both accounts Unallocated Cash and Receivable are equal
|
||||||
|
* Avoid posting if Payment and both accounts Payment Select and Liability are equal
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public class Doc_Allocation extends Doc
|
public class Doc_Allocation extends Doc
|
||||||
{
|
{
|
||||||
|
@ -209,6 +214,29 @@ public class Doc_Allocation extends Doc
|
||||||
// Sales Invoice
|
// Sales Invoice
|
||||||
else if (invoice.isSOTrx())
|
else if (invoice.isSOTrx())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Avoid usage of clearing accounts
|
||||||
|
// If both accounts Unallocated Cash and Receivable are equal
|
||||||
|
// then don't post
|
||||||
|
|
||||||
|
MAccount acct_unallocated_cash = null;
|
||||||
|
if (line.getC_Payment_ID() != 0)
|
||||||
|
acct_unallocated_cash = getPaymentAcct(as, line.getC_Payment_ID());
|
||||||
|
else if (line.getC_CashLine_ID() != 0)
|
||||||
|
acct_unallocated_cash = getCashAcct(as, line.getC_CashLine_ID());
|
||||||
|
MAccount acct_receivable = getAccount(Doc.ACCTTYPE_C_Receivable, as);
|
||||||
|
|
||||||
|
if ((!as.isPostIfClearingEqual()) && acct_unallocated_cash != null && acct_unallocated_cash.equals(acct_receivable)) {
|
||||||
|
|
||||||
|
// if not using clearing accounts, then don't post amtsource
|
||||||
|
// change the allocationsource to be writeoff + discount
|
||||||
|
allocationSource = line.getDiscountAmt().add(line.getWriteOffAmt());
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Normal behavior -- unchanged if using clearing accounts
|
||||||
|
|
||||||
// Payment/Cash DR
|
// Payment/Cash DR
|
||||||
if (line.getC_Payment_ID() != 0)
|
if (line.getC_Payment_ID() != 0)
|
||||||
{
|
{
|
||||||
|
@ -225,6 +253,10 @@ public class Doc_Allocation extends Doc
|
||||||
if (fl != null && cashLine.get_ID() != 0)
|
if (fl != null && cashLine.get_ID() != 0)
|
||||||
fl.setAD_Org_ID(cashLine.getAD_Org_ID());
|
fl.setAD_Org_ID(cashLine.getAD_Org_ID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// End Avoid usage of clearing accounts
|
||||||
|
|
||||||
// Discount DR
|
// Discount DR
|
||||||
if (Env.ZERO.compareTo(line.getDiscountAmt()) != 0)
|
if (Env.ZERO.compareTo(line.getDiscountAmt()) != 0)
|
||||||
{
|
{
|
||||||
|
@ -262,6 +294,28 @@ public class Doc_Allocation extends Doc
|
||||||
// Purchase Invoice
|
// Purchase Invoice
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Avoid usage of clearing accounts
|
||||||
|
// If both accounts Payment Select and Liability are equal
|
||||||
|
// then don't post
|
||||||
|
|
||||||
|
MAccount acct_payment_select = null;
|
||||||
|
if (line.getC_Payment_ID() != 0)
|
||||||
|
acct_payment_select = getPaymentAcct(as, line.getC_Payment_ID());
|
||||||
|
else if (line.getC_CashLine_ID() != 0)
|
||||||
|
acct_payment_select = getCashAcct(as, line.getC_CashLine_ID());
|
||||||
|
MAccount acct_liability = getAccount(Doc.ACCTTYPE_V_Liability, as);
|
||||||
|
boolean isUsingClearing = true;
|
||||||
|
|
||||||
|
if ((!as.isPostIfClearingEqual()) && acct_payment_select != null && acct_payment_select.equals(acct_liability)) {
|
||||||
|
|
||||||
|
// if not using clearing accounts, then don't post amtsource
|
||||||
|
// change the allocationsource to be writeoff + discount
|
||||||
|
allocationSource = line.getDiscountAmt().add(line.getWriteOffAmt());
|
||||||
|
isUsingClearing = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
// End Avoid usage of clearing accounts
|
||||||
|
|
||||||
allocationSource = allocationSource.negate(); // allocation is negative
|
allocationSource = allocationSource.negate(); // allocation is negative
|
||||||
// AP Invoice Amount DR
|
// AP Invoice Amount DR
|
||||||
if (as.isAccrual())
|
if (as.isAccrual())
|
||||||
|
@ -297,14 +351,14 @@ public class Doc_Allocation extends Doc
|
||||||
fl.setAD_Org_ID(payment.getAD_Org_ID());
|
fl.setAD_Org_ID(payment.getAD_Org_ID());
|
||||||
}
|
}
|
||||||
// Payment/Cash CR
|
// Payment/Cash CR
|
||||||
if (line.getC_Payment_ID() != 0)
|
if (isUsingClearing && line.getC_Payment_ID() != 0) // Avoid usage of clearing accounts
|
||||||
{
|
{
|
||||||
fl = fact.createLine (line, getPaymentAcct(as, line.getC_Payment_ID()),
|
fl = fact.createLine (line, getPaymentAcct(as, line.getC_Payment_ID()),
|
||||||
getC_Currency_ID(), null, line.getAmtSource().negate());
|
getC_Currency_ID(), null, line.getAmtSource().negate());
|
||||||
if (fl != null && payment != null)
|
if (fl != null && payment != null)
|
||||||
fl.setAD_Org_ID(payment.getAD_Org_ID());
|
fl.setAD_Org_ID(payment.getAD_Org_ID());
|
||||||
}
|
}
|
||||||
else if (line.getC_CashLine_ID() != 0)
|
else if (isUsingClearing && line.getC_CashLine_ID() != 0) // Avoid usage of clearing accounts
|
||||||
{
|
{
|
||||||
fl = fact.createLine (line, getCashAcct(as, line.getC_CashLine_ID()),
|
fl = fact.createLine (line, getCashAcct(as, line.getC_CashLine_ID()),
|
||||||
getC_Currency_ID(), null, line.getAmtSource().negate());
|
getC_Currency_ID(), null, line.getAmtSource().negate());
|
||||||
|
|
|
@ -31,6 +31,10 @@ import org.compiere.util.*;
|
||||||
* </pre>
|
* </pre>
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: Doc_Bank.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
|
* @version $Id: Doc_Bank.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
|
||||||
|
*
|
||||||
|
* FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual
|
||||||
|
* Avoid posting if both accounts BankAsset and BankInTransit are equal
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public class Doc_Bank extends Doc
|
public class Doc_Bank extends Doc
|
||||||
{
|
{
|
||||||
|
@ -158,6 +162,35 @@ public class Doc_Bank extends Doc
|
||||||
DocLine_Bank line = (DocLine_Bank)p_lines[i];
|
DocLine_Bank line = (DocLine_Bank)p_lines[i];
|
||||||
int C_BPartner_ID = line.getC_BPartner_ID();
|
int C_BPartner_ID = line.getC_BPartner_ID();
|
||||||
|
|
||||||
|
// Avoid usage of clearing accounts
|
||||||
|
// If both accounts BankAsset and BankInTransit are equal
|
||||||
|
// then remove the posting
|
||||||
|
|
||||||
|
MAccount acct_bank_asset = getAccount(Doc.ACCTTYPE_BankAsset, as);
|
||||||
|
MAccount acct_bank_in_transit = getAccount(Doc.ACCTTYPE_BankInTransit, as);
|
||||||
|
|
||||||
|
if ((!as.isPostIfClearingEqual()) && acct_bank_asset.equals(acct_bank_in_transit)) {
|
||||||
|
// Not using clearing accounts
|
||||||
|
// just post the difference (if any)
|
||||||
|
|
||||||
|
BigDecimal amt_stmt_minus_trx = line.getStmtAmt().subtract(line.getTrxAmt());
|
||||||
|
if (amt_stmt_minus_trx.compareTo(Env.ZERO) != 0) {
|
||||||
|
|
||||||
|
// BankAsset DR CR (Statement minus Payment)
|
||||||
|
fl = fact.createLine(line,
|
||||||
|
getAccount(Doc.ACCTTYPE_BankAsset, as),
|
||||||
|
line.getC_Currency_ID(), amt_stmt_minus_trx);
|
||||||
|
if (fl != null && AD_Org_ID != 0)
|
||||||
|
fl.setAD_Org_ID(AD_Org_ID);
|
||||||
|
if (fl != null && C_BPartner_ID != 0)
|
||||||
|
fl.setC_BPartner_ID(C_BPartner_ID);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Normal Adempiere behavior -- unchanged if using clearing accounts
|
||||||
|
|
||||||
// BankAsset DR CR (Statement)
|
// BankAsset DR CR (Statement)
|
||||||
fl = fact.createLine(line,
|
fl = fact.createLine(line,
|
||||||
getAccount(Doc.ACCTTYPE_BankAsset, as),
|
getAccount(Doc.ACCTTYPE_BankAsset, as),
|
||||||
|
@ -180,6 +213,10 @@ public class Doc_Bank extends Doc
|
||||||
else
|
else
|
||||||
fl.setAD_Org_ID(line.getAD_Org_ID(true)); // from payment
|
fl.setAD_Org_ID(line.getAD_Org_ID(true)); // from payment
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// End Avoid usage of clearing accounts
|
||||||
|
|
||||||
// Charge DR (Charge)
|
// Charge DR (Charge)
|
||||||
fl = fact.createLine(line,
|
fl = fact.createLine(line,
|
||||||
line.getChargeAccount(as, line.getChargeAmt().negate()),
|
line.getChargeAccount(as, line.getChargeAmt().negate()),
|
||||||
|
|
|
@ -31,6 +31,10 @@ import org.compiere.util.*;
|
||||||
* Update Costing Records
|
* Update Costing Records
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: Doc_MatchInv.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
|
* @version $Id: Doc_MatchInv.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
|
||||||
|
*
|
||||||
|
* FR [ 1840016 ] Avoid usage of clearing accounts - subject to C_AcctSchema.IsPostIfClearingEqual
|
||||||
|
* Avoid posting if both accounts Not Invoiced Receipts and Inventory Clearing are equal
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public class Doc_MatchInv extends Doc
|
public class Doc_MatchInv extends Doc
|
||||||
{
|
{
|
||||||
|
@ -221,6 +225,26 @@ public class Doc_MatchInv extends Doc
|
||||||
cr.setUser1_ID(m_invoiceLine.getUser1_ID());
|
cr.setUser1_ID(m_invoiceLine.getUser1_ID());
|
||||||
cr.setUser2_ID(m_invoiceLine.getUser2_ID());
|
cr.setUser2_ID(m_invoiceLine.getUser2_ID());
|
||||||
|
|
||||||
|
// Avoid usage of clearing accounts
|
||||||
|
// If both accounts Not Invoiced Receipts and Inventory Clearing are equal
|
||||||
|
// then remove the posting
|
||||||
|
|
||||||
|
MAccount acct_db = dr.getAccount(); // not_invoiced_receipts
|
||||||
|
MAccount acct_cr = cr.getAccount(); // inventory_clearing
|
||||||
|
|
||||||
|
if ((!as.isPostIfClearingEqual()) && acct_db.equals(acct_cr)) {
|
||||||
|
|
||||||
|
BigDecimal debit = dr.getAmtSourceDr();
|
||||||
|
BigDecimal credit = cr.getAmtSourceCr();
|
||||||
|
|
||||||
|
if (debit.compareTo(credit) == 0) {
|
||||||
|
fact.remove(dr);
|
||||||
|
fact.remove(cr);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// End Avoid usage of clearing accounts
|
||||||
|
|
||||||
|
|
||||||
// Invoice Price Variance difference
|
// Invoice Price Variance difference
|
||||||
BigDecimal ipv = cr.getAcctBalance().add(dr.getAcctBalance()).negate();
|
BigDecimal ipv = cr.getAcctBalance().add(dr.getAcctBalance()).negate();
|
||||||
|
|
|
@ -32,14 +32,12 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.compiere.model;
|
package org.compiere.model;
|
||||||
|
|
||||||
import java.util.*;
|
import java.math.BigDecimal;
|
||||||
import java.sql.Timestamp;
|
import org.compiere.util.KeyNamePair;
|
||||||
import java.math.*;
|
|
||||||
import org.compiere.util.*;
|
|
||||||
|
|
||||||
/** Generated Interface for C_AcctSchema
|
/** Generated Interface for C_AcctSchema
|
||||||
* @author Trifon Trifonov (generated)
|
* @author Trifon Trifonov (generated)
|
||||||
* @version Release 3.3.0 - 2007-08-24 11:39:36.406
|
* @version Release 3.3.0
|
||||||
*/
|
*/
|
||||||
public interface I_C_AcctSchema
|
public interface I_C_AcctSchema
|
||||||
{
|
{
|
||||||
|
@ -54,7 +52,7 @@ import org.compiere.util.*;
|
||||||
|
|
||||||
/** AccessLevel = 2 - Client
|
/** AccessLevel = 2 - Client
|
||||||
*/
|
*/
|
||||||
BigDecimal accessLevel = new BigDecimal(2);
|
BigDecimal accessLevel = BigDecimal.valueOf(2);
|
||||||
|
|
||||||
/** Load Meta Data */
|
/** Load Meta Data */
|
||||||
|
|
||||||
|
@ -110,7 +108,7 @@ import org.compiere.util.*;
|
||||||
*/
|
*/
|
||||||
public int getC_Currency_ID();
|
public int getC_Currency_ID();
|
||||||
|
|
||||||
public I_C_Currency getI_C_Currency() throws Exception;
|
public I_C_Currency getC_Currency() throws Exception;
|
||||||
|
|
||||||
/** Column name C_Period_ID */
|
/** Column name C_Period_ID */
|
||||||
public static final String COLUMNNAME_C_Period_ID = "C_Period_ID";
|
public static final String COLUMNNAME_C_Period_ID = "C_Period_ID";
|
||||||
|
@ -125,7 +123,7 @@ import org.compiere.util.*;
|
||||||
*/
|
*/
|
||||||
public int getC_Period_ID();
|
public int getC_Period_ID();
|
||||||
|
|
||||||
public I_C_Period getI_C_Period() throws Exception;
|
public I_C_Period getC_Period() throws Exception;
|
||||||
|
|
||||||
/** Column name CommitmentType */
|
/** Column name CommitmentType */
|
||||||
public static final String COLUMNNAME_CommitmentType = "CommitmentType";
|
public static final String COLUMNNAME_CommitmentType = "CommitmentType";
|
||||||
|
@ -283,6 +281,19 @@ import org.compiere.util.*;
|
||||||
*/
|
*/
|
||||||
public boolean isExplicitCostAdjustment();
|
public boolean isExplicitCostAdjustment();
|
||||||
|
|
||||||
|
/** Column name IsPostIfClearingEqual */
|
||||||
|
public static final String COLUMNNAME_IsPostIfClearingEqual = "IsPostIfClearingEqual";
|
||||||
|
|
||||||
|
/** Set Post if Clearing Equal.
|
||||||
|
* This flag controls if Adempiere must post when clearing (transit) and final accounts are the same
|
||||||
|
*/
|
||||||
|
public void setIsPostIfClearingEqual (boolean IsPostIfClearingEqual);
|
||||||
|
|
||||||
|
/** Get Post if Clearing Equal.
|
||||||
|
* This flag controls if Adempiere must post when clearing (transit) and final accounts are the same
|
||||||
|
*/
|
||||||
|
public boolean isPostIfClearingEqual();
|
||||||
|
|
||||||
/** Column name IsPostServices */
|
/** Column name IsPostServices */
|
||||||
public static final String COLUMNNAME_IsPostServices = "IsPostServices";
|
public static final String COLUMNNAME_IsPostServices = "IsPostServices";
|
||||||
|
|
||||||
|
@ -322,7 +333,7 @@ import org.compiere.util.*;
|
||||||
*/
|
*/
|
||||||
public int getM_CostType_ID();
|
public int getM_CostType_ID();
|
||||||
|
|
||||||
public I_M_CostType getI_M_CostType() throws Exception;
|
public I_M_CostType getM_CostType() throws Exception;
|
||||||
|
|
||||||
/** Column name Name */
|
/** Column name Name */
|
||||||
public static final String COLUMNNAME_Name = "Name";
|
public static final String COLUMNNAME_Name = "Name";
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
/** Generated Model - DO NOT CHANGE */
|
/** Generated Model - DO NOT CHANGE */
|
||||||
package org.compiere.model;
|
package org.compiere.model;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.sql.*;
|
|
||||||
import java.math.*;
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.util.Properties;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.KeyNamePair;
|
||||||
|
|
||||||
/** Generated Model for C_AcctSchema
|
/** Generated Model for C_AcctSchema
|
||||||
* @author Adempiere (generated)
|
* @author Adempiere (generated)
|
||||||
|
@ -39,7 +38,9 @@ public class X_C_AcctSchema extends PO implements I_C_AcctSchema, I_Persistent
|
||||||
public X_C_AcctSchema (Properties ctx, int C_AcctSchema_ID, String trxName)
|
public X_C_AcctSchema (Properties ctx, int C_AcctSchema_ID, String trxName)
|
||||||
{
|
{
|
||||||
super (ctx, C_AcctSchema_ID, trxName);
|
super (ctx, C_AcctSchema_ID, trxName);
|
||||||
/** if (C_AcctSchema_ID == 0) { setAutoPeriodControl (false);
|
/** if (C_AcctSchema_ID == 0)
|
||||||
|
{
|
||||||
|
setAutoPeriodControl (false);
|
||||||
setC_AcctSchema_ID (0);
|
setC_AcctSchema_ID (0);
|
||||||
setC_Currency_ID (0);
|
setC_Currency_ID (0);
|
||||||
setCommitmentType (null);
|
setCommitmentType (null);
|
||||||
|
@ -104,7 +105,8 @@ public static final int AD_ORGONLY_ID_AD_Reference_ID=322;
|
||||||
*/
|
*/
|
||||||
public void setAD_OrgOnly_ID (int AD_OrgOnly_ID)
|
public void setAD_OrgOnly_ID (int AD_OrgOnly_ID)
|
||||||
{
|
{
|
||||||
if (AD_OrgOnly_ID <= 0) set_Value (COLUMNNAME_AD_OrgOnly_ID, null);
|
if (AD_OrgOnly_ID <= 0)
|
||||||
|
set_Value (COLUMNNAME_AD_OrgOnly_ID, null);
|
||||||
else
|
else
|
||||||
set_Value (COLUMNNAME_AD_OrgOnly_ID, Integer.valueOf(AD_OrgOnly_ID));
|
set_Value (COLUMNNAME_AD_OrgOnly_ID, Integer.valueOf(AD_OrgOnly_ID));
|
||||||
}
|
}
|
||||||
|
@ -166,7 +168,7 @@ public static final int AD_ORGONLY_ID_AD_Reference_ID=322;
|
||||||
return ii.intValue();
|
return ii.intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public I_C_Currency getI_C_Currency() throws Exception
|
public I_C_Currency getC_Currency() throws Exception
|
||||||
{
|
{
|
||||||
Class<?> clazz = MTable.getClass(I_C_Currency.Table_Name);
|
Class<?> clazz = MTable.getClass(I_C_Currency.Table_Name);
|
||||||
I_C_Currency result = null;
|
I_C_Currency result = null;
|
||||||
|
@ -204,7 +206,7 @@ public static final int AD_ORGONLY_ID_AD_Reference_ID=322;
|
||||||
return ii.intValue();
|
return ii.intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public I_C_Period getI_C_Period() throws Exception
|
public I_C_Period getC_Period() throws Exception
|
||||||
{
|
{
|
||||||
Class<?> clazz = MTable.getClass(I_C_Period.Table_Name);
|
Class<?> clazz = MTable.getClass(I_C_Period.Table_Name);
|
||||||
I_C_Period result = null;
|
I_C_Period result = null;
|
||||||
|
@ -226,7 +228,8 @@ public static final int AD_ORGONLY_ID_AD_Reference_ID=322;
|
||||||
*/
|
*/
|
||||||
public void setC_Period_ID (int C_Period_ID)
|
public void setC_Period_ID (int C_Period_ID)
|
||||||
{
|
{
|
||||||
if (C_Period_ID <= 0) set_ValueNoCheck (COLUMNNAME_C_Period_ID, null);
|
if (C_Period_ID <= 0)
|
||||||
|
set_ValueNoCheck (COLUMNNAME_C_Period_ID, null);
|
||||||
else
|
else
|
||||||
set_ValueNoCheck (COLUMNNAME_C_Period_ID, Integer.valueOf(C_Period_ID));
|
set_ValueNoCheck (COLUMNNAME_C_Period_ID, Integer.valueOf(C_Period_ID));
|
||||||
}
|
}
|
||||||
|
@ -243,9 +246,12 @@ public static final int AD_ORGONLY_ID_AD_Reference_ID=322;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** CommitmentType AD_Reference_ID=359 */
|
/** CommitmentType AD_Reference_ID=359 */
|
||||||
public static final int COMMITMENTTYPE_AD_Reference_ID=359;/** Commitment & Reservation = B */
|
public static final int COMMITMENTTYPE_AD_Reference_ID=359;
|
||||||
public static final String COMMITMENTTYPE_CommitmentReservation = "B";/** Commitment only = C */
|
/** Commitment only = C */
|
||||||
public static final String COMMITMENTTYPE_CommitmentOnly = "C";/** None = N */
|
public static final String COMMITMENTTYPE_CommitmentOnly = "C";
|
||||||
|
/** Commitment & Reservation = B */
|
||||||
|
public static final String COMMITMENTTYPE_CommitmentReservation = "B";
|
||||||
|
/** None = N */
|
||||||
public static final String COMMITMENTTYPE_None = "N";
|
public static final String COMMITMENTTYPE_None = "N";
|
||||||
/** Set Commitment Type.
|
/** Set Commitment Type.
|
||||||
@param CommitmentType
|
@param CommitmentType
|
||||||
|
@ -253,10 +259,12 @@ public static final String COMMITMENTTYPE_None = "N";
|
||||||
*/
|
*/
|
||||||
public void setCommitmentType (String CommitmentType)
|
public void setCommitmentType (String CommitmentType)
|
||||||
{
|
{
|
||||||
if (CommitmentType == null) throw new IllegalArgumentException ("CommitmentType is mandatory");if (CommitmentType.equals("B") || CommitmentType.equals("C") || CommitmentType.equals("N")); else throw new IllegalArgumentException ("CommitmentType Invalid value - " + CommitmentType + " - Reference_ID=359 - B - C - N"); if (CommitmentType.length() > 1)
|
if (CommitmentType == null) throw new IllegalArgumentException ("CommitmentType is mandatory");
|
||||||
|
if (CommitmentType.equals("C") || CommitmentType.equals("B") || CommitmentType.equals("N")); else throw new IllegalArgumentException ("CommitmentType Invalid value - " + CommitmentType + " - Reference_ID=359 - C - B - N");
|
||||||
|
if (CommitmentType.length() > 1)
|
||||||
{
|
{
|
||||||
log.warning("Length > 1 - truncated");
|
log.warning("Length > 1 - truncated");
|
||||||
CommitmentType = CommitmentType.substring(0, 0);
|
CommitmentType = CommitmentType.substring(0, 1);
|
||||||
}
|
}
|
||||||
set_Value (COLUMNNAME_CommitmentType, CommitmentType);
|
set_Value (COLUMNNAME_CommitmentType, CommitmentType);
|
||||||
}
|
}
|
||||||
|
@ -270,20 +278,25 @@ if (CommitmentType == null) throw new IllegalArgumentException ("CommitmentType
|
||||||
}
|
}
|
||||||
|
|
||||||
/** CostingLevel AD_Reference_ID=355 */
|
/** CostingLevel AD_Reference_ID=355 */
|
||||||
public static final int COSTINGLEVEL_AD_Reference_ID=355;/** Batch/Lot = B */
|
public static final int COSTINGLEVEL_AD_Reference_ID=355;
|
||||||
public static final String COSTINGLEVEL_BatchLot = "B";/** Client = C */
|
/** Client = C */
|
||||||
public static final String COSTINGLEVEL_Client = "C";/** Organization = O */
|
public static final String COSTINGLEVEL_Client = "C";
|
||||||
|
/** Organization = O */
|
||||||
public static final String COSTINGLEVEL_Organization = "O";
|
public static final String COSTINGLEVEL_Organization = "O";
|
||||||
|
/** Batch/Lot = B */
|
||||||
|
public static final String COSTINGLEVEL_BatchLot = "B";
|
||||||
/** Set Costing Level.
|
/** Set Costing Level.
|
||||||
@param CostingLevel
|
@param CostingLevel
|
||||||
The lowest level to accumulate Costing Information
|
The lowest level to accumulate Costing Information
|
||||||
*/
|
*/
|
||||||
public void setCostingLevel (String CostingLevel)
|
public void setCostingLevel (String CostingLevel)
|
||||||
{
|
{
|
||||||
if (CostingLevel == null) throw new IllegalArgumentException ("CostingLevel is mandatory");if (CostingLevel.equals("B") || CostingLevel.equals("C") || CostingLevel.equals("O")); else throw new IllegalArgumentException ("CostingLevel Invalid value - " + CostingLevel + " - Reference_ID=355 - B - C - O"); if (CostingLevel.length() > 1)
|
if (CostingLevel == null) throw new IllegalArgumentException ("CostingLevel is mandatory");
|
||||||
|
if (CostingLevel.equals("C") || CostingLevel.equals("O") || CostingLevel.equals("B")); else throw new IllegalArgumentException ("CostingLevel Invalid value - " + CostingLevel + " - Reference_ID=355 - C - O - B");
|
||||||
|
if (CostingLevel.length() > 1)
|
||||||
{
|
{
|
||||||
log.warning("Length > 1 - truncated");
|
log.warning("Length > 1 - truncated");
|
||||||
CostingLevel = CostingLevel.substring(0, 0);
|
CostingLevel = CostingLevel.substring(0, 1);
|
||||||
}
|
}
|
||||||
set_Value (COLUMNNAME_CostingLevel, CostingLevel);
|
set_Value (COLUMNNAME_CostingLevel, CostingLevel);
|
||||||
}
|
}
|
||||||
|
@ -297,15 +310,24 @@ if (CostingLevel == null) throw new IllegalArgumentException ("CostingLevel is m
|
||||||
}
|
}
|
||||||
|
|
||||||
/** CostingMethod AD_Reference_ID=122 */
|
/** CostingMethod AD_Reference_ID=122 */
|
||||||
public static final int COSTINGMETHOD_AD_Reference_ID=122;/** Average PO = A */
|
public static final int COSTINGMETHOD_AD_Reference_ID=122;
|
||||||
public static final String COSTINGMETHOD_AveragePO = "A";/** Fifo = F */
|
/** Standard Costing = S */
|
||||||
public static final String COSTINGMETHOD_Fifo = "F";/** Average Invoice = I */
|
public static final String COSTINGMETHOD_StandardCosting = "S";
|
||||||
public static final String COSTINGMETHOD_AverageInvoice = "I";/** Lifo = L */
|
/** Average PO = A */
|
||||||
public static final String COSTINGMETHOD_Lifo = "L";/** Standard Costing = S */
|
public static final String COSTINGMETHOD_AveragePO = "A";
|
||||||
public static final String COSTINGMETHOD_StandardCosting = "S";/** User Defined = U */
|
/** Lifo = L */
|
||||||
public static final String COSTINGMETHOD_UserDefined = "U";/** Last Invoice = i */
|
public static final String COSTINGMETHOD_Lifo = "L";
|
||||||
public static final String COSTINGMETHOD_LastInvoice = "i";/** Last PO Price = p */
|
/** Fifo = F */
|
||||||
public static final String COSTINGMETHOD_LastPOPrice = "p";/** _ = x */
|
public static final String COSTINGMETHOD_Fifo = "F";
|
||||||
|
/** Last PO Price = p */
|
||||||
|
public static final String COSTINGMETHOD_LastPOPrice = "p";
|
||||||
|
/** Average Invoice = I */
|
||||||
|
public static final String COSTINGMETHOD_AverageInvoice = "I";
|
||||||
|
/** Last Invoice = i */
|
||||||
|
public static final String COSTINGMETHOD_LastInvoice = "i";
|
||||||
|
/** User Defined = U */
|
||||||
|
public static final String COSTINGMETHOD_UserDefined = "U";
|
||||||
|
/** _ = x */
|
||||||
public static final String COSTINGMETHOD__ = "x";
|
public static final String COSTINGMETHOD__ = "x";
|
||||||
/** Set Costing Method.
|
/** Set Costing Method.
|
||||||
@param CostingMethod
|
@param CostingMethod
|
||||||
|
@ -313,10 +335,12 @@ public static final String COSTINGMETHOD__ = "x";
|
||||||
*/
|
*/
|
||||||
public void setCostingMethod (String CostingMethod)
|
public void setCostingMethod (String CostingMethod)
|
||||||
{
|
{
|
||||||
if (CostingMethod == null) throw new IllegalArgumentException ("CostingMethod is mandatory");if (CostingMethod.equals("A") || CostingMethod.equals("F") || CostingMethod.equals("I") || CostingMethod.equals("L") || CostingMethod.equals("S") || CostingMethod.equals("U") || CostingMethod.equals("i") || CostingMethod.equals("p") || CostingMethod.equals("x")); else throw new IllegalArgumentException ("CostingMethod Invalid value - " + CostingMethod + " - Reference_ID=122 - A - F - I - L - S - U - i - p - x"); if (CostingMethod.length() > 1)
|
if (CostingMethod == null) throw new IllegalArgumentException ("CostingMethod is mandatory");
|
||||||
|
if (CostingMethod.equals("S") || CostingMethod.equals("A") || CostingMethod.equals("L") || CostingMethod.equals("F") || CostingMethod.equals("p") || CostingMethod.equals("I") || CostingMethod.equals("i") || CostingMethod.equals("U") || CostingMethod.equals("x")); else throw new IllegalArgumentException ("CostingMethod Invalid value - " + CostingMethod + " - Reference_ID=122 - S - A - L - F - p - I - i - U - x");
|
||||||
|
if (CostingMethod.length() > 1)
|
||||||
{
|
{
|
||||||
log.warning("Length > 1 - truncated");
|
log.warning("Length > 1 - truncated");
|
||||||
CostingMethod = CostingMethod.substring(0, 0);
|
CostingMethod = CostingMethod.substring(0, 1);
|
||||||
}
|
}
|
||||||
set_Value (COLUMNNAME_CostingMethod, CostingMethod);
|
set_Value (COLUMNNAME_CostingMethod, CostingMethod);
|
||||||
}
|
}
|
||||||
|
@ -335,10 +359,11 @@ if (CostingMethod == null) throw new IllegalArgumentException ("CostingMethod is
|
||||||
*/
|
*/
|
||||||
public void setDescription (String Description)
|
public void setDescription (String Description)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Description != null && Description.length() > 255)
|
if (Description != null && Description.length() > 255)
|
||||||
{
|
{
|
||||||
log.warning("Length > 255 - truncated");
|
log.warning("Length > 255 - truncated");
|
||||||
Description = Description.substring(0, 254);
|
Description = Description.substring(0, 255);
|
||||||
}
|
}
|
||||||
set_Value (COLUMNNAME_Description, Description);
|
set_Value (COLUMNNAME_Description, Description);
|
||||||
}
|
}
|
||||||
|
@ -352,11 +377,16 @@ if (CostingMethod == null) throw new IllegalArgumentException ("CostingMethod is
|
||||||
}
|
}
|
||||||
|
|
||||||
/** GAAP AD_Reference_ID=123 */
|
/** GAAP AD_Reference_ID=123 */
|
||||||
public static final int GAAP_AD_Reference_ID=123;/** German HGB = DE */
|
public static final int GAAP_AD_Reference_ID=123;
|
||||||
public static final String GAAP_GermanHGB = "DE";/** French Accounting Standard = FR */
|
/** International GAAP = UN */
|
||||||
public static final String GAAP_FrenchAccountingStandard = "FR";/** International GAAP = UN */
|
public static final String GAAP_InternationalGAAP = "UN";
|
||||||
public static final String GAAP_InternationalGAAP = "UN";/** US GAAP = US */
|
/** US GAAP = US */
|
||||||
public static final String GAAP_USGAAP = "US";/** Custom Accounting Rules = XX */
|
public static final String GAAP_USGAAP = "US";
|
||||||
|
/** German HGB = DE */
|
||||||
|
public static final String GAAP_GermanHGB = "DE";
|
||||||
|
/** French Accounting Standard = FR */
|
||||||
|
public static final String GAAP_FrenchAccountingStandard = "FR";
|
||||||
|
/** Custom Accounting Rules = XX */
|
||||||
public static final String GAAP_CustomAccountingRules = "XX";
|
public static final String GAAP_CustomAccountingRules = "XX";
|
||||||
/** Set GAAP.
|
/** Set GAAP.
|
||||||
@param GAAP
|
@param GAAP
|
||||||
|
@ -364,10 +394,12 @@ public static final String GAAP_CustomAccountingRules = "XX";
|
||||||
*/
|
*/
|
||||||
public void setGAAP (String GAAP)
|
public void setGAAP (String GAAP)
|
||||||
{
|
{
|
||||||
if (GAAP == null) throw new IllegalArgumentException ("GAAP is mandatory");if (GAAP.equals("DE") || GAAP.equals("FR") || GAAP.equals("UN") || GAAP.equals("US") || GAAP.equals("XX")); else throw new IllegalArgumentException ("GAAP Invalid value - " + GAAP + " - Reference_ID=123 - DE - FR - UN - US - XX"); if (GAAP.length() > 2)
|
if (GAAP == null) throw new IllegalArgumentException ("GAAP is mandatory");
|
||||||
|
if (GAAP.equals("UN") || GAAP.equals("US") || GAAP.equals("DE") || GAAP.equals("FR") || GAAP.equals("XX")); else throw new IllegalArgumentException ("GAAP Invalid value - " + GAAP + " - Reference_ID=123 - UN - US - DE - FR - XX");
|
||||||
|
if (GAAP.length() > 2)
|
||||||
{
|
{
|
||||||
log.warning("Length > 2 - truncated");
|
log.warning("Length > 2 - truncated");
|
||||||
GAAP = GAAP.substring(0, 1);
|
GAAP = GAAP.substring(0, 2);
|
||||||
}
|
}
|
||||||
set_Value (COLUMNNAME_GAAP, GAAP);
|
set_Value (COLUMNNAME_GAAP, GAAP);
|
||||||
}
|
}
|
||||||
|
@ -548,6 +580,30 @@ if (GAAP == null) throw new IllegalArgumentException ("GAAP is mandatory");if (G
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Set Post if Clearing Equal.
|
||||||
|
@param IsPostIfClearingEqual
|
||||||
|
This flag controls if Adempiere must post when clearing (transit) and final accounts are the same
|
||||||
|
*/
|
||||||
|
public void setIsPostIfClearingEqual (boolean IsPostIfClearingEqual)
|
||||||
|
{
|
||||||
|
set_Value (COLUMNNAME_IsPostIfClearingEqual, Boolean.valueOf(IsPostIfClearingEqual));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Get Post if Clearing Equal.
|
||||||
|
@return This flag controls if Adempiere must post when clearing (transit) and final accounts are the same
|
||||||
|
*/
|
||||||
|
public boolean isPostIfClearingEqual ()
|
||||||
|
{
|
||||||
|
Object oo = get_Value(COLUMNNAME_IsPostIfClearingEqual);
|
||||||
|
if (oo != null)
|
||||||
|
{
|
||||||
|
if (oo instanceof Boolean)
|
||||||
|
return ((Boolean)oo).booleanValue();
|
||||||
|
return "Y".equals(oo);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/** Set Post Services Separately.
|
/** Set Post Services Separately.
|
||||||
@param IsPostServices
|
@param IsPostServices
|
||||||
Differentiate between Services and Product Receivable/Payables
|
Differentiate between Services and Product Receivable/Payables
|
||||||
|
@ -596,7 +652,7 @@ if (GAAP == null) throw new IllegalArgumentException ("GAAP is mandatory");if (G
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public I_M_CostType getI_M_CostType() throws Exception
|
public I_M_CostType getM_CostType() throws Exception
|
||||||
{
|
{
|
||||||
Class<?> clazz = MTable.getClass(I_M_CostType.Table_Name);
|
Class<?> clazz = MTable.getClass(I_M_CostType.Table_Name);
|
||||||
I_M_CostType result = null;
|
I_M_CostType result = null;
|
||||||
|
@ -642,10 +698,11 @@ if (GAAP == null) throw new IllegalArgumentException ("GAAP is mandatory");if (G
|
||||||
{
|
{
|
||||||
if (Name == null)
|
if (Name == null)
|
||||||
throw new IllegalArgumentException ("Name is mandatory.");
|
throw new IllegalArgumentException ("Name is mandatory.");
|
||||||
|
|
||||||
if (Name.length() > 60)
|
if (Name.length() > 60)
|
||||||
{
|
{
|
||||||
log.warning("Length > 60 - truncated");
|
log.warning("Length > 60 - truncated");
|
||||||
Name = Name.substring(0, 59);
|
Name = Name.substring(0, 60);
|
||||||
}
|
}
|
||||||
set_Value (COLUMNNAME_Name, Name);
|
set_Value (COLUMNNAME_Name, Name);
|
||||||
}
|
}
|
||||||
|
@ -735,10 +792,11 @@ if (GAAP == null) throw new IllegalArgumentException ("GAAP is mandatory");if (G
|
||||||
{
|
{
|
||||||
if (Separator == null)
|
if (Separator == null)
|
||||||
throw new IllegalArgumentException ("Separator is mandatory.");
|
throw new IllegalArgumentException ("Separator is mandatory.");
|
||||||
|
|
||||||
if (Separator.length() > 1)
|
if (Separator.length() > 1)
|
||||||
{
|
{
|
||||||
log.warning("Length > 1 - truncated");
|
log.warning("Length > 1 - truncated");
|
||||||
Separator = Separator.substring(0, 0);
|
Separator = Separator.substring(0, 1);
|
||||||
}
|
}
|
||||||
set_Value (COLUMNNAME_Separator, Separator);
|
set_Value (COLUMNNAME_Separator, Separator);
|
||||||
}
|
}
|
||||||
|
@ -752,21 +810,27 @@ if (GAAP == null) throw new IllegalArgumentException ("GAAP is mandatory");if (G
|
||||||
}
|
}
|
||||||
|
|
||||||
/** TaxCorrectionType AD_Reference_ID=392 */
|
/** TaxCorrectionType AD_Reference_ID=392 */
|
||||||
public static final int TAXCORRECTIONTYPE_AD_Reference_ID=392;/** Write-off and Discount = B */
|
public static final int TAXCORRECTIONTYPE_AD_Reference_ID=392;
|
||||||
public static final String TAXCORRECTIONTYPE_Write_OffAndDiscount = "B";/** Discount only = D */
|
/** None = N */
|
||||||
public static final String TAXCORRECTIONTYPE_DiscountOnly = "D";/** None = N */
|
public static final String TAXCORRECTIONTYPE_None = "N";
|
||||||
public static final String TAXCORRECTIONTYPE_None = "N";/** Write-off only = W */
|
/** Write-off only = W */
|
||||||
public static final String TAXCORRECTIONTYPE_Write_OffOnly = "W";
|
public static final String TAXCORRECTIONTYPE_Write_OffOnly = "W";
|
||||||
|
/** Discount only = D */
|
||||||
|
public static final String TAXCORRECTIONTYPE_DiscountOnly = "D";
|
||||||
|
/** Write-off and Discount = B */
|
||||||
|
public static final String TAXCORRECTIONTYPE_Write_OffAndDiscount = "B";
|
||||||
/** Set Tax Correction.
|
/** Set Tax Correction.
|
||||||
@param TaxCorrectionType
|
@param TaxCorrectionType
|
||||||
Type of Tax Correction
|
Type of Tax Correction
|
||||||
*/
|
*/
|
||||||
public void setTaxCorrectionType (String TaxCorrectionType)
|
public void setTaxCorrectionType (String TaxCorrectionType)
|
||||||
{
|
{
|
||||||
if (TaxCorrectionType == null) throw new IllegalArgumentException ("TaxCorrectionType is mandatory");if (TaxCorrectionType.equals("B") || TaxCorrectionType.equals("D") || TaxCorrectionType.equals("N") || TaxCorrectionType.equals("W")); else throw new IllegalArgumentException ("TaxCorrectionType Invalid value - " + TaxCorrectionType + " - Reference_ID=392 - B - D - N - W"); if (TaxCorrectionType.length() > 1)
|
if (TaxCorrectionType == null) throw new IllegalArgumentException ("TaxCorrectionType is mandatory");
|
||||||
|
if (TaxCorrectionType.equals("N") || TaxCorrectionType.equals("W") || TaxCorrectionType.equals("D") || TaxCorrectionType.equals("B")); else throw new IllegalArgumentException ("TaxCorrectionType Invalid value - " + TaxCorrectionType + " - Reference_ID=392 - N - W - D - B");
|
||||||
|
if (TaxCorrectionType.length() > 1)
|
||||||
{
|
{
|
||||||
log.warning("Length > 1 - truncated");
|
log.warning("Length > 1 - truncated");
|
||||||
TaxCorrectionType = TaxCorrectionType.substring(0, 0);
|
TaxCorrectionType = TaxCorrectionType.substring(0, 1);
|
||||||
}
|
}
|
||||||
set_Value (COLUMNNAME_TaxCorrectionType, TaxCorrectionType);
|
set_Value (COLUMNNAME_TaxCorrectionType, TaxCorrectionType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
-- Nov 27, 2007 11:00:14 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53227,0,'IsPostIfClearingEqual',TO_DATE('2007-11-27 23:00:10','YYYY-MM-DD HH24:MI:SS'),100,'This flag controls if Adempiere must post when clearing (transit) and final accounts are the same','D',NULL,'Y','Post if Clearing Equal','Post if Clearing Equal',TO_DATE('2007-11-27 23:00:10','YYYY-MM-DD HH24:MI:SS'),100)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:16 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
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=53227 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_Column SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Element_ID=53227
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_Field SET Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=53227) AND IsCentrallyMaintained='Y'
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_Process_Para SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL, AD_Element_ID=53227 WHERE UPPER(ColumnName)='ISPOSTIFCLEARINGEQUAL' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_Process_Para SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Element_ID=53227 AND IsCentrallyMaintained='Y'
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_PrintFormatItem pi SET PrintName='Post if Clearing Equal', Name='Post if Clearing Equal' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=53227)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:46 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_PrintFormatItem pi SET PrintName='Post if Clearing Equal', Name='Post if Clearing Equal' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=53227)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:01:30 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
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,53266,53227,0,20,265,'IsPostIfClearingEqual',TO_DATE('2007-11-27 23:01:29','YYYY-MM-DD HH24:MI:SS'),100,'Y','This flag controls if Adempiere must post when clearing (transit) and final accounts are the same','D',1,'Y','N','N','N','N','N','N','N','N','N','Y','Post if Clearing Equal',0,TO_DATE('2007-11-27 23:01:29','YYYY-MM-DD HH24:MI:SS'),100,0)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:01:30 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
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=53266 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:01:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
ALTER TABLE C_AcctSchema ADD IsPostIfClearingEqual CHAR(1) DEFAULT 'Y' CHECK (IsPostIfClearingEqual IN ('Y','N'))
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:07:24 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,53266,53281,0,199,TO_DATE('2007-11-27 23:07:22','YYYY-MM-DD HH24:MI:SS'),100,'This flag controls if Adempiere must post when clearing (transit) and final accounts are the same',1,'D','Y','Y','Y','N','N','N','N','Y','Post if Clearing Equal',270,TO_DATE('2007-11-27 23:07:22','YYYY-MM-DD HH24:MI:SS'),100)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:07:24 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
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=53281 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
|
||||||
|
/
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
-- Nov 27, 2007 11:00:15 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53227,0,'IsPostIfClearingEqual',TO_TIMESTAMP('2007-11-27 23:00:10','YYYY-MM-DD HH24:MI:SS'),100,'This flag controls if Adempiere must post when clearing (transit) and final accounts are the same','D',NULL,'Y','Post if Clearing Equal','Post if Clearing Equal',TO_TIMESTAMP('2007-11-27 23:00:10','YYYY-MM-DD HH24:MI:SS'),100)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:16 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
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=53227 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_Column SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Element_ID=53227
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_Field SET Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=53227) AND IsCentrallyMaintained='Y'
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_Process_Para SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL, AD_Element_ID=53227 WHERE UPPER(ColumnName)='ISPOSTIFCLEARINGEQUAL' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_Process_Para SET ColumnName='IsPostIfClearingEqual', Name='Post if Clearing Equal', Description='This flag controls if Adempiere must post when clearing (transit) and final accounts are the same', Help=NULL WHERE AD_Element_ID=53227 AND IsCentrallyMaintained='Y'
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_PrintFormatItem SET PrintName='Post if Clearing Equal', Name='Post if Clearing Equal' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=53227)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:00:46 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
UPDATE AD_PrintFormatItem SET PrintName='Post if Clearing Equal', Name='Post if Clearing Equal' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=53227)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:01:30 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
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,53266,53227,0,20,265,'IsPostIfClearingEqual',TO_TIMESTAMP('2007-11-27 23:01:29','YYYY-MM-DD HH24:MI:SS'),100,'Y','This flag controls if Adempiere must post when clearing (transit) and final accounts are the same','D',1,'Y','N','N','N','N','N','N','N','N','N','Y','Post if Clearing Equal',0,TO_TIMESTAMP('2007-11-27 23:01:29','YYYY-MM-DD HH24:MI:SS'),100,0)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:01:30 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
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=53266 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:01:45 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
ALTER TABLE C_AcctSchema ADD COLUMN IsPostIfClearingEqual CHAR(1) DEFAULT 'Y' CHECK (IsPostIfClearingEqual IN ('Y','N'))
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:07:24 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy) VALUES (0,53266,53281,0,199,TO_TIMESTAMP('2007-11-27 23:07:22','YYYY-MM-DD HH24:MI:SS'),100,'This flag controls if Adempiere must post when clearing (transit) and final accounts are the same',1,'D','Y','Y','Y','N','N','N','N','Y','Post if Clearing Equal',270,TO_TIMESTAMP('2007-11-27 23:07:22','YYYY-MM-DD HH24:MI:SS'),100)
|
||||||
|
/
|
||||||
|
|
||||||
|
-- Nov 27, 2007 11:07:24 PM COT
|
||||||
|
-- FR 1840016 - Avoid usage of clearing accounts
|
||||||
|
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=53281 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID)
|
||||||
|
/
|
||||||
|
|
Loading…
Reference in New Issue