/// <summary> /// 填充明细 /// </summary> protected virtual void FillRefundPaylineItems(PaylineEntity payline, OrderPayEntity orderPay, PaylineModel model) { if (orderPay == null) { return; } if (orderPay.Order == null || orderPay.Amount <= 0) { return; } var ammount = model.Amount.HasValue ? model.Amount.Value : orderPay.Amount; if (ammount > orderPay.Amount) { ammount = orderPay.Amount; } var paylineItem = new PaylineItemEntity { Order = string.IsNullOrWhiteSpace(model.RefundOrderId) ? orderPay.Order : new OrderEntity { Id = model.RefundOrderId.Convert <long>() }, Payline = payline, Key = orderPay.Key, Amount = 0 - ammount, SaveType = SaveType.Add }; payline.PaylineItems.Add(paylineItem); payline.OutNumber = orderPay.Number; }
/// <summary> /// 填充明细 /// </summary> /// <param name="payline"></param> /// <param name="orders"></param> protected virtual void FillPaylineItems(PaylineEntity payline, IList <OrderEntity> orders) { if (orders == null) { return; } foreach (var order in orders) { var paylineItem = new PaylineItemEntity { Order = order, Payline = payline, Amount = order.PayAmount == 0 && order.Deposit > 0 ? order.Deposit: order.TotalPayAmount - order.PayAmount, SaveType = SaveType.Add }; payline.PaylineItems.Add(paylineItem); } }
/// <summary> /// 填充明细 /// </summary> /// <param name="payline"></param> /// <param name="orderPays"></param> protected virtual void FillRefundPaylineItems(PaylineEntity payline, IList <OrderPayEntity> orderPays) { if (orderPays == null) { return; } foreach (var orderPay in orderPays) { if (orderPay.Order == null || orderPay.Amount <= 0 || orderPay.Order.TotalPayAmount - orderPay.Order.PayAmount >= 0) { continue; } var paylineItem = new PaylineItemEntity { Order = orderPay.Order, Payline = payline, Amount = orderPay.Order.TotalPayAmount - orderPay.Order.PayAmount, SaveType = SaveType.Add }; payline.PaylineItems.Add(paylineItem); payline.OutNumber = orderPay.Number; } }