Ejemplo n.º 1
0
  public static MTransaction get(MInOutLine line, int M_ASI_ID) {
    final String whereClause =
        I_M_InOutLine.COLUMNNAME_M_Product_ID
            + "=? AND "
            + I_M_InOutLine.COLUMNNAME_M_InOutLine_ID
            + "=? AND "
            + I_M_InOutLine.COLUMNNAME_M_AttributeSetInstance_ID
            + "=?";

    return new Query(line.getCtx(), Table_Name, whereClause, line.get_TrxName())
        .setClient_ID()
        .setParameters(line.getM_Product_ID(), line.getM_InOutLine_ID(), M_ASI_ID)
        .firstOnly();
  }
Ejemplo n.º 2
0
  /**
   * get all material transaction for MInOutLine
   *
   * @param line MInOutLine
   * @return List the MTransaction
   */
  public static List<MTransaction> getByInOutLine(MInOutLine line) {
    ArrayList<MTransaction> transactions = new ArrayList();

    List<MInOutLineMA> lines =
        MInOutLineMA.get(line.getCtx(), line.getM_InOutLine_ID(), line.get_TrxName());
    if (lines != null && lines.size() == 0) {
      MTransaction transaction = get(line, line.getM_AttributeSetInstance_ID());
      if (transaction != null && transaction.get_ID() > 0) transactions.add(transaction);

      return transactions;
    }
    for (MInOutLineMA ma : lines) {
      MTransaction trx = get(line, ma.getM_AttributeSetInstance_ID());
      transactions.add(trx);
    }
    return transactions;
  }