|
@@ -274,17 +274,18 @@ func (rg *RegisterController) Add(c *gin.Context) {
|
|
|
|
|
|
// 新增合同及套餐
|
|
|
if req.Supplement == 1 {
|
|
|
- //新增合同信息
|
|
|
- if e = fms.CreateContractRegisterAndServicesAndPayMent(ob, serviceList, req.PrePayId); e != nil {
|
|
|
- resp.FailMsg("操作失败", "新增合同及套餐失败, Err: "+e.Error(), c)
|
|
|
- return
|
|
|
- }
|
|
|
//新增到款信息
|
|
|
if ob.HasPayment == 1 {
|
|
|
resp.Fail("合同存在代付不允许添加开票/到款登记", c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ //新增合同信息
|
|
|
+ if e = fms.CreateContractRegisterAndServicesAndPayMent(ob, serviceList, req.PrePayId); e != nil {
|
|
|
+ resp.FailMsg("操作失败", "新增合同及套餐失败, Err: "+e.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
prePayOB := new(fms.ContractPrePayment)
|
|
|
ppItem, e := prePayOB.Fetch(req.PrePayId)
|
|
|
if e != nil {
|
|
@@ -361,6 +362,8 @@ func (rg *RegisterController) Add(c *gin.Context) {
|
|
|
resp.FailMsg("删除预到款记录失败", "Err:"+e.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
+ // 校验金额-是否修改状态
|
|
|
+ go fmsService.CheckContractRegisterAmount(ob.ContractRegisterId)
|
|
|
|
|
|
// 开票到款汇总
|
|
|
go fmsService.SummaryInvoicePaymentByContractRegisterId(ob.ContractRegisterId)
|