Ejemplo n.º 1
0
        public LumCostRoll()
        {
            ProcBomCostRecs.SetProcessVisible(false);
            ProcBomCostRecs.SetProcessAllCaption("Cost Roll");

            var _bomItem = new PXGraph().Select <AMBomItem>();

            if ((rollsettings.Current.LotSize == 0 || rollsettings.Current.LotSize == null) && rollsettings.Current.SnglMlti == "S")
            {
                rollsettings.Current.LotSize  = 1000;
                rollsettings.Current.SnglMlti = "M";
            }


            if (ProcBomCostRecs.Select().Count == 0)
            {
                BomCostRecs.Cache.Insert(DoingCostRoll(_bomItem.FirstOrDefault()));
            }

            ProcBomCostRecs.SetProcessDelegate(delegate(List <AMBomCost> list)
            {
                rollsettings.Current.ApplyPend      = false;
                rollsettings.Current.IncFixed       = true;
                rollsettings.Current.IncMatScrp     = true;
                rollsettings.Current.UpdateMaterial = false;
                rollsettings.Current.IsPersistMode  = false;
                // Call the action to run and display the cost roll
                PXLongOperation.StartOperation(this, () => aMBomCostSummary(rollsettings.Current, _bomItem));
                rollsettings.ClearDialog();
            });
        }
Ejemplo n.º 2
0
        /// <summary> SOPackageDetailExt_usrShipmentSplitLineNbr Updated Event </summary>
        protected virtual void _(Events.FieldUpdated <SOPackageDetailExt.usrShipmentSplitLineNbr> e)
        {
            if (e.NewValue == null)
            {
                return;
            }
            var _shipLine      = Base.Transactions.Cache.Cached.RowCast <SOShipLine>().Where(x => x.LineNbr == (int?)e.NewValue).SingleOrDefault();
            var _stockItemInfo = GetStockInfo(_shipLine.InventoryID.Value, _MADEIN);
            var _shipLineSplit = new PXGraph().Select <SOShipLineSplit>().Where(x => x.ShipmentNbr == _shipLine.ShipmentNbr && x.LineNbr == _shipLine.LineNbr);
            var boxsInfo       = GetBoxsInfo(_shipLine.InventoryID);

            e.Cache.SetValueExt <SOPackageDetailEx.boxID>(e.Row, string.IsNullOrEmpty(boxsInfo.stockItemBox) ? boxsInfo.sBoxID : boxsInfo.stockItemBox);
            e.Cache.SetValueExt <SOPackageDetail.inventoryID>(e.Row, _shipLine.InventoryID);
            e.Cache.SetValueExt <SOPackageDetailExt.usrCountry>(e.Row, _stockItemInfo.GetItem <CSAnswers>()?.Value);
            if (!this._IsAutoPacking)
            {
                e.Cache.SetValueExt <SOPackageDetail.qty>(e.Row, _shipLine.ShippedQty);
            }
            // if ShipLineSplit count == 1 then set value
            if (_shipLineSplit.Count() == 1)
            {
                e.Cache.SetValueExt <SOPackageDetailExt.usrDateCode>(e.Row, _shipLineSplit.FirstOrDefault()?.LotSerialNbr);
            }
        }