zwxi 11 kuukautta sitten
vanhempi
commit
a54b259a4d
1 muutettua tiedostoa jossa 13 lisäystä ja 0 poistoa
  1. 13 0
      controller/census/invoice_payment.go

+ 13 - 0
controller/census/invoice_payment.go

@@ -883,6 +883,19 @@ func getCensusIncomeListV2(ch chan models.CensusIncomeChartResp, req fms.IncomeL
 	} else {
 		yearNum = latestTime.Year() - 2020
 		monthNum = int(latestTime.Month() - 1)
+
+		addMonth := 0
+		if req.ListParam == "1" {
+			addMonth = int(3 - latestTime.Month() % 3)
+		}
+		if req.ListParam == "2" {
+			addMonth = int(6 - latestTime.Month() % 6)
+		}
+		if req.ListParam == "3" {
+			addMonth = int(12 - latestTime.Month() % 12)
+		}
+		latestTime = latestTime.AddDate(0,addMonth,0)
+		monthNum += addMonth
 	}
 
 	//if yearNum < 0 {