|
@@ -138,7 +138,10 @@ func (s *contractService) ReturnCreate(returnData *viewmodels.ContractsReturn, p
|
|
|
return errors.New("金额填写有误")
|
|
|
}
|
|
|
returnedPrice, _ := strconv.ParseFloat(contract.Returned, 64)
|
|
|
- if price > returnedPrice {
|
|
|
+ contractPrice, _ := strconv.ParseFloat(contract.Price, 64)
|
|
|
+ resultPrice := contractPrice - returnedPrice
|
|
|
+
|
|
|
+ if price > resultPrice {
|
|
|
return errors.New("回款金额不能超过合同金额")
|
|
|
}
|
|
|
|