Example #1
0
        /// <summary>
        /// 添加收货明细,引用POLine信息
        /// </summary>
        /// <param name="session"></param>
        /// <param name="poLine"></param>
        /// <returns></returns>
        public bool AddLine(ISession session, POLine poLine)
        {
            if (poLine.ReceivableQty() <= 0M)
            {
                return(false);
            }
            if (!poLine.UnfinishedReceiveQtyChange(session, poLine.ReceivableQty()))
            {
                return(false);
            }

            RCVLine line = new RCVLine();

            line.OrderNumber    = this.OrderNumber;
            line.LineNumber     = this.NextLineNumber();
            line.TransTypeCode  = " ";
            line.LocationCode   = this.LocationCode;
            line.SKUID          = poLine.SKUID;
            line.UnitID         = poLine.UnitID;
            line.RefQty         = poLine.ReceivableQty();
            line.RCVTotalQty    = poLine.ReceivableQty();
            line.QualifiedQty   = poLine.ReceivableQty();
            line.UnQualifiedQty = 0M;
            line.RefOrderLine   = line.OriginalOrderLine = poLine.LineNumber;
            line.TaxValue       = 0M; // poLine.TaxValue; 系统默认进项税不可以退税抵扣,所以交易税率设置为0,需财务手工确定可以抵扣的进项税率
            line.Price          = poLine.Price;
            return(line.Create(session));
        }
Example #2
0
        /// <summary>
        /// ����ջ���ϸ������POLine��Ϣ
        /// </summary>
        /// <param name="session"></param>
        /// <param name="poLine"></param>
        /// <returns></returns>
        public bool AddLine(ISession session, POLine poLine)
        {
            if (poLine.ReceivableQty() <= 0M) return false;
            if (!poLine.UnfinishedReceiveQtyChange(session, poLine.ReceivableQty())) return false;

            RCVLine line = new RCVLine();
            line.OrderNumber = this.OrderNumber;
            line.LineNumber = this.NextLineNumber();
            line.TransTypeCode = " ";
            line.LocationCode = this.LocationCode;
            line.SKUID = poLine.SKUID;
            line.UnitID = poLine.UnitID;
            line.RefQty = poLine.ReceivableQty();
            line.RCVTotalQty = poLine.ReceivableQty();
            line.QualifiedQty = poLine.ReceivableQty();
            line.UnQualifiedQty = 0M;
            line.RefOrderLine = line.OriginalOrderLine = poLine.LineNumber;
            line.TaxValue = 0M;  // poLine.TaxValue; ϵͳĬ�Ͻ���˰��������˰�ֿۣ����Խ���˰������Ϊ0��������ֹ�ȷ�����Եֿ۵Ľ���˰��
            line.Price = poLine.Price;
            return line.Create(session);
        }
Example #3
0
        public SimpleJson AddLine(ISession session, string poLineNumber, string areaCode, string sectionCode, decimal qty)
        {
            //���
            if (string.IsNullOrEmpty(poLineNumber) || poLineNumber.Trim().Length <= 0)
                return new SimpleJson().HandleError("PO����");
            if (string.IsNullOrEmpty(areaCode) || areaCode.Trim().Length <= 0)
                return new SimpleJson().HandleError("��λΪ��");
            if (!string.IsNullOrEmpty(sectionCode) && sectionCode.Trim().Length > 0)
            {
                WHSection section = WHSection.Retrieve(session, areaCode, sectionCode);
                if (session == null)
                    return new SimpleJson()
                        .HandleError("��λ" + areaCode.Trim().ToUpper() + "�еĻ���" + sectionCode.Trim().ToUpper() + "������");
            }
            if (qty <= 0) return new SimpleJson().HandleError("�ջ�����" + qty.ToString() + "С��0");
            POLine poLine = POLine.Retrieve(session, this.RefOrderNumber, poLineNumber);
            if (poLine == null) return new SimpleJson().HandleError("PO " + this.RefOrderNumber + "�����" + poLineNumber + "����");
            if (poLine.ReceivableQty() <= 0M)
                return new SimpleJson().HandleError("����" + this.RefOrderNumber + "��" + poLineNumber + "���ջ�����Ϊ0");
            if (!poLine.UnfinishedReceiveQtyChange(session, qty))
                return new SimpleJson().HandleError("�޷����¶���" + this.RefOrderNumber + "��" + poLineNumber + "�Ĵ��������");

            RCVLine line = new RCVLine();
            line.OrderNumber = this.OrderNumber;
            line.LineNumber = this.NextLineNumber();
            line.TransTypeCode = " ";
            line.LocationCode = this.LocationCode;
            line.AreaCode = areaCode.Trim().ToUpper();
            line.SectionCode = string.IsNullOrEmpty(sectionCode) ? " " : sectionCode.Trim().ToUpper();
            line.SKUID = poLine.SKUID;
            line.UnitID = poLine.UnitID;
            line.RefQty = poLine.ReceivableQty();
            line.RCVTotalQty = qty;
            line.QualifiedQty = qty;
            line.UnQualifiedQty = 0M;
            line.RefOrderLine = line.OriginalOrderLine = poLine.LineNumber;
            line.TaxValue = 0M; // poLine.TaxValue;  ϵͳĬ�Ͻ���˰��������˰�ֿۣ����Խ���˰������Ϊ0��������ֹ�ȷ�����Եֿ۵Ľ���˰��
            line.Price = poLine.Price;
            line.Create(session);

            this.Update(session, "CurrentLineNumber");

            return new SimpleJson();
        }
Example #4
0
        public SimpleJson AddLine(ISession session, string poLineNumber, string areaCode, string sectionCode, decimal qty)
        {
            //检查
            if (string.IsNullOrEmpty(poLineNumber) || poLineNumber.Trim().Length <= 0)
            {
                return(new SimpleJson().HandleError("PO行为空"));
            }
            if (string.IsNullOrEmpty(areaCode) || areaCode.Trim().Length <= 0)
            {
                return(new SimpleJson().HandleError("库位为空"));
            }
            if (!string.IsNullOrEmpty(sectionCode) && sectionCode.Trim().Length > 0)
            {
                WHSection section = WHSection.Retrieve(session, areaCode, sectionCode);
                if (session == null)
                {
                    return(new SimpleJson()
                           .HandleError("库位" + areaCode.Trim().ToUpper() + "中的货架" + sectionCode.Trim().ToUpper() + "不存在"));
                }
            }
            if (qty <= 0)
            {
                return(new SimpleJson().HandleError("收货数量" + qty.ToString() + "小于0"));
            }
            POLine poLine = POLine.Retrieve(session, this.RefOrderNumber, poLineNumber);

            if (poLine == null)
            {
                return(new SimpleJson().HandleError("PO " + this.RefOrderNumber + "中不存在" + poLineNumber + "的行"));
            }
            if (poLine.ReceivableQty() <= 0M)
            {
                return(new SimpleJson().HandleError("订单" + this.RefOrderNumber + "行" + poLineNumber + "可收货数量为0"));
            }
            if (!poLine.UnfinishedReceiveQtyChange(session, qty))
            {
                return(new SimpleJson().HandleError("无法更新订单" + this.RefOrderNumber + "行" + poLineNumber + "的待入库数量"));
            }

            RCVLine line = new RCVLine();

            line.OrderNumber    = this.OrderNumber;
            line.LineNumber     = this.NextLineNumber();
            line.TransTypeCode  = " ";
            line.LocationCode   = this.LocationCode;
            line.AreaCode       = areaCode.Trim().ToUpper();
            line.SectionCode    = string.IsNullOrEmpty(sectionCode) ? " " : sectionCode.Trim().ToUpper();
            line.SKUID          = poLine.SKUID;
            line.UnitID         = poLine.UnitID;
            line.RefQty         = poLine.ReceivableQty();
            line.RCVTotalQty    = qty;
            line.QualifiedQty   = qty;
            line.UnQualifiedQty = 0M;
            line.RefOrderLine   = line.OriginalOrderLine = poLine.LineNumber;
            line.TaxValue       = 0M; // poLine.TaxValue;  系统默认进项税不可以退税抵扣,所以交易税率设置为0,需财务手工确定可以抵扣的进项税率
            line.Price          = poLine.Price;
            line.Create(session);

            this.Update(session, "CurrentLineNumber");

            return(new SimpleJson());
        }