Esempio n. 1
0
        protected override PayItemInfo PreCheckForCancelAbandon(PayItemInfo entity, out PayableInfo payableInfo)
        {
            var payItemInfo = base.PreCheckForCancelAbandon(entity, out payableInfo);

            CommissionMaster commissionMaster = ExternalDomainBroker.GetCommissionMaster(payableInfo.OrderSysNo.Value);

            if (commissionMaster.Status == VendorCommissionMasterStatus.SET)
            {
                if (payItemInfo.PayStyle != PayItemStyle.Normal)
                {
                    ThrowBizException("PayItem_CancelAbandon_VendorSettleOrderStatusNotMatchPayStyleForCommissionMaster");
                }
            }
            else
            {
                ThrowBizException("PayItem_CancelAbandon_VendorSettleOrderStatusNotSettledForCommissionMaster");
            }
            return(payItemInfo);
        }
Esempio n. 2
0
        protected override void PreCheckForCreate(PayItemInfo entity)
        {
            base.PreCheckForCreate(entity);

            CommissionMaster commissionMaster = ExternalDomainBroker.GetCommissionMaster(entity.OrderSysNo.Value);

            if (commissionMaster == null)
            {
                ThrowBizException("PayItem_OrderNotExisitsFormat", entity.OrderSysNo);
            }
            //填写佣金账扣上的CompanyCode为付款单CompanyCode
            entity.CompanyCode = commissionMaster.CompanyCode;
            entity.OrderStatus = (int?)commissionMaster.Status;

            if (commissionMaster.Status == VendorCommissionMasterStatus.SET)
            {
                if (entity.PayStyle != PayItemStyle.Normal)
                {
                    ThrowBizException("PayItem_Create_OnlyCanAddNormalPayForVendorSettleOrder");
                }
            }
            else
            {
                ThrowBizException("PayItem_Create_CommissionMasterStatusInvalid");
            }

            List <PayableInfo> payList = PayableBizProcessor.GetListByCriteria(new PayableInfo()
            {
                OrderSysNo = entity.OrderSysNo,
                OrderType  = entity.OrderType
            });

            //如果该单据已经有支付,对该应付作检查
            if (payList != null && payList.Count > 0)
            {
                ReferencePayableInfo = payList[0];
                if (ReferencePayableInfo.PayStatus == PayableStatus.FullPay)
                {
                    ThrowBizException("PayItem_Create_FullPay");
                }
            }
        }