Merge remote-tracking branch 'origin/master'
This commit is contained in:
35
svc/queries/statement_pdf_common.go
Normal file
35
svc/queries/statement_pdf_common.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package queries
|
||||
|
||||
import "bssapp-backend/models"
|
||||
|
||||
func getStatementsForPDF(
|
||||
accountCode string,
|
||||
startDate string,
|
||||
endDate string,
|
||||
parislemler []string,
|
||||
) ([]models.StatementHeader, error) {
|
||||
return GetStatements(models.StatementParams{
|
||||
AccountCode: accountCode,
|
||||
StartDate: startDate,
|
||||
EndDate: endDate,
|
||||
LangCode: "TR",
|
||||
Parislemler: parislemler,
|
||||
})
|
||||
}
|
||||
|
||||
func collectBelgeNos(headers []models.StatementHeader) []string {
|
||||
seen := make(map[string]struct{}, len(headers))
|
||||
out := make([]string, 0, len(headers))
|
||||
for _, h := range headers {
|
||||
no := h.BelgeNo
|
||||
if no == "" || no == "Baslangic_devir" {
|
||||
continue
|
||||
}
|
||||
if _, ok := seen[no]; ok {
|
||||
continue
|
||||
}
|
||||
seen[no] = struct{}{}
|
||||
out = append(out, no)
|
||||
}
|
||||
return out
|
||||
}
|
||||
Reference in New Issue
Block a user