Inheritance: OrderHeadBase
        public void TryAddOrderOperation(OrderHead orderHead, int operation, string reference)
        {
            bool hasOp = false;
            foreach (OrderOperation orderOperation in orderHead.OrderOperations)
            {
                if (orderOperation.Operation == operation)
                {
                    if (orderOperation.Reference == reference
                        || (orderOperation.Reference == null && reference == null))
                    {
                        hasOp = true;
                    }
                }
            }

            if (!hasOp)
            {
                //没有找到Op,新增

                RoutingDetail routingDetail = this.routingDetailMgrE.LoadRoutingDetail(orderHead.Routing, operation, reference);
                if (routingDetail != null)
                {
                    OrderOperation orderOperation = this.GenerateOrderOperation(orderHead, routingDetail);
                    this.CreateOrderOperation(orderOperation);
                }
                else
                {
                    throw new BusinessErrorException("Order.Error.RoutingDetail.Not.Found", orderHead.Routing.Code, operation.ToString(), reference);
                }
            }
        }
Example #2
0
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        OrderHead order = new OrderHead();
        if (this.tbPartyFrom.Text.Trim() != string.Empty)
        {
            order.PartyFrom = ThePartyMgr.LoadParty(this.tbPartyFrom.Text.Trim());
        }
        if (this.tbOrderNo.Text.Trim() != string.Empty)
        {
            order.OrderNo = this.tbOrderNo.Text.Trim();
        }

        if (this.tbStartTime.Text.Trim() != string.Empty)
        {
            order.ReleaseDate = DateTime.Parse(this.tbStartTime.Text.Trim());
        }

        if (this.tbEndTime.Text.Trim() != string.Empty)
        {
            order.StartDate = DateTime.Parse(this.tbEndTime.Text.Trim());
        }
        order.CreateUser = this.CurrentUser;
        order.CreateDate = DateTime.Now;

        IList<object> list = new List<object>();

        IList<WoReceiptView> woReceiptList = TheCriteriaMgr.FindAll<WoReceiptView>(SetCriteria());

        list.Add(order);
        list.Add(woReceiptList);
        string printUrl = TheReportMgr.WriteToFile("WoReceipt.xls", list);
        Page.ClientScript.RegisterStartupScript(GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + printUrl + "'); </script>");
        this.ShowSuccessMessage("MasterData.WoReceipt.Print.Successful");
    }
    public void InitPageParameter(OrderHead orderHead)
    {
        IList<OrderLocationTransaction> outLocTransList = new List<OrderLocationTransaction>();

        foreach (OrderDetail orderDetail in orderHead.OrderDetails)
        {
            decimal currentReceiveQty = orderDetail.CurrentReceiveQty == null ? 0 : (decimal)orderDetail.CurrentReceiveQty;
            decimal currentRejectQty = orderDetail.CurrentRejectQty == null ? 0 : (decimal)orderDetail.CurrentRejectQty;
            decimal currentScrapQty = orderDetail.CurrentScrapQty == null ? 0 : (decimal)orderDetail.CurrentScrapQty;
            decimal backoutQty = currentReceiveQty + currentRejectQty + currentScrapQty;
            foreach (OrderLocationTransaction orderLocTrans in orderDetail.OrderLocationTransactions)
            {
                if (orderLocTrans.IOType == BusinessConstants.IO_TYPE_IN)
                {
                    orderLocTrans.CurrentReceiveQty = orderLocTrans.UnitQty * currentReceiveQty;
                    orderLocTrans.CurrentRejectQty = orderLocTrans.UnitQty * currentRejectQty;
                    orderLocTrans.CurrentScrapQty = orderLocTrans.UnitQty * currentScrapQty;
                    outLocTransList.Add(orderLocTrans);

                }
            }
        }
        this.GV_List.DataSource = outLocTransList;
        this.GV_List.DataBind();
    }
        public InProcessLocation GenerateInProcessLocation(OrderHead orderHead)
        {
            InProcessLocation inProcessLocation = new InProcessLocation();

            CloneHelper.CopyProperty(orderHead, inProcessLocation, OrderHead2InProcessLocationCloneField);

            return inProcessLocation;
        }
        public OrderOperation GenerateOrderOperation(OrderHead orderHead, RoutingDetail routingDetail)
        {
            OrderOperation orderOp = new OrderOperation();
            CloneHelper.CopyProperty(routingDetail, orderOp, OrderOperationCloneFields);
            orderOp.OrderHead = orderHead;
            //todo UnitTime��WorkTime����

            orderHead.AddOrderOperation(orderOp);
            return orderOp;
        }
    public void CollectData(OrderHead orderHead)
    {
        foreach (GridViewRow gvr in GV_List.Rows)
        {
            int flowDetailId = int.Parse(((HiddenField)gvr.FindControl("hfFlowDetailId")).Value);
            string itemCode = ((Label)gvr.FindControl("lblItemCode")).Text;
            decimal reqQty = decimal.Parse(((Label)gvr.FindControl("lblOrderedQty")).Text);

            orderHead.GetOrderDetailByFlowDetailIdAndItemCode(flowDetailId, itemCode).RequiredQty = reqQty;
            orderHead.GetOrderDetailByFlowDetailIdAndItemCode(flowDetailId, itemCode).OrderedQty = reqQty;
        }
    }
        public OrderBinding CreateOrderBinding(OrderHead order, Flow bindedFlow, string bindingType)
        {
            OrderBinding orderBinding = new OrderBinding();

            orderBinding.OrderHead = order;
            orderBinding.BindedFlow = bindedFlow;
            orderBinding.BindingType = bindingType;

            this.CreateOrderBinding(orderBinding);

            return orderBinding;
        }
        public virtual OrderOperation LoadOrderOperation(com.Sconit.Entity.MasterData.OrderHead orderHead, Int32 operation)
        {
            string hql = @"from OrderOperation entity where entity.OrderHead.OrderNo = ? and entity.Operation = ?";
            IList <OrderOperation> result = FindAllWithCustomQuery <OrderOperation>(hql, new object[] { orderHead.OrderNo, operation }, new IType[] { NHibernateUtil.String, NHibernateUtil.Int32 });

            if (result != null && result.Count > 0)
            {
                return(result[0]);
            }
            else
            {
                return(null);
            }
        }
    public void InitPageParameter(OrderHead orderHead)
    {
        this.GV_List.DataSource = orderHead.OrderDetails;

        #region 设置默认LotNo
        string lotNo = LotNoHelper.GenerateLotNo();
        foreach (OrderDetail orderDetail in orderHead.OrderDetails)
        {
            orderDetail.HuLotNo = lotNo;
        }
        #endregion

        this.GV_List.DataBind();
    }
        public IList<OrderOperation> GenerateOrderOperation(OrderHead orderHead)
        {
            if (orderHead.Routing != null)
            {
                IList<OrderOperation> orderOperationList = new List<OrderOperation>();
                IList<RoutingDetail> routingDetailList = this.routingDetailMgr.GetRoutingDetail(orderHead.Routing, DateTime.Now);
                foreach (RoutingDetail routingDetail in routingDetailList)
                {
                    orderOperationList.Add(GenerateOrderOperation(orderHead, routingDetail));
                }

                return orderOperationList;
            }

            return null;
        }
Example #11
0
        public void GenerateOrderHeadSubsidiary(OrderHead orderHead)
        {
            if (orderHead.OrderDetails != null && orderHead.OrderDetails.Count > 0)
            {
                foreach (OrderDetail orderDetail in orderHead.OrderDetails)
                {
                    this.orderDetailMgr.GenerateOrderDetailSubsidiary(orderDetail);
                }
            }

            #region ����������׷��Operation
            if (orderHead.Type != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION
                && orderHead.Routing != null)
            {
                this.orderOperationMgr.GenerateOrderOperation(orderHead);
            }
            #endregion
        }
    public void InitPageParameter(OrderHead orderHead, bool hasOdd, bool isOddCreateHu)
    {
        IList<OrderDetail> orderDetailList = new List<OrderDetail>();
        foreach (OrderDetail orderDetail in orderHead.OrderDetails)
        {
            if (orderDetail.CurrentReceiveQty != 0 || orderDetail.CurrentRejectQty != 0 || orderDetail.CurrentScrapQty != 0)
            {
                orderDetailList.Add(orderDetail);
            }
        }
        this.GV_List.DataSource = orderDetailList;
        this.GV_List.DataBind();

        if (hasOdd)
        {
            this.lblIsOddCreateHu.Visible = true;
            this.cbIsOddCreateHu.Visible = true;
            this.cbIsOddCreateHu.Checked = isOddCreateHu;
        }
    }
    private IList<OrderHead> GetList()
    {
        IList<OrderHead> orderHeadList = new List<OrderHead>();
        foreach (GridViewRow gvr in GV_List.Rows)
        {
            string flowCode = ((Label)gvr.FindControl("lblFlow")).Text;
            DateTime startTime = DateTime.Parse(((TextBox)gvr.FindControl("tbStartTime")).Text);
            DateTime windowTime = DateTime.Parse(((TextBox)gvr.FindControl("tbWindowTime")).Text);

            OrderHead oh = new OrderHead();
            oh = TheOrderMgr.TransferFlow2Order(flowCode);
            oh.Priority = BusinessConstants.CODE_MASTER_ORDER_PRIORITY_VALUE_NORMAL;
            oh.StartTime = startTime;
            oh.WindowTime = windowTime;

            this.GetDetailControl(gvr).CollectData(oh);
            OrderHelper.FilterZeroOrderQty(oh);
            orderHeadList.Add(oh);
        }
        return orderHeadList;
    }
 public void InitPageParameter(OrderHead orderHead, bool isChanged)
 {
     if (InLocTransList == null || InLocTransList.Count == 0 || isChanged)
     {
         InLocTransList = new List<OrderLocationTransaction>();
         IDictionary<string, int> detailDic = new Dictionary<string, int>();
         foreach (OrderDetail orderDetail in orderHead.OrderDetails)
         {
             decimal currentReceiveQty = orderDetail.CurrentReceiveQty == null ? 0 : (decimal)orderDetail.CurrentReceiveQty;
             decimal currentRejectQty = orderDetail.CurrentRejectQty == null ? 0 : (decimal)orderDetail.CurrentRejectQty;
             decimal currentScrapQty = orderDetail.CurrentScrapQty == null ? 0 : (decimal)orderDetail.CurrentScrapQty;
             decimal backoutQty = currentReceiveQty + currentRejectQty + currentScrapQty;
             foreach (OrderLocationTransaction orderLocTrans in orderDetail.OrderLocationTransactions)
             {
                 if (orderLocTrans.IOType == BusinessConstants.IO_TYPE_OUT)
                 {
                     if (detailDic.ContainsKey(orderLocTrans.Item.Code + "-" + orderLocTrans.Operation))
                     {
                         InLocTransList[detailDic[orderLocTrans.Item.Code + "-" + orderLocTrans.Operation]].CurrentReceiveQty += orderLocTrans.UnitQty * backoutQty;
                         InLocTransList[detailDic[orderLocTrans.Item.Code + "-" + orderLocTrans.Operation]].OrderedQty += orderLocTrans.OrderedQty;
                         if (InLocTransList[detailDic[orderLocTrans.Item.Code + "-" + orderLocTrans.Operation]].UnitQty != 0 && backoutQty != 0)
                         {
                             InLocTransList[detailDic[orderLocTrans.Item.Code + "-" + orderLocTrans.Operation]].UnitQty = InLocTransList[detailDic[orderLocTrans.Item.Code + "-" + orderLocTrans.Operation]].CurrentReceiveQty / ((InLocTransList[detailDic[orderLocTrans.Item.Code + "-" + orderLocTrans.Operation]].CurrentReceiveQty - orderLocTrans.UnitQty * backoutQty) / InLocTransList[detailDic[orderLocTrans.Item.Code + "-" + orderLocTrans.Operation]].UnitQty + backoutQty);
                         }
                     }
                     else
                     {
                         detailDic.Add(orderLocTrans.Item.Code + "-" + orderLocTrans.Operation, InLocTransList.Count);
                         orderLocTrans.CurrentReceiveQty = orderLocTrans.UnitQty * backoutQty;
                         InLocTransList.Add(orderLocTrans);
                     }
                 }
             }
         }
     }
     this.GV_List.DataSource = InLocTransList;
     this.GV_List.DataBind();
 }
Example #15
0
 public virtual OrderOperation LoadOrderOperation(com.Sconit.Entity.MasterData.OrderHead orderHead, Int32 operation)
 {
     return(entityDao.LoadOrderOperation(orderHead, operation));
 }
    private void InitDetailParamater(OrderHead orderHead)
    {
        Flow currentFlow = this.TheFlowMgr.LoadFlow(orderHead.Flow);
        bool isScanHu = currentFlow.IsShipScanHu || currentFlow.IsReceiptScanHu || (currentFlow.CreateHuOption == BusinessConstants.CODE_MASTER_CREATE_HU_OPTION_VALUE_GI) || currentFlow.CreateHuOption == BusinessConstants.CODE_MASTER_CREATE_HU_OPTION_VALUE_GR;

        if (this.IsQuick && isScanHu && !this.IsReject)
        {
            this.ucHuList.InitPageParameter(orderHead);
            this.ucList.Visible = false;
            this.ucHuList.Visible = true;
        }
        else
        {
            if (!currentFlow.IsListDetail)
            {
                orderHead.OrderDetails = new List<OrderDetail>();
            }

            this.ucList.CleanPrice();
            this.ucList.IsReject = this.IsReject;
           
            this.ucList.InitPageParameter(orderHead);
            this.ucList.Visible = true;
            this.ucHuList.Visible = false;
        }
    }
    //供新增订单使用,由于还订单还没有保存,所以需要在ViewState中缓存OrderHead
    public void InitPageParameter(OrderHead orderHead)
    {
        this.NewOrEdit = "New";
        this.TheOrder = orderHead;
        this.TaxRate = TheOrder.TaxCode == null ? decimal.Zero : decimal.Parse(TheOrder.TaxCode);
        this.hfTax.Value = this.TaxRate.ToString("0.##");
        this.FlowCode = orderHead.Flow;
        this.StartTime = orderHead.StartTime > DateTime.Now ? orderHead.StartTime : DateTime.Now;
        this.PartyFromCode = orderHead.PartyFrom.Code;
        this.PartyToCode = orderHead.PartyTo.Code;
        if (orderHead.Currency != null)
        {
            this.currencyCode = orderHead.Currency.Code;
        }
        int seqInterval = int.Parse(TheEntityPreferenceMgr.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_SEQ_INTERVAL).Value);

        IList<OrderDetail> orderDetailList = new List<OrderDetail>();
        IList<OrderDetail> oldrderDetailList = new List<OrderDetail>();
        if (orderHead.OrderDetails != null && orderHead.OrderDetails.Count > 0)
        {
            foreach (OrderDetail orderDetail in orderHead.OrderDetails)
            {
                if (OrderHelper.IsOrderDetailValid(orderDetail, orderHead.WindowTime))
                {
                    orderDetailList.Add(orderDetail);
                    oldrderDetailList.Add(orderDetail);
                }
            }
        }

        //经过有效期校验,明细会改变
        TheOrder.OrderDetails = oldrderDetailList;

        if (this.IsShowPrice && !orderHead.IsShowPrice)
        {
            this.IsShowPrice = false;
        }
        if (orderHead.AllowCreateDetail)
        {
            OrderDetail blankOrderDetail = new OrderDetail();
            int seq = int.Parse(TheEntityPreferenceMgr.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_SEQ_INTERVAL).Value);
            if (this.TheOrder.OrderDetails == null || this.TheOrder.OrderDetails.Count == 0)
            {
                blankOrderDetail.Sequence = seqInterval;
            }
            else
            {
                CurrentSeq = this.TheOrder.OrderDetails.Last<OrderDetail>().Sequence + seqInterval;
                blankOrderDetail.Sequence = CurrentSeq;
            }
            blankOrderDetail.IsBlankDetail = true;
            orderDetailList.Add(blankOrderDetail);
        }

        this.GV_List.DataSource = orderDetailList;
        this.GV_List.DataBind();

        UpdateView(this.TheOrder);
    }
    //根据订单类型隐藏相应列
    private void HiddenGVColumn(OrderHead orderHead)
    {

        #region 按flowtype显示
        if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT)
        {
            this.GV_List.Columns[6].Visible = false;  //来源库位
            this.GV_List.Columns[8].Visible = false;  //物料清单
        }
        else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION)
        {
            this.GV_List.Columns[7].Visible = false;  //目的库位
            this.GV_List.Columns[8].Visible = false;  //物料清单
        }
        else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION)
        {
            this.GV_List.Columns[6].Visible = false;  //来源库位
        }

        else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER)
        {
            this.GV_List.Columns[8].Visible = false;  //物料清单
        }

        #endregion

        #region 数量字段
        if (orderHead.Status == null ||
            orderHead.Status == string.Empty ||
            orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE)
        {
            this.GV_List.Columns[10].Visible = false;  //已发数量
            this.GV_List.Columns[11].Visible = false;  //发货数量
            this.GV_List.Columns[12].Visible = false;  //已收数量
            this.GV_List.Columns[13].Visible = false;  //收货数量
            this.GV_List.Columns[14].Visible = false;  //次品数量
            this.GV_List.Columns[15].Visible = false;  //废品数量
            this.GV_List.Columns[20].Visible = orderHead.AllowCreateDetail;   //操作按钮
        }
        else if (orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT)
        {
            this.GV_List.Columns[10].Visible = false;  //已发数量
            this.GV_List.Columns[11].Visible = false;  //发货数量
            this.GV_List.Columns[12].Visible = false;  //已收数量
            this.GV_List.Columns[13].Visible = false;  //收货数量
            this.GV_List.Columns[14].Visible = false;  //次品数量
            this.GV_List.Columns[15].Visible = false;  //废品数量
            this.GV_List.Columns[20].Visible = false;   //操作按钮
        }
        else if (orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CANCEL)
        {
            this.GV_List.Columns[10].Visible = false;  //已发数量
            this.GV_List.Columns[11].Visible = false;  //发货数量
            this.GV_List.Columns[12].Visible = false;  //已收数量
            this.GV_List.Columns[13].Visible = false;  //收货数量
            this.GV_List.Columns[14].Visible = false;  //次品数量
            this.GV_List.Columns[15].Visible = false;  //废品数量
            this.GV_List.Columns[20].Visible = false;   //操作按钮
        }
        else if (orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
        {
            if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT)
            {
                this.GV_List.Columns[10].Visible = false;  //已发数量
                this.GV_List.Columns[11].Visible = false;  //发货数量
                this.GV_List.Columns[12].Visible = true;   //已收数量
                this.GV_List.Columns[13].Visible = false;   //收货数量
                this.GV_List.Columns[14].Visible = false;  //次品数量
                this.GV_List.Columns[15].Visible = false;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
            else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION)
            {
                this.GV_List.Columns[10].Visible = true;   //已发数量
                this.GV_List.Columns[11].Visible = false;   //发货数量
                this.GV_List.Columns[12].Visible = true;  //已收数量
                this.GV_List.Columns[13].Visible = false;  //收货数量
                this.GV_List.Columns[14].Visible = false;  //次品数量
                this.GV_List.Columns[15].Visible = false;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
            else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION)
            {
                this.GV_List.Columns[10].Visible = false;  //已发数量
                this.GV_List.Columns[11].Visible = false;  //发货数量
                this.GV_List.Columns[12].Visible = true;  //已收数量
                this.GV_List.Columns[13].Visible = true;  //收货数量
                this.GV_List.Columns[14].Visible = true;  //次品数量
                this.GV_List.Columns[15].Visible = true;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
            else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER)
            {
                this.GV_List.Columns[10].Visible = false;  //已发数量
                this.GV_List.Columns[11].Visible = false;  //发货数量
                this.GV_List.Columns[12].Visible = false;  //已收数量
                this.GV_List.Columns[13].Visible = true;   //收货数量
                this.GV_List.Columns[14].Visible = false;  //次品数量
                this.GV_List.Columns[15].Visible = false;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
        }
        else if (orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_COMPLETE)
        {
            if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT)
            {
                this.GV_List.Columns[10].Visible = false;  //已发数量
                this.GV_List.Columns[11].Visible = false;  //发货数量
                this.GV_List.Columns[12].Visible = true;   //已收数量
                this.GV_List.Columns[13].Visible = false;  //收货数量
                this.GV_List.Columns[14].Visible = false;  //次品数量
                this.GV_List.Columns[15].Visible = false;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
            else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION)
            {
                this.GV_List.Columns[10].Visible = true;   //已发数量
                this.GV_List.Columns[11].Visible = false;  //发货数量
                this.GV_List.Columns[12].Visible = false;  //已收数量
                this.GV_List.Columns[13].Visible = false;  //收货数量
                this.GV_List.Columns[14].Visible = false;  //次品数量
                this.GV_List.Columns[15].Visible = false;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
            else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION)
            {
                this.GV_List.Columns[10].Visible = false;  //已发数量
                this.GV_List.Columns[11].Visible = false;  //发货数量
                this.GV_List.Columns[12].Visible = true;   //已收数量
                this.GV_List.Columns[13].Visible = false;  //收货数量
                this.GV_List.Columns[14].Visible = false;  //次品数量
                this.GV_List.Columns[15].Visible = false;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
            else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER)
            {
                this.GV_List.Columns[10].Visible = false;  //已发数量
                this.GV_List.Columns[11].Visible = false;  //发货数量
                this.GV_List.Columns[12].Visible = true;   //已收数量
                this.GV_List.Columns[13].Visible = false;  //收货数量
                this.GV_List.Columns[14].Visible = false;  //次品数量
                this.GV_List.Columns[15].Visible = false;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
        }
        else if (orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_CLOSE)
        {
            if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT)
            {
                this.GV_List.Columns[10].Visible = false;  //已发数量
                this.GV_List.Columns[11].Visible = false;  //发货数量
                this.GV_List.Columns[12].Visible = true;   //已收数量
                this.GV_List.Columns[13].Visible = false;  //收货数量
                this.GV_List.Columns[14].Visible = false;  //次品数量
                this.GV_List.Columns[15].Visible = false;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
            else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION)
            {
                this.GV_List.Columns[10].Visible = true;   //已发数量
                this.GV_List.Columns[11].Visible = false;  //发货数量
                this.GV_List.Columns[12].Visible = false;  //已收数量
                this.GV_List.Columns[13].Visible = false;  //收货数量
                this.GV_List.Columns[14].Visible = false;  //次品数量
                this.GV_List.Columns[15].Visible = false;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
            else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION)
            {
                this.GV_List.Columns[10].Visible = false;  //已发数量
                this.GV_List.Columns[11].Visible = false;  //发货数量
                this.GV_List.Columns[12].Visible = true;   //已收数量
                this.GV_List.Columns[13].Visible = false;  //收货数量
                this.GV_List.Columns[14].Visible = false;  //次品数量
                this.GV_List.Columns[15].Visible = false;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
            else if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER)
            {
                this.GV_List.Columns[10].Visible = false;  //已发数量
                this.GV_List.Columns[11].Visible = false;  //发货数量
                this.GV_List.Columns[12].Visible = true;   //已收数量
                this.GV_List.Columns[13].Visible = false;  //收货数量
                this.GV_List.Columns[14].Visible = false;  //次品数量
                this.GV_List.Columns[15].Visible = false;  //废品数量
                this.GV_List.Columns[20].Visible = false;   //操作按钮
            }
        }
        else if (orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_VOID)
        {
            this.GV_List.Columns[10].Visible = true;  //已发数量
            this.GV_List.Columns[11].Visible = false;  //发货数量
            this.GV_List.Columns[12].Visible = true;   //已收数量
            this.GV_List.Columns[13].Visible = false;  //收货数量
            this.GV_List.Columns[14].Visible = false;  //次品数量
            this.GV_List.Columns[15].Visible = false;  //废品数量
            this.GV_List.Columns[20].Visible = false;   //操作按钮
        }
        #endregion


        //if (orderHead.IsShipByOrder &&
        //     orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS && orderHead.Type != BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION)
        //{
        //    this.GV_List.Columns[11].Visible = true;
        //}
        //else
        //{
        //    this.GV_List.Columns[11].Visible = false;
        //}

    }
Example #19
0
    private void InitDetailParamater(OrderHead orderHead)
    {
        Flow currentFlow = this.TheFlowMgr.LoadFlow(orderHead.Flow);

        if (!currentFlow.IsListDetail)
        {
            orderHead.OrderDetails = new List<OrderDetail>();
        }

        this.ucList.CleanPrice();

        this.ucList.NewItem = this.NewItem;
        this.ucList.InitPageParameter(orderHead);
        this.ucList.Visible = true;
    }
Example #20
0
        private ReceiptNote Order2ReceiptNote(OrderHead orderHead)
        {
            ReceiptNote receiptNote = new ReceiptNote();
            receiptNote.OrderNo = orderHead.OrderNo;
            receiptNote.CreateDate = orderHead.CreateDate;
            receiptNote.CreateUser = orderHead.CreateUser == null ? string.Empty : orderHead.CreateUser.Code;
            receiptNote.Status = orderHead.Status;

            return receiptNote;
        }
 /// <summary>
 /// 生产收货转换
 /// </summary>
 /// <param name="orderHead"></param>
 /// <returns></returns>
 public static List<Transformer> ConvertOrderHeadToTransformers(OrderHead orderHead)
 {
     List<Transformer> transformers = new List<Transformer>();
     if (orderHead == null || orderHead.OrderDetails == null || orderHead.OrderDetails.Count == 0)
     {
         return null;
     }
     foreach (OrderDetail orderDetail in orderHead.OrderDetails)
     {
         transformers.Add(ConvertOrderDetailToTransformer(orderDetail));
     }
     return transformers;
 }
Example #22
0
        public IList<Hu> CreateHu(OrderHead orderHead, User user)
        {
            if (orderHead.OrderDetails != null && orderHead.OrderDetails.Count > 0)
            {
                IList<Hu> huList = new List<Hu>();
                foreach (OrderDetail orderDetail in orderHead.OrderDetails)
                {
                    IListHelper.AddRange<Hu>(huList,
                        CreateHu(orderDetail.Item, orderDetail.OrderedQty, orderDetail.HuLotNo, orderDetail.Uom, orderDetail.UnitCount, orderDetail.HuLotSize,
                        null, null, null, orderDetail.OrderHead.PartyFrom, BusinessConstants.CODE_MASTER_ITEM_QUALITY_LEVEL_VALUE_1, user, orderDetail, null, orderDetail.ItemVersion, null,orderDetail.CustomerItemCode));
                }

                return huList;
            }

            return null;
        }
 public IList<OrderOperation> GetOrderOperation(OrderHead orderHead)
 {
     return GetOrderOperation(orderHead.OrderNo);
 }
        public void TryDeleteOrderOperation(OrderHead orderHead, IList<int> operationList)
        {
            IList<int> usedOpList = new List<int>();
            foreach (OrderDetail orderDetail in orderHead.OrderDetails)
            {
                foreach (OrderLocationTransaction orderLocationTransaction in orderDetail.OrderLocationTransactions)
                {
                    if (operationList.Contains(orderLocationTransaction.Operation)
                        && !usedOpList.Contains(orderLocationTransaction.Operation))
                    {
                        //������ЩOp��������ϸʹ�ã����뵽usedOpList����
                        usedOpList.Add(orderLocationTransaction.Operation);
                    }
                }
            }

            foreach (int op in operationList)
            {
                //û��ʹ�õ�op����ɾ��
                if (!usedOpList.Contains(op))
                {
                    this.DeleteOrderOperation(orderHead.OrderNo, op);
                }
            }
        }
 public void TryDeleteOrderOperation(OrderHead orderHead, int operation)
 {
     IList<int> operationList = new List<int>();
     operationList.Add(operation);
     TryDeleteOrderOperation(orderHead, operationList);
 }
        /*
         * 填充报表头
         * 
         * Param repack 报验单头对象
         */
        private void FillHead(OrderHead orderHead)
        {


            //订单号:
            string orderCode = Utility.BarcodeHelper.GetBarcodeStr(orderHead.OrderNo, this.barCodeFontName);
            this.SetRowCell(2, 8, orderCode);
            //Order No.:
            this.SetRowCell(3, 8, orderHead.OrderNo);

            if ("Normal".Equals(orderHead.Priority))
            {
                this.SetRowCell(4, 5, "");
            }
            else
            {
                this.SetRowCell(3, 5, "");
            }

            //发出时间 Issue Time:
            this.SetRowCell(4, 9, orderHead.StartDate.ToString());

            //供应商代码 Supplier Code:	
            this.SetRowCell(6, 3, orderHead.PartyFrom != null ? orderHead.PartyFrom.Code : String.Empty);

            //交货日期 Delivery Date:getDemandDeliverDate
            this.SetRowCell(6, 8, orderHead.WindowTime.ToLongDateString());


            //供应商名称 Supplier Name:		
            this.SetRowCell(7, 3, orderHead.PartyFrom != null ? orderHead.PartyFrom.Name : String.Empty);
            //窗口时间 Window Time:
            this.SetRowCell(7, 8, orderHead.WindowTime.ToLongTimeString());

            //供应商地址 Address:	
            this.SetRowCell(8, 3, orderHead.ShipFrom != null ? orderHead.ShipFrom.Address : String.Empty);
            //交货道口 Delivery Dock:
            this.SetRowCell(8, 8, orderHead.DockDescription);

            //供应商联系人 Contact:	
            this.SetRowCell(9, 3, orderHead.ShipFrom != null ? orderHead.ShipFrom.ContactPersonName : String.Empty);
            //物流协调员 Follow Up:
            this.SetRowCell(9, 8, orderHead.ShipTo != null ? orderHead.ShipTo.ContactPersonName : String.Empty);

            //供应商电话 Telephone:		
            this.SetRowCell(10, 3, orderHead.ShipFrom != null ? orderHead.ShipFrom.TelephoneNumber : String.Empty);
            //YFV电话 Telephone:
            this.SetRowCell(10, 8, orderHead.ShipTo != null ? orderHead.ShipTo.TelephoneNumber : String.Empty);

            //供应商传真 Fax:	
            this.SetRowCell(11, 3, orderHead.ShipFrom != null ? orderHead.ShipFrom.Fax : String.Empty);
            //YFV传真 Fax:
            this.SetRowCell(11, 8, orderHead.ShipTo != null ? orderHead.ShipTo.Fax : String.Empty);

            //系统号 SysCode:
            //this.SetRowCell(++rowNum, 3, "");
            //版本号 Version:
            //this.SetRowCell(rowNum, 8, "");
        }
Example #27
0
 public IList<OrderBinding> GetOrderBinding(OrderHead orderHead, params string[] bindingTypes)
 {
     return GetOrderBinding(orderHead.OrderNo, bindingTypes);
 }
    private void UpdateView(OrderHead orderHead)
    {
        HiddenPriceColumn(orderHead);
        //根据订单类型隐藏相应列
        HiddenGVColumn(orderHead);

        if (orderHead == null || orderHead.OrderDetails == null || orderHead.OrderDetails.Count == 0)
        {
            this.tabPrice.Visible = false;
            this.trTax.Visible = false;
            this.trIncludeTaxPrice.Visible = false;
        }
    }
        /*
         * 填充报表头
         * 
         * Param orderHead 要货单头对象
         */
        protected void FillHead(OrderHead orderHead)
        {

            this.SetRowCell(1, 5, orderHead.OrderNo);

            //卖方:
            this.SetRowCell(2, 1, orderHead.BillFrom.Address);

            //签订时间:
            this.SetRowCell(2, 5, orderHead.ReleaseDate == null ? string.Empty : orderHead.ReleaseDate.Value.ToString("yyyy-MM-dd"));

            //地址:
            this.SetRowCell(3, 1, orderHead.ShipFrom.Address);
            //报价单号:	
            this.SetRowCell(3, 5, orderHead.ReferenceOrderNo);
            //电话:
            this.SetRowCell(4, 1, orderHead.ShipFrom.TelephoneNumber);
            //传真:
            this.SetRowCell(4, 5, orderHead.ShipFrom.Fax);
            //联系人:
            this.SetRowCell(5, 1, orderHead.ShipFrom.ContactPersonName);
            //邮政编码:	
            this.SetRowCell(5, 5, orderHead.ShipFrom.PostalCode);

            //买方:
            this.SetRowCell(7, 1, orderHead.BillTo.Address);
            //地址:
            this.SetRowCell(8, 1, orderHead.ShipTo.Address);
            //电话:
            this.SetRowCell(9, 1, orderHead.ShipTo.TelephoneNumber);
            //传真:
            this.SetRowCell(9, 5, orderHead.ShipTo.Fax);
            //联系人:
            this.SetRowCell(10, 1, orderHead.ShipTo.ContactPersonName);
            //邮政编码:	
            this.SetRowCell(10, 5, orderHead.ShipTo.PostalCode);

        }
    //控制价格选项
    private void HiddenPriceColumn(OrderHead orderHead)
    {

        this.tabPrice.Visible = false;              //订单折扣,总价
        this.trTax.Visible = false;                 //税金
        this.trIncludeTaxPrice.Visible = false;     //含税金额
        this.GV_List.Columns[16].Visible = false;  //单价
        this.GV_List.Columns[17].Visible = false;  //折扣率
        this.GV_List.Columns[18].Visible = false;  //折扣金额
        this.GV_List.Columns[19].Visible = false;  //总金额

        if (!AllowEditPrice() || (this.OrderStatus != BusinessConstants.CODE_MASTER_STATUS_VALUE_CREATE && this.OrderStatus != null && this.OrderStatus != string.Empty))
        {

            this.tbOrderDiscount.Attributes.Add("onfocus", "this.blur();");
            this.tbOrderDiscountRate.Attributes.Add("onfocus", "this.blur();");
        }

        //企业选项和Flow选项
        if (this.ModuleSubType != BusinessConstants.CODE_MASTER_ORDER_SUB_TYPE_VALUE_RTN && IsShowPrice && GetOrderHead().IsShowPrice)
        {
            //控制价格字段
            if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION || this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT)
            {
                this.tabPrice.Visible = true;              //订单折扣,总价
                this.GV_List.Columns[16].Visible = true;  //单价
                if (this.IsShowDiscount)
                {
                    this.GV_List.Columns[17].Visible = true;  //折扣率
                    this.GV_List.Columns[18].Visible = true;  //折扣金额
                }
                this.GV_List.Columns[19].Visible = true;  //总金额

                if ((this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT
                || this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION)
                            && (orderHead.IsIncludeTax.HasValue
                             && !orderHead.IsIncludeTax.Value))
                {
                    this.lblOrderTax.Text = decimal.Parse( orderHead.TaxCode).ToString("0.##") + "%" + TheLanguageMgr.TranslateMessage("MasterData.Order.OrderHead.Tax", this.CurrentUser);
                    this.trTax.Visible = true;//税金
                    this.trIncludeTaxPrice.Visible = true;//含税金额
                }

                if (this.NewOrEdit == "Edit")
                {
                    if (this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT
                        || this.ModuleType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION)
                    {
                        tbOrderDetailPrice.Text = orderHead.OrderDetailAmountAfterDiscount.ToString("F2");
                        if (orderHead.Discount != null && orderHead.OrderDiscountRate != null)
                        {
                            tbOrderDiscount.Text = ((decimal)orderHead.Discount).ToString("F2");
                            tbOrderDiscountRate.Text = ((decimal)orderHead.OrderDiscountRate).ToString("F2");
                        }

                        tbOrderPrice.Text = orderHead.OrderAmountAfterDiscount.ToString("F2");

                        if (orderHead != null && (!orderHead.IsIncludeTax.HasValue || !orderHead.IsIncludeTax.Value))
                        {
                            this.tbOrderTax.Text = orderHead.OrderTax.ToString("F2");  //(orderHead.OrderDetailAmountAfterDiscount * decimal.Parse(orderHead.TaxCode) / 100).ToString("F2");
                            this.tbOrderIncludeTaxPrice.Text = orderHead.OrderIncludeTaxPrice.ToString("F2");//(orderHead.OrderDetailAmountAfterDiscount * (decimal.Parse(orderHead.TaxCode) / 100 + 1)).ToString("F2");
                        }
                        else
                        {
                            this.tbOrderTax.Text = string.Empty;
                            this.tbOrderIncludeTaxPrice.Text = string.Empty;
                        }
                    }
                }

            }
        }
    }
 public void InitPageParameter(OrderHead orderHead, bool isChanged)
 {
     BindTransformerDetail();
 }
    private RequisitionOrder fillOrderHead(OrderHead orderHead)
    {
        RequisitionOrder order = new RequisitionOrder();

        com.Sconit.Entity.Svp.User createUser = new com.Sconit.Entity.Svp.User();
        createUser.name = orderHead.CreateUser.Name;

        com.Sconit.Entity.Svp.User planner = new com.Sconit.Entity.Svp.User();
        planner.name = orderHead.CreateUser.Name;

        com.Sconit.Entity.Svp.Party partyFrom = new com.Sconit.Entity.Svp.Party();
        partyFrom.id = orderHead.PartyFrom.Code;
        partyFrom.code = orderHead.PartyFrom.Code;
        partyFrom.description = orderHead.PartyFrom.Name;

        if (orderHead.ShipFrom != null)
        {
            partyFrom.address = orderHead.ShipFrom.Address;
            partyFrom.contact = orderHead.ShipFrom.ContactPersonName;
            partyFrom.telephone = orderHead.ShipFrom.TelephoneNumber;
            partyFrom.mobilephone = orderHead.ShipFrom.MobilePhone;
            partyFrom.fax = orderHead.ShipFrom.Fax;
            partyFrom.postCode = orderHead.ShipFrom.PostalCode;
        }

        com.Sconit.Entity.Svp.Party partyTo = new com.Sconit.Entity.Svp.Party();
        partyTo.id = orderHead.PartyTo.Code;
        partyTo.code = orderHead.PartyTo.Code;
        partyTo.description = orderHead.PartyTo.Name;

        if (orderHead.ShipTo != null)
        {
            partyTo.address = orderHead.ShipTo.Address;
            partyTo.contact = orderHead.ShipTo.ContactPersonName;
            partyTo.telephone = orderHead.ShipTo.TelephoneNumber;
            partyTo.mobilephone = orderHead.ShipTo.MobilePhone;
            partyTo.fax = orderHead.ShipTo.Fax;
            partyTo.postCode = orderHead.ShipTo.PostalCode;
        }

        order.id = orderHead.OrderNo;
        order.requisitionOrderNo = orderHead.OrderNo;
        order.type = orderHead.Type;
        order.orderType = orderHead.SubType;
        order.priority = orderHead.Priority;
        order.createUser = createUser;
        order.createDate = orderHead.CreateDate;
        order.createDateSpecified = true;
        order.effectiveDate = orderHead.StartTime;
        order.effectiveDateSpecified = true;
        order.demandDeliverDate = orderHead.WindowTime;
        order.demandDeliverDateSpecified = true;

        string t = (orderHead.DockDescription == null || orderHead.DockDescription == string.Empty) ?
            orderHead.PartyTo.Code : orderHead.PartyTo.Code + "@" + orderHead.DockDescription;

        order.demandDeliverAddr = orderHead.PartyTo.Name + " " + t + " "
            + (orderHead.DockDescription != null ? orderHead.DockDescription : string.Empty);

        order.partyFrom = partyFrom;
        order.partyTo = partyTo;
        if (orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
        {
            order.status = "In_Process";
        }else{
        order.status = orderHead.Status;
        }
        order.planner = planner;

        order.print = orderHead.IsPrinted;
        order.printSpecified = true;

        return order;
    }