コード例 #1
0
ファイル: List.ascx.cs プロジェクト: Novthirteen/yfkey-scms
 public void InitPageParameter(InProcessLocation ip)
 {
     bool isScanHu = (ip.InProcessLocationDetails[0].HuId != null);
     List<Transformer> transformerList = TransformerHelper.ConvertInProcessLocationDetailsToTransformers(ip.InProcessLocationDetails);
     this.ucTransformer.InitPageParameter(transformerList, this.ModuleType, BusinessConstants.TRANSFORMER_MODULE_TYPE_SHIPVIEW, isScanHu);
     this.ucTransformer.InitialUIForAsn(ip);
 }
コード例 #2
0
        public InProcessLocation GenerateInProcessLocation(OrderHead orderHead)
        {
            InProcessLocation inProcessLocation = new InProcessLocation();

            CloneHelper.CopyProperty(orderHead, inProcessLocation, OrderHead2InProcessLocationCloneField);

            return inProcessLocation;
        }
コード例 #3
0
        public void AddInProcessLocation(InProcessLocation inProcessLocation)
        {
            if (this.InProcessLocations == null)
            {
                this.InProcessLocations = new List<InProcessLocation>();
            }

            this.InProcessLocations.Add(inProcessLocation);
        }
コード例 #4
0
    public void InitPageParameter(InProcessLocation ip, bool printASN, string action)
    {
        this.IpNo = ip.IpNo;
        this.Action = action;
        this.ucEdit.Action = action;
        this.IsPrintASN = printASN;
        this.btnApprove.Visible = ip.ApprovalStatus == BusinessConstants.CODE_MASTER_APPROVALSTATUS_PENDING;
        this.btnReject.Visible = ip.ApprovalStatus == BusinessConstants.CODE_MASTER_APPROVALSTATUS_PENDING;
        this.btnPrint.Visible = ip.ApprovalStatus == BusinessConstants.CODE_MASTER_APPROVALSTATUS_APPROVED;
        this.btnExport.Visible = ip.ApprovalStatus == BusinessConstants.CODE_MASTER_APPROVALSTATUS_APPROVED;

        if (ip.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_CLOSE)
        {

            this.btnAdjustLocFrom.Visible = true;
            if (this.AsnType == BusinessConstants.CODE_MASTER_INPROCESS_LOCATION_TYPE_VALUE_GAP)
            {
                this.btnAdjustLocFrom.Visible = ip.ApprovalStatus == BusinessConstants.CODE_MASTER_APPROVALSTATUS_APPROVED;
                this.btnAdjustLocTo.Visible = ip.ApprovalStatus == BusinessConstants.CODE_MASTER_APPROVALSTATUS_APPROVED;
                this.btnClose.Visible = false;
            }
            else
            {
                this.btnAdjustLocFrom.Text = "${Common.Button.Cancel}";
                this.btnAdjustLocTo.Visible = false;
                if (ip.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
                {
                    this.btnAdjustLocFrom.Visible = false;
                    this.btnClose.Visible = true;
                }
                else
                {
                    this.btnAdjustLocFrom.Visible = true;
                    this.btnClose.Visible = false;
                }
            }
        }
        else
        {
            this.btnUpdate.Visible = false;
            this.btnClose.Visible = false;
            this.btnAdjustLocFrom.Visible = false;
            this.btnAdjustLocTo.Visible = false;
        }

        if (this.btnClose.Visible)
        {
            this.ucEdit.Action = "Close";
        }
        this.ucEdit.InitPageParameter(ip.IpNo);
        this.ucDetailList.InitPageParameter(ip.IpNo);
        if (printASN)
        {
            this.PrintASN(ip,false);
        }
    }
コード例 #5
0
    public void InitPageParameter(InProcessLocation ip, bool printASN)
    {
        this.GV_List.DataSource = ip.InProcessLocationDetails;
        this.GV_List.DataBind();

        if (printASN)
        {
            this.PrintASN(ip);
        }
    }
コード例 #6
0
        public void CreateInProcessLocationDetail(InProcessLocation inProcessLocation, OrderLocationTransaction outOrderLocationTransaction, IList<InventoryTransaction> inventoryTransactionList)
        {
            if (inventoryTransactionList != null && inventoryTransactionList.Count > 0)
            {
                InProcessLocationDetail mergedInProcessLocationDetail = null;

                foreach (InventoryTransaction inventoryTransaction in inventoryTransactionList)
                {
                    if (inventoryTransaction.Hu == null && !inventoryTransaction.IsConsignment)
                    {
                        #region �ϲ���������
                        //û��HU && �Ǽ��۲ſ��Ժϲ�
                        if (mergedInProcessLocationDetail == null)
                        {
                            mergedInProcessLocationDetail = new InProcessLocationDetail();
                            mergedInProcessLocationDetail.InProcessLocation = inProcessLocation;
                            mergedInProcessLocationDetail.OrderLocationTransaction = outOrderLocationTransaction;
                        }

                        mergedInProcessLocationDetail.Qty += (0 - inventoryTransaction.Qty) / outOrderLocationTransaction.UnitQty;
                        #endregion
                    }
                    else
                    {
                        InProcessLocationDetail inProcessLocationDetail = new InProcessLocationDetail();
                        inProcessLocationDetail.InProcessLocation = inProcessLocation;
                        inProcessLocationDetail.OrderLocationTransaction = outOrderLocationTransaction;
                        if (inventoryTransaction.Hu != null)
                        {
                            inProcessLocationDetail.HuId = inventoryTransaction.Hu.HuId;
                            inProcessLocationDetail.LotNo = inventoryTransaction.Hu.LotNo;
                        }
                        inProcessLocationDetail.IsConsignment = inventoryTransaction.IsConsignment;
                        inProcessLocationDetail.PlannedBill = inventoryTransaction.PlannedBill;
                        inProcessLocationDetail.Qty = (0 - inventoryTransaction.Qty) / outOrderLocationTransaction.UnitQty;

                        inProcessLocation.AddInProcessLocationDetail(inProcessLocationDetail);

                        this.CreateInProcessLocationDetail(inProcessLocationDetail);
                    }
                }

                if (mergedInProcessLocationDetail != null)
                {
                    inProcessLocation.AddInProcessLocationDetail(mergedInProcessLocationDetail);

                    this.CreateInProcessLocationDetail(mergedInProcessLocationDetail);
                }
            }
        }
コード例 #7
0
        public virtual InProcessLocationDetail LoadInProcessLocationDetail(com.Sconit.Entity.Distribution.InProcessLocation inProcessLocation, com.Sconit.Entity.MasterData.OrderLocationTransaction orderLocationTransaction, String lotNo)
        {
            string hql = @"from InProcessLocationDetail entity where entity.InProcessLocation.IpNo = ? and entity.OrderLocationTransaction.Id = ? and entity.LotNo = ?";
            IList <InProcessLocationDetail> result = FindAllWithCustomQuery <InProcessLocationDetail>(hql, new object[] { inProcessLocation.IpNo, orderLocationTransaction.Id, lotNo }, new IType[] { NHibernateUtil.String, NHibernateUtil.Int32, NHibernateUtil.String });

            if (result != null && result.Count > 0)
            {
                return(result[0]);
            }
            else
            {
                return(null);
            }
        }
コード例 #8
0
 public void InitPageParameter(InProcessLocation inProcessLocation)
 {
     IList<InProcessLocationDetail> inProcessLocationDetailList = new List<InProcessLocationDetail>();
     if (inProcessLocation.InProcessLocationDetails != null && inProcessLocation.InProcessLocationDetails.Count > 0)
     {
         foreach(InProcessLocationDetail inProcessLocationDetail in inProcessLocation.InProcessLocationDetails)
         {
             if (inProcessLocationDetail.HuId != null)
             {
                 inProcessLocationDetailList.Add(inProcessLocationDetail);
             }
         }
     }
     this.GV_List.DataSource = inProcessLocationDetailList;
     this.GV_List.DataBind();
 }
コード例 #9
0
 public void InitPageParameter(InProcessLocation ip, bool printASN)
 {
     this.IpNo = ip.IpNo;
     this.Action = "View";
     this.ucEdit.Action = "View";
     this.btnClose.Visible = false;
     this.ucEdit.InitPageParameter(ip.IpNo);
     this.ucDetailList.InitPageParameter(ip);
     //if (ip.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE)
     //{
     //    this.btnUpdate.Visible = true;
     //}
     if (printASN)
     {
         this.PrintASN(ip);
     }
 }
コード例 #10
0
        public void RecordLocationTransaction(OrderLocationTransaction orderLocationTransaction, InventoryTransaction inventoryTransaction, InProcessLocation inProcessLocation, User user)
        {
            LocationTransaction locationTransaction = GenerateOrderLocationTransaction(orderLocationTransaction, inventoryTransaction.Location, user);

            if (inventoryTransaction.Hu != null)
            {
                locationTransaction.HuId = inventoryTransaction.Hu.HuId;
                locationTransaction.LotNo = inventoryTransaction.Hu.LotNo;
            }
            if (locationTransaction.LotNo == null || locationTransaction.LotNo == string.Empty)
            {
                locationTransaction.LotNo = inventoryTransaction.LotNo;
            }
            locationTransaction.BatchNo = inventoryTransaction.LocationLotDetailId;
            locationTransaction.IpNo = inProcessLocation.IpNo;
            locationTransaction.Qty = inventoryTransaction.Qty;
            locationTransaction.EffectiveDate = DateTime.Parse(inProcessLocation.CreateDate.ToString("yyyy-MM-dd"));

            this.CreateLocationTransaction(locationTransaction);
        }
コード例 #11
0
    private void PrintASN(InProcessLocation inProcessLocation)
    {
        IList<object> list = new List<object>();
        list.Add(inProcessLocation);
        list.Add(inProcessLocation.InProcessLocationDetails);

        
        //报表url
        string asnUrl = TheReportMgr.WriteToFile(inProcessLocation.AsnTemplate, list);

        //客户端打印
        Page.ClientScript.RegisterStartupScript(GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + asnUrl + "'); </script>");


        //Hu打印,todo
        //if (inProcessLocation != null)
        //{

        //    IList<object> huObj = new List<object>();
        //    IList<Hu> huList = new List<Hu>();
        //    IList<InProcessLocationDetail> inProcessLocationDetailList = inProcessLocation.InProcessLocationDetails;
        //    if (inProcessLocationDetailList != null && inProcessLocationDetailList.Count > 0)
        //    {
        //        foreach (InProcessLocationDetail inProcessLocationDetail in inProcessLocationDetailList)
        //        {
        //            Hu hu = TheHuMgr.LoadHu(inProcessLocationDetail.HuId);
        //            if (hu != null)
        //            {
        //                huList.Add(hu);
        //            }
        //        }
        //        if (huList != null && huList.Count > 0)
        //        {
        //            huObj.Add(huList);
        //            huObj.Add(CurrentUser.Code);
        //            string barCodeUrl = TheReportMgr.WriteToFile("BarCode.xls", huObj,"hu.xls");
        //            Page.ClientScript.RegisterStartupScript(GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + barCodeUrl + "'); </script>");
        //        }
        //    }
        //}
    }
コード例 #12
0
    private void BindData(InProcessLocation ip)
    {
        //PartyFrom
        this.tbPartyFrom.ReadonlyTextBox_DataBind(ip.PartyFrom.Code, ip.PartyFrom.Name);

        //PartyTo
        this.tbPartyTo.ReadonlyTextBox_DataBind(ip.PartyTo.Code, ip.PartyTo.Name);

        //ShipFrom
        if (ip.ShipFrom != null)
            this.tbShipFrom.ReadonlyTextBox_DataBind(ip.ShipFrom.Code, ip.ShipFrom.Address);

        //ShipTo
        if (ip.ShipTo != null)
            this.tbShipTo.ReadonlyTextBox_DataBind(ip.ShipTo.Code, ip.ShipTo.Address);

        //Carrier
        //todo

        //DockDescription
        this.tbDockDescription.ReadonlyTextBox_DataBind(null, ip.DockDescription);
    }
コード例 #13
0
        public IList<InProcessLocationTrack> CreateIInProcessLocationTrack(InProcessLocation inProcessLocation, Routing routing)
        {
            IList<RoutingDetail> routingDetailList = this.routingDetailMgr.GetRoutingDetail(routing, DateTime.Now);

            if (routingDetailList != null && routingDetailList.Count > 0)
            {
                IList<InProcessLocationTrack> inProcessLocationTrackList = new List<InProcessLocationTrack>();
                foreach (RoutingDetail routingDetail in routingDetailList)
                {
                    InProcessLocationTrack inProcessLocationTrack = new InProcessLocationTrack();
                    inProcessLocationTrack.IpProcessLocation = inProcessLocation;
                    inProcessLocationTrack.Operation = routingDetail.Operation;
                    inProcessLocationTrack.Activity = routingDetail.Activity;
                    inProcessLocationTrack.WorkCenter = routingDetail.WorkCenter;

                    this.entityDao.CreateInProcessLocationTrack(inProcessLocationTrack);
                    inProcessLocationTrackList.Add(inProcessLocationTrack);
                }

                return inProcessLocationTrackList;
            }

            return null;
        }
コード例 #14
0
        public void CreateInProcessLocationDetail(InProcessLocation inProcessLocation, OrderLocationTransaction outOrderLocationTransaction, IList<Hu> huList)
        {
            if (huList != null && huList.Count > 0)
            {
                foreach (Hu hu in huList)
                {
                    InProcessLocationDetail inProcessLocationDetail = new InProcessLocationDetail();
                    inProcessLocationDetail.InProcessLocation = inProcessLocation;
                    inProcessLocationDetail.OrderLocationTransaction = outOrderLocationTransaction;
                    inProcessLocationDetail.HuId = hu.HuId;
                    inProcessLocationDetail.LotNo = hu.LotNo;
                    inProcessLocationDetail.Qty = hu.Qty * hu.UnitQty / outOrderLocationTransaction.UnitQty;  //�ȳ�Hu.UnitQtyתΪ������λ���ڳ�outOrderLocationTransaction.UnitQtyתΪ������λ��

                    inProcessLocation.AddInProcessLocationDetail(inProcessLocationDetail);

                    this.CreateInProcessLocationDetail(inProcessLocationDetail);
                }
            }
        }
コード例 #15
0
 public void InitPageParameter(InProcessLocation ip, bool printASN)
 {
     InitPageParameter(ip, printASN, "View");
 }
コード例 #16
0
        private Receipt ReceiveFromInProcessLocation(InProcessLocation inProcessLocation, User user, IDictionary<string, string> huIdStorageBinDic, string externalOrderNo)
        {
            if (inProcessLocation.OrderType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION)
            {
                throw new TechnicalException("production can't auto receive after shipping raw marterial");
            }

            Receipt receipt = this.ConvertInProcessLocationToReceipt(inProcessLocation, huIdStorageBinDic, externalOrderNo);
            return this.ReceiveOrder(receipt, user);
        }
コード例 #17
0
 public Receipt ConvertInProcessLocationToReceipt(InProcessLocation inProcessLocation, IDictionary<string, string> huIdStorageBinDic)
 {
     return ConvertInProcessLocationToReceipt(inProcessLocation, huIdStorageBinDic, null);
 }
コード例 #18
0
 public void TryCompleteTransportationOrder(InProcessLocation ip, User user)
 {
     DetachedCriteria criteria = DetachedCriteria.For(typeof(TransportationOrderDetail));
     criteria.Add(Expression.Eq("InProcessLocation.IpNo", ip.IpNo));
     IList<TransportationOrderDetail> orderDetailList = criteriaMgr.FindAll<TransportationOrderDetail>(criteria);
     if (orderDetailList != null && orderDetailList.Count > 0)
     {
         bool canComplete = true;
         TransportationOrder order = this.LoadTransportationOrder(orderDetailList[0].TransportationOrder.OrderNo);
         foreach (TransportationOrderDetail orderDetail in order.OrderDetails)
         {
             if (orderDetail.InProcessLocation.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE)
             {
                 canComplete = false;
                 break;
             }
         }
         if (order.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS && canComplete)
         {
             CompleteTransportationOrder(order, user);
         }
     }
 }
コード例 #19
0
 public IList<InProcessLocationDetail> GetInProcessLocationDetail(InProcessLocation inProcessLocation)
 {
     return GetInProcessLocationDetail(inProcessLocation.IpNo);
 }
コード例 #20
0
        public Receipt ConvertInProcessLocationToReceipt(InProcessLocation inProcessLocation, IDictionary<string, string> huIdStorageBinDic, string externalOrderNo)
        {
            Receipt receipt = new Receipt();
            receipt.ExternalReceiptNo = externalOrderNo;
            receipt.AddInProcessLocation(inProcessLocation);
            if (inProcessLocation.InProcessLocationDetails != null && inProcessLocation.InProcessLocationDetails.Count > 0)
            {
                foreach (InProcessLocationDetail inProcessLocationDetail in inProcessLocation.InProcessLocationDetails)
                {
                    OrderLocationTransaction orderLocationTransaction = inProcessLocationDetail.OrderLocationTransaction;
                    OrderDetail orderDetail = orderLocationTransaction.OrderDetail;
                    OrderHead orderHead = orderDetail.OrderHead;

                    OrderLocationTransaction inOrderLocationTransaction = this.orderLocationTransactionMgrE.GetOrderLocationTransaction(orderDetail.Id, BusinessConstants.IO_TYPE_IN)[0];

                    bool isMerge = false;
                    if (receipt.ReceiptDetails != null && receipt.ReceiptDetails.Count > 0 && !inProcessLocation.IsReceiptScanHu)
                    {
                        //如果收货不扫描条码,收货项需要根据发货项进行合并
                        foreach (ReceiptDetail receiptDetail in receipt.ReceiptDetails)
                        {
                            if (inOrderLocationTransaction.Id == receiptDetail.OrderLocationTransaction.Id)
                            {
                                //if (inProcessLocationDetail.IsConsignment == receiptDetail.IsConsignment
                                //    && inProcessLocationDetail.PlannedBill == receiptDetail.PlannedBill) {
                                //    throw new BusinessErrorException("寄售库存,不能按按数量进行收货。");
                                //}

                                isMerge = true;
                                receiptDetail.ShippedQty += inProcessLocationDetail.Qty;
                                receiptDetail.ReceivedQty += inProcessLocationDetail.Qty;
                                break;
                            }
                        }
                    }

                    if (!isMerge)
                    {
                        ReceiptDetail receiptDetail = new ReceiptDetail();

                        receiptDetail.OrderLocationTransaction = inOrderLocationTransaction;
                        receiptDetail.Id = inProcessLocationDetail.Id;
                        receiptDetail.ShippedQty = inProcessLocationDetail.Qty;
                        receiptDetail.ReceivedQty = inProcessLocationDetail.Qty;
                        if (inProcessLocation.IsReceiptScanHu)   //只有按条码收货才Copy条码信息
                        {
                            receiptDetail.HuId = inProcessLocationDetail.HuId;
                            receiptDetail.LotNo = inProcessLocationDetail.LotNo;

                            //上架库位赋值
                            if (inOrderLocationTransaction.OrderDetail.OrderHead.SubType == BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE_VALUE_NML
                                && huIdStorageBinDic != null
                                && receiptDetail.HuId != null
                                && receiptDetail.HuId.Trim() != string.Empty
                                && huIdStorageBinDic.ContainsKey(receiptDetail.HuId.Trim()))
                            {
                                receiptDetail.PutAwayBinCode = huIdStorageBinDic[receiptDetail.HuId.Trim()];
                            }
                        }
                        receiptDetail.IsConsignment = inProcessLocationDetail.IsConsignment;
                        receiptDetail.PlannedBill = inProcessLocationDetail.PlannedBill;
                        receiptDetail.Receipt = receipt;

                        if (receiptDetail.ShippedQty != 0)//过滤已收满数量
                        {
                            receipt.AddReceiptDetail(receiptDetail);
                        }
                    }
                }
            }

            return receipt;
        }
コード例 #21
0
 public virtual InProcessLocationDetail LoadInProcessLocationDetail(com.Sconit.Entity.Distribution.InProcessLocation inProcessLocation, com.Sconit.Entity.MasterData.OrderLocationTransaction orderLocationTransaction, String lotNo)
 {
     return(entityDao.LoadInProcessLocationDetail(inProcessLocation, orderLocationTransaction, lotNo));
 }
コード例 #22
0
    private void PrintASN(InProcessLocation inProcessLocation)
    {
       // inProcessLocation.InProcessLocationDetails = TheInProcessLocationDetailMgr.SummarizeInProcessLocationDetails(inProcessLocation.InProcessLocationDetails);
        if (inProcessLocation.AsnTemplate == null || inProcessLocation.AsnTemplate == string.Empty)
        {
            ShowErrorMessage("ASN.PrintError.NoASNTemplate");
            return;
        }

        IList<object> list = new List<object>();
        list.Add(inProcessLocation);
        list.Add(inProcessLocation.InProcessLocationDetails);

        //报表url
        string asnUrl = TheReportMgr.WriteToFile(inProcessLocation.AsnTemplate, list);
        //客户端打印
        //如果在UpdatePanel中调用JavaScript需要使用 ScriptManager.RegisterClientScriptBlock
        ScriptManager.RegisterClientScriptBlock(this, GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + asnUrl + "'); </script>", false);
        //Page.ClientScript.RegisterStartupScript(GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + asnUrl + "'); </script>");
    }
コード例 #23
0
        private InProcessLocation ShipOrder(InProcessLocation inProcessLocation, User user, bool checkOrderStatus)
        {
            #region 变量定义
            IList<InProcessLocationDetail> nonZeroInProcessLocationDetailList = new List<InProcessLocationDetail>(); //存储非0发货项
            IDictionary<string, OrderHead> cachedOrderHead = new Dictionary<string, OrderHead>();  //缓存用到的OrderHead
            #endregion

            #region 判断是否全0发货
            if (inProcessLocation.InProcessLocationDetails != null && inProcessLocation.InProcessLocationDetails.Count > 0)
            {
                //判断全0发货
                foreach (InProcessLocationDetail inProcessLocationDetail in inProcessLocation.InProcessLocationDetails)
                {
                    if (inProcessLocationDetail.Qty != 0)
                    {
                        nonZeroInProcessLocationDetailList.Add(inProcessLocationDetail);
                    }
                }

                if (nonZeroInProcessLocationDetailList.Count == 0)
                {
                    throw new BusinessErrorException("OrderDetail.Error.OrderDetailShipEmpty");
                }
                else
                {
                    inProcessLocation.InProcessLocationDetails = nonZeroInProcessLocationDetailList;
                }
            }
            else
            {
                throw new BusinessErrorException("OrderDetail.Error.OrderDetailShipEmpty");
            }
            #endregion

            #region 发货
            DoShipOrder(inProcessLocation, user, checkOrderStatus);
            #endregion

            #region 判断自动收货
            if (inProcessLocation.IsAutoReceive)
            {
                if (inProcessLocation.CompleteLatency.HasValue && inProcessLocation.CompleteLatency.Value > 0)
                {
                    //todo 收货延迟,记录到Quratz表中
                    throw new NotImplementedException("Complete Latency Not Implemented");
                }
                else
                {
                    //立即收货
                    ReceiveFromInProcessLocation(inProcessLocation, user, null, null);
                }
            }
            #endregion

            return inProcessLocation;
        }
コード例 #24
0
        /*
         * 填充报表头
         *
         * Param repack 报验单头对象
         */
        private void FillHead(InProcessLocation ip)
        {
            this.SetRowCell( 7, 27, ip.CreateDate.ToShortDateString());
            //this.SetRowCell( 10, 30, "5500032357");
            this.SetRowCell( 17, 5, ip.InProcessLocationDetails.Count.ToString());

            var detail = from i in ip.InProcessLocationDetails
                         group i by new { i.OrderLocationTransaction.Item.Code, i.OrderLocationTransaction.Item.Description, i.OrderLocationTransaction.Item.Uom }
                             into g
                             select new { g.Key.Code, g.Key.Description, g.Key.Uom, qty = g.Sum(i => i.Qty) };

            int offset = 0;
            foreach (var row in detail)
            {
                this.SetRowCell( 27 + offset, 3, row.Description);
                this.SetRowCell( 27 + offset, 12, ((ItemReference)(itemrefMgr.GetItemReference(row.Code, ip.PartyTo.Code)[0])).ReferenceCode);
                this.SetRowCell( 27 + offset, 20, row.Uom.Description);
                this.SetRowCell( 27 + offset, 25, Math.Round(row.qty, 0).ToString());
                offset++;
            }
        }
コード例 #25
0
ファイル: RepASNMgr.cs プロジェクト: Novthirteen/yfkey-scms
 /*
  * 填充报表头
  *
  * Param pageIndex 页号
  * Param orderHead 订单头对象
  * Param orderDetails 订单明细对象
  */
 private void FillHead(InProcessLocation inProcessLocation)
 {
     //首部
     //No.
     string ipNo = inProcessLocation.IpNo;
     if (inProcessLocation.PrintCount > 0)
     {
         ipNo += "      (" + inProcessLocation.PrintCount.ToString() + ")";
     }
     this.SetRowCell(3, 14, ipNo);
     //收货单位
     this.SetRowCell(5, 2, inProcessLocation.PartyTo.Name);
     if (inProcessLocation.OrderType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER)
     {
         //移库路线上没有shipto,暂时取默认的地址
         ShipAddress shipAddress = shipAddressMgr.GetDefaultShipAddress(inProcessLocation.PartyTo);
         this.SetRowCell(5, 9, shipAddress == null ? string.Empty : shipAddress.Address);
     }
     else
     {
         //地址
         this.SetRowCell(5, 9, inProcessLocation.ShipTo == null ? string.Empty : inProcessLocation.ShipTo.Address);
     }
     //卸货地点
     //运输方法
     //车号
     //介绍信编号
     //货物出门性质
     CodeMaster codeMaster = codeMasterMgr.LoadCodeMaster(BusinessConstants.CODE_MASTER_ORDER_TYPE, inProcessLocation.OrderType);
     this.SetRowCell(6, 16, codeMaster.Description);
 }
コード例 #26
0
        public InProcessLocationDetail GetNoneHuAndIsConsignmentInProcessLocationDetail(InProcessLocation inProcessLocation, OrderLocationTransaction orderLocationTransaction)
        {
            DetachedCriteria criteria = DetachedCriteria.For<InProcessLocationDetail>();

            criteria.Add(Expression.Eq("InProcessLocation.IpNo", inProcessLocation.IpNo));
            criteria.Add(Expression.Eq("OrderLocationTransaction.Id", orderLocationTransaction.Id));
            criteria.Add(Expression.Or(Expression.IsNull("HuId"), Expression.Eq("HuId", "")));
            criteria.Add(Expression.Eq("IsConsignment", false));

            IList<InProcessLocationDetail> list = this.criteriaMgr.FindAll<InProcessLocationDetail>(criteria);

            if (list != null && list.Count > 0)
            {
                return list[0];
            }
            else
            {
                return null;
            }
        }
コード例 #27
0
        /*
         * 填充报表头
         * 
         * Param pageIndex 页号
         * Param orderHead 订单头对象
         * Param orderDetails 订单明细对象
         */
        protected void FillHead(InProcessLocation inProcessLocation)
        {

            //首部
            //No.
            this.SetRowCell(3, 14, inProcessLocation.IpNo);
            //收货单位
            this.SetRowCell(5, 2, inProcessLocation.PartyTo.Name);
            //地址
            this.SetRowCell(5, 9, inProcessLocation.ShipTo == null ? string.Empty : inProcessLocation.ShipTo.Address);

            //卸货地点
            //运输方法
            //车号
            //介绍信编号
            //货物出门性质
            CodeMaster codeMaster = codeMasterMgrE.LoadCodeMaster(BusinessConstants.CODE_MASTER_ORDER_TYPE, inProcessLocation.OrderType);
            this.SetRowCell(6, 16, codeMaster.Description);

        }
コード例 #28
0
        private void DoShipOrder(InProcessLocation inProcessLocation, User user, bool checkOrderStatus)
        {
            #region 变量定义
            IDictionary<string, OrderHead> cachedOrderHead = new Dictionary<string, OrderHead>();  //缓存用到的OrderHead
            IList<InProcessLocationDetail> batchFeedInProcessLocationDetailList = new List<InProcessLocationDetail>();
            #endregion

            #region 更新订单信息
            foreach (InProcessLocationDetail inProcessLocationDetail in inProcessLocation.InProcessLocationDetails)
            {
                OrderLocationTransaction orderLocationTransaction = inProcessLocationDetail.OrderLocationTransaction;
                OrderDetail orderDetail = orderLocationTransaction.OrderDetail;
                OrderHead orderHead = orderDetail.OrderHead;

                if (orderLocationTransaction.BackFlushMethod != BusinessConstants.CODE_MASTER_BACKFLUSH_METHOD_VALUE_BATCH_FEED)
                {
                    #region 判断OrderHead状态并缓存
                    if (!cachedOrderHead.ContainsKey(orderHead.OrderNo))
                    {
                        //检查权限
                        //if (!OrderHelper.CheckOrderOperationAuthrize(orderHead, user, BusinessConstants.ORDER_OPERATION_SHIP_ORDER))
                        //{
                        //    throw new BusinessErrorException("Order.Error.NoShipPermission", orderHead.OrderNo);
                        //}

                        //判断OrderHead状态
                        if (checkOrderStatus && orderHead.Status != BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
                        {
                            throw new BusinessErrorException("Order.Error.StatusErrorWhenShip", orderHead.Status, orderHead.OrderNo);
                        }

                        #region 整包装收货判断,快速的不要判断
                        if (orderHead.FulfillUnitCount && orderHead.Type != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION
                            && orderHead.SubType == BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE_VALUE_NML && !(orderHead.IsAutoRelease && orderHead.IsAutoStart))
                        {
                            if (inProcessLocationDetail.Qty % orderDetail.UnitCount != 0)
                            {
                                //不是整包装
                                throw new BusinessErrorException("Order.Error.NotFulfillUnitCountGrGi", orderDetail.Item.Code);
                            }
                        }
                        #endregion

                        //缓存OrderHead
                        cachedOrderHead.Add(orderHead.OrderNo, orderHead);
                    }
                    #endregion

                    #region 更新OrderLocationTransaction、OrderDetail数量
                    this.orderDetailMgrE.RecordOrderShipQty(orderLocationTransaction, inProcessLocationDetail, true);
                    #endregion
                }
                else
                {
                    //只有普通的工单才记录待回冲表,返工不记录。
                    if (orderHead.SubType == BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE_VALUE_NML)
                    {

                        batchFeedInProcessLocationDetailList.Add(inProcessLocationDetail);
                    }
                }
            }
            #endregion

            #region 创建ASN
            this.inProcessLocationMgrE.CreateInProcessLocation(inProcessLocation, user);
            #endregion

            #region 新增投料回冲计划数
            if (batchFeedInProcessLocationDetailList.Count > 0)
            {
                foreach (InProcessLocationDetail inProcessLocationDetail in batchFeedInProcessLocationDetailList)
                {
                    OrderLocationTransaction orderLocationTransaction = inProcessLocationDetail.OrderLocationTransaction;

                    OrderPlannedBackflush orderPlannedBackflush = new OrderPlannedBackflush();
                    orderPlannedBackflush.OrderLocationTransaction = orderLocationTransaction;
                    orderPlannedBackflush.InProcessLocation = inProcessLocation;
                    orderPlannedBackflush.IsActive = true;
                    orderPlannedBackflush.PlannedQty = orderLocationTransaction.UnitQty * inProcessLocationDetail.Qty;

                    this.orderPlannedBackflushMgrE.CreateOrderPlannedBackflush(orderPlannedBackflush);
                }
            }
            #endregion

            #region 更新订单头信息
            DateTime dateTimeNow = DateTime.Now;
            foreach (OrderHead orderHead in cachedOrderHead.Values)
            {
                orderHead.LastModifyUser = user;
                orderHead.LastModifyDate = dateTimeNow;
                this.orderHeadMgrE.UpdateOrderHead(orderHead);
            }
            #endregion
        }
コード例 #29
0
 public void InitPageParameter(InProcessLocation ip)
 {
     this.InitPageParameter(ip, false);
 }
コード例 #30
0
        public void CreateInProcessLocationDetail(InProcessLocation inProcessLocation, OrderLocationTransaction outOrderLocationTransaction, IList<InventoryTransaction> inventoryTransactionList)
        {
            if (inventoryTransactionList != null && inventoryTransactionList.Count > 0)
            {
                InProcessLocationDetail mergedInProcessLocationDetail = null;

                foreach (InventoryTransaction inventoryTransaction in inventoryTransactionList)
                {
                    if (inventoryTransaction.Hu == null && !inventoryTransaction.IsConsignment)
                    {
                        #region 合并发货数量
                        //没有HU && 非寄售才可以合并
                        if (mergedInProcessLocationDetail == null)
                        {
                            mergedInProcessLocationDetail = new InProcessLocationDetail();
                            mergedInProcessLocationDetail.InProcessLocation = inProcessLocation;
                            mergedInProcessLocationDetail.OrderLocationTransaction = outOrderLocationTransaction;
                            mergedInProcessLocationDetail.Item = outOrderLocationTransaction.OrderDetail.Item;
                            mergedInProcessLocationDetail.ReferenceItemCode = outOrderLocationTransaction.OrderDetail.ReferenceItemCode;
                            mergedInProcessLocationDetail.CustomerItemCode = outOrderLocationTransaction.OrderDetail.CustomerItemCode;
                            mergedInProcessLocationDetail.Uom = outOrderLocationTransaction.OrderDetail.Uom;
                            mergedInProcessLocationDetail.UnitCount = outOrderLocationTransaction.OrderDetail.UnitCount;
                            mergedInProcessLocationDetail.LocationFrom = outOrderLocationTransaction.OrderDetail.LocationFrom;
                            mergedInProcessLocationDetail.LocationTo = outOrderLocationTransaction.OrderDetail.LocationTo;
                        }

                        mergedInProcessLocationDetail.Qty += (0 - inventoryTransaction.Qty) / outOrderLocationTransaction.UnitQty;
                        #endregion
                    }
                    else
                    {
                        InProcessLocationDetail inProcessLocationDetail = new InProcessLocationDetail();
                        inProcessLocationDetail.InProcessLocation = inProcessLocation;
                        inProcessLocationDetail.OrderLocationTransaction = outOrderLocationTransaction;
                        if (inventoryTransaction.Hu != null)
                        {
                            inProcessLocationDetail.HuId = inventoryTransaction.Hu.HuId;
                            inProcessLocationDetail.LotNo = inventoryTransaction.Hu.LotNo;
                        }
                        inProcessLocationDetail.IsConsignment = inventoryTransaction.IsConsignment;
                        inProcessLocationDetail.PlannedBill = inventoryTransaction.PlannedBill;
                        inProcessLocationDetail.Qty = (0 - inventoryTransaction.Qty) / outOrderLocationTransaction.UnitQty;
                        inProcessLocationDetail.Item = outOrderLocationTransaction.OrderDetail.Item;
                        inProcessLocationDetail.ReferenceItemCode = outOrderLocationTransaction.OrderDetail.ReferenceItemCode;
                        inProcessLocationDetail.CustomerItemCode = outOrderLocationTransaction.OrderDetail.CustomerItemCode;
                        inProcessLocationDetail.Uom = outOrderLocationTransaction.OrderDetail.Uom;
                        inProcessLocationDetail.UnitCount = outOrderLocationTransaction.OrderDetail.UnitCount;
                        inProcessLocationDetail.LocationFrom = outOrderLocationTransaction.OrderDetail.LocationFrom;
                        inProcessLocationDetail.LocationTo = outOrderLocationTransaction.OrderDetail.LocationTo;

                        inProcessLocation.AddInProcessLocationDetail(inProcessLocationDetail);

                        this.CreateInProcessLocationDetail(inProcessLocationDetail);
                    }
                }

                if (mergedInProcessLocationDetail != null)
                {
                    inProcessLocation.AddInProcessLocationDetail(mergedInProcessLocationDetail);

                    this.CreateInProcessLocationDetail(mergedInProcessLocationDetail);
                }
            }
        }
コード例 #31
0
ファイル: PrintingMgr.cs プロジェクト: Novthirteen/yfkey-scms
        private ReceiptNote InProcessLocation2ReceiptNote(InProcessLocation inProcessLocation)
        {
            ReceiptNote receiptNote = new ReceiptNote();
            receiptNote.OrderNo = inProcessLocation.IpNo;
            receiptNote.CreateDate = inProcessLocation.CreateDate;
            receiptNote.CreateUser = inProcessLocation.CreateUser == null ? string.Empty : inProcessLocation.CreateUser.Code;
            receiptNote.Status = inProcessLocation.Status;

            return receiptNote;
        }
コード例 #32
0
 //重置发货数
 public static void ClearShippedQty(InProcessLocation inProcessLocation)
 {
     if (inProcessLocation.InProcessLocationDetails != null && inProcessLocation.InProcessLocationDetails.Count > 0)
     {
         foreach (InProcessLocationDetail inProcessLocationDetail in inProcessLocation.InProcessLocationDetails)
         {
             inProcessLocationDetail.Qty = 0;
         }
     }
 }