Пример #1
0
        /**
         *  Set Order Line.
         *  Does not set Quantity!
         *	@param oLine order line
         *	@param M_Locator_ID locator
         *  @param Qty used only to find suitable locator
         */
        public void SetOrderLine(MOrderLine oLine, int M_Locator_ID, Decimal Qty)
        {
            SetC_OrderLine_ID(oLine.GetC_OrderLine_ID());
            SetLine(oLine.GetLine());
            SetC_UOM_ID(oLine.GetC_UOM_ID());
            MProduct product = oLine.GetProduct();

            if (product == null)
            {
                SetM_Product_ID(0);
                SetM_AttributeSetInstance_ID(0);
                base.SetM_Locator_ID(0);
            }
            else
            {
                SetM_Product_ID(oLine.GetM_Product_ID());
                SetM_AttributeSetInstance_ID(oLine.GetM_AttributeSetInstance_ID());
                //
                if (product.IsItem())
                {
                    if (M_Locator_ID == 0)
                    {
                        SetM_Locator_ID(Qty);   //	requires warehouse, product, asi
                    }
                    else
                    {
                        SetM_Locator_ID(M_Locator_ID);
                    }
                }
                else
                {
                    base.SetM_Locator_ID(0);
                }
            }
            SetC_Charge_ID(oLine.GetC_Charge_ID());
            SetDescription(oLine.GetDescription());
            SetIsDescription(oLine.IsDescription());
            //
            SetC_Project_ID(oLine.GetC_Project_ID());
            SetC_ProjectPhase_ID(oLine.GetC_ProjectPhase_ID());
            SetC_ProjectTask_ID(oLine.GetC_ProjectTask_ID());
            SetC_Activity_ID(oLine.GetC_Activity_ID());
            SetC_Campaign_ID(oLine.GetC_Campaign_ID());
            SetAD_OrgTrx_ID(oLine.GetAD_OrgTrx_ID());
            SetUser1_ID(oLine.GetUser1_ID());
            SetUser2_ID(oLine.GetUser2_ID());
        }