ziwen 2 years ago
parent
commit
12b0542f39
2 changed files with 5 additions and 2 deletions
  1. 2 2
      controller/contract/register.go
  2. 3 0
      models/fms/contract_invoice.go

+ 2 - 2
controller/contract/register.go

@@ -315,7 +315,7 @@ func (rg *RegisterController) Add(c *gin.Context) {
 			Amount:             ppItem.Amount,
 			OriginAmount:       ppItem.OriginAmount,
 			CurrencyUnit:       ppItem.CurrencyUnit,
-			InvoiceType:        fms.ContractInvoiceTypePrePay,
+			InvoiceType:        fms.ContractInvoiceTypePay,
 			InvoiceDate:        ppItem.CreateTime,
 			AdminId:            int(adminInfo.AdminId),
 			AdminName:          adminInfo.RealName,
@@ -724,7 +724,7 @@ func (rg *RegisterController) Detail(c *gin.Context) {
 			result.InvoiceList = append(result.InvoiceList, invoiceList[i])
 			continue
 		}
-		if invoiceList[i].InvoiceType == fms.ContractInvoiceTypePay || invoiceList[i].InvoiceType == fms.ContractInvoiceTypePrePay {
+		if invoiceList[i].InvoiceType == fms.ContractInvoiceTypePay{
 			result.PaymentList = append(result.PaymentList, invoiceList[i])
 		}
 	}

+ 3 - 0
models/fms/contract_invoice.go

@@ -29,6 +29,7 @@ type ContractInvoice struct {
 	AdminName          string    `gorm:"column:admin_name" json:"admin_name" description:"操作人姓名"`
 	Remark             string    `gorm:"column:remark" json:"remark" description:"备注信息"`
 	IsDeleted          int       `gorm:"column:is_deleted" json:"is_deleted" description:"是否已删除: 0-正常; 1-已删除"`
+	IsPrePay           int       `gorm:"column:is_pre_pay" json:"is_deleted" description:"是否预付款: 0-不是; 1-是"`
 	base.TimeBase
 }
 
@@ -51,6 +52,7 @@ type ContractInvoiceItem struct {
 	SellerName         string  `gorm:"column:seller_name" json:"seller_name" description:"销售名称"`
 	PayType            int     `gorm:"column:pay_type" json:"pay_type" description:"付款方式:0-无;1-年付;2-半年付;3-季付;4-次付;5-异常"`
 	Remark             string  `gorm:"column:remark" json:"remark" description:"备注信息"`
+	IsPrePay           int     `gorm:"column:is_pre_pay" json:"is_deleted" description:"是否预付款: 0-不是; 1-是"`
 	CreateTime         string  `gorm:"column:create_time" json:"create_time" description:"创建时间"`
 }
 
@@ -243,6 +245,7 @@ func formatContractInvoice2Item(item *ContractInvoice) (formatItem *ContractInvo
 	formatItem.SellerName = item.SellerName
 	formatItem.PayType = item.PayType
 	formatItem.Remark = item.Remark
+	formatItem.IsPrePay = item.IsPrePay
 	formatItem.CreateTime = utils.TimeTransferString(utils.FormatDateTime, item.CreateTime)
 	return
 }