improve
This commit is contained in:
parent
8e2b0ada32
commit
0f5a0ed5ab
|
@ -47,6 +47,7 @@ func (h *ApplicationHandler) Dashboard(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
for _, account := range resp.Accounts[min:] {
|
for _, account := range resp.Accounts[min:] {
|
||||||
if filterAccount(r, account) {
|
if filterAccount(r, account) {
|
||||||
|
fmt.Println(account)
|
||||||
a := account.ToStorageType()
|
a := account.ToStorageType()
|
||||||
accounts = append([]any{a}, accounts...)
|
accounts = append([]any{a}, accounts...)
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,8 @@ func (h *ExportsHandler) Agenda(w http.ResponseWriter, r *http.Request) {
|
||||||
f.SetCellValue("Sheet1", "F1", "Numéro allocataire / Pole emploi")
|
f.SetCellValue("Sheet1", "F1", "Numéro allocataire / Pole emploi")
|
||||||
f.SetCellValue("Sheet1", "G1", "Prescipteur")
|
f.SetCellValue("Sheet1", "G1", "Prescipteur")
|
||||||
f.SetCellValue("Sheet1", "H1", "Prescipteur Nom")
|
f.SetCellValue("Sheet1", "H1", "Prescipteur Nom")
|
||||||
f.SetCellValue("Sheet1", "I1", "Gestionnaire événement")
|
f.SetCellValue("Sheet1", "I1", "Prescipteur Email")
|
||||||
|
f.SetCellValue("Sheet1", "J1", "Gestionnaire événement")
|
||||||
// f.SetCellValue("Sheet1", "I1", "Prescripteur téléphone")
|
// f.SetCellValue("Sheet1", "I1", "Prescripteur téléphone")
|
||||||
|
|
||||||
i := 2
|
i := 2
|
||||||
|
@ -94,24 +95,27 @@ func (h *ExportsHandler) Agenda(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
admin := groups[e.Owners[0]]
|
admin := groups[e.Owners[0]]
|
||||||
|
|
||||||
subscribedbygroup := ""
|
|
||||||
subscribedbyuser := ""
|
|
||||||
if v, ok := e.Data["subscribed_by"].(map[string]any); ok {
|
|
||||||
if v2, ok := v["group"].(map[string]any); ok {
|
|
||||||
if v3, ok := v2["id"].(string); ok {
|
|
||||||
subscribedbygroup = v3
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if v4, ok := v["user"].(map[string]any); ok {
|
|
||||||
if v5, ok := v4["display_name"].(string); ok {
|
|
||||||
subscribedbyuser = v5
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, s := range e.Subscriptions {
|
for _, s := range e.Subscriptions {
|
||||||
|
subscribedbygroup := ""
|
||||||
|
subscribedbyuser := ""
|
||||||
|
subscribedbyemail := ""
|
||||||
|
if v, ok := s.Data["subscribed_by"].(map[string]any); ok {
|
||||||
|
if v2, ok := v["group"].(map[string]any); ok {
|
||||||
|
if v3, ok := v2["name"].(string); ok {
|
||||||
|
subscribedbygroup = v3
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if v4, ok := v["user"].(map[string]any); ok {
|
||||||
|
if v5, ok := v4["display_name"].(string); ok {
|
||||||
|
subscribedbyuser = v5
|
||||||
|
}
|
||||||
|
if v6, ok := v4["email"].(string); ok {
|
||||||
|
subscribedbyemail = v6
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
beneficiary := beneficiaries_map[s.Subscriber]
|
beneficiary := beneficiaries_map[s.Subscriber]
|
||||||
|
|
||||||
|
@ -121,9 +125,10 @@ func (h *ExportsHandler) Agenda(w http.ResponseWriter, r *http.Request) {
|
||||||
f.SetCellValue("Sheet1", fmt.Sprintf("D%d", i), beneficiary.Data["last_name"])
|
f.SetCellValue("Sheet1", fmt.Sprintf("D%d", i), beneficiary.Data["last_name"])
|
||||||
f.SetCellValue("Sheet1", fmt.Sprintf("E%d", i), beneficiary.Data["first_name"])
|
f.SetCellValue("Sheet1", fmt.Sprintf("E%d", i), beneficiary.Data["first_name"])
|
||||||
f.SetCellValue("Sheet1", fmt.Sprintf("F%d", i), beneficiary.Data["file_number"])
|
f.SetCellValue("Sheet1", fmt.Sprintf("F%d", i), beneficiary.Data["file_number"])
|
||||||
f.SetCellValue("Sheet1", fmt.Sprintf("G%d", i), groups[subscribedbygroup].Data["name"])
|
f.SetCellValue("Sheet1", fmt.Sprintf("G%d", i), subscribedbygroup)
|
||||||
f.SetCellValue("Sheet1", fmt.Sprintf("H%d", i), subscribedbyuser)
|
f.SetCellValue("Sheet1", fmt.Sprintf("H%d", i), subscribedbyuser)
|
||||||
f.SetCellValue("Sheet1", fmt.Sprintf("I%d", i), admin.Data["name"])
|
f.SetCellValue("Sheet1", fmt.Sprintf("I%d", i), subscribedbyemail)
|
||||||
|
f.SetCellValue("Sheet1", fmt.Sprintf("J%d", i), admin.Data["name"])
|
||||||
i = i + 1
|
i = i + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue