예제 #1
0
        /// <summary>
        /// 入库通知单行转换入库单行
        /// </summary>
        /// <param name="inNoticeLine"></param>
        /// <returns></returns>
        protected WPurchaseLine CloneInNoticeLine(WPurchaseNoticeLine inNoticeLine)
        {
            //如果通知数量-下推-完成<0 则返回
            decimal inCount = inNoticeLine.InCount - inNoticeLine.DownCount - inNoticeLine.CompleteCount;

            if (inCount <= 0)
            {
                return(null);
            }
            WPurchaseLine line = new WPurchaseLine()
            {
                Batch        = inNoticeLine.Batch,
                CreateDate   = DateTime.Now,
                Factory      = inNoticeLine.Factory,
                InCount      = inCount,
                InPutCount   = inCount,
                MaterialCode = inNoticeLine.MaterialCode,
                MaterialID   = inNoticeLine.MaterialID,
                OwnerCode    = inNoticeLine.OwnerCode,
                UnitID       = inNoticeLine.UnitID,
                SourceLineID = inNoticeLine.ID
            };

            return(line);
        }
예제 #2
0
        /// <summary>
        /// 构建库存不足提示
        /// </summary>
        /// <param name="line"></param>
        /// <param name="msg">错误信息</param>
        /// <returns></returns>
        private string BuilderErrorMessage(WPurchaseNoticeLine line, string msg)
        {
            StringBuilder sb = new StringBuilder(msg);

            sb.AppendLine(",物料:" + line.MaterialCode);
            if (!string.IsNullOrWhiteSpace(line.Batch))
            {
                sb.AppendLine(",批次:" + line.Batch);
            }
            if (!string.IsNullOrWhiteSpace(line.OwnerCode))
            {
                sb.AppendLine(",货主:" + line.OwnerCode);
            }
            return(sb.ToString());
        }