Package org.compiere.model

Examples of org.compiere.model.MOrderLine


        //  Create new InOut Line
        MInOutLine iol = new MInOutLine (inout);
        iol.setM_Product_ID(M_Product_ID, C_UOM_ID)//  Line UOM
        iol.setQty(QtyEntered);              //  Movement/Entered
        //
        MOrderLine ol = null;
        MRMALine rmal = null;
        if (C_OrderLine_ID != 0)
        {
          iol.setC_OrderLine_ID(C_OrderLine_ID);
          ol = new MOrderLine (Env.getCtx(), C_OrderLine_ID, trxName);
          if (ol.getQtyEntered().compareTo(ol.getQtyOrdered()) != 0)
          {
            iol.setMovementQty(QtyEntered
                .multiply(ol.getQtyOrdered())
                .divide(ol.getQtyEntered(), 12, BigDecimal.ROUND_HALF_UP));
            iol.setC_UOM_ID(ol.getC_UOM_ID());
          }
          iol.setM_AttributeSetInstance_ID(ol.getM_AttributeSetInstance_ID());
          iol.setDescription(ol.getDescription());
          //
          iol.setC_Project_ID(ol.getC_Project_ID());
          iol.setC_ProjectPhase_ID(ol.getC_ProjectPhase_ID());
          iol.setC_ProjectTask_ID(ol.getC_ProjectTask_ID());
          iol.setC_Activity_ID(ol.getC_Activity_ID());
          iol.setC_Campaign_ID(ol.getC_Campaign_ID());
          iol.setAD_OrgTrx_ID(ol.getAD_OrgTrx_ID());
          iol.setUser1_ID(ol.getUser1_ID());
          iol.setUser2_ID(ol.getUser2_ID());
        }
        else if (il != null)
        {
          if (il.getQtyEntered().compareTo(il.getQtyInvoiced()) != 0)
          {
            iol.setQtyEntered(QtyEntered
                .multiply(il.getQtyInvoiced())
                .divide(il.getQtyEntered(), 12, BigDecimal.ROUND_HALF_UP));
            iol.setC_UOM_ID(il.getC_UOM_ID());
          }
          iol.setDescription(il.getDescription());
          iol.setC_Project_ID(il.getC_Project_ID());
          iol.setC_ProjectPhase_ID(il.getC_ProjectPhase_ID());
          iol.setC_ProjectTask_ID(il.getC_ProjectTask_ID());
          iol.setC_Activity_ID(il.getC_Activity_ID());
          iol.setC_Campaign_ID(il.getC_Campaign_ID());
          iol.setAD_OrgTrx_ID(il.getAD_OrgTrx_ID());
          iol.setUser1_ID(il.getUser1_ID());
          iol.setUser2_ID(il.getUser2_ID());
        }

        // 25-09-2009 rgliddon: Made following if block independent from the
        // previous if-else block.
        if (M_RMALine_ID != 0)
        {
          rmal = new MRMALine(Env.getCtx(), M_RMALine_ID, trxName);
          iol.setM_RMALine_ID(M_RMALine_ID);
          iol.setQtyEntered(QtyEntered);
          iol.setDescription(rmal.getDescription());
          iol.setM_AttributeSetInstance_ID(rmal.getM_AttributeSetInstance_ID());
          iol.setC_Project_ID(rmal.getC_Project_ID());
          iol.setC_ProjectPhase_ID(rmal.getC_ProjectPhase_ID());
          iol.setC_ProjectTask_ID(rmal.getC_ProjectTask_ID());
          iol.setC_Activity_ID(rmal.getC_Activity_ID());
          iol.setAD_OrgTrx_ID(rmal.getAD_OrgTrx_ID());
          iol.setUser1_ID(rmal.getUser1_ID());
          iol.setUser2_ID(rmal.getUser2_ID());
        }

        //  Charge
        if (M_Product_ID == 0)
        {
          if (ol != null && ol.getC_Charge_ID() != 0)      //  from order
            iol.setC_Charge_ID(ol.getC_Charge_ID());
          else if (il != null && il.getC_Charge_ID() != 0//  from invoice
            iol.setC_Charge_ID(il.getC_Charge_ID());
          else if (rmal != null && rmal.getC_Charge_ID() != 0) // from rma
            iol.setC_Charge_ID(rmal.getC_Charge_ID());
        }
View Full Code Here


        for (MRMALine line : lines)
        {
            if (line.getShipLine() != null && line.getShipLine().getC_OrderLine_ID() != 0)
            {
                // Create order lines if the RMA Doc line has a shipment line
                MOrderLine orderLine = new MOrderLine(order);
                MOrderLine originalOLine = new MOrderLine(getCtx(), line.getShipLine().getC_OrderLine_ID(), null);
                orderLine.setAD_Org_ID(line.getAD_Org_ID());
                orderLine.setM_Product_ID(originalOLine.getM_Product_ID());
                orderLine.setM_AttributeSetInstance_ID(originalOLine.getM_AttributeSetInstance_ID());
                orderLine.setC_UOM_ID(originalOLine.getC_UOM_ID());
                orderLine.setC_Tax_ID(originalOLine.getC_Tax_ID());
                orderLine.setM_Warehouse_ID(originalOLine.getM_Warehouse_ID());
                orderLine.setC_Currency_ID(originalOLine.getC_Currency_ID());
                orderLine.setQty(line.getQty());
                orderLine.setC_Project_ID(originalOLine.getC_Project_ID());
                orderLine.setC_Activity_ID(originalOLine.getC_Activity_ID());
                orderLine.setC_Campaign_ID(originalOLine.getC_Campaign_ID());
                orderLine.setPrice();
                orderLine.setPrice(line.getAmt());
               
                if (!orderLine.save())
                {
View Full Code Here

    {
      newOrder(rLine, C_BPartner_ID);
    }
   
    //  No Order Line
    m_orderLine = new MOrderLine(m_order);
    m_orderLine.setDatePromised(rLine.getDateRequired());
    if (product != null)
    {
      m_orderLine.setProduct(product);
      m_orderLine.setM_AttributeSetInstance_ID(rLine.getM_AttributeSetInstance_ID());
View Full Code Here

TOP

Related Classes of org.compiere.model.MOrderLine

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.