Ejemplo n.º 1
0
        /// <summary>
        /// 出库通知单行转换出库单行
        /// </summary>
        /// <param name="outNoticeLine"></param>
        /// <returns></returns>
        protected WSellLine CloneOutNoticeLine(WSellNoticeLine outNoticeLine)
        {
            //如果通知数量-下推-完成<0 则返回
            decimal outCount = outNoticeLine.OutCount - outNoticeLine.DownCount - outNoticeLine.CompleteCount;

            if (outCount <= 0)
            {
                return(null);
            }
            WSellLine line = new WSellLine()
            {
                Batch        = outNoticeLine.Batch,
                CreateDate   = DateTime.Now,
                Factory      = outNoticeLine.Factory,
                OutCount     = outCount,
                OutPutCount  = outCount,
                MaterialCode = outNoticeLine.MaterialCode,
                MaterialID   = outNoticeLine.MaterialID,
                OwnerCode    = outNoticeLine.OwnerCode,
                UnitID       = outNoticeLine.UnitID,
                SourceLineID = outNoticeLine.ID
            };

            return(line);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 构建库存不足提示
        /// </summary>
        /// <param name="line"></param>
        /// <param name="msg">错误信息</param>
        /// <returns></returns>
        private string BuilderErrorMessage(WSellNoticeLine 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());
        }