Exemplo n.º 1
0
 public object GetProductHtmlInfo(Hyt.Model.PdProduct product)
 {
     return("");
 }
Exemplo n.º 2
0
        /// <summary>
        /// 审核采购退货单
        /// </summary>
        /// <param name="sysNo">采购单编号</param>
        /// <remarks>2016-6-18 王耀发 创建</remarks>
        public bool AuditPurchaseReturn(int sysNo)
        {
            int CreatedBy      = BLL.Authentication.AdminAuthenticationBo.Instance.Current.Base.SysNo;
            var purchaseReturn = IPrPurchaseReturnDao.Instance.GetPrPurchaseReturn(sysNo);

            if (UpdateStatus(sysNo, (int)PurchaseStatus.采购退货单状态.已审核))
            {
                var receiptVoucherMod = new FnReceiptVoucher();
                receiptVoucherMod.TransactionSysNo = "";
                receiptVoucherMod.IncomeType       = (int)Hyt.Model.WorkflowStatus.FinanceStatus.收款单收入类型.预付;
                receiptVoucherMod.Source           = (int)Hyt.Model.WorkflowStatus.FinanceStatus.收款来源类型.采购退货单;
                receiptVoucherMod.SourceSysNo      = sysNo;
                receiptVoucherMod.IncomeAmount     = purchaseReturn.ReturnTotalMoney;
                receiptVoucherMod.ReceivedAmount   = 0;
                receiptVoucherMod.Status           = (int)Hyt.Model.WorkflowStatus.FinanceStatus.收款单状态.待确认;
                receiptVoucherMod.Remark           = "采购退货收款单";
                receiptVoucherMod.CreatedBy        = CreatedBy;
                receiptVoucherMod.CreatedDate      = DateTime.Now;
                receiptVoucherMod.ConfirmedBy      = 0;
                receiptVoucherMod.ConfirmedDate    = DateTime.Now;
                receiptVoucherMod.LastUpdateBy     = CreatedBy;
                receiptVoucherMod.LastUpdateDate   = DateTime.Now;
                receiptVoucherMod.PaymentType      = null;
                FinanceBo.Instance.InsertReceiptVoucher(receiptVoucherMod);
                //创建出库单
                WhInventoryOut outEntity = new WhInventoryOut
                {
                    TransactionSysNo = ReceiptNumberBo.Instance.GetPurchaseOutNo(),
                    WarehouseSysNo   = purchaseReturn.WarehouseSysNo,
                    SourceType       = (int)WarehouseStatus.出库单来源.采购单,
                    SourceSysNO      = sysNo,
                    DeliveryType     = 0,
                    Remarks          = "采购退货出库",
                    IsPrinted        = 0,
                    Status           = (int)WarehouseStatus.采购退货出库单状态.待出库,
                    CreatedBy        = CreatedBy,
                    CreatedDate      = DateTime.Now,
                    LastUpdateBy     = CreatedBy,
                    LastUpdateDate   = DateTime.Now,
                    Stamp            = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue,
                };

                outEntity.ItemList = new List <WhInventoryOutItem>();
                var        purchaseReturnDetails = BLL.Purchase.PrPurchaseReturnDetailsBo.Instance.GetPurchaseReturnDetailsList(sysNo);
                PrPurchase purMod = PrPurchaseBo.Instance.GetPrPurchaseInfo(purchaseReturn.PurchaseSysNo);

                //出库明细
                foreach (var item in purchaseReturnDetails)
                {
                    Hyt.Model.PdProduct Product = Hyt.BLL.Product.PdProductBo.Instance.GetProductBySysNo(item.ProductSysNo);
                    outEntity.ItemList.Add(new WhInventoryOutItem
                    {
                        ProductSysNo         = item.ProductSysNo,
                        ProductName          = Product.ProductName,
                        StockOutQuantity     = item.ReturnQuantity,
                        RealStockOutQuantity = 0,
                        SourceItemSysNo      = item.SysNo,//记录出库单明细来源单号(采购退货单明细编号)
                        Remarks        = "",
                        CreatedBy      = CreatedBy,
                        CreatedDate    = DateTime.Now,
                        LastUpdateBy   = CreatedBy,
                        LastUpdateDate = DateTime.Now
                    });
                }
                var inSysNo = WhInventoryOutBo.Instance.CreateWhInventoryOut(outEntity); //保存出库单数据
            }
            return(true);
        }