|
@@ -103,7 +103,7 @@ type ContractRegisterListReq struct {
|
|
|
StartDate string `json:"start_date" form:"start_date" binding:"omitempty,datetime=2006-01-02" description:"合同开始日期"`
|
|
|
EndDate string `json:"end_date" form:"end_date" binding:"omitempty,datetime=2006-01-02" description:"合同结束日期"`
|
|
|
ServiceTypes string `json:"service_types" form:"service_types" description:"套餐类型"`
|
|
|
- ContractType string `json:"contract_type" form:"contract_type" description:"合同类型"`
|
|
|
+ ContractType string `json:"contract_type" form:"contract_type" description:"合同类型"`
|
|
|
RegisterStatus int `json:"register_status" form:"register_status" description:"登记状态"`
|
|
|
ListParam int `json:"list_param" form:"list_param" description:"套餐类型: 0-全部; 1-ficc; 2-权益"`
|
|
|
base.PageReq
|
|
@@ -184,6 +184,7 @@ type ContractRegisterAddReq struct {
|
|
|
ProductIds string `json:"product_ids" description:"产品ID:1-FICC; 2-权益, 如果两者都有,则用英文逗号拼接"`
|
|
|
ServiceRemark string `json:"service_remark" description:"套餐备注"`
|
|
|
HasPayment int `json:"has_payment" description:"是否有代付: 0-无; 1-有"`
|
|
|
+ HasInvoice int `json:"has_invoice" description:"是否需要开票到款流程: 0-无; 1-有"`
|
|
|
Supplement int `json:"supplement" description:"是否为补录合同: 0-否; 1-是"`
|
|
|
ContractRegisterId int `json:"contract_register_id" description:"登记ID"`
|
|
|
Services []ContractServiceAddReq `json:"services" description:"服务套餐内容"`
|
|
@@ -605,7 +606,7 @@ func UpdateContractPreRegister(item *ContractRegister, updateCols []string, serv
|
|
|
}
|
|
|
|
|
|
for i := range invoiceList {
|
|
|
- if invoiceList[i].ContractInvoiceId == 0{
|
|
|
+ if invoiceList[i].ContractInvoiceId == 0 {
|
|
|
if e := invoiceList[i].Create(); e != nil {
|
|
|
err = e
|
|
|
return
|
|
@@ -621,11 +622,11 @@ func UpdateContractPreRegister(item *ContractRegister, updateCols []string, serv
|
|
|
//更新另一类型的invoice表数据
|
|
|
invoiceItem := ContractInvoice{
|
|
|
ContractRegisterId: item.ContractRegisterId,
|
|
|
- StartDate: item.StartDate,
|
|
|
- EndDate: item.EndDate,
|
|
|
- CurrencyUnit: item.CurrencyUnit,
|
|
|
+ StartDate: item.StartDate,
|
|
|
+ EndDate: item.EndDate,
|
|
|
+ CurrencyUnit: item.CurrencyUnit,
|
|
|
}
|
|
|
- tx.Model(&invoiceItem).Select([]string{"StartDate","EndDate","CurrencyUnit"}).Where("ContractRegisterId",item.ContractRegisterId).Updates(invoiceItem)
|
|
|
+ tx.Model(&invoiceItem).Select([]string{"StartDate", "EndDate", "CurrencyUnit"}).Where("ContractRegisterId", item.ContractRegisterId).Updates(invoiceItem)
|
|
|
|
|
|
//删除
|
|
|
if len(delInvoiceIds) > 0 {
|
|
@@ -704,12 +705,11 @@ func UpdateContractRegisterPre(item *ContractRegister, updateCols []string, serv
|
|
|
//更新另一类型的invoice表数据
|
|
|
invoiceItem := ContractInvoice{
|
|
|
ContractRegisterId: item.ContractRegisterId,
|
|
|
- StartDate: item.StartDate,
|
|
|
- EndDate: item.EndDate,
|
|
|
- CurrencyUnit: item.CurrencyUnit,
|
|
|
+ StartDate: item.StartDate,
|
|
|
+ EndDate: item.EndDate,
|
|
|
+ CurrencyUnit: item.CurrencyUnit,
|
|
|
}
|
|
|
- tx.Model(&invoiceItem).Select([]string{"StartDate","EndDate","CurrencyUnit"}).Where("ContractRegisterId",item.ContractRegisterId).Updates(invoiceItem)
|
|
|
-
|
|
|
+ tx.Model(&invoiceItem).Select([]string{"StartDate", "EndDate", "CurrencyUnit"}).Where("ContractRegisterId", item.ContractRegisterId).Updates(invoiceItem)
|
|
|
|
|
|
// 开票到款操作类型: 0-无; 1-更新; 2-新增;
|
|
|
if invoiceHandleType == 2 {
|
|
@@ -722,13 +722,13 @@ func UpdateContractRegisterPre(item *ContractRegister, updateCols []string, serv
|
|
|
pp := &ContractPreRegister{
|
|
|
PreRegisterId: ppList[0].PreRegisterId,
|
|
|
}
|
|
|
- ppUpdateCols := make([]string,0)
|
|
|
- if v.InvoiceType == 3{
|
|
|
+ ppUpdateCols := make([]string, 0)
|
|
|
+ if v.InvoiceType == 3 {
|
|
|
pp.InvoiceId = v.ContractInvoiceId
|
|
|
ppUpdateCols = append(ppUpdateCols, "InvoiceId")
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
pp.ArriveId = v.ContractInvoiceId
|
|
|
- ppUpdateCols = append(ppUpdateCols, "ArriveId")
|
|
|
+ ppUpdateCols = append(ppUpdateCols, "ArriveId")
|
|
|
}
|
|
|
if e := pp.Update(ppUpdateCols); e != nil {
|
|
|
err = e
|