예제 #1
0
        /// <summary>
        /// 生成差错退款账单
        /// </summary>
        internal PlatformBill <NormalRefundRoleBill, NormalRefundRoleBillSource, NormalRefundDetailBill> MakeErrorRefundBill(NormalPayRoleBill payBill, ErrorRefundInfo refundInfo, IEnumerable <NormalRefundRoleBill> refundedBills, IEnumerable <NormalRefundRoleBill> tradeRoleRefundBills)
        {
            var refundBill = new PlatformBill <NormalRefundRoleBill, NormalRefundRoleBillSource, NormalRefundDetailBill>();

            refundBill.Premium  = getPremiumProfit(tradeRoleRefundBills, refundBill.Deduction);
            refundBill.TradeFee = makeTradeFeeProfit(tradeRoleRefundBills);
            refundBill.Account  = Account;
            return(refundBill);
        }
예제 #2
0
        /// <summary>
        /// 生成退款账单
        /// </summary>
        internal PlatformBill <PostponeRefundRoleBill, PostponeRefundRoleBillSource, PostponeRefundDetailBill> MakeRefundBill(PostponePayRoleBill payBill, IEnumerable <PostponeRefundRoleBill> tradeRoleRefundBills)
        {
            var refundBill = new PlatformBill <PostponeRefundRoleBill, PostponeRefundRoleBillSource, PostponeRefundDetailBill> {
                Deduction = makeDeductionProfit(payBill)
            };

            refundBill.Premium  = getPremiumProfit(tradeRoleRefundBills, refundBill.Deduction);
            refundBill.TradeFee = makeTradeFeeProfit(tradeRoleRefundBills);
            refundBill.Account  = Account;
            return(refundBill);
        }
예제 #3
0
        /// <summary>
        /// 生成支付账单
        /// </summary>
        internal PlatformBill <PostponePayRoleBill, PostponePayRoleBillSource, PostponePayDetailBill> MakePayBill(IEnumerable <Order.Domain.Applyform.PostponeFlight> flights, IEnumerable <Order.Domain.Passenger> passengers, IEnumerable <PostponePayRoleBill> tradeRolePayBills)
        {
            var result = new PlatformBill <PostponePayRoleBill, PostponePayRoleBillSource, PostponePayDetailBill> {
                Deduction = this.Deduction.MakePayBill(flights, passengers),
            };

            result.Deduction.Owner.Account = SystemManagement.SystemParamService.PlatformIncodeAccountForPostpone;
            result.Premium  = getPremiumProfit(tradeRolePayBills, result.Deduction);
            result.TradeFee = makeTradeFeeProfit(tradeRolePayBills);
            result.Account  = Deduction.Account;
            return(result);
        }
예제 #4
0
        /// <summary>
        /// 生成支付账单
        /// </summary>
        internal PlatformBill <NormalPayRoleBill, NormalPayRoleBillSource, NormalPayDetailBill> MakePayBill(TradeInfo trade, IEnumerable <NormalPayRoleBill> tradeRolePayBills, Deduction deduction)
        {
            var payBill = new PlatformBill <NormalPayRoleBill, NormalPayRoleBillSource, NormalPayDetailBill>();

            if (deduction != null && (deduction.Rebate != 0 || deduction.Increasing != 0))
            {
                payBill.Deduction = Deduction.MakePayBill(trade, deduction);
                if (payBill.Deduction.Owner != null)
                {
                    payBill.Deduction.Owner.Account = GetAccount(payBill.Deduction.Amount);
                }
            }
            payBill.Premium  = getPremiumProfit(tradeRolePayBills, payBill.Deduction);
            payBill.TradeFee = makeTradeFeeProfit(tradeRolePayBills);
            return(payBill);
        }
예제 #5
0
        private PlatformBill getPlatformBill(BillBase bill)
        {
            var result = new PlatformBill {
                BillType  = getTradementType(bill.TradementBase),
                Remark    = bill.Remark,
                Id        = bill.Id,
                TradeNo   = bill.TradementBase.TradeNo,
                TradeTime = bill.TradeTime,
                Roles     = new List <BillRole>()
            };

            foreach (var roleBill in bill.RoleBills)
            {
                result.Roles.Add(getBillRole(roleBill));
            }
            if (bill.PlatformBasicProfit != null)
            {
                result.Roles.Add(new BillRole {
                    Amount   = bill.PlatformBasicProfit.TradeFee,
                    RoleName = "平台手续费",
                    Owner    = Guid.Empty,
                    Status   = bill.PlatformBasicProfit.Success,
                    Account  = bill.PlatformBasicProfit.Account
                });
                if (bill.PlatformBasicProfit.Premium != 0)
                {
                    result.Roles.Add(new BillRole {
                        Amount   = bill.PlatformBasicProfit.Premium,
                        RoleName = "溢价",
                        Owner    = Guid.Empty,
                        Status   = bill.PlatformBasicProfit.Success,
                        Account  = bill.PlatformBasicProfit.Account
                    });
                }
            }
            result.Roles.Add(new BillRole {
                Amount   = bill.TradementBase.TradeFee,
                RoleName = "通道手续费",
                Owner    = Guid.Empty,
                Status   = null,
                Account  = bill.TradementBase.PayeeAccount
            });
            return(result);
        }