|
@@ -99,6 +99,24 @@ func (rg *PreRegisterController) List(c *gin.Context) {
|
|
|
item := new(fms.ContractPreRegisterList)
|
|
|
item.ContractPreRegisterItem = v
|
|
|
item.ServicesName = serviceMap[v.ContractRegisterId]
|
|
|
+ if v.HasPayment == 1 {
|
|
|
+ //代付
|
|
|
+ if v.ContractType == 1 {
|
|
|
+ item.ContractTypeString = "代付合同(新签)"
|
|
|
+ } else if v.ContractType == 2 {
|
|
|
+ item.ContractTypeString = "代付合同(续约)"
|
|
|
+ } else {
|
|
|
+ item.ContractTypeString = "代付合同(补充)"
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if v.ContractType == 1 {
|
|
|
+ item.ContractTypeString = "自付合同(新签)"
|
|
|
+ } else if v.ContractType == 2 {
|
|
|
+ item.ContractTypeString = "自付合同(续约)"
|
|
|
+ } else {
|
|
|
+ item.ContractTypeString = "自付合同(补充)"
|
|
|
+ }
|
|
|
+ }
|
|
|
respList = append(respList, item)
|
|
|
}
|
|
|
|
|
@@ -190,7 +208,8 @@ func (rg *PreRegisterController) Add(c *gin.Context) {
|
|
|
ob.HasInvoice = 1
|
|
|
ob.Set()
|
|
|
ob.CurrencyUnit = currencyUnit
|
|
|
- ob.ContractType = 2
|
|
|
+ ob.ContractType = req.ContractType
|
|
|
+ ob.HasPayment = req.HasPayment
|
|
|
if req.RegisterType == fms.ContractInvoiceTypePreMake {
|
|
|
//sellerItem := sellerMap[r.SellerId]
|
|
|
//if sellerItem == nil {
|
|
@@ -309,6 +328,8 @@ func (rg *PreRegisterController) Add(c *gin.Context) {
|
|
|
}
|
|
|
pp.Set()
|
|
|
pp.CurrencyUnit = r.CurrencyUnit
|
|
|
+ pp.ContractType = req.ContractType
|
|
|
+ pp.HasPayment = req.HasPayment
|
|
|
if pp.InvoiceType == fms.ContractInvoiceTypePreMake {
|
|
|
//开票走开票字段
|
|
|
pp.InvoiceId = v.ContractInvoiceId
|
|
@@ -461,6 +482,8 @@ func (rg *PreRegisterController) Edit(c *gin.Context) {
|
|
|
ob.EndDate = endDate
|
|
|
ob.ModifyTime = time.Now().Local()
|
|
|
ob.CurrencyUnit = currencyUnit
|
|
|
+ ob.ContractType = req.ContractType
|
|
|
+ ob.HasPayment = req.HasPayment
|
|
|
if req.RegisterType == fms.ContractInvoiceTypePreMake {
|
|
|
//sellerItem := sellerMap[r.SellerId]
|
|
|
//if sellerItem == nil {
|
|
@@ -487,7 +510,7 @@ func (rg *PreRegisterController) Edit(c *gin.Context) {
|
|
|
}
|
|
|
updateCols := []string{
|
|
|
"ProductIds", "CompanyName", "SellerId", "SellerName", "StartDate", "EndDate",
|
|
|
- "RaiSellerId", "RaiSellerName", "ModifyTime", "CurrencyUnit",
|
|
|
+ "RaiSellerId", "RaiSellerName", "ModifyTime", "CurrencyUnit","ContractType","HasPayment",
|
|
|
}
|
|
|
|
|
|
invoiceList := make([]*fms.ContractInvoice, 0)
|
|
@@ -568,6 +591,8 @@ func (rg *PreRegisterController) Edit(c *gin.Context) {
|
|
|
}
|
|
|
pp.Set()
|
|
|
pp.CurrencyUnit = r.CurrencyUnit
|
|
|
+ pp.ContractType = req.ContractType
|
|
|
+ pp.HasPayment = req.HasPayment
|
|
|
ppUpdateCols := make([]string, 0)
|
|
|
if pp.InvoiceType == fms.ContractInvoiceTypePreMake {
|
|
|
//开票走开票字段
|
|
@@ -599,7 +624,7 @@ func (rg *PreRegisterController) Edit(c *gin.Context) {
|
|
|
pp.PaymentSellerTeamName = sellerItem.TeamName
|
|
|
ppUpdateCols = append(ppUpdateCols, "InvoiceDate", "Amount", "OriginAmount", "SellerId",
|
|
|
"SellerName", "SellerGroupId", "SellerGroupName", "SellerTeamId", "SellerTeamName", "InvoiceId",
|
|
|
- "PaymentSellerId", "PaymentSellerName", "PaymentSellerGroupId", "PaymentSellerGroupName", "PaymentSellerTeamId", "PaymentSellerTeamName")
|
|
|
+ "PaymentSellerId", "PaymentSellerName", "PaymentSellerGroupId", "PaymentSellerGroupName", "PaymentSellerTeamId", "PaymentSellerTeamName","ContractType","HasPayment")
|
|
|
} else {
|
|
|
//到款
|
|
|
pp.ArriveRemark = r.Remark
|
|
@@ -622,7 +647,7 @@ func (rg *PreRegisterController) Edit(c *gin.Context) {
|
|
|
pp.PaymentSellerTeamId = sellerItem.TeamId
|
|
|
pp.PaymentSellerTeamName = sellerItem.TeamName
|
|
|
ppUpdateCols = append(ppUpdateCols, "CurrencyUnit", "ArriveDate", "ArriveAmount", "ArriveOriginAmount", "ArriveId",
|
|
|
- "PaymentSellerId", "PaymentSellerName", "PaymentSellerGroupId", "PaymentSellerGroupName", "PaymentSellerTeamId", "PaymentSellerTeamName")
|
|
|
+ "PaymentSellerId", "PaymentSellerName", "PaymentSellerGroupId", "PaymentSellerGroupName", "PaymentSellerTeamId", "PaymentSellerTeamName","ContractType","HasPayment")
|
|
|
}
|
|
|
|
|
|
if pp.PreRegisterId == 0 {
|
|
@@ -1007,6 +1032,8 @@ func (rg *PreRegisterController) Save(c *gin.Context) {
|
|
|
ob.EndDate = endDate
|
|
|
ob.ModifyTime = time.Now()
|
|
|
ob.CurrencyUnit = req.List[0].CurrencyUnit
|
|
|
+ ob.ContractType = req.ContractType
|
|
|
+ ob.HasPayment = req.HasPayment
|
|
|
if req.RegisterType == fms.ContractInvoiceTypePreMake {
|
|
|
//sellerItem := sellerMap[r.SellerId]
|
|
|
//if sellerItem == nil {
|
|
@@ -1128,6 +1155,8 @@ func (rg *PreRegisterController) Save(c *gin.Context) {
|
|
|
}
|
|
|
pp.Set()
|
|
|
pp.CurrencyUnit = r.CurrencyUnit
|
|
|
+ pp.ContractType = req.ContractType
|
|
|
+ pp.HasPayment = req.HasPayment
|
|
|
if pp.InvoiceType == fms.ContractInvoiceTypePreMake {
|
|
|
//开票走开票字段
|
|
|
pp.Remark = r.Remark
|