|
|
@@ -282,7 +282,13 @@ func (s Service) Cancel(req accountModel.AccountMainCancelReq) error {
|
|
|
|
|
|
main.ActualMachineHour = 0
|
|
|
for _, item := range details {
|
|
|
- detail.PaymentAccount += item.PaymentAccount * per
|
|
|
+ // 计算费用
|
|
|
+ discount := float64(1) // 计算折扣
|
|
|
+ if item.Data5 != "" {
|
|
|
+ d, _ := strconv.ParseFloat(item.Data5, 64)
|
|
|
+ discount = 1 - d / 100
|
|
|
+ }
|
|
|
+ detail.PaymentAccount += item.PaymentAccount * discount * per
|
|
|
}
|
|
|
|
|
|
oldAmount := main.TotalPrice
|