|
@@ -79,7 +79,7 @@ func ExportInvoicePaymentCensusList(c *gin.Context, results *fms.InvoicePaymentC
|
|
|
sheet.AddRow()
|
|
|
|
|
|
// 表头, 套餐动态获取
|
|
|
- rowTitle := []string{"序号", "客户名称", "代付方", "是否新客户", "合同有效期", "开票日", "开票金额", "到款日", "到款金额", "付款方式", "销售",
|
|
|
+ rowTitle := []string{"序号", "客户名称", "代付方", "是否新客户", "合同起始日期", "合同结束日期", "开票日", "开票金额", "开票换算金额(元)", "到款日", "到款金额", "到款换算金额(元)", "付款方式", "销售",
|
|
|
"销售组别", "销售类型"}
|
|
|
serviceTempCond := ``
|
|
|
serviceTempPars := make([]interface{}, 0)
|
|
@@ -188,14 +188,20 @@ func ExportInvoicePaymentCensusList(c *gin.Context, results *fms.InvoicePaymentC
|
|
|
// 合同有效期
|
|
|
colD := dataRow.AddCell()
|
|
|
colD.VMerge = mergeRowNum
|
|
|
- colD.SetString(fmt.Sprint(v.StartDate, "至", v.EndDate))
|
|
|
+ colD.SetString(v.StartDate)
|
|
|
+
|
|
|
+ colF := dataRow.AddCell()
|
|
|
+ colF.VMerge = mergeRowNum
|
|
|
+ colF.SetString(v.EndDate)
|
|
|
// 开票到款信息
|
|
|
for k2, v2 := range v.InvoicePaymentList {
|
|
|
rowData := []string{
|
|
|
v2.InvoiceDate, // 开票日
|
|
|
- fmt.Sprint(v2.InvoiceAmount), // 开票金额
|
|
|
+ fmt.Sprint(v2.InvoiceOriginAmount), // 开票金额
|
|
|
+ fmt.Sprint(v2.InvoiceAmount), // 开票换算金额
|
|
|
v2.PaymentDate, // 到款日
|
|
|
- fmt.Sprint(v2.PaymentAmount), // 到款金额
|
|
|
+ fmt.Sprint(v2.PaymentOriginAmount), // 到款金额
|
|
|
+ fmt.Sprint(v2.PaymentAmount), // 到款换算金额
|
|
|
fms.ContractPaymentPayTypeNameMap[v2.PayType], // 付款方式
|
|
|
v2.SellerName, // 销售
|
|
|
v2.SellerGroupName, // 组别
|
|
@@ -828,7 +834,6 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
var latestTime time.Time
|
|
|
|
|
|
invoiceItem, err := fms.GetLatestIncome(cond, pars)
|
|
@@ -1060,7 +1065,7 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
|
|
|
partAccumulate = 0.0
|
|
|
}
|
|
|
}
|
|
|
- } else if endDateTime.Before(historyTime) || endDateTime.Equal(historyTime) {
|
|
|
+ } else if endDateTime.Before(historyTime) || endDateTime.Equal(historyTime) {
|
|
|
//全部走旧查询
|
|
|
//fmt.Println("旧查询")
|
|
|
//fmt.Println("st:",st)
|
|
@@ -1593,7 +1598,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
if serviceAmount, ok := serviceAmountMap[v.ContractRegisterId]; ok {
|
|
|
item := fms.NotInvoicePaymentSummaryItem{
|
|
|
NotInvoicedAmountOriginTotal: serviceAmount[2].ServiceAmount,
|
|
|
- ServiceProductId: 2,
|
|
|
+ ServiceProductId: 2,
|
|
|
}
|
|
|
item.SellerId = v.SellerId
|
|
|
item.SellerName = v.SellerName
|
|
@@ -1606,7 +1611,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
if serviceAmount, ok := serviceAmountMap[v.ContractRegisterId]; ok {
|
|
|
item := fms.NotInvoicePaymentSummaryItem{
|
|
|
NotInvoicedAmountOriginTotal: serviceAmount[1].ServiceAmount,
|
|
|
- ServiceProductId: 1,
|
|
|
+ ServiceProductId: 1,
|
|
|
}
|
|
|
item.SellerId = v.SellerId
|
|
|
item.SellerName = v.SellerName
|
|
@@ -1622,7 +1627,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
if serviceAmount, ok := serviceAmountMap[v.ContractRegisterId]; ok {
|
|
|
item1 := fms.NotInvoicePaymentSummaryItem{
|
|
|
NotInvoicedAmountOriginTotal: serviceAmount[2].ServiceAmount,
|
|
|
- ServiceProductId: 2,
|
|
|
+ ServiceProductId: 2,
|
|
|
}
|
|
|
item1.SellerId = v.SellerId
|
|
|
item1.SellerName = v.SellerName
|
|
@@ -1632,7 +1637,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
|
|
|
item2 := fms.NotInvoicePaymentSummaryItem{
|
|
|
NotInvoicedAmountOriginTotal: serviceAmount[1].ServiceAmount,
|
|
|
- ServiceProductId: 1,
|
|
|
+ ServiceProductId: 1,
|
|
|
}
|
|
|
item2.SellerId = v.SellerId
|
|
|
item2.SellerName = v.SellerName
|
|
@@ -1646,7 +1651,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
if serviceAmount, ok := serviceAmountMap[v.ContractRegisterId]; ok {
|
|
|
item1 := fms.NotInvoicePaymentSummaryItem{
|
|
|
NotInvoicedAmountOriginTotal: serviceAmount[1].ServiceAmount,
|
|
|
- ServiceProductId: 1,
|
|
|
+ ServiceProductId: 1,
|
|
|
}
|
|
|
item1.SellerId = v.SellerId
|
|
|
item1.SellerName = v.SellerName
|
|
@@ -1660,7 +1665,7 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
if serviceAmount, ok := serviceAmountMap[v.ContractRegisterId]; ok {
|
|
|
item2 := fms.NotInvoicePaymentSummaryItem{
|
|
|
NotInvoicedAmountOriginTotal: serviceAmount[2].ServiceAmount,
|
|
|
- ServiceProductId: 2,
|
|
|
+ ServiceProductId: 2,
|
|
|
}
|
|
|
item2.SellerId = v.SellerId
|
|
|
item2.SellerName = v.SellerName
|
|
@@ -1725,8 +1730,8 @@ func (ct *InvoicePaymentController) NotInvoiceList(c *gin.Context) {
|
|
|
v.NotInvoicedAmountOriginTotal = v.PaymentAmountTotal - v.InvoiceAmountTotal
|
|
|
}
|
|
|
}
|
|
|
- v.NotInvoicedAmountTotal = v.NotInvoicedAmountOriginTotal/v.RMBRate
|
|
|
- v.NotInvoicedAmountTotal ,_= strconv.ParseFloat(fmt.Sprintf("%.2f", v.NotInvoicedAmountTotal), 64)
|
|
|
+ v.NotInvoicedAmountTotal = v.NotInvoicedAmountOriginTotal / v.RMBRate
|
|
|
+ v.NotInvoicedAmountTotal, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", v.NotInvoicedAmountTotal), 64)
|
|
|
}
|
|
|
// 补充销售信息
|
|
|
if v.SellerId > 0 && v.RaiSellerId > 0 {
|
|
@@ -2121,6 +2126,7 @@ func (ct *InvoicePaymentController) NotPaymentList(c *gin.Context) {
|
|
|
v.PaymentAmount = summaryList[i].PaymentAmount
|
|
|
v.PaymentOriginAmount = summaryList[i].PaymentOriginAmount
|
|
|
v.PayType = summaryList[i].PayType
|
|
|
+ v.NotPaymentOriginAmount = summaryList[i].InvoiceOriginAmount - summaryList[i].PaymentOriginAmount
|
|
|
v.NotPaymentAmount = summaryList[i].InvoiceAmount - summaryList[i].PaymentAmount
|
|
|
v.ServiceProductId = summaryList[i].ServiceProductId
|
|
|
v.UnitName = unitMap[summaryList[i].CurrencyUnit]
|
|
@@ -2528,7 +2534,7 @@ func ExportNotPaymentCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
|
|
|
sheet.AddRow()
|
|
|
|
|
|
// 表头, 套餐动态获取
|
|
|
- rowTitle := []string{"序号", "客户名称", "合同编号", "合同有效期", "套餐类型", "开票日", "开票金额", "金额单位", "开票销售",
|
|
|
+ rowTitle := []string{"序号", "客户名称", "合同编号", "合同起始日期", "合同结束日期", "套餐类型", "开票日", "开票金额", "金额单位", "开票换算金额", "开票销售",
|
|
|
"销售组别", "销售类型"}
|
|
|
|
|
|
titleRow := sheet.AddRow()
|
|
@@ -2563,7 +2569,11 @@ func ExportNotPaymentCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
|
|
|
// 合同有效期
|
|
|
colD := dataRow.AddCell()
|
|
|
colD.VMerge = mergeRowNum
|
|
|
- colD.SetString(fmt.Sprint(v.StartDate, "至", v.EndDate))
|
|
|
+ colD.SetString(v.StartDate)
|
|
|
+
|
|
|
+ colF := dataRow.AddCell()
|
|
|
+ colF.VMerge = mergeRowNum
|
|
|
+ colF.SetString(v.EndDate)
|
|
|
// 套餐类型
|
|
|
colE := dataRow.AddCell()
|
|
|
colE.VMerge = mergeRowNum
|
|
@@ -2572,12 +2582,13 @@ func ExportNotPaymentCensusList(c *gin.Context, results *fms.NotInvoicePaymentCe
|
|
|
// 开票到款信息
|
|
|
for _, v2 := range v.InvoicePaymentList {
|
|
|
rowData := []string{
|
|
|
- v2.InvoiceDate, // 开票日
|
|
|
- fmt.Sprint(v2.NotPaymentAmount), // 开票金额
|
|
|
- v2.UnitName, // 开票金额
|
|
|
- v2.SellerName, // 销售
|
|
|
- v2.SellerGroupName, // 组别
|
|
|
- sellerTypeMap[v2.SellerType], // 销售类型
|
|
|
+ v2.InvoiceDate, // 开票日
|
|
|
+ fmt.Sprint(v2.NotPaymentOriginAmount), // 开票原始金额
|
|
|
+ v2.UnitName, // 开票金额
|
|
|
+ fmt.Sprint(v2.NotPaymentAmount), // 开票换算金额
|
|
|
+ v2.SellerName, // 销售
|
|
|
+ v2.SellerGroupName, // 组别
|
|
|
+ sellerTypeMap[v2.SellerType], // 销售类型
|
|
|
}
|
|
|
for i := range rowData {
|
|
|
dataRow.AddCell().SetString(rowData[i])
|