|
@@ -569,7 +569,7 @@ func (rg *RegisterController) Edit(c *gin.Context) {
|
|
|
|
|
|
updateCols := []string{
|
|
|
"ProductIds", "ContractCode", "RelateContractCode", "CrmContractId", "ContractSource", "CompanyName", "ActualCompanyName",
|
|
|
- "SellerId", "SellerName", "ContractType", "ContractAmount", "StartDate", "EndDate", "SignDate", "AgreedPayTime","RaiSellerId","RaiSellerName",
|
|
|
+ "SellerId", "SellerName", "ContractType", "ContractAmount", "StartDate", "EndDate", "SignDate", "AgreedPayTime", "RaiSellerId", "RaiSellerName",
|
|
|
"ContractStatus", "RegisterStatus", "Remark", "ServiceRemark", "HasPayment", "NewCompany", "ModifyTime",
|
|
|
}
|
|
|
nowTime := time.Now().Local()
|
|
@@ -832,7 +832,7 @@ func (rg *RegisterController) Detail(c *gin.Context) {
|
|
|
item.SellerIds = strconv.Itoa(item.RaiSellerId)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
item.SellerIds = strings.Trim(item.SellerIds, ",")
|
|
|
result.ContractRegisterItem = item
|
|
|
|
|
@@ -1164,7 +1164,7 @@ func (rg *RegisterController) Invoice(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 校验金额-是否修改状态
|
|
|
go fmsService.CheckContractRegisterAmount(req.ContractRegisterId)
|
|
|
|
|
@@ -1681,10 +1681,10 @@ func (rg *RegisterController) Export(c *gin.Context) {
|
|
|
dataRow.AddCell().SetString(v.CurrencyUnit) // 货币单位
|
|
|
if ficcAmount != nil {
|
|
|
dataRow.AddCell().SetString(fmt.Sprint("¥", ficcAmount.ServiceAmount)) // FICC套餐总金额
|
|
|
- dataRow.AddCell().SetString("") // 权益套餐总金额
|
|
|
+ dataRow.AddCell().SetString("") // 权益套餐总金额
|
|
|
}
|
|
|
if raiAmount != nil {
|
|
|
- dataRow.AddCell().SetString("") // 权益套餐总金额
|
|
|
+ dataRow.AddCell().SetString("") // 权益套餐总金额
|
|
|
dataRow.AddCell().SetString(fmt.Sprint("¥", raiAmount.ServiceAmount)) // FICC套餐总金额
|
|
|
}
|
|
|
if ficcAmount == nil && raiAmount == nil {
|
|
@@ -1754,7 +1754,7 @@ func (rg *RegisterController) Export(c *gin.Context) {
|
|
|
// @Title 开票/到款列表
|
|
|
// @Description 开票/到款列表
|
|
|
// @Param InvoiceType query int false "类型: 1-开票登记; 2-到款登记"
|
|
|
-// @Param ContractCode query string false "合同编号"
|
|
|
+// @Param Keyword query string false "查询关键字"
|
|
|
// @Param StartDate query string false "开始日期"
|
|
|
// @Param EndDate query string false "结束日期"
|
|
|
// @Param MinAmount query float64 false "开票金额区间-最小值"
|
|
@@ -1785,18 +1785,12 @@ func (rg *RegisterController) InvoiceList(c *gin.Context) {
|
|
|
cond := `invoice_type = ?`
|
|
|
pars := make([]interface{}, 0)
|
|
|
pars = append(pars, req.InvoiceType)
|
|
|
- // 合同编号
|
|
|
- if req.ContractCode != "" {
|
|
|
- kw := fmt.Sprint("%", req.ContractCode, "%")
|
|
|
- pars = append(pars, kw)
|
|
|
- // 开票列表同时模糊查询销售名称
|
|
|
- if req.InvoiceType == fms.ContractInvoiceTypeMake {
|
|
|
- cond += ` AND (a.contract_code LIKE ? )`
|
|
|
- pars = append(pars, kw)
|
|
|
- } else {
|
|
|
- cond += ` AND a.contract_code LIKE ?`
|
|
|
- pars = append(pars, kw)
|
|
|
- }
|
|
|
+ // 搜索
|
|
|
+ if req.Keyword != "" {
|
|
|
+ kw := fmt.Sprint("%", req.Keyword, "%")
|
|
|
+ //pars = append(pars, kw)
|
|
|
+ cond += ` AND (b.company_name LIKE ? OR a.contract_code LIKE ?)`
|
|
|
+ pars = append(pars, kw, kw)
|
|
|
}
|
|
|
if req.StartDate != "" && req.EndDate != "" {
|
|
|
st := fmt.Sprint(req.StartDate, " 00:00:00")
|
|
@@ -1968,7 +1962,7 @@ func ExportInvoiceList(c *gin.Context, req fms.ContractInvoiceListReq, results *
|
|
|
sheet.AddRow()
|
|
|
|
|
|
// 列表数据表头
|
|
|
- titles := []string{"合同编号", "套餐类型", fmt.Sprintf("%s金额", listName), "金额单位", "换算金额(元)",
|
|
|
+ titles := []string{"客户名称", "合同编号", "套餐类型", fmt.Sprintf("%s金额", listName), "金额单位", "换算金额(元)",
|
|
|
fmt.Sprintf("%s日期", listName), "备注"}
|
|
|
titleRow := sheet.AddRow()
|
|
|
titleRow.SetHeight(40)
|
|
@@ -1985,6 +1979,7 @@ func ExportInvoiceList(c *gin.Context, req fms.ContractInvoiceListReq, results *
|
|
|
for _, v := range list {
|
|
|
dataRow := sheet.AddRow()
|
|
|
dataRow.SetHeight(20)
|
|
|
+ dataRow.AddCell().SetString(v.CompanyName) // 客户名称
|
|
|
dataRow.AddCell().SetString(v.ContractCode) // 合同编号
|
|
|
dataRow.AddCell().SetString(ServiceTemplateStrMap[v.ServiceProductId]) // 套餐类型
|
|
|
dataRow.AddCell().SetString(fmt.Sprint(v.OriginAmount)) // 开票金额
|