Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-03-09 13:19:14 +03:00
parent 6df18ed14d
commit 0d303f0c0f
12 changed files with 382 additions and 280 deletions

View File

@@ -101,15 +101,19 @@ func GetAccounts(ctx context.Context) ([]models.Account, error) {
return nil, err
}
if len(acc.AccountCode) >= 4 {
acc.DisplayCode =
strings.TrimSpace(acc.AccountCode[:3] + " " + acc.AccountCode[3:])
} else {
acc.DisplayCode = acc.AccountCode
}
acc.DisplayCode = formatAccountDisplayCode(acc.AccountCode)
accounts = append(accounts, acc)
}
return accounts, rows.Err()
}
func formatAccountDisplayCode(code string) string {
trimmed := strings.TrimSpace(code)
runes := []rune(trimmed)
if len(runes) <= 3 {
return trimmed
}
return strings.TrimSpace(string(runes[:3]) + " " + string(runes[3:]))
}