Package org.compiere.model

Examples of org.compiere.model.MInventory


        ResultSet rs = pstmt.executeQuery();
        MAcctSchema[] as = {new MAcctSchema (getCtx(),p_C_AcctSchema_ID,get_TrxName())};
       
        while (rs.next()){
          int id = rs.getInt("m_inventory_id");
          MInventory inv = new MInventory(getCtx(), id, get_TrxName());
          log.info("" + inv);
          //if(inv.getDocStatus() != DocAction.STATUS_Completed || inv.getDocStatus() != DocAction.STATUS_Closed)
            //{
            String status = inv.completeIt();
            inv.setDocStatus(status);
            //}
           
            if(p_Post)
              Doc.postImmediate(as, inv.get_Table_ID(), inv.getM_Inventory_ID(), true, get_TrxName());
           
          inv.save(get_TrxName());
        }
        pstmt .close();
      }catch (Exception e) {e.printStackTrace();return "error!";}
      return "ok";
  }
View Full Code Here


                                   " is zero or less.");
    if (!product.isVerified())
      throw new AdempiereUserError("@Error@ Product "+product.getName()+" is not verified");

    // Create the Inventory record
    MInventory inv = new MInventory(getCtx(), 0, get_TrxName());
    inv.setM_Warehouse_ID(loc.getM_Warehouse_ID());
    inv.setClientOrg(getAD_Client_ID(), Env.getAD_Org_ID(getCtx()));
    inv.addDescription("From BOM " + bom.getValue());
    inv.setZPacksDocumentNo();
    inv.save(get_TrxName());
   
    // Add the packed product inventory line and then copy lines from the BOM
    addPackedProductLine(pack, product, inv, chargeID);
    copyBOMLines(bom, pack, product, inv, chargeID);
   
    // Assign the new inventory to the pack
    pack.setM_Inventory_ID(inv.getM_Inventory_ID());
    pack.save(get_TrxName());
   
    // Return the message to be shown in the status bar.  The SrvProcess will
    // commit all changes to the database made as part of the get_TrxName()
    // transaction.
    return "Physical Inventory "+inv.getDocumentNo()+" created.";
   
  //  doIt
View Full Code Here

TOP

Related Classes of org.compiere.model.MInventory

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.