|
@@ -1046,13 +1046,17 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
|
|
|
|
|
|
if err == utils.ErrNoRow {
|
|
|
historyItem, e := fms.GetLatestHistoryIncome(historyCond, historyPars)
|
|
|
- if e != nil && err != utils.ErrNoRow {
|
|
|
+ if e != nil && e != utils.ErrNoRow {
|
|
|
err = fmt.Errorf("获取最新的历史开票或到款日期, Err: %s", err.Error())
|
|
|
return
|
|
|
}
|
|
|
latestTime = historyItem.InvoiceDate
|
|
|
}
|
|
|
|
|
|
+ if latestTime.IsZero() {
|
|
|
+ latestTime = time.Now()
|
|
|
+ }
|
|
|
+
|
|
|
latestTime = latestTime.AddDate(0, 0, -latestTime.Day()+1)
|
|
|
|
|
|
var dateSlice []string
|