new revenue getters
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
@@ -51,6 +50,7 @@ func AddRevenueEntryHandler(db *sql.DB) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
func GetRevenueReportHandler(db *sql.DB) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
companyID, _ := strconv.Atoi(r.URL.Query().Get("company_id"))
|
||||
@@ -58,7 +58,7 @@ func GetRevenueReportHandler(db *sql.DB) http.HandlerFunc {
|
||||
year, _ := strconv.Atoi(r.URL.Query().Get("year"))
|
||||
idx, _ := strconv.Atoi(r.URL.Query().Get("index"))
|
||||
|
||||
entries, err := service.GetRevenue(db, companyID, model.PeriodType(periodType), year, idx)
|
||||
entries, err := database.GetRevenueByPeriod(db, companyID, )
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
@@ -68,3 +68,4 @@ func GetRevenueReportHandler(db *sql.DB) http.HandlerFunc {
|
||||
json.NewEncoder(w).Encode(entries)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user