Ejemplo n.º 1
0
        /// <summary>
        /// 生成反转的行。
        /// </summary>
        protected virtual ICreateInOutLine DoCreateReversalInOutLine(IInOutLineState inOutLine)
        {
            var reversalLine = new CreateInOutLine();

            reversalLine.ReversalLineNumber = inOutLine.LineNumber;//设置反转行
            //reversalLine.Organization = Context.Organization;//?
            //reversalLine.UpdatedBy = Context.User;
            //reversalLine.UpdateTime = now;
            //reversalLine.CreatedBy = Context.User;
            //reversalLine.CreationTime = now;
            reversalLine.ProductId = inOutLine.ProductId;
            reversalLine.LocatorId = inOutLine.LocatorId;
            reversalLine.AttributeSetInstanceId = inOutLine.AttributeSetInstanceId;

            //reversalLine.IsDescription = inOutLine.IsDescription;
            reversalLine.IsInvoiced = inOutLine.IsInvoiced;
            reversalLine.LineNumber = inOutLine.LineNumber;
            //reversalLine.RmaLine = inOutLine.RmaLine;
            reversalLine.Processed = inOutLine.Processed;
            //reversalLine.RmaLine = inOutLine.RmaLine;
            reversalLine.QuantityUomId = inOutLine.QuantityUomId;

            //数量全部反转?
            reversalLine.MovementQuantity = -inOutLine.MovementQuantity;
            //reversalLine.QuantityEntered = -inOutLine.QuantityEntered;
            //reversalLine.ScrappedQuantity = -inOutLine.ScrappedQuantity;
            reversalLine.PickedQuantity = -inOutLine.PickedQuantity;
            //reversalLine.TargetQuantity = -inOutLine.TargetQuantity;

            return(reversalLine);
        }
Ejemplo n.º 2
0
        private ICreateInOutLine CreateInOutLine(InOutCommands.AddLine d)
        {
            var line = new CreateInOutLine();

            var prdState = GetProductState(d.ProductId);

            string attrSetInstId = AttributeSetInstanceUtils.CreateAttributeSetInstance(AttributeSetService, AttributeSetInstanceApplicationService,
                                                                                        prdState.AttributeSetId, d.AttributeSetInstance);

            if (_log.IsDebugEnabled)
            {
                _log.Debug("Create attribute set instance, id: " + attrSetInstId);
            }

            line.LineNumber             = d.LineNumber;
            line.ProductId              = prdState.ProductId;
            line.LocatorId              = d.LocatorId;
            line.AttributeSetInstanceId = attrSetInstId;
            line.QuantityUomId          = d.QuantityUomId;
            line.MovementQuantity       = d.MovementQuantity;
            line.Description            = d.Description;
            line.Active = true;
            //todo More proerties???
            return(line);
        }