|
@@ -1573,9 +1573,9 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
|
|
|
case "开票金额":
|
|
|
if sellerId != "" {
|
|
|
- condition += ` AND a.rai_seller_id IN (` + sellerId + `) `
|
|
|
+ condition += ` AND a.seller_id IN (` + sellerId + `) `
|
|
|
}
|
|
|
- condition += " AND a.is_deleted = 0 AND a.invoiced_amount > 0 AND b.invoice_type = 1 AND b.invoice_time >= ? AND b.invoice_time <= ? "
|
|
|
+ condition += " AND b.is_deleted = 0 AND a.invoice_type IN (1,3) AND a.invoice_time >= ? AND a.invoice_time <= ? "
|
|
|
pars = append(pars, startDate, endDate)
|
|
|
total, err := fms.GetContractInvoiceCount(condition, pars)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
@@ -1584,7 +1584,7 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
return
|
|
|
}
|
|
|
trialTotal = total
|
|
|
- condition += " GROUP BY b.contract_invoice_id ORDER BY invoice_time DESC "
|
|
|
+ condition += " GROUP BY a.contract_invoice_id ORDER BY a.invoice_time DESC "
|
|
|
listFmsData, err := fms.GetContractRegisterList(condition, pars, startSize, pageSize)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据信息失败"
|
|
@@ -1605,9 +1605,9 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
|
|
|
case "到款金额":
|
|
|
if sellerId != "" {
|
|
|
- condition += ` AND a.rai_seller_id IN (` + sellerId + `) `
|
|
|
+ condition += ` AND a.seller_id IN (` + sellerId + `) `
|
|
|
}
|
|
|
- condition += " AND a.is_deleted = 0 AND a.payment_amount > 0 AND b.invoice_type = 2 AND b.invoice_time >= ? AND b.invoice_time <= ? "
|
|
|
+ condition += " AND b.is_deleted = 0 AND a.invoice_type IN (2,4) AND a.invoice_time >= ? AND a.invoice_time <= ? "
|
|
|
pars = append(pars, startDate, endDate)
|
|
|
total, err := fms.GetContractInvoiceCount(condition, pars)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
@@ -1616,7 +1616,7 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
return
|
|
|
}
|
|
|
trialTotal = total
|
|
|
- condition += " GROUP BY b.contract_invoice_id ORDER BY invoice_time DESC "
|
|
|
+ condition += " GROUP BY a.contract_invoice_id ORDER BY invoice_time DESC "
|
|
|
listFmsData, err := fms.GetContractRegisterList(condition, pars, startSize, pageSize)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据信息失败"
|
|
@@ -1637,14 +1637,14 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
|
|
|
case "未到款比例":
|
|
|
if sellerId != "" {
|
|
|
- condition += ` AND a.rai_seller_id IN (` + sellerId + `) `
|
|
|
+ condition += ` AND a.seller_id IN (` + sellerId + `) `
|
|
|
}
|
|
|
var condition2 string
|
|
|
var pars2 []interface{}
|
|
|
- condition2 = condition + " AND a.is_deleted = 0 AND a.payment_amount > 0 AND b.invoice_type = 2 AND b.invoice_time >= ? AND b.invoice_time <= ? "
|
|
|
+ condition2 = condition + " AND b.is_deleted = 0 AND a.invoice_type IN (2,4) AND a.invoice_time >= ? AND a.invoice_time <= ? "
|
|
|
pars2 = append(pars2, startDate, endDate)
|
|
|
|
|
|
- condition += " AND a.is_deleted = 0 AND a.invoiced_amount > 0 AND b.invoice_type = 1 AND b.invoice_time >= ? AND b.invoice_time <= ? "
|
|
|
+ condition += " AND b.is_deleted = 0 AND a.invoice_type IN (1,3) AND a.invoice_time >= ? AND a.invoice_time <= ? "
|
|
|
pars = append(pars, startDate, endDate)
|
|
|
amount1, err := fms.GetContractInvoiceAmountCount(condition, pars)
|
|
|
if err != nil {
|
|
@@ -1668,9 +1668,9 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
|
|
|
case "新客开票":
|
|
|
if sellerId != "" {
|
|
|
- condition += ` AND a.rai_seller_id IN (` + sellerId + `) `
|
|
|
+ condition += ` AND a.seller_id IN (` + sellerId + `) `
|
|
|
}
|
|
|
- condition += " AND a.is_deleted = 0 AND a.contract_type = 1 AND a.invoiced_amount > 0 AND b.invoice_type = 1 AND b.invoice_time >= ? AND b.invoice_time <= ? "
|
|
|
+ condition += ` AND b.is_deleted = 0 AND b.contract_type = 1 AND a.invoice_type IN (1,3) AND a.invoice_time >= ? AND a.invoice_time <= ? `
|
|
|
pars = append(pars, startDate, endDate)
|
|
|
total, err := fms.GetContractInvoiceCount(condition, pars)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
@@ -1679,8 +1679,9 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
return
|
|
|
}
|
|
|
trialTotal = total
|
|
|
- condition += " GROUP BY b.contract_invoice_id ORDER BY invoice_time DESC "
|
|
|
+ condition += " GROUP BY a.contract_invoice_id ORDER BY a.invoice_time DESC "
|
|
|
listFmsData, err := fms.GetContractRegisterList(condition, pars, startSize, pageSize)
|
|
|
+
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据信息失败"
|
|
|
br.ErrMsg = "获取数据信息失败,Err:" + err.Error()
|
|
@@ -1699,10 +1700,14 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
}
|
|
|
|
|
|
case "新客到款":
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if sellerId != "" {
|
|
|
- condition += ` AND a.rai_seller_id IN (` + sellerId + `) `
|
|
|
+ condition += ` AND a.seller_id IN (` + sellerId + `) `
|
|
|
}
|
|
|
- condition += " AND a.is_deleted = 0 AND a.contract_type = 1 AND a.payment_amount > 0 AND b.invoice_type = 2 AND b.invoice_time >= ? AND b.invoice_time <= ? "
|
|
|
+ condition += ` AND b.is_deleted = 0 AND b.contract_type = 1 AND a.invoice_type IN (2,4) AND a.invoice_time >= ? AND a.invoice_time <= ? `
|
|
|
pars = append(pars, startDate, endDate)
|
|
|
total, err := fms.GetContractInvoiceCount(condition, pars)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
@@ -1711,7 +1716,7 @@ func (this *StatisticRaiDataSummaryController) RaiDataSummaryDetail() {
|
|
|
return
|
|
|
}
|
|
|
trialTotal = total
|
|
|
- condition += " GROUP BY b.contract_invoice_id ORDER BY invoice_time DESC "
|
|
|
+ condition += ` GROUP BY a.contract_invoice_id ORDER BY a.invoice_time DESC `
|
|
|
listFmsData, err := fms.GetContractRegisterList(condition, pars, startSize, pageSize)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取数据信息失败"
|