|
@@ -2544,8 +2544,8 @@ func ExportNotPaymentCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
|
|
|
rowA := sheet.AddRow()
|
|
|
cellAA := rowA.AddCell()
|
|
|
cellAA.SetString(fmt.Sprintf("开票未到款合计金额(换算后):%.2f(元)", results.InvoiceTotal))
|
|
|
- rowBData := "已开票金额:"
|
|
|
- for _, v := range results.InvoiceCurrencyTotal {
|
|
|
+ rowBData := "开票未到款金额:"
|
|
|
+ for _, v := range results.NotPaymentCurrencyTotal {
|
|
|
rowBData += fmt.Sprintf("%s%.2f(%s) ", v.Name, v.Amount, v.UnitName)
|
|
|
}
|
|
|
rowB := sheet.AddRow()
|
|
@@ -2555,40 +2555,6 @@ func ExportNotPaymentCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
|
|
|
// 表头, 套餐动态获取
|
|
|
rowTitle := []string{"序号", "客户名称", "是否新客户", "合同有效期", "开票日", "开票金额", "到款日", "到款金额", "付款方式", "销售",
|
|
|
"销售组别", "销售类型"}
|
|
|
- serviceTempCond := ``
|
|
|
- serviceTempPars := make([]interface{}, 0)
|
|
|
- serviceTempOB := new(fms.ContractServiceTemplate)
|
|
|
- serviceTempList, e := serviceTempOB.List(serviceTempCond, serviceTempPars)
|
|
|
- if e != nil {
|
|
|
- resp.FailData("获取套餐模板列表失败", "Err:"+e.Error(), c)
|
|
|
- return
|
|
|
- }
|
|
|
- serviceTempListMap := make(map[int]*fms.ContractServiceTemplate)
|
|
|
- var serviceTempShow []*fms.ContractServiceTemplate
|
|
|
- for i := range serviceTempList {
|
|
|
- serviceTempListMap[serviceTempList[i].ServiceTemplateId] = serviceTempList[i]
|
|
|
- }
|
|
|
- for i := range serviceTempList {
|
|
|
- if serviceTempList[i].ProductId == 1 {
|
|
|
- rowTitle = append(rowTitle, serviceTempList[i].Title)
|
|
|
- serviceTempShow = append(serviceTempShow, serviceTempList[i])
|
|
|
- } else if serviceTempList[i].ProductId == 2 {
|
|
|
- if serviceTempList[i].Title == "行业套餐" || serviceTempList[i].Title == "权益大套餐" || (serviceTempList[i].Title == "策略" && serviceTempListMap[serviceTempList[i].Pid].Pid == 0) {
|
|
|
- } else if serviceTempList[i].Title == "医药" || serviceTempList[i].Title == "消费" || serviceTempList[i].Title == "科技" || serviceTempList[i].Title == "智造" {
|
|
|
- } else {
|
|
|
- serviceTempShow = append(serviceTempShow, serviceTempList[i])
|
|
|
- }
|
|
|
- if serviceTempList[i].Title == "行业套餐" || serviceTempList[i].Title == "45万" || serviceTempList[i].Title == "70万" {
|
|
|
- continue
|
|
|
- }
|
|
|
-
|
|
|
- if serviceTempList[i].Pid > 0 && serviceTempListMap[serviceTempList[i].Pid].Pid > 0 {
|
|
|
- continue
|
|
|
- }
|
|
|
-
|
|
|
- rowTitle = append(rowTitle, serviceTempList[i].Title)
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
hi := 0
|
|
|
insertHi := 0
|
|
@@ -2609,33 +2575,6 @@ func ExportNotPaymentCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 新增一行放主观和客观
|
|
|
- specialRow := sheet.AddRow()
|
|
|
- for i := 0; i < hi; i++ {
|
|
|
- if i == insertHi {
|
|
|
- v1 := specialRow.AddCell()
|
|
|
- v1.SetString("45万")
|
|
|
- v1.SetStyle(style)
|
|
|
- v1 = specialRow.AddCell()
|
|
|
- v1.SetString("70万")
|
|
|
- v1.SetStyle(style)
|
|
|
- for j := 0; j < 8; j++ {
|
|
|
- if j%2 == 0 {
|
|
|
- v1 = specialRow.AddCell()
|
|
|
- v1.SetString("主观")
|
|
|
- v1.SetStyle(style)
|
|
|
- } else {
|
|
|
- v1 = specialRow.AddCell()
|
|
|
- v1.SetString("客观")
|
|
|
- v1.SetStyle(style)
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- v := specialRow.AddCell()
|
|
|
- v.SetString("")
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
newCompanyMap := map[int]string{0: "否", 1: "是"}
|
|
|
sellerTypeMap := map[int]string{1: "FICC销售", 2: "权益销售"}
|
|
|
for k, v := range list {
|
|
@@ -2672,27 +2611,6 @@ func ExportNotPaymentCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
|
|
|
v2.SellerGroupName, // 组别
|
|
|
sellerTypeMap[v2.SellerType], // 销售类型
|
|
|
}
|
|
|
- // 套餐金额信息
|
|
|
- serviceTempShowAmount := make(map[int]string)
|
|
|
- for i := range serviceTempShow {
|
|
|
- for s2 := range v2.ServiceAmountList {
|
|
|
- item := v2.ServiceAmountList[s2]
|
|
|
- if item.ServiceTemplateId == serviceTempShow[i].ServiceTemplateId {
|
|
|
- serviceTempShowAmount[serviceTempShow[i].ServiceTemplateId] = fmt.Sprint(item.Amount)
|
|
|
- break
|
|
|
- } else if serviceTempShow[i].Pid == item.ServiceTemplateId {
|
|
|
- serviceTempShowAmount[serviceTempShow[i].ServiceTemplateId] = fmt.Sprint(item.Amount / 2)
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- for i := range serviceTempShow {
|
|
|
- sa := ""
|
|
|
- if am, ok := serviceTempShowAmount[serviceTempShow[i].ServiceTemplateId]; ok {
|
|
|
- sa = am
|
|
|
- }
|
|
|
- rowData = append(rowData, sa)
|
|
|
- }
|
|
|
// 首行开票到款
|
|
|
if k2 == 0 {
|
|
|
for i := range rowData {
|