示例#1
0
        void biStkIn_Click(object sender, EventArgs e)
        {
            DataGridViewRow row = dgvPurchaseOrder.CurrentRow;

            if (row != null)
            {
                Guid?poguid = row.Cells["colPOGuid"].Value.ToGuid();
                ORD_PurchaseOrderResult orderResult = orderLogic.GetInfo(new ORD_PurchaseOrderParam()
                {
                    POGuid = poguid
                });
                if (orderResult != null && orderResult.Status == "Complete" && orderResult.StkInOccStatus != "全部占有")
                {
                    List <ORD_PurchaseOrderLineResult> lineList = orderResult.OrderLineList;
                    if (lineList != null && lineList.Count > 0)
                    {
                        //有效的可作为入库明细的采购记录
                        List <ORD_PurchaseOrderLineResult> effLineList = lineList.Where(a => a.IsCancel == false && a.Qty > a.StkInOccQty).ToList();
                        if (effLineList != null && effLineList.Count > 0)
                        {
                            STK_InResult inResult = stkInLogic.GetInfo(new STK_InParam()
                            {
                                SourceBillGuid = poguid, Status = "New"
                            });
                            frmStkIn frmStkIn = new frmStkIn();
                            frmStkIn.BringToFront();
                            frmStkIn.StartPosition = FormStartPosition.CenterParent;
                            if (inResult != null)
                            {
                                //存在关联的未提交的入库单
                                frmStkIn.StkInGuid = inResult.StkInGuid;
                            }
                            frmStkIn.ShowDialog();
                        }
                        else
                        {
                            this.ShowMessage("当前采购单没有再需要入库的采购明细!若存在有关联的已提交未审核的入库单,请及时联系相关人员审核!");
                        }
                    }
                }
                else
                {
                    this.ShowMessage("未审核或者全部占有的采购单据不允许入库!");
                }
            }
            else
            {
                this.ShowMessage("未选中数据行!");
            }
        }
示例#2
0
        private void InitData()
        {
            if (poguid != null)
            {
                ORD_PurchaseOrderResult info = orderLogic.GetInfo(new ORD_PurchaseOrderParam {
                    POGuid = poguid
                });
                this.ConvertEntityToControl <ORD_PurchaseOrderResult>(this.stcpOrder.Controls, info, null);
                this.ConvertEntityToControl <ORD_PurchaseOrderResult>(this.stcpOther.Controls, info, null);
                this.ConvertEntityToControl <ORD_PurchaseOrderResult>(this.stcpConEntry.Controls, info, null);
                if (info != null)
                {
                    txtPurDeptName.Text = info.HR_DepartmentResult == null ? "" : info.HR_DepartmentResult.DeptName;
                    decimal taxAmount   = Math.Round(info.TaxAmount.ToDecimal(), 3, MidpointRounding.AwayFromZero);
                    decimal totalAmount = Math.Round(info.Amount.ToDecimal(), 3, MidpointRounding.AwayFromZero);
                    txtAmount.Text    = totalAmount.ToStringHasNull();
                    txtTaxAmount.Text = taxAmount.ToStringHasNull();
                    if (info.OrderLineList != null)
                    {
                        addOrModifyList = info.OrderLineList;
                    }
                }
                this.CheckIsReadOnly <ORD_PurchaseOrderResult>(info);
                this.CheckAuditStatus <ORD_PurchaseOrderResult>(info, this.stcpOrder, this.panDtlOpr, this.stcpOther, this.stcpAttachFiles, this.stcpConEntry, this.stcpLine);
                this.EditBeforeData = info;
            }
            else
            {
                cboInvType.SelectedValue = "备货库存";
                string date = DateTime.Now.Date.ToStringHasNull();
                txtPODate.Text           = date;
                txtNeedDeliveryDate.Text = date;
                txtNeedPayAmtDate.Text   = date;

                this.txtPurDeptName.Text = MySession.DeptName;
                this.txtPurDeptID.Text   = MySession.DeptID.ToStringHasNull();
                this.txtBuyerName.Text   = MySession.UserName;
                this.txtBuyerID.Text     = MySession.UserID.ToStringHasNull();

                SYS_DictItemLineLogic.SetCombolSelectedIndex(this.cboPurOrgID, MySession.OrgID, true);
            }
            bsOrderLine.DataSource          = addOrModifyList;
            dgvPurchaseOrderLine.DataSource = bsOrderLine;

            CheckAuditButton("ORD_PurchaseOrder", poguid, this.tsbSubmit, null, this.tsbAudit, this.tsbUnDo);
            if (this.txtIsCancel.Text.Trim().ToLower() == "true")
            {
                this.lblSignFlag.SetFlag(ZNLCRM.Controls.UcSignature.SignFlag.CancelBill);
                this.tsbCancelBill.Visible = false;
                this.tsbTakeCancel.Visible = true;
            }
            else
            {
                this.lblSignFlag.SetFlag(ZNLCRM.Controls.UcSignature.SignFlag.None);
                this.tsbCancelBill.Visible = true;
                this.tsbTakeCancel.Visible = false;
            }
            this.DataIsChanged = false;
        }
示例#3
0
文件: frmStkIn.cs 项目: halfx/ZNL
        public void InitSourceData(string billType, Guid?sourceBillGuid)
        {
            if (cboBillType.SelectedValue.ToStringHasNull() == "")
            {
                SYS_DictItemLineLogic.SetCombolSelectedIndex(cboBillType, billType, true);
            }
            switch (billType)
            {
            case "PO_IN":    //采购入库
                #region 采购入库
                ORD_PurchaseOrderResult rst = purOrderLogic.GetInfo(new ORD_PurchaseOrderParam()
                {
                    POGuid = sourceBillGuid
                });
                if (rst != null)
                {
                    bsStkInLine.Clear();
                    tempList.Clear();
                    delList.Clear();
                    addOrModifyList.Clear();
                    SetStkLineObjectValue(rst);
                    CalcExchangeRate();
                }
                #endregion
                break;

            case "SOR_IN":    //销售退货入库
                #region 销售退货入库
                ORD_SalesReturnResult returnResult = returnLogic.GetInfo(new ORD_SalesReturnParam()
                {
                    SRGuid = sourceBillGuid
                });
                if (returnResult != null)
                {
                    bsStkInLine.Clear();
                    tempList.Clear();
                    delList.Clear();
                    addOrModifyList.Clear();
                    SetStkLineObjectValue(returnResult);
                    CalcExchangeRate();
                }
                #endregion
                break;
            }
        }
示例#4
0
        private void InitData()
        {
            if (PRGuid != null)
            {
                ORD_PurchaseReturnResult info = returnLogic.GetInfo(new ORD_PurchaseReturnParam {
                    PRGuid = PRGuid
                });

                this.ConvertEntityToControl <ORD_PurchaseReturnResult>(this.stcpBase.Controls, info, null);
                if (info != null)
                {
                    txtOperDeptName.Text = info.OperDeptName;
                    decimal totalAmount = Math.Round(info.Amount.ToDecimal(), 3, MidpointRounding.AwayFromZero);
                    txtAmount.Text = totalAmount.ToStringHasNull();
                    if (info.ReturnLineList != null)
                    {
                        addOrModifyList = info.ReturnLineList;
                    }
                }
            }
            else
            {
                txtReturnDate.Text   = DateTime.Now.Date.ToStringHasNull();
                txtOperDeptID.Text   = MySession.DeptID.ToStringHasNull();
                txtOperDeptName.Text = MySession.DeptName;
                txtOperEmpID.Text    = MySession.UserID.ToStringHasNull();
                txtOperEmpName.Text  = MySession.UserName.ToStringHasNull();
                SYS_DictItemLineLogic.SetCombolSelectedIndex(this.cboOperOrgID, MySession.OrgID, true);
            }
            bsPurchaseReturnLine.DataSource  = addOrModifyList;
            dgvPurchaseReturnLine.DataSource = bsPurchaseReturnLine;
            //CheckAuditButton("ORD_SalesOrder", SRGuid, this.tsbSubmit, null, this.tsbAudit, this.tsbUnDo);
            if (PRGuid == null && SourceBillGuid != null)
            {
                ORD_PurchaseOrderResult orderResult = orderLogic.GetInfo(new ORD_PurchaseOrderParam()
                {
                    POGuid = SourceBillGuid
                });
                if (orderResult != null)
                {
                    InitSourceData(orderResult);
                }
            }
        }