退还扣除运单费
This commit is contained in:
@@ -485,14 +485,18 @@ func ResetCreateWaybillFee(db *dao.DaoDB, order *model.GoodsOrder) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !isRefund {
|
if !isRefund { // 骑手已经到店了,无法退款
|
||||||
return err
|
globals.SugarLogger.Debug("Refund Money Fail:", "骑手已到店,无法退款")
|
||||||
|
return errors.New("骑手已到店,无法退款")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取品牌的支付记录
|
// 获取品牌的支付记录
|
||||||
orderBill, _ := dao.GetBrandBill(db, store.BrandID, order.VendorOrderID, model.BrandBillTypeExpend, model.BrandBillFeeTypeDelivery, order.VendorWaybillID)
|
orderBill, _ := dao.GetBrandBill(db, store.BrandID, order.VendorOrderID, 0, model.BrandBillFeeTypeDelivery, order.VendorWaybillID)
|
||||||
if len(orderBill) != model.YES {
|
for _, v := range orderBill {
|
||||||
return errors.New("订单支出数据异常,应该为一条数据")
|
if v.BillType == model.BrandBillTypeIncome { // 已经退款了
|
||||||
|
globals.SugarLogger.Debug("Refund Money Fail:", "同一订单无法重复退款")
|
||||||
|
return errors.New("无法重复退款")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将支出记录修改为退款记录,支付类型为收入,且类型为三方配送时:退费
|
// 将支出记录修改为退款记录,支付类型为收入,且类型为三方配送时:退费
|
||||||
|
|||||||
@@ -240,11 +240,11 @@ func (c *BaseScheduler) CancelWaybill(bill *model.Waybill, cancelReasonID int, c
|
|||||||
if handlerInfo := partner.GetDeliveryPlatformFromVendorID(bill.WaybillVendorID); handlerInfo != nil {
|
if handlerInfo := partner.GetDeliveryPlatformFromVendorID(bill.WaybillVendorID); handlerInfo != nil {
|
||||||
if err = utils.CallFuncLogErrorWithInfo(func() error {
|
if err = utils.CallFuncLogErrorWithInfo(func() error {
|
||||||
if err := handlerInfo.Handler.CancelWaybill(bill, cancelReasonID, cancelReason); err != nil {
|
if err := handlerInfo.Handler.CancelWaybill(bill, cancelReasonID, cancelReason); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
globals.SugarLogger.Debug("=================正儿八经去平台取消订单")
|
globals.SugarLogger.Debug("=================正儿八经去平台取消订单")
|
||||||
order, _ := partner.CurOrderManager.LoadOrder(bill.VendorOrderID, bill.OrderVendorID)
|
order, _ := partner.CurOrderManager.LoadOrder(bill.VendorOrderID, bill.OrderVendorID)
|
||||||
orderman.ResetCreateWaybillFee(nil, order)
|
return orderman.ResetCreateWaybillFee(nil, order)
|
||||||
}
|
|
||||||
return err
|
|
||||||
}, "CancelWaybill bill:%v", bill); err == nil {
|
}, "CancelWaybill bill:%v", bill); err == nil {
|
||||||
bill.Status = model.WaybillStatusCanceled
|
bill.Status = model.WaybillStatusCanceled
|
||||||
bill.DeliveryFlag |= model.WaybillDeliveryFlagMaskActiveCancel
|
bill.DeliveryFlag |= model.WaybillDeliveryFlagMaskActiveCancel
|
||||||
|
|||||||
Reference in New Issue
Block a user