Example #1
0
 protected void btnAgree_Click(object sender, EventArgs e)
 {
     try
     {
         decimal applyformId;
         if (decimal.TryParse(Request.QueryString["id"], out applyformId))
         {
             CheckPNR();
             RefundOrScrapApplyform      applyform = ApplyformQueryService.QueryRefundOrScrapApplyform(applyformId);
             IEnumerable <RefundFeeView> feeInfos  = CollectFeeInfo();
             if (!feeInfos.Any())
             {
                 throw new Exception("费率输入不正确!");
             }
             string pnr  = txtPNR.Text.Trim();
             string bpnr = txtBPNR.Text.Trim();
             var    refundProcessView = new RefundProcessView
             {
                 NewPNR = new PNRPair(pnr, bpnr),
                 Items  = feeInfos
             };
             ApplyformProcessService.AgreeRefundOrScrapByProvider(applyformId, refundProcessView, CurrentUser.UserName, CurrentUser.Name);
             ReleaseLock(applyformId);
             RegisterScript(this, "alert('同意退废票成功');location.href='/OrderModule/Provide/ChangeProcessList.aspx'");
         }
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex, "同意退/废票");
     }
 }
Example #2
0
 protected void btnAgree_Click(object sender, EventArgs e)
 {
     try
     {
         decimal applyformId;
         if (decimal.TryParse(Request.QueryString["id"], out applyformId))
         {
             CheckPNR();
             RefundOrScrapApplyform applyform = ApplyformQueryService.QueryRefundOrScrapApplyform(applyformId);
             string pnr  = txtPNR.Text.Trim();
             string bpnr = txtBPNR.Text.Trim();
             var    refundProcessView = new RefundProcessView
             {
                 NewPNR = new PNRPair(pnr, bpnr)
             };
             ApplyformProcessService.AgreeRefundOrScrapByProvider(applyformId, refundProcessView, CurrentUser.UserName, CurrentUser.Name);
             ReleaseLock(applyformId);
             RegisterScript(this, "alert('同意退废票成功');location.href='" + ReturnUrl + "'");
         }
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex, "同意废票");
     }
 }
Example #3
0
        protected override IEnumerable <Service.Distribution.Domain.Bill.Refund.RefundFlight> AgreeByProviderExecuteCore(RefundProcessView processView)
        {
            var supplierFee           = SystemManagement.SystemParamService.ResourcerRate;
            var providerFee           = SystemManagement.SystemParamService.ProviderRate;
            var providerFeePerTicket  = IsSpecial && !Order.IsThirdRelation ? (providerFee + supplierFee) : providerFee;
            var supplierFeePerTicket  = IsSpecial && Order.IsThirdRelation ? supplierFee : 0;
            var purchaserFeePerTicket = providerFeePerTicket + supplierFeePerTicket;

            foreach (var flight in Flights)
            {
                var flightCount = flight.OriginalFlight.Ticket.Flights.Count();
                var fee         = purchaserFeePerTicket / flightCount;
                flight.RefundRate = 0;
                decimal?refundServiceCharge = null;
                var     specialBunk         = flight.OriginalFlight.Bunk as Bunk.SpecialBunk;
                if (specialBunk != null)
                {
                    // 废票时,服务费全退
                    refundServiceCharge = specialBunk.ServiceCharge;
                }
                yield return(new Service.Distribution.Domain.Bill.Refund.RefundFlight(flight.OriginalFlight.ReservateFlight)
                {
                    Rate = 0,
                    FeeForPurchaser = fee,
                    FeeForProvider = providerFeePerTicket / flightCount,
                    FeeForSupplier = supplierFeePerTicket / flightCount,
                    RefundServiceCharge = refundServiceCharge
                });
            }
        }
Example #4
0
 protected override IEnumerable <Service.Distribution.Domain.Bill.Refund.RefundFlight> AgreeByProviderExecuteCore(RefundProcessView processView)
 {
     if (processView.Items == null)
     {
         throw new CustomException("缺少退票处理信息");
     }
     foreach (var flight in Flights)
     {
         var refundRate = 0M;
         var refundFee  = 0M;
         if (RefundType == RefundType.Involuntary)
         {
             refundRate = 0;
             refundFee  = 0;
         }
         else
         {
             var refundFlightProcessView = processView.Items.FirstOrDefault(item => flight.OriginalFlight.IsSameVoyage(item.AirportPair));
             if (refundFlightProcessView == null)
             {
                 throw new CustomException("缺少航段的处理信息。航段:" + flight.OriginalFlight.Departure.Code + "-" + flight.OriginalFlight.Arrival.Code);
             }
             refundRate = refundFlightProcessView.Rate;
             refundFee  = Utility.Calculator.Round(refundFlightProcessView.Fee, 0);
         }
         flight.RefundRate = refundRate;
         yield return(new Service.Distribution.Domain.Bill.Refund.RefundFlight(flight.OriginalFlight.ReservateFlight)
         {
             Rate = refundRate,
             FeeForProvider = refundFee,
             FeeForPurchaser = refundFee,
             FeeForSupplier = 0,
             RefundServiceCharge = flight.RefundServiceCharge
         });
     }
 }
Example #5
0
 protected abstract IEnumerable <Service.Distribution.Domain.Bill.Refund.RefundFlight> AgreeByProviderExecuteCore(RefundProcessView processView);
Example #6
0
        /// <summary>
        /// 出票方同意退/废票
        /// 不会退款,仅提交财务审核
        /// </summary>
        internal IEnumerable <Service.Distribution.Domain.Bill.Refund.RefundFlight> AgreeByProvider(RefundProcessView processView, string operatorAccount, string operatorName)
        {
            checkProcessByBusiness();
            if (RequireSeparatePNR && PNRPair.IsNullOrEmpty(processView.NewPNR))
            {
                throw new CustomException("未提供分离后的新编码");
            }
            NewPNR = processView.NewPNR;
            var refundFlights = AgreeByProviderExecuteCore(processView);

            Status          = RefundApplyformStatus.AgreedByProviderBusiness;
            Operator        = operatorName;
            OperatorAccount = operatorAccount;
            Processed();
            return(refundFlights);
        }