|
@@ -1130,14 +1130,6 @@ func (rg *RegisterController) Invoice(c *gin.Context) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // todo 判断是否符合均分金额的条件,如果符合,需要生成金额分配记录表
|
|
|
- if req.InvoiceType == fms.ContractInvoiceTypePay {
|
|
|
- err = fmsService.CalculatePaymentServiceAmount(req.ContractRegisterId)
|
|
|
- if err != nil {
|
|
|
- resp.FailMsg("自动分配金额失败", "自动分配金额失败, Err: "+err.Error(), c)
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
// 新增的记录
|
|
|
if len(newInvoice) > 0 {
|
|
|
newAmount := decimal.NewFromFloat(0).Round(2)
|
|
@@ -1164,6 +1156,15 @@ func (rg *RegisterController) Invoice(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ // todo 判断是否符合均分金额的条件,如果符合,需要生成金额分配记录表
|
|
|
+ if req.InvoiceType == fms.ContractInvoiceTypePay {
|
|
|
+ err = fmsService.CalculatePaymentServiceAmount(req.ContractRegisterId)
|
|
|
+ if err != nil {
|
|
|
+ resp.FailMsg("自动分配金额失败", "自动分配金额失败, Err: "+err.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 校验金额-是否修改状态
|
|
|
go fmsService.CheckContractRegisterAmount(req.ContractRegisterId)
|
|
|
|