/** * Check if ASI is mandatory * * @param isSOTrx is outgoing trx? * @return true if ASI is mandatory, false otherwise */ public boolean isASIMandatory(boolean isSOTrx, int AD_Org_ID) { // // If CostingLevel is BatchLot ASI is always mandatory - check all client acct schemas MAcctSchema[] mass = MAcctSchema.getClientAcctSchema(getCtx(), getAD_Client_ID(), get_TrxName()); for (MAcctSchema as : mass) { // String cl = getCostingLevel(as,AD_Org_ID); String cl = getCostingLevel(as); if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(cl)) { return true; } } // // Check Attribute Set settings int M_AttributeSet_ID = getM_AttributeSet_ID(); if (M_AttributeSet_ID != 0) { MAttributeSet mas = MAttributeSet.get(getCtx(), M_AttributeSet_ID); if (mas == null || !mas.isInstanceAttribute()) return false; // Outgoing transaction else if (isSOTrx) return mas.isMandatory(); // Incoming transaction else // isSOTrx == false return mas.isMandatoryAlways(); } // // Default not mandatory return false; }
/** * Has the Product Instance Attribute * * @return true if instance attributes */ public boolean isInstanceAttribute() { if (getM_AttributeSet_ID() == 0) return false; MAttributeSet mas = MAttributeSet.get(getCtx(), getM_AttributeSet_ID()); return mas.isInstanceAttribute(); } // isInstanceAttribute
/** * Get Attribute Set * * @return set or null */ public MAttributeSet getAttributeSet() { if (getM_AttributeSet_ID() != 0) return MAttributeSet.get(getCtx(), getM_AttributeSet_ID()); return null; } // getAttributeSet