Beispiel #1
0
 /// <summary>
 /// 更新收款单
 /// </summary>
 /// <param name="entity">收款单</param>
 /// <returns></returns>
 /// <remarks>2013-07-08 朱成果 创建</remarks>
 public override void Update(FnReceiptVoucher entity)
 {
     Context.Update("FnReceiptVoucher", entity)
     .AutoMap(x => x.SysNo)
     .Where("SysNo", entity.SysNo)
     .Execute();
 }
Beispiel #2
0
        /// <summary>
        /// 创建订单收款单
        /// </summary>
        /// <param name="soOrder">订单</param>
        /// <returns>收款单实体</returns>
        /// <remarks>2013-07-08 朱成果 创建</remarks>
        public FnReceiptVoucher CreateReceiptVoucherByOrder(SoOrder soOrder)
        {
            var entity = Hyt.DataAccess.Finance.IFnReceiptVoucherDao.Instance.GetEntity(sourceFromOrder, soOrder.SysNo);

            if (entity != null)
            {
                return(null);
            }
            var payType         = Hyt.BLL.Basic.PaymentTypeBo.Instance.GetEntity(soOrder.PayTypeSysNo);
            FnReceiptVoucher rv = new FnReceiptVoucher()
            {
                TransactionSysNo = soOrder.TransactionSysNo,
                Status           = (int)FinanceStatus.收款单状态.待确认,
                Source           = sourceFromOrder,
                CreatedBy        = soOrder.OrderCreatorSysNo,
                CreatedDate      = DateTime.Now,
                LastUpdateBy     = soOrder.OrderCreatorSysNo,
                LastUpdateDate   = DateTime.Now,
                IncomeAmount     = soOrder.CashPay,
                IncomeType       = payType == null?20:payType.PaymentType,
                SourceSysNo      = soOrder.SysNo
            };

            rv.SysNo = Hyt.DataAccess.Finance.IFnReceiptVoucherDao.Instance.Insert(rv);
            return(rv);
        }
Beispiel #3
0
        /// <summary>
        /// 创建订单收款单
        /// </summary>
        /// <param name="soOrder">订单</param>
        /// <returns>FnReceiptVoucher</returns>
        /// <remarks>2013-07-16 黄伟 创建</remarks>
        private FnReceiptVoucher CreateReceiptVoucherByOrder(SoOrder soOrder)
        {
            var entity = IFnReceiptVoucherDao.Instance.GetEntity((int)FinanceStatus.收款来源类型.销售单, soOrder.SysNo);

            if (entity != null)
            {
                return(null);
            }
            var payType = Hyt.BLL.Basic.PaymentTypeBo.Instance.GetEntity(soOrder.PayTypeSysNo);
            var rv      = new FnReceiptVoucher()
            {
                TransactionSysNo = soOrder.TransactionSysNo,
                Status           = (int)FinanceStatus.收款单状态.已确认,
                ConfirmedBy      = soOrder.OrderCreatorSysNo,
                ConfirmedDate    = DateTime.Now,
                Source           = (int)FinanceStatus.收款来源类型.销售单,
                CreatedBy        = soOrder.OrderCreatorSysNo,
                CreatedDate      = DateTime.Now,
                IncomeAmount     = soOrder.CashPay,
                IncomeType       = payType.PaymentType,
                SourceSysNo      = soOrder.SysNo
            };

            rv.SysNo = IFnReceiptVoucherDao.Instance.Insert(rv);
            return(rv);
        }
Beispiel #4
0
        /// <summary>
        /// 添加收款单
        /// </summary>
        /// <param name="entity">收款单实体</param>
        /// <returns>收款单编号</returns>
        /// <remarks>2013-07-08 朱成果 创建</remarks>
        public override int Insert(FnReceiptVoucher entity)
        {
            if (entity.ConfirmedDate == DateTime.MinValue)
            {
                entity.ConfirmedDate = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue;
            }
            var sysNo = Context.Insert("FnReceiptVoucher", entity)
                        .AutoMap(o => o.SysNo)
                        .ExecuteReturnLastId <int>("SysNo");

            return(sysNo);
        }
Beispiel #5
0
        /// <summary>
        /// 作废出库单
        /// </summary>
        /// <param name="sysNo">出库单系统编号</param>
        /// <param name="user">操作用户</param>
        /// <returns>成功返回true,失败返回false</returns>
        /// <remarks>2016-06-27 王耀发 创建</remarks>
        public bool InventoryOutCancel(int sysNo, SyUser user)
        {
            var model = GetWhInventoryOut(sysNo);

            if (null == model)
            {
                throw new HytException("出库单不存在!");
            }
            if (!AdminAuthenticationBo.Instance.HasWareHousePrivilege(model.WarehouseSysNo))
            {
                throw new HytException("用户没有作废该条出库单的权限!");
            }
            FnReceiptVoucher ReceiptVoucher = null;

            if (model.SourceType != (int)WarehouseStatus.出库单来源.调货单)
            {
                //获取对应收款单
                ReceiptVoucher = FnReceiptVoucherBo.Instance.GetEntity((int)Hyt.Model.WorkflowStatus.FinanceStatus.收款来源类型.采购退货单, model.SourceSysNO);
                if (ReceiptVoucher.Status == (int)FinanceStatus.收款单状态.已确认)
                {
                    throw new HytException("该条出库单对应的收款单已确认,不能作废!");
                }
            }
            model.Status = WarehouseStatus.采购退货出库单状态.作废.GetHashCode();
            var id = UpdateWhInventoryOut(model);

            if (id <= 0)
            {
                return(false);
            }
            if (model.SourceType != (int)WarehouseStatus.出库单来源.调货单)
            {
                //更新采购退货单状态
                Hyt.BLL.Purchase.PrPurchaseReturnBo.Instance.UpdateStatus(model.SourceSysNO, (int)PurchaseStatus.采购退货单状态.待审核);
                //更新收款单状态
                ReceiptVoucher.Status         = (int)FinanceStatus.收款单状态.作废;
                ReceiptVoucher.LastUpdateBy   = user.SysNo;
                ReceiptVoucher.LastUpdateDate = DateTime.Now;
                FnReceiptVoucherBo.Instance.Update(ReceiptVoucher);
            }
            return(true);
        }
Beispiel #6
0
        /// <summary>
        /// 二期业务数据1段 财务
        /// </summary>
        /// <param name="listObject"></param>
        private void AddBaseTaskObject2ToList2(List <BaseTask> listObject)
        {
            BaseTask fninvoice = new FnInvoice();

            BaseTask fnpv = new FnReceiptVoucher();
            BaseTask fnReceiptVoucherItem = new FnReceiptVoucherItem();
            BaseTask fnop                 = new FnOnlinePayment();
            BaseTask fnPaymentVoucher     = new FnPaymentVoucher();
            BaseTask fnPaymentVoucherItem = new FnPaymentVoucherItem();



            listObject.Add(fninvoice);
            listObject.Add(fnpv);
            listObject.Add(fnReceiptVoucherItem);
            listObject.Add(fnop);


            listObject.Add(fnPaymentVoucher);
            listObject.Add(fnPaymentVoucherItem);
        }
Beispiel #7
0
        Hyt.Model.Icp.GZBaiYunJiChang.Order.OrderPaymentRel SetOrderPaymentRel(int OrderSysNo)
        {
            FnReceiptVoucher ReceiptVoucher = Hyt.BLL.Finance.FnReceiptVoucherBo.Instance.GetReceiptVoucherByOrder(OrderSysNo);
            List <CBFnReceiptVoucherItem> ReceiptVoucherItemList = Hyt.BLL.Finance.FnReceiptVoucherBo.Instance.GetReceiptVoucherItem(ReceiptVoucher.SysNo);
            string PayEntName = "";
            string PayNo      = "";

            foreach (CBFnReceiptVoucherItem item in ReceiptVoucherItemList)
            {
                if (PayEntName == "")
                {
                    PayEntName = item.PaymentTypeName;
                }
                else
                {
                    PayEntName += "," + item.PaymentTypeName;
                }
                if (PayNo == "")
                {
                    PayNo = item.VoucherNo;
                }
                else
                {
                    PayNo += "," + item.VoucherNo;
                }
            }

            Hyt.Model.Icp.GZBaiYunJiChang.Order.OrderPaymentRel OrderPaymentRel = new Hyt.Model.Icp.GZBaiYunJiChang.Order.OrderPaymentRel();
            //支付企业代码
            OrderPaymentRel.PayEntNo = "C010000000677460";
            //支付企业名称
            OrderPaymentRel.PayEntName = PayEntName;
            //支付交易类型
            OrderPaymentRel.PayType = "M";
            //支付交易编号
            OrderPaymentRel.PayNo = PayNo;
            //备注
            OrderPaymentRel.Notes = "";
            return(OrderPaymentRel);
        }
Beispiel #8
0
        private void AddBaseTaskObjectToList(List <BaseTask> listObject)
        {
            BaseTask bsAT                    = new BsArea();
            BaseTask bsDP                    = new BsDeliveryPayment();
            BaseTask bsPT                    = new BsPaymentType();
            BaseTask bsCode                  = new BsCode();
            BaseTask bsOrganization          = new BsOrganization();
            BaseTask bsOrganizationWarehouse = new BsOrganizationWarehouse();

            BaseTask crCustomer = new CrCustomer();
            BaseTask crCL       = new CrCustomerLevel();
            BaseTask crCQ       = new CrCustomerQuestion();
            BaseTask crRA       = new CrReceiveAddress();

            BaseTask dsMallType      = new DsMallType();
            BaseTask dsDealerLevel   = new DsDealerLevel();
            BaseTask feArticle       = new FeArticle();
            BaseTask feAC            = new FeArticleCategory();
            BaseTask feCS            = new FeCommentSupport();
            BaseTask fepc            = new FeProductComment();
            BaseTask fePCI           = new FeProductCommentImage();
            BaseTask fePCR           = new FeProductCommentReply();
            BaseTask feSearchKeyword = new FeSearchKeyword();
            BaseTask feadvertgroup   = new FeAdvertGroup();
            BaseTask feadvertitem    = new FeAdvertItem();
            BaseTask feproductgroup  = new FeProductGroup();
            BaseTask feproductitem   = new FeProductItem();

            BaseTask fnIT      = new FnInvoiceType();
            BaseTask fninvoice = new FnInvoice();

            BaseTask fnpv = new  FnReceiptVoucher();
            BaseTask fnReceiptVoucherItem = new FnReceiptVoucherItem();
            BaseTask fnop                 = new FnOnlinePayment();
            BaseTask fnPaymentVoucher     = new FnPaymentVoucher();
            BaseTask fnPaymentVoucherItem = new FnPaymentVoucherItem();

            BaseTask lgDelivery              = new LgDelivery();
            BaseTask lgDI                    = new LgDeliveryItem();
            BaseTask lgDS                    = new LgDeliveryScope();
            BaseTask lgDT                    = new LgDeliveryType();
            BaseTask lgDUC                   = new LgDeliveryUserCredit();
            BaseTask lgPT                    = new LgPickupType();
            BaseTask lgsettlement            = new LgSettlement();
            BaseTask lgSI                    = new LgSettlementItem();
            BaseTask lgDeliveryPrintTemplate = new LgDeliveryPrintTemplate();
            BaseTask pdAttribute             = new PdAttribute();
            BaseTask pdAG                    = new PdAttributeGroup();
            BaseTask pdAGA                   = new PdAttributeGroupAssociation();
            BaseTask pdAO                    = new PdAttributeOption();
            BaseTask pdBrand                 = new PdBrand();
            BaseTask pdCGA                   = new PdCatAttributeGroupAso();
            BaseTask pdCategory              = new PdCategory();
            BaseTask pdCA                    = new PdCategoryAssociation();
            BaseTask pdPrice                 = new PdPrice();
            BaseTask pdProduct               = new PdProduct();
            BaseTask pdPA                    = new PdProductAssociation();
            BaseTask pdProductAttribute      = new PdProductAttribute();
            BaseTask pdPI                    = new PdProductImage();
            BaseTask pdTemplate              = new PdTemplate();
            BaseTask pdProductStatistics     = new PdProductStatistics();

            BaseTask soOrder         = new SoOrder();
            BaseTask soOrderItem     = new SoOrderItem();
            BaseTask soRA            = new SoReceiveAddress();
            BaseTask SyUG            = new SyUserGroup();
            BaseTask syGU            = new SyGroupUser();
            BaseTask syMenu          = new SyMenu();
            BaseTask syMenuPrivilege = new SyMenuPrivilege();
            BaseTask syPrivilege     = new SyPrivilege();
            BaseTask syRole          = new SyRole();
            BaseTask syRoleMenu      = new SyRoleMenu();
            BaseTask syRolePrivilege = new SyRolePrivilege();
            BaseTask syPermission    = new SyPermission();
            BaseTask syUser          = new SyUser();
            BaseTask syUW            = new SyUserWarehouse();
            BaseTask syMyMenu        = new SyMyMenu();

            BaseTask spcombo                  = new SpCombo();
            BaseTask spComboItem              = new SpComboItem();
            BaseTask spcopon                  = new spcoupon();
            BaseTask sqpromotion              = new SPpromotion();
            BaseTask spromotiongift           = new SPpromotiongift();
            BaseTask sppromotionoverlay       = new SPpromotionoverlay();
            BaseTask sppromotionrule          = new SPpromotionrule();
            BaseTask sppromotionrulecondition = new SPpromotionrulecondition();
            BaseTask sppromotionrulekeyvalue  = new SPpromotionrulekeyvalue();
            BaseTask syTaskConfig             = new SyTaskConfig();

            BaseTask whStockOut     = new WhStockOut();
            BaseTask whStockOutItem = new WhstockOutItem();
            BaseTask whwarehouse    = new WhWarehouse();
            BaseTask whwa           = new WHwarehousearea();
            BaseTask whwdy          = new WHwarehouseDeliveryType();
            BaseTask whWPT          = new WhWarehousePickupType();
            BaseTask whstockin      = new WhStockIn();
            BaseTask whstockinItem  = new WHStockinItem();
            BaseTask rcReturn       = new RCReturn();
            BaseTask rcReturnItem   = new RcReturnItem();

            listObject.Add(bsAT);
            listObject.Add(bsDP);
            listObject.Add(bsPT);
            listObject.Add(bsCode);
            listObject.Add(bsOrganization);
            listObject.Add(bsOrganizationWarehouse);

            listObject.Add(crCustomer);
            listObject.Add(crCL);
            listObject.Add(crCQ);
            listObject.Add(crRA);
            listObject.Add(dsMallType);
            listObject.Add(dsDealerLevel);
            listObject.Add(feArticle);
            listObject.Add(feAC);
            listObject.Add(feCS);
            listObject.Add(fePCI);
            listObject.Add(fePCR);
            listObject.Add(fepc);
            listObject.Add(feSearchKeyword);
            listObject.Add(feadvertgroup);
            listObject.Add(feadvertitem);
            listObject.Add(feproductgroup);
            listObject.Add(feproductitem);

            listObject.Add(fnIT);
            listObject.Add(fnpv);
            listObject.Add(fnReceiptVoucherItem);
            listObject.Add(fnop);
            listObject.Add(fninvoice);

            listObject.Add(fnPaymentVoucher);
            listObject.Add(fnPaymentVoucherItem);

            listObject.Add(lgDelivery);
            listObject.Add(lgDI);
            listObject.Add(lgDS);
            listObject.Add(lgDT);
            listObject.Add(lgPT);
            listObject.Add(lgsettlement);
            listObject.Add(lgSI);
            listObject.Add(lgDeliveryPrintTemplate);

            listObject.Add(pdAttribute);
            listObject.Add(pdAG);
            listObject.Add(pdAGA);
            listObject.Add(pdAO);
            listObject.Add(pdBrand);
            listObject.Add(pdCGA);
            listObject.Add(pdCategory);
            listObject.Add(pdCA);
            listObject.Add(pdPrice);
            listObject.Add(pdProduct);
            listObject.Add(pdPA);
            listObject.Add(pdProductAttribute);
            listObject.Add(pdTemplate);
            listObject.Add(pdProductStatistics);

            listObject.Add(soOrder);
            listObject.Add(soOrderItem);

            listObject.Add(spcombo);
            listObject.Add(spComboItem);
            listObject.Add(spcopon);
            listObject.Add(sqpromotion);
            listObject.Add(spromotiongift);
            //listObject.Add(sppromotionoverlay);
            listObject.Add(sppromotionrule);
            listObject.Add(sppromotionrulecondition);
            listObject.Add(sppromotionrulekeyvalue);

            listObject.Add(syGU);
            listObject.Add(syUW);
            listObject.Add(SyUG);
            listObject.Add(syMenu);
            listObject.Add(syUser);
            listObject.Add(syPermission);

            listObject.Add(syMenuPrivilege);
            listObject.Add(syPrivilege);
            listObject.Add(syRole);
            listObject.Add(syRoleMenu);
            listObject.Add(syRolePrivilege);
            listObject.Add(syMyMenu);
            listObject.Add(syTaskConfig);

            listObject.Add(whStockOut);
            listObject.Add(whStockOutItem);
            listObject.Add(whwarehouse);
            listObject.Add(whwa);
            listObject.Add(whwdy);
            listObject.Add(whWPT);
            listObject.Add(whstockin);
            listObject.Add(whstockinItem);
            listObject.Add(rcReturn);
            listObject.Add(rcReturnItem);
            listObject.Add(lgDUC);
            listObject.Add(pdPI);
            listObject.Add(soRA);
        }
Beispiel #9
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);
        }
Beispiel #10
0
        /// <summary>
        /// 创建收款单
        /// </summary>
        /// <param name="paymentVoucher"></param>
        /// <returns></returns>
        /// <remarks>
        /// 2016-6-24 王耀发 创建
        /// </remarks>
        public int InsertReceiptVoucher(FnReceiptVoucher receiptVoucher)
        {
            var receiptVoucherSysNo = IFnReceiptVoucherDao.Instance.Insert(receiptVoucher);

            return(receiptVoucherSysNo);
        }
Beispiel #11
0
 /// <summary>
 /// 更新收款单
 /// </summary>
 /// <param name="entity">收款单</param>
 /// <returns></returns>
 /// <remarks>2013-07-08 朱成果 创建</remarks>
 public abstract void Update(FnReceiptVoucher entity);
Beispiel #12
0
 /// <summary>
 /// 添加收款单
 /// </summary>
 /// <param name="entity">收款单实体</param>
 /// <returns>收款单编号</returns>
 /// <remarks>2013-07-08 朱成果 创建</remarks>
 public abstract int Insert(FnReceiptVoucher entity);
Beispiel #13
0
 /// <summary>
 /// 修改收款单
 /// </summary>
 /// <param name="model">收款单实体</param>
 /// <returns></returns>
 ///<remarks>2013-07-08 朱成果 创建</remarks>
 public void Update(FnReceiptVoucher model)
 {
     Hyt.DataAccess.Finance.IFnReceiptVoucherDao.Instance.Update(model);
 }