Package org.openbravo.model.materialmgmt.transaction

Examples of org.openbravo.model.materialmgmt.transaction.InventoryCountLine


    final OBCriteria<InventoryCountLine> iclObc = OBDal.getInstance().createCriteria(
        InventoryCountLine.class);
    iclObc.setFirstResult(1);
    iclObc.setMaxResults(1);
    final InventoryCountLine baseLine = (InventoryCountLine) DalUtil.copy(iclObc.list().get(0),
        false);
    final long time = System.currentTimeMillis();
    commitTransaction();
    for (int i = 0; i < NO_HEADER; i++) {
      final InventoryCount ic = (InventoryCount) DalUtil.copy(baseIc, false);
      ic.setPosted("N");
      ic.setProcessed(false);
      ic.setName(NAME_PREFIX + "_" + i);
      for (int j = 0; j < NO_LINE; j++) {
        final InventoryCountLine icl = (InventoryCountLine) DalUtil.copy(baseLine, false);
        icl.setPhysInventory(ic);
        icl.setLineNo((long) j);
        ic.getMaterialMgmtInventoryCountLineList().add(icl);
      }
      OBDal.getInstance().save(ic);
    }
    commitTransaction();
View Full Code Here


    final OBCriteria<InventoryCountLine> iclObc = OBDal.getInstance().createCriteria(
        InventoryCountLine.class);
    iclObc.setFirstResult(1);
    iclObc.setMaxResults(1);
    final InventoryCountLine baseLine = (InventoryCountLine) DalUtil.copy(iclObc.list().get(0),
        false);
    final long time = System.currentTimeMillis();
    commitTransaction();

    final OBCriteria<InventoryCount> icObc = OBDal.getInstance().createCriteria(
        InventoryCount.class);
    icObc.add(Expression.like("name", NAME_PREFIX + "%"));
    int cnt = 0;
    int cntLine = 0;
    for (final InventoryCount ic : icObc.list()) {
      cnt++;
      final InventoryCountLine icl = (InventoryCountLine) DalUtil.copy(baseLine, false);
      icl.setPhysInventory(ic);
      icl.setLineNo((long) (ic.getMaterialMgmtInventoryCountLineList().size() + 1));
      ic.getMaterialMgmtInventoryCountLineList().add(icl);

      cntLine = ic.getMaterialMgmtInventoryCountLineList().size();

      icl.setDescription("desc " + ic.getName());
      final InventoryCountLine icl2 = ic.getMaterialMgmtInventoryCountLineList().get(0);
      icl2.setQuantityOrderBook(new BigDecimal((icl2.getQuantityOrderBook() == null ? 0f : icl2
          .getQuantityOrderBook().floatValue() + 1f)));
      OBDal.getInstance().save(ic);
    }
    commitTransaction();
    log.debug("Read " + cnt + " inventorycounts with each " + cntLine
View Full Code Here

TOP

Related Classes of org.openbravo.model.materialmgmt.transaction.InventoryCountLine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.